branch: externals/auctex commit f84b1a5fdbb9cccebf3f6831973ea29d6725ef2c Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@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"