yatex

changeset 339:9c39aa8a50e9 dev

YaTeX-help takes one optional argument which directly taken as keyword.
author HIROSE Yuuji <yuuji@gentei.org>
date Thu, 18 Dec 2014 17:55:33 +0900
parents c731bc210af1
children 3206061867ae
files yatexhlp.el
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line diff
     1.1 --- a/yatexhlp.el	Thu Dec 18 17:30:56 2014 +0900
     1.2 +++ b/yatexhlp.el	Thu Dec 18 17:55:33 2014 +0900
     1.3 @@ -1,7 +1,7 @@
     1.4  ;;; yatexhlp.el --- YaTeX helper with LaTeX commands and macros
     1.5  ;;; 
     1.6  ;;; (c)1994,1998,2004 by HIROSE Yuuji.[yuuji@yatex.org]
     1.7 -;;; Last modified Sat Sep  1 08:11:14 2012 on firestorm
     1.8 +;;; Last modified Thu Dec 18 17:53:52 2014 on firestorm
     1.9  ;;; $Id$
    1.10  
    1.11  ;;; Code:
    1.12 @@ -302,8 +302,9 @@
    1.13        (message "No matches found.")))
    1.14  
    1.15  ;;;###autoload
    1.16 -(defun YaTeX-help ()
    1.17 -  "Show help buffer of LaTeX/TeX commands or macros."
    1.18 +(defun YaTeX-help (&optional macro)
    1.19 +  "Show help buffer of LaTeX/TeX commands or macros.
    1.20 +Optional argument MACRO, if supplied, is directly selected to keyword."
    1.21    (interactive)
    1.22    (let (p beg end command)
    1.23      (save-excursion
    1.24 @@ -311,6 +312,7 @@
    1.25  	  (goto-char (match-end 0)))
    1.26        (setq p (point))			;remember current position.
    1.27        (cond
    1.28 +       (macro nil)
    1.29         ((YaTeX-on-begin-end-p)
    1.30  	;;if on \begin or \end, extract its environment.
    1.31  	(setq command
    1.32 @@ -331,10 +333,11 @@
    1.33  	    (search-forward "}" (point-end-of-line))
    1.34  	    (setq command (buffer-substring beg (match-beginning 0)))))
    1.35        (setq command
    1.36 -	    (completing-read
    1.37 -	     "Describe (La)TeX command: "
    1.38 -	     YaTeX-help-entries nil nil command))
    1.39 -      );end excursion
    1.40 +	    (or macro
    1.41 +		(completing-read
    1.42 +		 "Describe (La)TeX command: "
    1.43 +		 YaTeX-help-entries nil nil command))));end excursion
    1.44 +
    1.45      (setq YaTeX-help-saved-config (current-window-configuration))
    1.46      (or (YaTeX-refer-help command YaTeX-help-file)
    1.47  	(YaTeX-refer-help command YaTeX-help-file-private)