• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/

Lines Matching defs:windows

1 ;;; follow.el --- synchronize windows showing the same buffer
33 ;; combines windows into one tall virtual window.
38 ;; * The windows always displays adjacent sections of the buffer.
44 ;; makes it possible to walk between windows using normal cursor
49 ;; mode, use two full-height windows as though they would have been
60 ;; columns. Delete the other windows and split the window with
80 ;; `follow-mode' is active, the two windows will follow eachother!
86 ;; windows.
93 ;; The command `follow-delete-other-windows-and-split' maximises the
101 ;; (global-set-key [f7] 'follow-delete-other-windows-and-split)
113 ;; (setq truncate-partial-width-windows nil)
158 ;; follow-delete-other-windows-and-split C-c . 1
169 ;; Switch buffer in all windows displaying the current buffer
173 ;; Switch buffer in all windows in the active frame.
176 ;; Show the current buffer in all windows on the current
195 ;; 1) Use multiple frames; `follow' mode only affects windows displayed
209 ;; kernel of the display routines, making sure that the windows (using
212 ;; windows are aligned.
224 ;; non-selected windows unaligned. It will, however, pop right back
275 "Synchronize windows showing the same buffer."
277 :group 'windows
321 (define-key map "1" 'follow-delete-other-windows-and-split)
373 ("Switch To Buffer (all windows)"
378 . follow-delete-other-windows-and-split)
426 follow-delete-other-windows-and-split t]
428 ["Switch To Buffer (all windows)"
476 "*When non-nil, patch Emacs so that tail windows won't be recentered.
480 windows are recentered automatically. However, when using
488 recentering empty windows. Please report if you find a repeatable
489 situation in which Emacs recenters empty windows.
491 XEmacs, as of 19.12, does not recenter windows, good!")
513 "True when Follow mode should redisplay the windows.")
528 (defvar follow-windows-start-end-cache nil
569 "Minor mode that combines windows into one tall virtual window.
574 * The windows always displays adjacent sections of the buffer.
580 makes it possible to walk between windows using normal cursor
585 mode, use two full-height windows as though they would have been
590 To split one large window into two side-by-side windows, the commands
592 `M-x follow-delete-other-windows-and-split' can be used.
594 Only windows displayed in the same frame follow each-other.
643 ;; `scroll-up' and `-down', but for windows in Follow Mode.
654 ;; our post-command-hook will move our windows back into the old
675 (let* ((windows (follow-all-followers))
676 (end (window-end (car (reverse windows)))))
679 (select-window (car windows))
684 (set-window-start (car windows) (point)))))))
703 (let* ((windows (follow-all-followers))
704 (win (car (reverse windows)))
705 (start (window-start (car windows))))
722 (defun follow-delete-other-windows-and-split (&optional arg)
723 "Create two side by side windows and enter Follow Mode.
726 in the selected window. All other windows, in the current
728 side-by-side windows. Follow Mode is activated, hence the
729 two windows always will display two successive pages.
738 (global-set-key [f7] 'follow-delete-other-windows-and-split)"
746 (delete-other-windows)
756 "Show BUFFER in all windows in the current Follow Mode window chain."
759 (windows (follow-all-followers)))
760 (while windows
761 (select-window (car windows))
763 (setq windows (cdr windows)))
768 "Show BUFFER in all windows on this frame.
774 (walk-windows
784 "Show current buffer in all windows on this frame, and enter Follow Mode.
806 (error "%s" "No more windows"))))
815 (error "%s" "No more windows"))))
834 Rearrange all other windows around the middle window.
858 (windows (follow-all-followers))
859 (win (nth (/ (- (length windows) 1) 2) windows)))
868 "Arrange windows displaying the same buffer in successor order.
872 Follow mode since the windows should always be aligned."
894 (follow-windows-start-end followers)))
912 "Return all windows displaying the same buffer as the TESTWIN.
913 The list contains only windows displayed in the same frame as TESTWIN.
920 (windows '())
924 (setq windows (cons win windows)))
928 (nreverse windows)))
931 (defun follow-split-followers (windows &optional win)
938 (while (not (eq (car windows) win))
939 (setq pred (cons (car windows) pred))
940 (setq windows (cdr windows)))
941 (cons pred (cdr windows))))
990 (defun follow-calc-win-start (windows pos win)
993 If WIN is nil the point below all windows is returned."
995 (while (and windows (not (eq (car windows) win)))
996 (setq start (window-start (car windows)))
997 (set-window-start (car windows) pos 'noforce)
998 (setq pos (car (inline (follow-calc-win-end (car windows)))))
999 (set-window-start (car windows) start 'noforce)
1000 (setq windows (cdr windows)))
1004 ;; The result from `follow-windows-start-end' is cached when using
1007 (defsubst follow-cache-valid-p (windows)
1008 "Test if the cached value of `follow-windows-start-end' can be used.
1011 (cache follow-windows-start-end-cache))
1012 (while (and res windows cache)
1013 (setq res (and (eq (car windows)
1015 (eq (window-start (car windows))
1017 (setq windows (cdr windows))
1019 (and res (null windows) (null cache))))
1023 "Force `follow-windows-start-end' to recalculate the end of the window."
1024 (setq follow-windows-start-end-cache nil))
1027 ;; Build a list of windows and their start and end positions.
1036 (defun follow-windows-start-end (windows)
1038 (if (follow-cache-valid-p windows)
1039 follow-windows-start-end-cache
1042 (while windows
1043 (select-window (car windows))
1045 (cons (cons (car windows)
1049 (setq windows (cdr windows)))
1051 (setq follow-windows-start-end-cache (nreverse win-start-end))
1052 follow-windows-start-end-cache)))
1063 ;; By `aligned' we mean that for all adjecent windows, the end of the
1067 (defsubst follow-windows-aligned-p (win-start-end)
1084 ;; Check if the point is visible in all windows. (So that
1087 (defun follow-point-visible-all-windows-p (win-start-end)
1088 "Non-nil when the window-point is visible in all windows."
1172 ;; Select a window that will display the point if the windows would
1177 (defun follow-select-if-visible-from-first (dest windows)
1182 (goto-char (window-start (car windows)))
1185 (vertical-motion 0 (car windows))
1189 ;; At or below the start. Check the windows.
1191 (while (and (not win) windows)
1192 (set-window-start (car windows) (point) 'noforce)
1193 (setq end-pos-end-p (follow-calc-win-end (car windows)))
1199 (setq win (car windows))
1200 (setq windows (cdr windows)))))))
1209 ;; Redraw all the windows on the screen, starting with the top window.
1213 (defun follow-redisplay (&optional windows win)
1216 from the top. WINDOWS should contain a list of windows to
1218 Should WINDOWS be nil, the windows displaying the
1223 (or windows
1224 (setq windows (follow-all-followers win)))
1225 (follow-downward windows (follow-calculate-first-window-start windows win)))
1228 ;; Redisplay a chain of windows. Start every window directly after the
1232 (defun follow-downward (windows pos)
1234 (while windows
1235 (set-window-start (car windows) pos)
1236 (setq pos (car (follow-calc-win-end (car windows))))
1237 (setq windows (cdr windows))))
1240 ;;(defun follow-downward (windows pos)
1243 ;; (while windows
1244 ;; (setq p (window-point (car windows)))
1245 ;; (set-window-start (car windows) pos)
1246 ;; (set-window-point (car windows) (max p pos))
1247 ;; (setq pos (car (follow-calc-win-end (car windows))))
1248 ;; (setq windows (cdr windows)))))
1254 ;; have somewhere splited a line between windows) we try to enhance
1258 ;; windows.
1264 (defun follow-calculate-first-window-start (windows &optional win start)
1267 WINDOWS is a chain of windows to work with. WIN is the window
1274 (let ((guess (follow-estimate-first-window-start windows win start)))
1278 (let ((win-start (follow-calc-win-start windows (cdr guess) win)))
1285 windows (cdr guess) win start))
1289 windows (cdr guess) win start)))))))
1294 (defun follow-estimate-first-window-start (windows win start)
1299 (let ((pred (car (follow-split-followers windows win)))
1317 (windows guess win start)
1324 (if (not (= (vertical-motion 1 (car windows)) 1))
1330 (setq win-start (follow-calc-win-start windows (point) win))
1345 (windows guess &optional win start)
1355 (vertical-motion 0 (car windows))
1358 (if (not (= (vertical-motion -1 (car windows)) -1))
1363 (setq win-start (follow-calc-win-start windows (point) win))
1377 ;; windows only displaying the tail isn't recentered.
1382 ;; A window displaying only the tail, is a windows whose
1397 "Make sure windows displaying the end of a buffer aren't recentered.
1400 non-first windows in Follow Mode."
1444 "Ensure that the windows in Follow mode are adjacent after each command."
1467 (let* ((windows (inline (follow-all-followers win)))
1470 (follow-update-window-start (car windows))
1471 (follow-windows-start-end windows)))
1472 (aligned (follow-windows-aligned-p win-start-end))
1483 ;; be visible in several windows.
1515 (select-window (car (reverse windows)))
1542 (select-window (car windows))
1545 (setq win-start-end (follow-windows-start-end windows))
1552 ((follow-select-if-visible-from-first dest windows)
1556 (follow-redisplay windows (car windows))
1578 (setq win-start-end (follow-windows-start-end windows))
1581 ;; Redraw the windows whenever needed.
1584 (follow-windows-aligned-p win-start-end)))
1585 (not (inline (follow-point-visible-all-windows-p
1589 (follow-redisplay windows (selected-window))
1590 (setq win-start-end (follow-windows-start-end windows))
1597 ;; difference between the width of the windows.
1607 ;; multiple windows.
1612 (selected-window) windows win-start-end))
1616 ;;(if (not (follow-windows-aligned-p
1617 ;; (follow-windows-start-end windows)))
1618 ;; (message "follow-mode: windows still unaligend!"))
1622 ;; We still must update the windows displaying the tail so that
1632 ;; good when spanning several windows.
1635 ;; end-1. This will highlight a little bit in windows above
1638 (defun follow-maximize-region (win windows win-start-end)
1639 "Make a highlighted region stretching multiple windows look good."
1640 (let* ((all (follow-split-followers windows win))
1661 ;; window the windows will be unaligned.
1666 ;; Discussion: Now when the other windows in the chain follow the
1748 "Redraw windows showing the same buffer as shown in WINDOW.
1774 ;; output and tries to reposition the windows whose buffers are in
1780 ;; that a process can cause a redisplay recentering "tail" windows.
1787 ;; output filter. It also makes sure that the windows connected to
1977 (let* ((windows (follow-all-followers win))
1978 (win-start-end (follow-windows-start-end windows))
1999 (follow-redisplay windows win)
2000 (setq win-start-end (follow-windows-start-end windows))
2006 (setq win-start-end (follow-windows-start-end windows)))
2014 new-window-point windows)
2016 (follow-redisplay windows (car windows))
2019 (follow-windows-start-end windows)))
2025 ;; windows are aligned and the point is visible
2033 (follow-windows-start-end windows))))
2036 (not (follow-windows-aligned-p win-start-end)))
2037 (follow-redisplay windows)))))))
2051 ;; windows showing only the end of a buffer is unconditionally
2086 "Redraw all windows in FRAME, when in Follow mode."
2095 windows
2099 (walk-windows
2109 (setq windows (follow-all-followers win))
2110 (if (memq orig-window windows)
2121 (follow-redisplay windows win))
2131 ;; In XEmacs, isearch often finds matches in other windows than the
2157 ;; In Emacs (not XEmacs) windows showing nothing are sometimes
2159 ;; non-first windows in the window chain. This section tries to
2160 ;; make the windows stay where they should be.
2162 ;; If the display is updated, all windows starting at (point-max) are
2164 ;; read-and-write cycle to update the `force' flag inside the windows.
2170 ;; windows.
2181 ;; we might save other windows from being recentered.
2188 ;; to recenter tail windows.
2194 Avoid to recenter windows displaying only the end of a file as when
2195 displaying a short file in two windows, using Follow Mode."
2200 ;; tail windows.
2206 Don't recenter windows showing only the end of a buffer.
2235 follow-windows-start-end
2239 follow-windows-aligned-p
2240 follow-point-visible-all-windows-p