/[emacs]/emacs/lisp/simple.el
ViewVC logotype

Diff of /emacs/lisp/simple.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.551.2.25 by miles, Sat Sep 4 09:28:13 2004 UTC revision 1.551.2.26 by miles, Thu Sep 16 00:12:21 2004 UTC
# Line 249  If `fringe-arrow', indicate the locus by Line 249  If `fringe-arrow', indicate the locus by
249                   (const :tag "Fringe arrow" 'fringe-arrow))                   (const :tag "Fringe arrow" 'fringe-arrow))
250    :group 'next-error    :group 'next-error
251    :version "21.4")    :version "21.4")
252    
253    ;;; Internal variable for `next-error-follow-mode-post-command-hook'.
254    (defvar next-error-follow-last-line nil)
255    
256    (define-minor-mode next-error-follow-minor-mode
257      "Minor mode for compilation, occur and diff modes.
258    When turned on, cursor motion in the compilation, grep, occur or diff
259    buffer causes automatic display of the corresponding source code
260    location."
261      nil " Fol" nil
262      (if (not next-error-follow-minor-mode)
263          (remove-hook 'post-command-hook 'next-error-follow-mode-post-command-hook t)
264        (add-hook 'post-command-hook 'next-error-follow-mode-post-command-hook nil t)
265        (make-variable-buffer-local 'next-error-follow-last-line)))
266    
267    ;;; Used as a `post-command-hook' by `next-error-follow-mode'
268    ;;; for the *Compilation* *grep* and *Occur* buffers.
269    (defun next-error-follow-mode-post-command-hook ()
270      (unless (equal next-error-follow-last-line (line-number-at-pos))
271        (setq next-error-follow-last-line (line-number-at-pos))
272        (condition-case nil
273            (let ((compilation-context-lines nil))
274              (setq compilation-current-error (point))
275              (next-error-no-select 0))
276          (error t))))
277    
278    
279  ;;;  ;;;
280    

Legend:
Removed from v.1.551.2.25  
changed lines
  Added in v.1.551.2.26

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26