Some more changes
This commit is contained in:
@ -564,8 +564,7 @@ which to use. If NODE is non-nil, use that instead."
|
||||
;;;###autoload
|
||||
(defun latex-help-texdoc (name)
|
||||
"Lookup NAME in the texdoc cache.
|
||||
When used interactively, prompt for NAME. If DIR is nil, it will be looked up
|
||||
in the texdoc cache."
|
||||
When used interactively, prompt for NAME."
|
||||
(interactive (list (latex-help--prompt-texdoc-entry)))
|
||||
(latex-help--maybe-init-caches)
|
||||
(when-let ((file (latex-help--texdoc-prompt-for-entry-file name)))
|
||||
@ -634,22 +633,39 @@ documentation for that thing."
|
||||
"Get help with LaTeX.
|
||||
Prompt the user for an info topic or texdoc file, then open that thing."
|
||||
(interactive)
|
||||
(let ((prompts))
|
||||
(let ((prompts)
|
||||
(tap (latex-help--get-thing-at-point))
|
||||
(def-entry nil)
|
||||
(def-name nil))
|
||||
(latex-help--maybe-init-caches)
|
||||
(cl-flet ((add-cache-for-type (type)
|
||||
(dolist (entry (latex-help--get-cache-for-type type))
|
||||
(push (format "(Info) %s - %s"
|
||||
(capitalize (symbol-name type))
|
||||
(car entry))
|
||||
prompts))))
|
||||
prompts)
|
||||
(when (and (eq type (cdr tap))
|
||||
(equal (car entry) (car tap)))
|
||||
(setq def-entry (car prompts)
|
||||
def-name (car entry))))))
|
||||
(add-cache-for-type 'command)
|
||||
(add-cache-for-type 'package)
|
||||
(add-cache-for-type 'class)
|
||||
(add-cache-for-type 'environment)
|
||||
(dolist (entry latex-help--texdoc-cache)
|
||||
(push (format "(Texdoc) %s" entry) prompts))
|
||||
(when-let ((ans (completing-read "LaTeX Help: " prompts
|
||||
nil t nil 'latex-help--general-history))
|
||||
(push (format "(Texdoc) %s" entry) prompts)
|
||||
(when (and (member (cdr tap) '(class package environment))
|
||||
(equal entry (car tap)))
|
||||
(setq def-entry (car prompts)
|
||||
def-name entry)))
|
||||
(when-let ((ans (completing-read (format "LaTeX Help%s: "
|
||||
(if def-name
|
||||
(format " (default %s)"
|
||||
def-name)
|
||||
""))
|
||||
prompts
|
||||
nil t nil 'latex-help--general-history
|
||||
def-entry))
|
||||
((not (zerop (length ans)))))
|
||||
(if (string-prefix-p "(Texdoc) " ans)
|
||||
(latex-help-texdoc (seq-subseq ans (length "(Texdoc) ")))
|
||||
|
Reference in New Issue
Block a user