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 wrap: on
line diff
--- a/yatexhlp.el	Thu Dec 18 17:30:56 2014 +0900
+++ b/yatexhlp.el	Thu Dec 18 17:55:33 2014 +0900
@@ -1,7 +1,7 @@
 ;;; yatexhlp.el --- YaTeX helper with LaTeX commands and macros
 ;;; 
 ;;; (c)1994,1998,2004 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Sat Sep  1 08:11:14 2012 on firestorm
+;;; Last modified Thu Dec 18 17:53:52 2014 on firestorm
 ;;; $Id$
 
 ;;; Code:
@@ -302,8 +302,9 @@
       (message "No matches found.")))
 
 ;;;###autoload
-(defun YaTeX-help ()
-  "Show help buffer of LaTeX/TeX commands or macros."
+(defun YaTeX-help (&optional macro)
+  "Show help buffer of LaTeX/TeX commands or macros.
+Optional argument MACRO, if supplied, is directly selected to keyword."
   (interactive)
   (let (p beg end command)
     (save-excursion
@@ -311,6 +312,7 @@
 	  (goto-char (match-end 0)))
       (setq p (point))			;remember current position.
       (cond
+       (macro nil)
        ((YaTeX-on-begin-end-p)
 	;;if on \begin or \end, extract its environment.
 	(setq command
@@ -331,10 +333,11 @@
 	    (search-forward "}" (point-end-of-line))
 	    (setq command (buffer-substring beg (match-beginning 0)))))
       (setq command
-	    (completing-read
-	     "Describe (La)TeX command: "
-	     YaTeX-help-entries nil nil command))
-      );end excursion
+	    (or macro
+		(completing-read
+		 "Describe (La)TeX command: "
+		 YaTeX-help-entries nil nil command))));end excursion
+
     (setq YaTeX-help-saved-config (current-window-configuration))
     (or (YaTeX-refer-help command YaTeX-help-file)
 	(YaTeX-refer-help command YaTeX-help-file-private)

yatex.org