diff options
| author | Romain Francoise | 2005-08-27 16:11:44 +0000 |
|---|---|---|
| committer | Romain Francoise | 2005-08-27 16:11:44 +0000 |
| commit | 713fbb79dbd0e3e7e6933f95624f4b98df43eff5 (patch) | |
| tree | a47859e6315370192e9d2c652506f688b5aa6b4c | |
| parent | a24c45d2bd2ef0e298e5ec52469a0e1eea8d1e70 (diff) | |
| download | emacs-713fbb79dbd0e3e7e6933f95624f4b98df43eff5.tar.gz emacs-713fbb79dbd0e3e7e6933f95624f4b98df43eff5.zip | |
(makeinfo-compile): Use `compilation-start'. Set `next-error-function'
according to `disable-errors'.
(makeinfo-next-error): New function.
(makeinfo-region): Adjust to new `makeinfo-compile' prototype.
(makeinfo-buffer): Likewise.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/textmodes/makeinfo.el | 38 |
2 files changed, 28 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1b7eb7d9317..65e22bf8d2c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2005-08-27 Romain Francoise <romain@orebokech.com> | 1 | 2005-08-27 Romain Francoise <romain@orebokech.com> |
| 2 | 2 | ||
| 3 | * textmodes/makeinfo.el (makeinfo-compile): Use | ||
| 4 | `compilation-start'. Set `next-error-function' according to | ||
| 5 | `disable-errors'. | ||
| 6 | (makeinfo-next-error): New function. | ||
| 7 | (makeinfo-region): Adjust to new `makeinfo-compile' prototype. | ||
| 8 | (makeinfo-buffer): Likewise. | ||
| 9 | |||
| 3 | * progmodes/compile.el (compilation-start): Add autoload cookie. | 10 | * progmodes/compile.el (compilation-start): Add autoload cookie. |
| 4 | 11 | ||
| 5 | * progmodes/antlr-mode.el: Don't autoload `compilation-start'. | 12 | * progmodes/antlr-mode.el: Don't autoload `compilation-start'. |
diff --git a/lisp/textmodes/makeinfo.el b/lisp/textmodes/makeinfo.el index f2c407975e2..d8829a2d3dd 100644 --- a/lisp/textmodes/makeinfo.el +++ b/lisp/textmodes/makeinfo.el | |||
| @@ -171,22 +171,27 @@ command to gain use of `next-error'." | |||
| 171 | makeinfo-options | 171 | makeinfo-options |
| 172 | " " | 172 | " " |
| 173 | makeinfo-temp-file) | 173 | makeinfo-temp-file) |
| 174 | "Use `makeinfo-buffer' to gain use of the `next-error' command" | 174 | t |
| 175 | nil | ||
| 176 | 'makeinfo-compilation-sentinel-region))))))) | 175 | 'makeinfo-compilation-sentinel-region))))))) |
| 177 | 176 | ||
| 178 | ;;; Actually run makeinfo. COMMAND is the command to run. | 177 | (defun makeinfo-next-error (arg reset) |
| 179 | ;;; ERROR-MESSAGE is what to say when next-error can't find another error. | 178 | "This function is used to disable `next-error' if the user has |
| 180 | ;;; If PARSE-ERRORS is non-nil, do try to parse error messages. | 179 | used `makeinfo-region'. Since the compilation process is used on |
| 181 | (defun makeinfo-compile (command error-message parse-errors sentinel) | 180 | a temporary file in that case, calling `next-error' would give |
| 182 | (let ((buffer | 181 | nonsensical results." |
| 183 | (compile-internal command error-message nil | 182 | (error "Use `makeinfo-buffer' to gain use of the `next-error' command")) |
| 184 | (and (not parse-errors) | 183 | |
| 185 | ;; If we do want to parse errors, pass nil. | 184 | ;; Actually run makeinfo. COMMAND is the command to run. If |
| 186 | ;; Otherwise, use this function, which won't | 185 | ;; DISABLE-ERRORS is non-nil, disable `next-error' by setting |
| 187 | ;; ever find any errors. | 186 | ;; `next-error-function' to `makeinfo-next-error' in the compilation |
| 188 | (lambda (&rest ignore) | 187 | ;; buffer. |
| 189 | (setq compilation-error-list nil)))))) | 188 | (defun makeinfo-compile (command disable-errors sentinel) |
| 189 | (let ((buffer (compilation-start command))) | ||
| 190 | (with-current-buffer buffer | ||
| 191 | (setq next-error-function | ||
| 192 | (if disable-errors | ||
| 193 | 'makeinfo-next-error | ||
| 194 | 'compilation-next-error-function))) | ||
| 190 | (set-process-sentinel (get-buffer-process buffer) sentinel))) | 195 | (set-process-sentinel (get-buffer-process buffer) sentinel))) |
| 191 | 196 | ||
| 192 | ;; Delete makeinfo-temp-file after processing is finished, | 197 | ;; Delete makeinfo-temp-file after processing is finished, |
| @@ -249,9 +254,8 @@ Use the \\[next-error] command to move to the next error | |||
| 249 | (save-excursion | 254 | (save-excursion |
| 250 | (makeinfo-compile | 255 | (makeinfo-compile |
| 251 | (concat makeinfo-run-command " " makeinfo-options | 256 | (concat makeinfo-run-command " " makeinfo-options |
| 252 | " " buffer-file-name) | 257 | " " buffer-file-name) |
| 253 | "No more errors." | 258 | nil |
| 254 | t | ||
| 255 | 'makeinfo-compilation-sentinel-buffer))) | 259 | 'makeinfo-compilation-sentinel-buffer))) |
| 256 | 260 | ||
| 257 | (defun makeinfo-compilation-sentinel-buffer (proc msg) | 261 | (defun makeinfo-compilation-sentinel-buffer (proc msg) |