branch: externals/auctex commit 94af6a0b597445818be6aaf7e6187d2bb3a35272 Author: Arash Esbati <ar...@gnu.org> Commit: Arash Esbati <ar...@gnu.org>
; Silence the compiler * style/dinbrief.el (LaTeX-dinbrief-style): Adjust indentation. Consolidate the name of style hooks to run in one `TeX-run-style-hooks' call. (LaTeX-dinbrief-sender): Use `forward-line' instead of `previous-line'. * style/tikz.el: Move definition of variables to the beginning of the library. --- style/dinbrief.el | 28 +++++++++--------- style/tikz.el | 86 +++++++++++++++++++++++++++---------------------------- 2 files changed, 56 insertions(+), 58 deletions(-) diff --git a/style/dinbrief.el b/style/dinbrief.el index 8c08b66..4707654 100644 --- a/style/dinbrief.el +++ b/style/dinbrief.el @@ -1,6 +1,6 @@ ;;; dinbrief.el --- Special code for LaTeX-Style dinbrief. -;; Copyright (C) 1994, 2013, 2014, 2018 Free Software Foundation, Inc. +;; Copyright (C) 1994, 2013, 2014, 2018, 2020 Free Software Foundation, Inc. ;; Author: Werner Fink <wer...@suse.de> ;; Maintainer: auctex-de...@gnu.org @@ -78,19 +78,17 @@ (beginning-of-line 1)) (open-line 2) (indent-relative-maybe) - (LaTeX-dinbrief-insert TeX-esc "usepackage" - LaTeX-optop "latin1,utf8" LaTeX-optcl - TeX-grop "inputenc" TeX-grcl) - (newline-and-indent) - (LaTeX-dinbrief-insert TeX-esc "usepackage" - LaTeX-optop "T1" LaTeX-optcl - TeX-grop "fontenc" TeX-grcl) - (newline-and-indent) - (LaTeX-dinbrief-insert TeX-esc "usepackage" - TeX-grop "ngerman" TeX-grcl) - (TeX-run-style-hooks "inputenc") - (TeX-run-style-hooks "fontenc") - (TeX-run-style-hooks "ngerman"))) + (LaTeX-dinbrief-insert TeX-esc "usepackage" + LaTeX-optop "latin1,utf8" LaTeX-optcl + TeX-grop "inputenc" TeX-grcl) + (newline-and-indent) + (LaTeX-dinbrief-insert TeX-esc "usepackage" + LaTeX-optop "T1" LaTeX-optcl + TeX-grop "fontenc" TeX-grcl) + (newline-and-indent) + (LaTeX-dinbrief-insert TeX-esc "usepackage" + TeX-grop "ngerman" TeX-grcl) + (TeX-run-style-hooks "inputenc" "fontenc" "ngerman"))) (defun LaTeX-dinbrief-env-recipient (environment) "Insert ENVIRONMENT and prompt for recipient and address." @@ -216,7 +214,7 @@ (goto-char (point-min)) ; insert before \end{document} (if (re-search-forward ".end.document." (point-max) t) (beginning-of-line 1)) - (previous-line 1) ;FIXME: Use forward-line! + (forward-line -1) (LaTeX-dinbrief-insert TeX-esc "address" TeX-grop name) (if (not (zerop (length str))) (progn diff --git a/style/tikz.el b/style/tikz.el index 4a2fc03..ded4d25 100644 --- a/style/tikz.el +++ b/style/tikz.el @@ -1,6 +1,6 @@ ;;; tikz.el --- AUCTeX style for `tikz.sty' -;; Copyright (C) 2016 Free Software Foundation, Inc. +;; Copyright (C) 2016, 2020 Free Software Foundation, Inc. ;; Author: Matthew Leach <matt...@mattleach.net> ;; Maintainer: auctex-de...@gnu.org @@ -30,6 +30,48 @@ ;;; Code: +(defcustom TeX-TikZ-point-name-regexp + "(\\([A-Za-z0-9]+\\))" + "A regexp that matches TikZ names." + :type 'regexp + :group 'auctex-tikz) + +(defconst TeX-TikZ-point-function-map + '(("Rect Point" TeX-TikZ-arg-rect-point) + ("Polar Point" TeX-TikZ-arg-polar-point) + ("Named Point" TeX-TikZ-arg-named-point)) + "An alist of point specification types and their functions.") + +(defconst TeX-TikZ-relative-point-function-map + (apply #'append (mapcar + (lambda (point-map) + (let ((key (car point-map)) + (value (cadr point-map))) + `((,(concat "+" key) ,value "+") + (,(concat "++" key) ,value "++")))) + TeX-TikZ-point-function-map)) + "`TeX-TikZ-point-function-map' with \"+\" and \"++\" as a +prefix.") + +(defconst TeX-TikZ-path-connector-function-map + '(("--" identity) + ("|-" identity) + ( "-|" identity) + ("sin" identity) + ("cos" identity)) + "An alist of path connectors.") + +(defconst TeX-TikZ-draw-arg-function-map + `(,@TeX-TikZ-point-function-map + ,@TeX-TikZ-relative-point-function-map + ,@TeX-TikZ-path-connector-function-map + ("Node" TeX-TikZ-arg-node) + ("Circle" TeX-TikZ-arg-circle) + ("Arc" TeX-TikZ-arg-arc) + ("Parabola" TeX-TikZ-arg-parabola) + ("Grid" TeX-TikZ-arg-grid)) + "An alist of argument names and functoins for TikZ's \draw.") + (defun TeX-TikZ-get-opt-arg-string (arg &optional open close) "Return a string for optional arguments. If ARG is nil or \"\", return \"\". Otherwise return \"OPEN ARG @@ -150,12 +192,6 @@ is finished." ;; Finish the macro. (insert ";"))) -(defcustom TeX-TikZ-point-name-regexp - "(\\([A-Za-z0-9]+\\))" - "A regexp that matches TikZ names." - :type 'regexp - :group 'auctex-tikz) - (defun TeX-TikZ-find-named-points () "Find TiKZ named points in current enviroment. Begin by finding the span of the current TikZ enviroment and then @@ -213,42 +249,6 @@ If OPTIONAL is non-nil and the user doesn't provide a point, (let ((options (TeX-TikZ-arg-options t))) (concat "grid" options))) -(defconst TeX-TikZ-point-function-map - '(("Rect Point" TeX-TikZ-arg-rect-point) - ("Polar Point" TeX-TikZ-arg-polar-point) - ("Named Point" TeX-TikZ-arg-named-point)) - "An alist of point specification types and their functions.") - -(defconst TeX-TikZ-relative-point-function-map - (apply 'append (mapcar - (lambda (point-map) - (let ((key (car point-map)) - (value (cadr point-map))) - `((,(concat "+" key) ,value "+") - (,(concat "++" key) ,value "++")))) - TeX-TikZ-point-function-map)) - "`TeX-TikZ-point-function-map' with \"+\" and \"++\" as a -prefix.") - -(defconst TeX-TikZ-path-connector-function-map - '(("--" identity) - ("|-" identity) - ( "-|" identity) - ("sin" identity) - ("cos" identity)) - "An alist of path connectors.") - -(defconst TeX-TikZ-draw-arg-function-map - `(,@TeX-TikZ-point-function-map - ,@TeX-TikZ-relative-point-function-map - ,@TeX-TikZ-path-connector-function-map - ("Node" TeX-TikZ-arg-node) - ("Circle" TeX-TikZ-arg-circle) - ("Arc" TeX-TikZ-arg-arc) - ("Parabola" TeX-TikZ-arg-parabola) - ("Grid" TeX-TikZ-arg-grid)) - "An alist of argument names and functoins for TikZ's \draw.") - (defun TeX-TikZ-draw-arg (_ignored) "Prompt the user for the arguments to a TikZ draw macro." (TeX-TikZ-macro-arg TeX-TikZ-draw-arg-function-map))