In case somebody wants to have a toolbar button for
`TeX-command-master', you can check out the attached patch.

The button does not update the displayed image.  You will always see
the cog wheels.

There won't be the usual questions about which command to use you
normally get with `C-c C-c'.  So for the button it is crucial that we
always compute the correct next command.  If we fail to do so, we
might think about alternative invocations to temporarily reenable the
question for the command.  I don't know if something like `S-mouse-1'
works which could be used for this purpose (if it works).

-- 
Ralf
Index: tex-bar.el
===================================================================
RCS file: /cvsroot/auctex/auctex/tex-bar.el,v
retrieving revision 1.11
diff -u -r1.11 tex-bar.el
--- tex-bar.el	21 May 2005 11:56:45 -0000	1.11
+++ tex-bar.el	22 May 2005 09:10:53 -0000
@@ -84,7 +84,7 @@
 
 (defcustom TeX-bar-LaTeX-buttons
   '(open-file save-buffer cut copy paste undo
-	      [separator nil] latex next-error view bibtex)
+	      [separator nil] latex next-error view bibtex command-master)
   "List of buttons available in `latex-mode'.
 It should be a list in the same format of the BUTTONS parameter
 in function `toolbarx-install-toolbar', often a symbol that
@@ -166,6 +166,10 @@
     (bibtex :image "bibtex"
 	    :command (TeX-command "BibTeX" 'TeX-master-file -1)
 	    :help (lambda nil (TeX-bar-help-from-command-list "BibTeX")))
+    (command-master
+     :image "exec"
+     :command (TeX-command-master -1)
+     :help "Execute next processing step for document")
     (latex-symbols-experimental . (:alias :eval-group
 					  LaTeX-symbols-toolbar-switch-contents
 					  LaTeX-symbols-toolbar-contents)))
Index: tex-buf.el
===================================================================
RCS file: /cvsroot/auctex/auctex/tex-buf.el,v
retrieving revision 1.229
diff -u -r1.229 tex-buf.el
--- tex-buf.el	16 May 2005 08:46:57 -0000	1.229
+++ tex-buf.el	22 May 2005 09:10:53 -0000
@@ -92,7 +92,11 @@
 If a prefix argument OVERRIDE-CONFIRM is given, confirmation will
 depend on it being positive instead of the entry in `TeX-command-list'."
   (interactive "P")
-  (TeX-command (TeX-command-query (TeX-master-file)) 'TeX-master-file
+  (TeX-command (if (or (not override-confirm)
+		       (and override-confirm (> override-confirm 0)))
+		   (TeX-command-query (TeX-master-file))
+		 (TeX-command-next (TeX-master-file)))
+	       'TeX-master-file
 	       override-confirm))
 
 (defvar TeX-command-region-begin nil)
@@ -386,25 +390,27 @@
 
 (defvar TeX-command-history nil)
 
+(defun TeX-command-next (name)
+  "Return the next command to be run on NAME."
+  (cond ((if (string-equal name TeX-region)
+	     (TeX-check-files (concat name "." (TeX-output-extension))
+			      (list name)
+			      TeX-file-extensions)
+	   (TeX-save-document (TeX-master-file)))
+	 TeX-command-default)
+	((and (memq major-mode '(doctex-mode latex-mode))
+	      (TeX-check-files (concat name ".bbl")
+			       (mapcar 'car
+				       (LaTeX-bibliography-list))
+			       BibTeX-file-extensions))
+	 ;; We should check for bst files here as well.
+	 TeX-command-BibTeX)
+	((TeX-process-get-variable name 'TeX-command-next TeX-command-Show))
+	(TeX-command-Show)))
+
 (defun TeX-command-query (name)
   "Query the user for what TeX command to use."
-  (let* ((default (cond ((if (string-equal name TeX-region)
-			     (TeX-check-files (concat name "." (TeX-output-extension))
-					      (list name)
-					      TeX-file-extensions)
-			   (TeX-save-document (TeX-master-file)))
-			 TeX-command-default)
-			((and (memq major-mode '(doctex-mode latex-mode))
-			      (TeX-check-files (concat name ".bbl")
-					       (mapcar 'car
-						       (LaTeX-bibliography-list))
-					       BibTeX-file-extensions))
-			 ;; We should check for bst files here as well.
-			 TeX-command-BibTeX)
-			((TeX-process-get-variable name
-						   'TeX-command-next
-						   TeX-command-Show))
-			(TeX-command-Show)))
+  (let* ((default (TeX-command-next name))
 	 (completion-ignore-case t)
 	 (answer (or TeX-command-force
 		     (completing-read
_______________________________________________
auctex-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to