171 |
makeinfo-options |
makeinfo-options |
172 |
" " |
" " |
173 |
makeinfo-temp-file) |
makeinfo-temp-file) |
174 |
"Use `makeinfo-buffer' to gain use of the `next-error' command" |
t |
|
nil |
|
175 |
'makeinfo-compilation-sentinel-region))))))) |
'makeinfo-compilation-sentinel-region))))))) |
176 |
|
|
177 |
;;; Actually run makeinfo. COMMAND is the command to run. |
(defun makeinfo-next-error (arg reset) |
178 |
;;; ERROR-MESSAGE is what to say when next-error can't find another error. |
"This function is used to disable `next-error' if the user has |
179 |
;;; If PARSE-ERRORS is non-nil, do try to parse error messages. |
used `makeinfo-region'. Since the compilation process is used on |
180 |
(defun makeinfo-compile (command error-message parse-errors sentinel) |
a temporary file in that case, calling `next-error' would give |
181 |
(let ((buffer |
nonsensical results." |
182 |
(compile-internal command error-message nil |
(error "Use `makeinfo-buffer' to gain use of the `next-error' command")) |
183 |
(and (not parse-errors) |
|
184 |
;; If we do want to parse errors, pass nil. |
;; Actually run makeinfo. COMMAND is the command to run. If |
185 |
;; Otherwise, use this function, which won't |
;; DISABLE-ERRORS is non-nil, disable `next-error' by setting |
186 |
;; ever find any errors. |
;; `next-error-function' to `makeinfo-next-error' in the compilation |
187 |
(lambda (&rest ignore) |
;; buffer. |
188 |
(setq compilation-error-list nil)))))) |
(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))) |
195 |
(set-process-sentinel (get-buffer-process buffer) sentinel))) |
(set-process-sentinel (get-buffer-process buffer) sentinel))) |
196 |
|
|
197 |
;; Delete makeinfo-temp-file after processing is finished, |
;; Delete makeinfo-temp-file after processing is finished, |
254 |
(save-excursion |
(save-excursion |
255 |
(makeinfo-compile |
(makeinfo-compile |
256 |
(concat makeinfo-run-command " " makeinfo-options |
(concat makeinfo-run-command " " makeinfo-options |
257 |
" " buffer-file-name) |
" " buffer-file-name) |
258 |
"No more errors." |
nil |
|
t |
|
259 |
'makeinfo-compilation-sentinel-buffer))) |
'makeinfo-compilation-sentinel-buffer))) |
260 |
|
|
261 |
(defun makeinfo-compilation-sentinel-buffer (proc msg) |
(defun makeinfo-compilation-sentinel-buffer (proc msg) |