emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/cape 4b8f101dfb 8/9: char: `*--define` macro: Call tran


From: ELPA Syncer
Subject: [elpa] externals/cape 4b8f101dfb 8/9: char: `*--define` macro: Call translation-hash from within the macro
Date: Thu, 28 Sep 2023 00:57:47 -0400 (EDT)

branch: externals/cape
commit 4b8f101dfb0ef4f1ac418f2170b268565310e0e0
Author: hedy <hedy@tilde.cafe>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    char: `*--define` macro: Call translation-hash from within the macro
    
    This lets the translation hash to be computed within the macro rather
    than after the macro is expanded.
    
    I kept the name `hash` for the variable symbol to conform to the style
    of the other macro variables/functions in let.
---
 cape-char.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/cape-char.el b/cape-char.el
index a5c32f8228..cd11dc2101 100644
--- a/cape-char.el
+++ b/cape-char.el
@@ -72,11 +72,12 @@ PREFIX are the prefix characters."
         (docsig (intern (format "cape--%s-docsig" name)))
         (exit (intern (format "cape--%s-exit" name)))
         (properties (intern (format "cape--%s-properties" name)))
-        (thing-re (concat (regexp-opt (mapcar #'char-to-string prefix)) "[^ 
\n\t]*" )))
+        (thing-re (concat (regexp-opt (mapcar #'char-to-string prefix)) "[^ 
\n\t]*" ))
+        (hash-val (cape-char--translation-hash
+                   method
+                   (concat "\\`" (regexp-opt (mapcar #'char-to-string 
prefix))))))
     `(progn
-       (defvar ,hash (cape-char--translation-hash
-                      ,method
-                      ,(concat "\\`" (regexp-opt (mapcar #'char-to-string 
prefix)))))
+       (defvar ,hash ,hash-val)
        (defcustom ,prefix-required t
          ,(format "Initial prefix is required for `%s' to trigger." capf)
          :type 'boolean



reply via email to

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