# HG changeset patch # User HIROSE Yuuji # Date 1418892933 -32400 # Node ID 9c39aa8a50e9e3e4f1fc87ae00c939bc059d70f4 # Parent c731bc210af11f940d803395405afeada1694583 YaTeX-help takes one optional argument which directly taken as keyword. diff -r c731bc210af1 -r 9c39aa8a50e9 yatexhlp.el --- 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)