diff options
| author | Stefan Monnier | 2004-04-22 22:56:08 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-04-22 22:56:08 +0000 |
| commit | e462ab772ac754ec2333929c54207cece4a8efe4 (patch) | |
| tree | 21bc1a4971b016249713f5859d0709d854926199 | |
| parent | bb2c34b14781830ae47d2caaac2b56beb71cff52 (diff) | |
| download | emacs-e462ab772ac754ec2333929c54207cece4a8efe4.tar.gz emacs-e462ab772ac754ec2333929c54207cece4a8efe4.zip | |
(next-error): Change arg name. Add support for the documented C-u C-x ` usage.
| -rw-r--r-- | lisp/simple.el | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 494a9884100..782dd9c3a2e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; simple.el --- basic editing commands for Emacs | 1 | ;;; simple.el --- basic editing commands for Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 99, | 3 | ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 99, |
| 4 | ;; 2000, 2001, 2002, 2003 | 4 | ;; 2000, 01, 02, 03, 04 |
| 5 | ;; Free Software Foundation, Inc. | 5 | ;; Free Software Foundation, Inc. |
| 6 | 6 | ||
| 7 | ;; Maintainer: FSF | 7 | ;; Maintainer: FSF |
| @@ -74,11 +74,14 @@ similar mode is started, or when it is used with \\[next-error] | |||
| 74 | or \\[compile-goto-error].") | 74 | or \\[compile-goto-error].") |
| 75 | 75 | ||
| 76 | (defvar next-error-function nil | 76 | (defvar next-error-function nil |
| 77 | "The next-error vehicle for other modes. | 77 | "Function to use to find the next error in the current buffer. |
| 78 | This variable can be bound to a function by a mode. It is | 78 | The function is called with 2 parameters: |
| 79 | buffer-local by default. Together with | 79 | ARG is an integer specifying by how many errors to move. |
| 80 | `next-error-last-buffer', this variable lets modes hook into | 80 | RESET is a boolean which, if non-nil, says to go back to the beginning |
| 81 | \\[next-error].") | 81 | of the errors before moving. |
| 82 | Major modes providing compile-like functionality should set this variable | ||
| 83 | to indicate to `next-error' that this is a candidate buffer and how | ||
| 84 | to navigate in it.") | ||
| 82 | 85 | ||
| 83 | (make-variable-buffer-local 'next-error-function) | 86 | (make-variable-buffer-local 'next-error-function) |
| 84 | 87 | ||
| @@ -119,13 +122,13 @@ buffer-local by default. Together with | |||
| 119 | (current-buffer))) | 122 | (current-buffer))) |
| 120 | (error "No next-error capable buffer found!"))))))) | 123 | (error "No next-error capable buffer found!"))))))) |
| 121 | 124 | ||
| 122 | (defun next-error (argp &optional reset) | 125 | (defun next-error (arg &optional reset) |
| 123 | "Visit next next-error message and corresponding source code. | 126 | "Visit next next-error message and corresponding source code. |
| 124 | 127 | ||
| 125 | If all the error messages parsed so far have been processed already, | 128 | If all the error messages parsed so far have been processed already, |
| 126 | the message buffer is checked for new ones. | 129 | the message buffer is checked for new ones. |
| 127 | 130 | ||
| 128 | A prefix ARGP specifies how many error messages to move; | 131 | A prefix ARG specifies how many error messages to move; |
| 129 | negative means move back to previous error messages. | 132 | negative means move back to previous error messages. |
| 130 | Just \\[universal-argument] as a prefix means reparse the error message buffer | 133 | Just \\[universal-argument] as a prefix means reparse the error message buffer |
| 131 | and start at the first error. | 134 | and start at the first error. |
| @@ -148,10 +151,11 @@ uses Compilation mode or Compilation Minor mode. | |||
| 148 | See variables `compilation-parse-errors-function' and | 151 | See variables `compilation-parse-errors-function' and |
| 149 | \`compilation-error-regexp-alist' for customization ideas." | 152 | \`compilation-error-regexp-alist' for customization ideas." |
| 150 | (interactive "P") | 153 | (interactive "P") |
| 154 | (if (consp arg) (setq reset t arg nil)) | ||
| 151 | (when (setq next-error-last-buffer (next-error-find-buffer)) | 155 | (when (setq next-error-last-buffer (next-error-find-buffer)) |
| 152 | ;; we know here that next-error-function is a valid symbol we can funcall | 156 | ;; we know here that next-error-function is a valid symbol we can funcall |
| 153 | (with-current-buffer next-error-last-buffer | 157 | (with-current-buffer next-error-last-buffer |
| 154 | (funcall next-error-function argp reset)))) | 158 | (funcall next-error-function (prefix-numeric-value arg) reset)))) |
| 155 | 159 | ||
| 156 | (defalias 'goto-next-locus 'next-error) | 160 | (defalias 'goto-next-locus 'next-error) |
| 157 | (defalias 'next-match 'next-error) | 161 | (defalias 'next-match 'next-error) |