auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. dbfb016dbc7c25e4aee09


From: Tassilo Horn
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. dbfb016dbc7c25e4aee09fc86bdcea8c9b4bc97d
Date: Tue, 2 Mar 2021 14:53:53 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  dbfb016dbc7c25e4aee09fc86bdcea8c9b4bc97d (commit)
      from  18bc7b640a3bbb303000e1b434f70df39a49bcae (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit dbfb016dbc7c25e4aee09fc86bdcea8c9b4bc97d
Author: Tassilo Horn <tsdh@gnu.org>
Date:   Tue Mar 2 20:52:13 2021 +0100

    Use active region if it is a logo name.
    
    * style/hologo.el (LaTeX-hologo--arg-use-region-or-query-logo-name):
    New function for the logo name arg of \hologo and \Hologo.

diff --git a/style/hologo.el b/style/hologo.el
index 373ba9d..8f8693c 100644
--- a/style/hologo.el
+++ b/style/hologo.el
@@ -106,17 +106,23 @@
                 "space"  "hyphen" "runtogether"))) ; plainTeX
   "Local key=value options for hologo macros.")
 
+(defun LaTeX-hologo--arg-use-region-or-query-logo-name (optional)
+  (if (and (use-region-p)
+           (member (buffer-substring (region-beginning) (region-end))
+                   LaTeX-hologo-logo-names))
+      ""
+    (TeX-argument-insert
+     (completing-read "Logo name: " LaTeX-hologo-logo-names)
+     optional)))
+
 (TeX-add-style-hook
  "hologo"
  (lambda ()
    (TeX-add-symbols
 
     ;; Insert logo macros
-    '("hologo" (TeX-arg-eval completing-read
-                             "Logo name: " LaTeX-hologo-logo-names))
-
-    '("Hologo" (TeX-arg-eval completing-read
-                             "Logo name: " LaTeX-hologo-logo-names))
+    '("hologo" LaTeX-hologo--arg-use-region-or-query-logo-name)
+    '("Hologo" LaTeX-hologo--arg-use-region-or-query-logo-name)
 
     ;; Setup macros
     '("hologoSetup" (TeX-arg-key-val LaTeX-hologo-key-val-options-global))

-----------------------------------------------------------------------

Summary of changes:
 style/hologo.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

[Prev in Thread] Current Thread [Next in Thread]