# HG changeset patch # User yuuji@gentei.org # Date 1297925613 -32400 # Node ID 670549efa5c2fe5911041e47583158c272a430fb # Parent 269fb1992c2d1656f0c46315b08a5ee7dde92c81 YaTeX-call-command-on-file: Use last input command line as default. diff -r 269fb1992c2d -r 670549efa5c2 yatexprc.el --- a/yatexprc.el Wed Feb 16 21:39:22 2011 +0900 +++ b/yatexprc.el Thu Feb 17 15:53:33 2011 +0900 @@ -2,7 +2,7 @@ ;;; YaTeX process handler. ;;; yatexprc.el ;;; (c)1993-2010 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Wed Oct 20 12:32:44 2010 on firestorm +;;; Last modified Thu Feb 17 15:50:32 2011 on firestorm ;;; $Id$ ;(require 'yatex) @@ -357,20 +357,24 @@ "Holds history list of YaTeX-call-command-on-file.") (put 'YaTeX-call-command-history 'no-default t) (defun YaTeX-call-command-on-file (base-cmd buffer &optional file) - "Call external command BASE-CMD int the BUFFER. + "Call external command BASE-CMD in the BUFFER. By default, pass the basename of current file. Optional 3rd argument FILE changes the default file name." (YaTeX-save-buffers) - (YaTeX-typeset - (read-string-with-history - "Call command: " - (concat base-cmd " " - (let ((me (file-name-nondirectory (or file buffer-file-name)))) - (if (string-match "\\.tex" me) - (substring me 0 (match-beginning 0)) - me))) - 'YaTeX-call-command-history) - buffer)) + (let ((default (concat base-cmd " " + (let ((me (file-name-nondirectory + (or file buffer-file-name)))) + (if (string-match "\\.tex" me) + (substring me 0 (match-beginning 0)) + me))))) + (or YaTeX-call-command-history + (setq YaTeX-call-command-history (list default))) + (YaTeX-typeset + (read-string-with-history + "Call command: " + (car YaTeX-call-command-history) + 'YaTeX-call-command-history) + buffer))) (defun YaTeX-bibtex-buffer (cmd) "Pass the bibliography data of editing file to bibtex."