branch: main
commit 83c8aa682e47f5981b90c0b20686bba1281d10ef
Author: Hugo Heagren <h...@heagren.com>
Commit: Ikumi Keita <ik...@ikumi.que.jp>

    Allow t in `TeX-doc-backend-alist' to mean `use in all modes'
    
    * tex.el (TeX-doc): Support using t in `TeX-doc-backend-alist' backend
    mode list to mean that a backend should be available in all modes.
    (TeX-doc-backend-alist): Document change.
---
 tex.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tex.el b/tex.el
index 9bbf45b6..3a8c89bb 100644
--- a/tex.el
+++ b/tex.el
@@ -6715,7 +6715,8 @@ Each item consists of four elements.
 
 The first is a symbol describing the backend's name.
 
-The second is a list of modes the backend should be activated in.
+The second is either a list of modes the backend should be activated in,
+or the symbol t, which stands for all modes.
 
 The third is a function returning a list of documents available
 to the backend.  It should return nil if the backend is not
@@ -6733,7 +6734,8 @@ NAME may be a package, a command, or a document."
   (let (docs)
     ;; Build the lists of available documentation used for completion.
     (dolist (elt TeX-doc-backend-alist)
-      (when (memq major-mode (nth 1 elt))
+      (when (or (eq t (nth 1 elt))
+                (memq major-mode (nth 1 elt)))
         (let ((completions (funcall (nth 2 elt))))
           (unless (null completions)
             (cl-pushnew (cons completions (nth 0 elt)) docs :test #'equal)))))

Reply via email to