auctex-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex f84b1a5fdb 43/76: Simplify implementation of sty


From: Tassilo Horn
Subject: [elpa] externals/auctex f84b1a5fdb 43/76: Simplify implementation of style/ifthen.el
Date: Fri, 13 Jan 2023 14:31:03 -0500 (EST)

branch: externals/auctex
commit f84b1a5fdbb9cccebf3f6831973ea29d6725ef2c
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Simplify implementation of style/ifthen.el
    
    * style/ifthen.el (LaTeX-ifthen-test): New variable.
    (LaTeX-arg-ifthen-test): Delete and move the functionality into
    the hook.
---
 style/ifthen.el | 28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/style/ifthen.el b/style/ifthen.el
index 6610f88e82..0650975e43 100644
--- a/style/ifthen.el
+++ b/style/ifthen.el
@@ -31,33 +31,29 @@
 ;;; Code:
 
 (require 'tex)
+(require 'latex)
 
 ;; Silence the compiler:
 (declare-function font-latex-add-keywords
                   "font-latex"
                   (keywords class))
 
-(defun LaTeX-arg-ifthen-test (optional &optional prompt)
-  "Query and insert skeleton for a test in ifthen macros."
-  (TeX-argument-insert
-   (completing-read
-    (TeX-argument-prompt optional prompt "Test")
-    '("<" "=" ">"
-      "\\isodd{}"
-      "\\isundefined{}"
-      "\\equal{}{}"
-      "\\lengthtest{<}"
-      "\\lengthtest{=}"
-      "\\lengthtest{>}"
-      "\\boolean{}"))
-   optional))
+(defvar LaTeX-ifthen-test '("<" "=" ">"
+                            "\\isodd{}"
+                            "\\isundefined{}"
+                            "\\equal{}{}"
+                            "\\lengthtest{<}"
+                            "\\lengthtest{=}"
+                            "\\lengthtest{>}"
+                            "\\boolean{}")
+  "List of tests in ifthen macros.")
 
 (TeX-add-style-hook
  "ifthen"
  (lambda ()
    (TeX-add-symbols
-    '("ifthenelse" LaTeX-arg-ifthen-test t nil)
-    '("whiledo"    LaTeX-arg-ifthen-test t)
+    '("ifthenelse" (TeX-arg-completing-read LaTeX-ifthen-test "Test") t nil)
+    '("whiledo"    (TeX-arg-completing-read LaTeX-ifthen-test "Test") t)
     "AND"
     "OR"
     "NOT"




reply via email to

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