From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.devel Subject: makeinfo-buffer master file Date: Mon, 16 Feb 2004 10:45:17 +1000 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87d68fx36q.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1076892765 16156 80.91.224.253 (16 Feb 2004 00:52:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Feb 2004 00:52:45 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Feb 16 01:52:40 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AsX03-0001p3-00 for ; Mon, 16 Feb 2004 01:52:39 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AsX03-0000Z7-00 for ; Mon, 16 Feb 2004 01:52:39 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AsWwY-0007ES-V7 for emacs-devel@quimby.gnus.org; Sun, 15 Feb 2004 19:49:02 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AsWtk-0006fG-2d for emacs-devel@gnu.org; Sun, 15 Feb 2004 19:46:08 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AsWt9-0006Vv-Q4 for emacs-devel@gnu.org; Sun, 15 Feb 2004 19:46:03 -0500 Original-Received: from [61.8.0.85] (helo=mailout2.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AsWt8-0006VX-KH for emacs-devel@gnu.org; Sun, 15 Feb 2004 19:45:30 -0500 Original-Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86]) by mailout2.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1G0jR5O027939 for ; Mon, 16 Feb 2004 11:45:27 +1100 Original-Received: from localhost (ppp183.dyn10.pacific.net.au [61.8.10.183]) by mailproxy1.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1G0jQ0H020035 for ; Mon, 16 Feb 2004 11:45:26 +1100 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1AsWsv-00015M-00; Mon, 16 Feb 2004 10:45:17 +1000 Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19960 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19960 --=-=-= This is a further proposal for makeinfo-buffer, * textmodes/makeinfo.el (makeinfo-buffer): Look for TeX-master variable to indicate top-level texi file. I've been using this with the Guile manual. I know tex-main-file is checked by tex-mode, I wasn't sure whether TeX-master or tex-main-file or both should be used. I went with TeX-master because that's what Guile has currently. --=-=-= Content-Disposition: attachment; filename=makeinfo.el.master.diff *** 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 ! "^@setfilename[ \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 ! "^@setfilename[ \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'." --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel --=-=-=--