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

Lines Matching +defs:start +defs:process

161 ;;		way to start Follow Mode, hence it is recomended
216 ;; 2) After a process output has been perfomed.
470 (defcustom follow-intercept-processes (fboundp 'start-process)
471 "When non-nil, Follow Mode will monitor process output."
515 (defvar follow-process-filter-alist '()
528 (defvar follow-windows-start-end-cache nil
529 "Cache used by `follow-window-start-end'.")
607 (follow-intercept-process-output))
624 ;; This will start follow-mode whenever a new file is loaded, if
684 (set-window-start (car windows) (point)))))))
705 (start (window-start (car windows))))
706 (if (eq start (point-min))
709 (goto-char start)
713 (set-window-start win (point))
714 (goto-char start)
745 (start (window-start)))
751 (set-window-start (selected-window) start)
894 (follow-windows-start-end followers)))
949 Actually, the position returned is the start of the next
973 (goto-char (window-start))
980 ;; The start of the window is assumed to
981 ;; coinside with the start of a line.
990 (defun follow-calc-win-start (windows pos win)
991 "Calculate where WIN will start if the first in WINDOWS start at POS.
994 (let (start)
996 (setq start (window-start (car windows)))
997 (set-window-start (car windows) pos 'noforce)
999 (set-window-start (car windows) start 'noforce)
1004 ;; The result from `follow-windows-start-end' is cached when using
1008 "Test if the cached value of `follow-windows-start-end' can be used.
1011 (cache follow-windows-start-end-cache))
1015 (eq (window-start (car windows))
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.
1028 ;; Useful to avoid calculating start/end position whenever they are needed.
1036 (defun follow-windows-start-end (windows)
1039 follow-windows-start-end-cache
1040 (let ((win-start-end '())
1044 (setq win-start-end
1046 (cons (window-start)
1048 win-start-end))
1051 (setq follow-windows-start-end-cache (nreverse win-start-end))
1052 follow-windows-start-end-cache)))
1055 (defsubst follow-pos-visible (pos win win-start-end)
1057 (let ((wstart-wend-bend (cdr (assq win win-start-end))))
1064 ;; first is equal with the start of the successor. The first window
1065 ;; should start at a full screen line.
1067 (defsubst follow-windows-aligned-p (win-start-end)
1071 (goto-char (window-start (car (car win-start-end))))
1074 (vertical-motion 0 (car (car win-start-end)))
1075 (setq res (eq (point) (window-start (car (car win-start-end)))))))
1076 (while (and res (cdr win-start-end))
1078 (setq res (eq (car (cdr (cdr (car win-start-end))))
1079 (car (cdr (car (cdr win-start-end))))))
1080 (setq win-start-end (cdr win-start-end)))
1087 (defun follow-point-visible-all-windows-p (win-start-end)
1090 (while (and res win-start-end)
1091 (setq res (follow-pos-visible (window-point (car (car win-start-end)))
1092 (car (car win-start-end))
1093 win-start-end))
1094 (setq win-start-end (cdr win-start-end)))
1099 ;; line. If WIN is not aligned the start is updated which probably
1104 ;; (Without the update, the start of the window will move as the
1106 ;; will move the start of the window in the wrong direction.)
1108 (defun follow-update-window-start (win)
1109 "Make sure that the start of WIN starts at a full screen line."
1111 (goto-char (window-start win))
1115 (if (eq (point) (window-start win))
1118 (set-window-start win (point) 'noforce)))))
1128 (defun follow-select-if-visible (dest win-start-end)
1132 (while (and (not win) win-start-end)
1136 (if (follow-pos-visible dest (car (car win-start-end)) win-start-end)
1138 (setq win (car (car win-start-end)))
1140 (setq win-start-end (cdr win-start-end)))
1152 (defun follow-select-if-end-visible (win-start-end)
1155 (while (and (not win) win-start-end)
1159 (if (and (eq (point-max) (nth 2 (car win-start-end)))
1160 (nth 3 (car win-start-end))
1162 (let ((end (window-end (car (car win-start-end)))))
1166 (setq win (car (car win-start-end)))
1168 (setq win-start-end (cdr win-start-end)))
1182 (goto-char (window-start (car windows)))
1183 ;; Make sure the line start in the beginning of a real screen
1187 ;; Above the start, not visible.
1189 ;; At or below the start. Check the windows.
1192 (set-window-start (car windows) (point) 'noforce)
1225 (follow-downward windows (follow-calculate-first-window-start windows win)))
1235 (set-window-start (car windows) pos)
1245 ;; (set-window-start (car windows) pos)
1251 ;; Return the start of the first window.
1261 ;; unlikely that we ever will miss the correct start by more than one
1264 (defun follow-calculate-first-window-start (windows &optional win start)
1265 "Calculate the start of the first window.
1272 (or start
1273 (setq start (window-start win)))
1274 (let ((guess (follow-estimate-first-window-start windows win start)))
1278 (let ((win-start (follow-calc-win-start windows (cdr guess) win)))
1279 (cond ((= win-start start)
1282 ((< win-start start)
1284 (follow-calculate-first-window-start-from-above
1285 windows (cdr guess) win start))
1288 (follow-calculate-first-window-start-from-below
1289 windows (cdr guess) win start)))))))
1294 (defun follow-estimate-first-window-start (windows win start)
1302 (goto-char start)
1313 ;; Find the starting point, start at GUESS and search downward.
1316 (defun follow-calculate-first-window-start-from-above
1317 (windows guess win start)
1320 win-start
1330 (setq win-start (follow-calc-win-start windows (point) win))
1331 (if (>= win-start start)
1338 ;; Find the starting point, start at GUESS and search upward. Return
1344 (defun follow-calculate-first-window-start-from-below
1345 (windows guess &optional win start)
1347 (setq start (or start (window-start win)))
1350 win-start
1363 (setq win-start (follow-calc-win-start windows (point) win))
1364 (cond ((= win-start start) ; Perfect match, use this value
1367 ((< win-start start) ; Walked to far, use preious result
1383 ;; window-start position is equal to (point-max) of the buffer it
1399 This is done by reading and rewriting the start position of
1406 start
1414 (setq start (window-start win))
1419 (eq (point-max) start))
1420 ;; Write the same window start back, but don't
1422 (set-window-start win start))
1469 (win-start-end (inline
1470 (follow-update-window-start (car windows))
1471 (follow-windows-start-end windows)))
1472 (aligned (follow-windows-aligned-p win-start-end))
1473 (visible (follow-pos-visible dest win win-start-end)))
1507 ((follow-select-if-end-visible win-start-end)
1531 ((follow-select-if-visible dest win-start-end)
1544 (set-window-start (selected-window) (point-min))
1545 (setq win-start-end (follow-windows-start-end windows))
1569 (set-window-start win (window-start win) nil)
1574 (follow-pos-visible dest win win-start-end))
1578 (setq win-start-end (follow-windows-start-end windows))
1584 (follow-windows-aligned-p win-start-end)))
1586 win-start-end))))
1590 (setq win-start-end (follow-windows-start-end windows))
1601 (if (follow-pos-visible dest win win-start-end)
1603 (follow-select-if-visible dest win-start-end)
1612 (selected-window) windows win-start-end))
1617 ;; (follow-windows-start-end windows)))
1638 (defun follow-maximize-region (win windows win-start-end)
1645 (setq data (assq (car pred) win-start-end))
1649 (set-window-point (car succ) (nth 1 (assq (car succ) win-start-end)))
1685 scroll-bar-set-window-start)))
1702 (symbol-function 'event-start) event)))
1773 ;; The following sections installs a spy that listens to process
1779 ;; using `set-process-filter' are also intercepted. The reason is
1780 ;; that a process can cause a redisplay recentering "tail" windows.
1783 ;; Technically, we set the process filter to `follow-generic-filter'.
1784 ;; The original filter is stored in `follow-process-filter-alist'.
1791 ;; `set-process-filter'? (How often are processes created in a
1794 ;; Discussion: Should we also advice `process-filter' to make our
1797 ;;{{{ Advice for `set-process-filter'
1802 (defadvice set-process-filter (before follow-set-process-filter activate)
1803 "Ensure process output will be displayed correctly in Follow Mode buffers.
1805 Follow Mode inserts its own process filter to do its
1806 magic stuff before the real process filter is called."
1809 (setq follow-process-filter-alist
1810 (delq (assq (ad-get-arg 0) follow-process-filter-alist)
1811 follow-process-filter-alist))
1812 (follow-tidy-process-filter-alist)
1817 (setq follow-process-filter-alist
1819 follow-process-filter-alist))
1823 (defun follow-call-set-process-filter (proc filter)
1824 "Call original `set-process-filter' without the Follow mode advice."
1825 (ad-disable-advice 'set-process-filter 'before
1826 'follow-set-process-filter)
1827 (ad-activate 'set-process-filter)
1829 (set-process-filter proc filter)
1830 (ad-enable-advice 'set-process-filter 'before
1831 'follow-set-process-filter)
1832 (ad-activate 'set-process-filter)))
1835 (defadvice process-filter (after follow-process-filter activate)
1836 "Return the original process filter, not `follow-generic-filter'."
1840 follow-process-filter-alist))))))
1843 (defun follow-call-process-filter (proc)
1844 "Call original `process-filter' without the Follow mode advice."
1845 (ad-disable-advice 'process-filter 'after
1846 'follow-process-filter)
1847 (ad-activate 'process-filter)
1849 (process-filter proc)
1850 (ad-enable-advice 'process-filter 'after
1851 'follow-process-filter)
1852 (ad-activate 'process-filter)))
1855 (defun follow-tidy-process-filter-alist ()
1856 "Remove old processes from `follow-process-filter-alist'."
1857 (let ((alist follow-process-filter-alist)
1858 (ps (process-list))
1861 (if (and (not (memq (process-status (car (car alist)))
1866 (setq follow-process-filter-alist new)))
1871 ;; Normally, all new processed are intercepted by our `set-process-filter'.
1874 ;; `follow-stop-intercept-process-output'.
1876 (defun follow-intercept-process-output ()
1882 (let ((list (process-list)))
1884 (if (eq (process-filter (car list)) 'follow-generic-filter)
1886 ;; The custom `set-process-filter' defined above.
1887 (set-process-filter (car list) (process-filter (car list))))
1892 (defun follow-stop-intercept-process-output ()
1904 (follow-tidy-process-filter-alist)
1905 (let ((list (process-list)))
1907 (if (eq (process-filter (car list)) 'follow-generic-filter)
1909 (follow-call-set-process-filter
1911 (cdr-safe (assq (car list) follow-process-filter-alist)))
1912 (setq follow-process-filter-alist
1913 (delq (assq (car list) follow-process-filter-alist)
1914 follow-process-filter-alist))))
1922 ;; process output to work with Follow mode. Whenever the start of the
1929 "Process output filter for process connected to buffers in Follow mode."
1932 (buf (process-buffer proc))
1937 (orig-window-start (and win (window-start win))))
1941 ;; provoke the process hadnling code to sceduling a redisplay.
1946 (let ((filter (cdr-safe (assq proc follow-process-filter-alist))))
1955 (if (not (marker-buffer (process-mark proc)))
1956 (set-marker (process-mark proc) (point-max)))
1957 (let ((moving (= (point) (process-mark proc)))
1961 (goto-char (process-mark proc))
1965 (set-marker (process-mark proc) (point)))
1966 (if moving (goto-char (process-mark proc)))))))
1978 (win-start-end (follow-windows-start-end windows))
1979 (new-window-start (window-start win))
1982 ;; The start of the selected window was repositioned.
1983 ;; Try to use the original start position and continue
1991 ;; window start.
1993 ;; This case is typically used when the process filter
1994 ;; tries to reposition the start of the window in order
1996 ((not (eq orig-window-start new-window-start))
1998 (set-window-start win orig-window-start)
2000 (setq win-start-end (follow-windows-start-end windows))
2002 win-start-end)
2005 (set-window-start win new-window-start))
2006 (setq win-start-end (follow-windows-start-end windows)))
2018 (setq win-start-end
2019 (follow-windows-start-end windows)))
2028 (point) (selected-window) win-start-end))
2032 (setq win-start-end
2033 (follow-windows-start-end windows))))
2036 (not (follow-windows-aligned-p win-start-end)))
2088 ;; doesn't start a mutally recursive endless loop.
2134 ;; the start of the window for the selected window. This is not much
2199 ;; Without this advice, `mouse-drag-region' would start to recenter
2228 follow-calculate-first-window-start
2229 follow-estimate-first-window-start
2230 follow-calculate-first-window-start-from-above
2231 follow-calculate-first-window-start-from-below
2233 follow-calc-win-start
2235 follow-windows-start-end
2242 follow-update-window-start