branch: externals/auctex
commit 8941bd640feb81363b21dfe1791539a63e107790
Author: Arash Esbati <[email protected]>
Commit: Arash Esbati <[email protected]>

    * style/fontspec.el ("fontspec"): Replace `TeX-arg-eval'.
---
 style/fontspec.el | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/style/fontspec.el b/style/fontspec.el
index 90018a21d4..a19d5ce5dd 100644
--- a/style/fontspec.el
+++ b/style/fontspec.el
@@ -390,18 +390,16 @@ to appropriate keys which are eventually prepended to
                                "Existing feature")
       "New name")
 
-    '("aliasfontfeatureoption"
-      (TeX-arg-eval
-       (lambda ()
-         (let* ((key (completing-read
-                      (TeX-argument-prompt nil nil "Feature")
-                      (LaTeX-fontspec-font-features)))
-                (val (completing-read
-                      (TeX-argument-prompt nil nil "Existing name")
-                      (cadr (assoc key (LaTeX-fontspec-font-features))))))
-           (TeX-argument-insert key nil)
-           (format "%s" val))))
-      "New name") )
+    `("aliasfontfeatureoption"
+      (TeX-arg-completing-read (LaTeX-fontspec-font-features) "Feature")
+      (TeX-arg-completing-read
+       ,(lambda ()
+          (save-excursion
+            (re-search-backward "\\\\aliasfontfeatureoption{\\([^}]+\\)}"
+                                (line-beginning-position) t))
+          (cadr (assoc (match-string-no-properties 1)
+                       (LaTeX-fontspec-font-features)))))
+      "New Name") )
 
    (LaTeX-add-environments
     ;; 4.6 Strong emphasis


Reply via email to