>From e313d690b13d83a3b9e0d2290758af6e3f061a3c Mon Sep 17 00:00:00 2001 From: Arash Esbati
Date: Sat, 23 Jan 2016 17:05:12 +0100 Subject: [PATCH 1/4] Improve font related queries * style/amsthm.el (LaTeX-amsthm-fontdecl): Do not prefix the elements with `TeX-esc'. (LaTeX-arg-amsthm-fontdecl): New function. ("amsthm"): Use `LaTeX-arg-amsthm-fontdecl' for font related queries. --- style/amsthm.el | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/style/amsthm.el b/style/amsthm.el index a01cfe3..5c83724 100644 --- a/style/amsthm.el +++ b/style/amsthm.el @@ -40,21 +40,34 @@ defined with \"\\newtheoremstyle\".") (defvar LaTeX-amsthm-fontdecl - (mapcar (lambda (elt) (concat TeX-esc elt)) - '(;; family - "rmfamily" "sffamily" "ttfamily" - ;; series - "mdseries" "bfseries" - ;; shape - "upshape" "itshape" "slshape" "scshape" - ;; size - "tiny" "scriptsize" "footnotesize" - "small" "normalsize" "large" - "Large" "LARGE" "huge" "Huge" - ;; reset macro - "normalfont")) + '(;; family + "rmfamily" "sffamily" "ttfamily" + ;; series + "mdseries" "bfseries" + ;; shape + "upshape" "itshape" "slshape" "scshape" + ;; size + "tiny" "scriptsize" "footnotesize" + "small" "normalsize" "large" + "Large" "LARGE" "huge" "Huge" + ;; reset macro + "normalfont") "List of font declaration commands for \"\\newtheoremstyle\".") +(defun LaTeX-arg-amsthm-fontdecl (optional &optional prompt) + "Prompt for font declaration commands in \"\\newtheoremstyle\". +If OPTIONAL is non-nil, insert the resulting value as an optional +argument. Use PROMPT as the prompt string." + ;; `INITIAL-INPUT' (5th argument to `TeX-completing-read-multiple') + ;; is hard-coded to `TeX-esc'. + (let* ((crm-separator (regexp-quote TeX-esc)) + (fontdecl (mapconcat 'identity + (TeX-completing-read-multiple + (TeX-argument-prompt optional prompt "Font") + LaTeX-amsthm-fontdecl nil nil TeX-esc) + TeX-esc))) + (TeX-argument-insert fontdecl optional))) + (defun LaTeX-amsthm-env-label (environment) "Insert ENVIRONMENT, query for an optional argument and prompt for label. AUCTeX users should add ENVIRONMENT to @@ -161,16 +174,9 @@ make them available as new environments. Update (format "%s" nthmstyle)))) (TeX-arg-length "Space above") (TeX-arg-length "Space below") - (TeX-arg-eval mapconcat 'identity - (TeX-completing-read-multiple - "Body font: " - LaTeX-amsthm-fontdecl) "") + (LaTeX-arg-amsthm-fontdecl "Body font") "Indent amount" - (TeX-arg-eval mapconcat 'identity - (TeX-completing-read-multiple - "Theorem head font: " - LaTeX-amsthm-fontdecl) "") - + (LaTeX-arg-amsthm-fontdecl "Theorem head font") "Punctuation after head" (TeX-arg-length "Space after head") "Theorem head spec")) -- 2.7.0