Function: makeinfo-compilation-sentinel-region

makeinfo-compilation-sentinel-region is a byte-compiled function defined in makeinfo.el.gz.

Signature

(makeinfo-compilation-sentinel-region PROC MSG)

Documentation

Sentinel for makeinfo-compile run from makeinfo-region.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/makeinfo.el.gz
;; Delete makeinfo-temp-file after processing is finished,
;; and visit Info file.
;; This function is called when the compilation process changes state.
;; Based on `compilation-sentinel' in compile.el
(defun makeinfo-compilation-sentinel-region (proc msg)
  "Sentinel for `makeinfo-compile' run from `makeinfo-region'."
  (compilation-sentinel proc msg)
  (when (memq (process-status proc) '(signal exit))
    (if (file-exists-p makeinfo-temp-file)
	(delete-file makeinfo-temp-file))
    ;; Always use the version on disk.
    (let ((buffer (get-file-buffer makeinfo-output-file-name)))
      (if buffer
	  (with-current-buffer buffer
	    (revert-buffer t t))
	(setq buffer (find-file-noselect makeinfo-output-file-name)))
      (if (window-dedicated-p)
	  (switch-to-buffer-other-window buffer)
	(switch-to-buffer buffer)))
    (goto-char (point-min))))