*** makeinfo.el.~1.16.~ Sat Sep 6 08:16:12 2003 --- makeinfo.el Wed Jan 21 17:50:17 2004 *************** (defun makeinfo-current-node () *** 219,257 **** (defun makeinfo-buffer () "Make Info file from current buffer. ! ! Use the \\[next-error] command to move to the next error ! \(if there are errors\)." (interactive) ! (cond ((null buffer-file-name) (error "Buffer not visiting any file")) ((buffer-modified-p) (if (y-or-n-p "Buffer modified; do you want to save it? ") (save-buffer)))) ! ;; Find and record the Info filename, ! ;; or else explain that a filename is needed. ! (save-excursion ! (goto-char (point-min)) ! (let ((search-end (save-excursion (forward-line 100) (point)))) ! (if (re-search-forward ! "address@hidden \t]+\\([^ \t\n]+\\)[ \t]*" ! search-end t) ! (setq makeinfo-output-file-name ! (expand-file-name ! (buffer-substring (match-beginning 1) (match-end 1)))) ! (error ! "The texinfo file needs a line saying: @setfilename ")))) ! (setq makeinfo-output-node-name (makeinfo-current-node)) ! ! (save-excursion ! (makeinfo-compile ! (concat makeinfo-run-command " " makeinfo-options ! " " buffer-file-name) ! "No more errors." ! t ! 'makeinfo-compilation-sentinel-buffer))) (defun makeinfo-compilation-sentinel-buffer (proc msg) "Sentinel for `makeinfo-compile' run from `makeinfo-buffer'." --- 219,268 ---- (defun makeinfo-buffer () "Make Info file from current buffer. ! Use the \\[next-error] command to move through errors (if any). ! Set a `TeX-master' local variable to indicate the top-level file for a ! multi-file document." (interactive) ! (cond ((boundp 'TeX-master) ! (save-some-buffers)) ;; buffers might be holding sub-files ! ((null buffer-file-name) (error "Buffer not visiting any file")) ((buffer-modified-p) (if (y-or-n-p "Buffer modified; do you want to save it? ") (save-buffer)))) ! (let ((master (if (boundp 'TeX-master) TeX-master buffer-file-name))) ! ! ;; Find and record the Info filename, ! ;; or else explain that a filename is needed. ! ;; If the master file is not in a buffer then it's only visited ! ;; temporarily, so as not to junk up the user's buffer list. ! (save-excursion ! (let ((buf (get-file-buffer master))) ! (if buf ! (set-buffer buf) ! (find-file master)) ! (goto-char (point-min)) ! (unwind-protect ! (let ((search-end (save-excursion (forward-line 100) (point)))) ! (if (re-search-forward ! "address@hidden \t]+\\([^ \t\n]+\\)[ \t]*" ! search-end t) ! (setq makeinfo-output-file-name ! (expand-file-name ! (buffer-substring (match-beginning 1) (match-end 1)))) ! (error "%s needs a line saying: @setfilename " master))) ! (unless buf (kill-buffer nil))))) ! ! (setq makeinfo-output-node-name (makeinfo-current-node)) ! ! (save-excursion ! (makeinfo-compile ! (concat makeinfo-run-command " " makeinfo-options " " master) ! "No more errors." ! t ! 'makeinfo-compilation-sentinel-buffer)))) (defun makeinfo-compilation-sentinel-buffer (proc msg) "Sentinel for `makeinfo-compile' run from `makeinfo-buffer'."