emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/simple.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/simple.el [lexbind]
Date: Wed, 15 Sep 2004 20:34:05 -0400

Index: emacs/lisp/simple.el
diff -c emacs/lisp/simple.el:1.551.2.25 emacs/lisp/simple.el:1.551.2.26
*** emacs/lisp/simple.el:1.551.2.25     Sat Sep  4 09:28:13 2004
--- emacs/lisp/simple.el        Thu Sep 16 00:12:21 2004
***************
*** 249,254 ****
--- 249,280 ----
                   (const :tag "Fringe arrow" 'fringe-arrow))
    :group 'next-error
    :version "21.4")
+ 
+ ;;; Internal variable for `next-error-follow-mode-post-command-hook'.
+ (defvar next-error-follow-last-line nil)
+ 
+ (define-minor-mode next-error-follow-minor-mode
+   "Minor mode for compilation, occur and diff modes.
+ When turned on, cursor motion in the compilation, grep, occur or diff
+ buffer causes automatic display of the corresponding source code
+ location."
+   nil " Fol" nil
+   (if (not next-error-follow-minor-mode)
+       (remove-hook 'post-command-hook 
'next-error-follow-mode-post-command-hook t)
+     (add-hook 'post-command-hook 'next-error-follow-mode-post-command-hook 
nil t)
+     (make-variable-buffer-local 'next-error-follow-last-line)))
+ 
+ ;;; Used as a `post-command-hook' by `next-error-follow-mode'
+ ;;; for the *Compilation* *grep* and *Occur* buffers.
+ (defun next-error-follow-mode-post-command-hook ()
+   (unless (equal next-error-follow-last-line (line-number-at-pos))
+     (setq next-error-follow-last-line (line-number-at-pos))
+     (condition-case nil
+       (let ((compilation-context-lines nil))
+         (setq compilation-current-error (point))
+         (next-error-no-select 0))
+       (error t))))
+ 
  
  ;;;
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]