branch: externals/auctex commit 49ee91aae14c271eb959d0696c1cb8b7405ed9d5 Author: Stefan Monnier <monn...@iro.umontreal.ca> Commit: Tassilo Horn <t...@gnu.org>
Fix byte-compile warnings. * tex.el (TeX-mode-specific-command-menu): Remove Emacs 20 compatibility code. * style/shortvrb.el ("shortvrb"): Use mapcar instead of dolist/add-to-list. * style/pstricks.el (LaTeX-pst-point-in-parens) (LaTeX-pst-macro-psarc, LaTeX-pst-macro-pscircle) (LaTeX-pst-macro-rput, LaTeX-pst-macro-uput) (LaTeX-pst-macro-multirputps, LaTeX-pst-macro-psline) (LaTeX-pst-macro-psdots, LaTeX-pst-macro-parabola) (LaTeX-pst-macro-pnt-twolen, LaTeX-pst-macro-psbezier) (LaTeX-pst-macro-pspolygon, LaTeX-pst-macro-psframe) (LaTeX-pst-macro-psgrid, LaTeX-pst-macro-newpsobject): Rename unused arg to silence the byte-compiler. (LaTeX-pst-parameters-add): Remove unused var beg. * style/pst-plot.el (LaTeX-pst-macro-psaxes): Rename unused arg to silence the byte-compiler and fix indentation. ("pst-plot"): Use mapc instead of mapcar for side-effects only. * style/pst-node.el (LaTeX-pstnode-macro-nput) (LaTeX-pstnode-macro-cnodeput, LaTeX-pstnode-macro-nc) (LaTeX-pstnode-macro-pc, LaTeX-pstnode-macro-tnabcput): Rename unused arg to silence the byte-compiler. * style/psfig.el (TeX-arg-psfig, LaTeX-env-psfigure): Rename unused arg to silence the byte-compiler. * style/prosper.el: Fix comment style. (LaTeX-prosper-insert-title, LaTeX-prosper-arg-pdftransition) (LaTeX-prosper-insert-options, LaTeX-prosper-insert-slide): Rename unused arg to silence the byte-compiler. * style/pdfsync.el (LaTeX-pdfsync-output-page): Remove unused sync-line variable. * style/natbib.el (natbib-note-args): Rename unused arg to silence the byte-compiler. * style/inputenc.el (LaTeX-arg-inputenc-inputenc): Rename unused arg to silence the byte-compiler. * style/harvard.el (LaTeX-env-harvardbib): Rename unused arg to silence the byte-compiler. * style/graphicx.el (LaTeX-arg-includegraphics): Rename unused arg to silence the byte-compiler. * style/fancyref.el (TeX-arg-fancyref-format): Rename unused arg to silence the byte-compiler. * style/epsf.el (TeX-arg-epsfsize): Rename unused arg to silence the byte-compiler. * style/emp.el (LaTeX-env-empfile): Rename unused arg to silence the byte-compiler. * style/dinbrief.el (LaTeX-dinbrief-sender): Add a FIXME. * style/bigstrut.el (TeX-arg-bigstrut): Rename unused arg to silence the byte-compiler. * style/beamer.el (LaTeX-beamer-after-insert-env, TeX-arg-beamer-overlay-spec) (TeX-arg-beamer-frametitle, TeX-arg-beamer-note) (LaTeX-arg-beamer-theme, LaTeX-arg-beamer-inner-theme) (LaTeX-arg-beamer-outer-theme, LaTeX-arg-beamer-color-theme) (LaTeX-arg-beamer-font-theme): Rename unused arg to silence the byte-compiler. * style/babel.el (require): Require cl at compile-time. (LaTeX-babel-active-languages): Use pushnew/nreverse instead of add-to-list. * bib-cite.el (bib-cite--kind): New function. (bib-display, bib-find): Use it. (featurep): Use with-current-buffer instead of set-buffer. (bib-cite--fontify-help): New function. (bib-cite-fontify-help-as-bibtex, bib-cite-fontify-help-as-latex): Use it. (bib-highlight-mouse, bib-label-help): Make comment conform to the commenting conventions. (bib-label-prompt-map): Derive from minibuffer-local-completion-map instead of copying that. (bib-display-this-environment): Fix comment. (bib-document-TeX-files): Don't doubly-declare the-file. Signed-off-by: Tassilo Horn <t...@gnu.org> --- ChangeLog | 90 ++++++++++++++++++++++++ bib-cite.el | 198 +++++++++++++++++++++++++---------------------------- style/babel.el | 10 ++- style/beamer.el | 18 +++--- style/bigstrut.el | 9 ++- style/dinbrief.el | 4 +- style/emp.el | 2 +- style/epsf.el | 2 +- style/fancyref.el | 4 +- style/graphicx.el | 2 +- style/harvard.el | 164 ++++++++++++++++++++++---------------------- style/inputenc.el | 2 +- style/natbib.el | 2 +- style/pdfsync.el | 4 +- style/prosper.el | 20 +++--- style/psfig.el | 4 +- style/pst-node.el | 15 ++-- style/pst-plot.el | 24 +++--- style/pstricks.el | 32 ++++---- style/shortvrb.el | 9 +-- tex.el | 12 +-- 21 files changed, 352 insertions(+), 275 deletions(-) diff --git a/ChangeLog b/ChangeLog index af4b4f9..dd76553 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,93 @@ +2014-12-08 Stefan Monnier <monn...@iro.umontreal.ca> + + * tex.el (TeX-mode-specific-command-menu): Remove Emacs 20 + compatibility code. + + * style/shortvrb.el ("shortvrb"): Use mapcar instead of + dolist/add-to-list. + + * style/pstricks.el (LaTeX-pst-point-in-parens) + (LaTeX-pst-macro-psarc, LaTeX-pst-macro-pscircle) + (LaTeX-pst-macro-rput, LaTeX-pst-macro-uput) + (LaTeX-pst-macro-multirputps, LaTeX-pst-macro-psline) + (LaTeX-pst-macro-psdots, LaTeX-pst-macro-parabola) + (LaTeX-pst-macro-pnt-twolen, LaTeX-pst-macro-psbezier) + (LaTeX-pst-macro-pspolygon, LaTeX-pst-macro-psframe) + (LaTeX-pst-macro-psgrid, LaTeX-pst-macro-newpsobject): Rename + unused arg to silence the byte-compiler. + (LaTeX-pst-parameters-add): Remove unused var beg. + + * style/pst-plot.el (LaTeX-pst-macro-psaxes): Rename unused arg to + silence the byte-compiler and fix indentation. + ("pst-plot"): Use mapc instead of mapcar for side-effects only. + + * style/pst-node.el (LaTeX-pstnode-macro-nput) + (LaTeX-pstnode-macro-cnodeput, LaTeX-pstnode-macro-nc) + (LaTeX-pstnode-macro-pc, LaTeX-pstnode-macro-tnabcput): Rename + unused arg to silence the byte-compiler. + + * style/psfig.el (TeX-arg-psfig, LaTeX-env-psfigure): Rename + unused arg to silence the byte-compiler. + + * style/prosper.el: Fix comment style. + (LaTeX-prosper-insert-title, LaTeX-prosper-arg-pdftransition) + (LaTeX-prosper-insert-options, LaTeX-prosper-insert-slide): Rename + unused arg to silence the byte-compiler. + + * style/pdfsync.el (LaTeX-pdfsync-output-page): Remove unused + sync-line variable. + + * style/natbib.el (natbib-note-args): Rename unused arg to silence + the byte-compiler. + + * style/inputenc.el (LaTeX-arg-inputenc-inputenc): Rename unused + arg to silence the byte-compiler. + + * style/harvard.el (LaTeX-env-harvardbib): Rename unused arg to + silence the byte-compiler. + + * style/graphicx.el (LaTeX-arg-includegraphics): Rename unused arg + to silence the byte-compiler. + + * style/fancyref.el (TeX-arg-fancyref-format): Rename unused arg + to silence the byte-compiler. + + * style/epsf.el (TeX-arg-epsfsize): Rename unused arg to silence + the byte-compiler. + + * style/emp.el (LaTeX-env-empfile): Rename unused arg to silence + the byte-compiler. + + * style/dinbrief.el (LaTeX-dinbrief-sender): Add a FIXME. + + * style/bigstrut.el (TeX-arg-bigstrut): Rename unused arg to + silence the byte-compiler. + + * style/beamer.el + (LaTeX-beamer-after-insert-env, TeX-arg-beamer-overlay-spec) + (TeX-arg-beamer-frametitle, TeX-arg-beamer-note) + (LaTeX-arg-beamer-theme, LaTeX-arg-beamer-inner-theme) + (LaTeX-arg-beamer-outer-theme, LaTeX-arg-beamer-color-theme) + (LaTeX-arg-beamer-font-theme): Rename unused arg to silence the + byte-compiler. + + * style/babel.el (require): Require cl at compile-time. + (LaTeX-babel-active-languages): Use pushnew/nreverse instead of + add-to-list. + + * bib-cite.el (bib-cite--kind): New function. + (bib-display, bib-find): Use it. + (featurep): Use with-current-buffer instead of set-buffer. + (bib-cite--fontify-help): New function. + (bib-cite-fontify-help-as-bibtex, bib-cite-fontify-help-as-latex): + Use it. + (bib-highlight-mouse, bib-label-help): Make comment conform to the + commenting conventions. + (bib-label-prompt-map): Derive from + minibuffer-local-completion-map instead of copying that. + (bib-display-this-environment): Fix comment. + (bib-document-TeX-files): Don't doubly-declare the-file. + 2014-12-08 Mos� Giordano <m...@gnu.org> * style/mathtools.el ("mathtools"): Fix closing bracket diff --git a/bib-cite.el b/bib-cite.el index da074d2..1707b19 100644 --- a/bib-cite.el +++ b/bib-cite.el @@ -1002,6 +1002,16 @@ runs bib-find, and [mouse-3] runs bib-display." "^[, \t]*[a-zA-Z]+[ \t]*=[ \t]*\\([a-zA-Z][^#%'(),={}\" \t\n]*\\)" "Regular expression for field containing a @string.") +(defun bib-cite--kind () + (save-excursion + (if (not (looking-at "\\\\")) + (search-backward "\\" nil t)) + (if (looking-at bib-ref-regexpc) + 'ref + (if (looking-at "\\\\label{") + 'label + 'cite)))) + (defun bib-display () "Display BibTeX citation or matching \\ref or \\label command under point. @@ -1023,23 +1033,15 @@ string, a second prompt for a ref will be given. A TAGS file is created and used for multi-file documents under auctex." (interactive) - (let ((cite)(ref)(label)) - (save-excursion - (if (not (looking-at "\\\\")) - (search-backward "\\" nil t)) - (if (looking-at bib-ref-regexpc) - (setq ref t) - (if (looking-at "\\\\label{") - (setq label t) - (setq cite t)))) + (let ((kind (bib-cite--kind))) (cond ;; reftex doesn't handle label->ref ((and bib-cite-use-reftex-view-crossref - (or ref cite)) + (memq kind '(ref cite))) ;;;FIXME: reftex doesn't want point on \ref or \cite part, but on keyword (require 'reftex) (reftex-view-crossref nil)) - (cite + ((eq kind 'cite) (bib-display-citation)) (t (bib-display-label))))) @@ -1064,22 +1066,14 @@ string, a second prompt for a ref will be given. A TAGS file is created and used for multi-file documents under auctex." (interactive) - (let ((cite)(ref)(label)) - (save-excursion - (if (not (looking-at "\\\\")) - (search-backward "\\" nil t)) - (if (looking-at bib-ref-regexpc) - (setq ref t) - (if (looking-at "\\\\label{") - (setq label t) - (setq cite t)))) + (let ((kind (bib-cite--kind))) (cond ;; reftex doesn't handle label->ref ((and bib-cite-use-reftex-view-crossref - (or ref cite)) + (memq kind '(ref cite))) (require 'reftex) (reftex-view-crossref t)) - (cite + ((eq kind 'cite) (bib-edit-citation)) (t (bib-find-label))))) @@ -1236,8 +1230,7 @@ to create a bibtex file containing only the references used in the document." (when (featurep 'xemacs) (defun bib-cite-fontify-help-xemacs (defaults) (if (fboundp 'font-lock-set-defaults-1) ; >= XEmacs 19.14 - (progn - (set-buffer "*Help*") + (with-current-buffer "*Help*" (setq font-lock-defaults-computed nil font-lock-keywords nil) (font-lock-set-defaults-1 @@ -1247,41 +1240,44 @@ to create a bibtex file containing only the references used in the document." font-lock-keywords nil) (font-lock-set-defaults-1))))) +(defun bib-cite--fontify-help () + ;; FIXME: This looks ugly and incorrect. + (if font-lock-mode + (font-lock-mode -1) + (if (fboundp 'font-lock-unset-defaults) (font-lock-unset-defaults)) + (font-lock-unfontify-buffer)) + (if (fboundp 'font-lock-ensure) + (font-lock-ensure) + (with-no-warnings (font-lock-fontify-buffer)))) + (defun bib-cite-fontify-help-as-bibtex () - (save-excursion - (cond - ((not (featurep 'font-lock)) - nil) ;No font-lock! Stop here. - ;; font-lock under Emacs and XEmacs - ((featurep 'xemacs) - ;; XEmacs - (bib-cite-fontify-help-xemacs 'bibtex-mode)) - (t - ;; Emacs - (set-buffer "*Help*") + (cond + ((not (featurep 'font-lock)) + nil) ;No font-lock! Stop here. + ;; font-lock under Emacs and XEmacs + ((featurep 'xemacs) + ;; XEmacs + (bib-cite-fontify-help-xemacs 'bibtex-mode)) + (t + ;; Emacs + (with-current-buffer "*Help*" (let ((font-lock-defaults - '(bib-cite-bibtex-font-lock-keywords - nil t ((?$ . "\"")(?\" . "."))))) - (if (not font-lock-mode) - (font-lock-mode 1) - (if (fboundp 'font-lock-unset-defaults) - (font-lock-unset-defaults)) - (font-lock-unfontify-buffer)) - (font-lock-fontify-buffer)))))) + '(bib-cite-bibtex-font-lock-keywords + nil t ((?$ . "\"")(?\" . "."))))) + (bib-cite--fontify-help)))))) (defun bib-cite-fontify-help-as-latex () - (save-excursion - (cond - ((not (featurep 'font-lock)) - nil) ;No font-lock! Stop here. - ;; font-lock under Emacs and XEmacs - ((featurep 'xemacs) - ;; XEmacs, not necessary to do s.th. special for font-latex, we do *not* - ;; want the buffer-local faces! - (bib-cite-fontify-help-xemacs 'latex-mode)) - (t - ;; Emacs - (set-buffer "*Help*") + (cond + ((not (featurep 'font-lock)) + nil) ;No font-lock! Stop here. + ;; font-lock under Emacs and XEmacs + ((featurep 'xemacs) + ;; XEmacs, not necessary to do s.th. special for font-latex, we do *not* + ;; want the buffer-local faces! + (bib-cite-fontify-help-xemacs 'latex-mode)) + (t + ;; Emacs + (with-current-buffer "*Help*" ;; Actually, don't want to `permanently' affect *Help* buffer... ;;(if (featurep 'font-latex) ;; (font-latex-setup) @@ -1297,12 +1293,7 @@ to create a bibtex file containing only the references used in the document." (font-lock-comment-start-regexp . "%") (font-lock-mark-block-function . mark-paragraph)) '(tex-font-lock-keywords nil nil ((?$ . "\"")))))) - (if (not font-lock-mode) - (font-lock-mode 1) - (if (fboundp 'font-lock-unset-defaults) - (font-lock-unset-defaults)) - (font-lock-unfontify-buffer)) - (font-lock-fontify-buffer)))))) + (bib-cite--fontify-help)))))) (defvar bib-document-TeX-files-warnings nil "Bib-cite internal variable.") @@ -1374,15 +1365,15 @@ See variables bib-etags-command and bib-etags-filename" (defun bib-highlight-mouse () "Make that nice green highlight when the mouse is over LaTeX commands." (interactive) -;;;Comment this out. User should be able to use bib-highlight-mouse -;;;to try it out regardless of bib-highlight-mouse-t. -;;;Check bib-highlight-mouse-t only in automated cases. -;;; -;;; (if (and bib-highlight-mouse-t -;;; ;;window-system) ;Do nothing unless under X -;;; ) -;;; *all of code was here* -;;; ) + ;;Comment this out. User should be able to use bib-highlight-mouse + ;;to try it out regardless of bib-highlight-mouse-t. + ;;Check bib-highlight-mouse-t only in automated cases. + ;; + ;; (if (and bib-highlight-mouse-t + ;; ;;window-system) ;Do nothing unless under X + ;; ) + ;; *all of code was here* + ;; ) (save-excursion (let ((s)(e)(extent)(local-extent-list bib-ext-list) (inhibit-read-only t) @@ -1427,11 +1418,11 @@ See variables bib-etags-command and bib-etags-filename" (let ((before-change-functions) (after-change-functions) ;;(this-overlay (make-overlay s e)) ) -;;; Even using overlays doens't help here. If bib-highlight-mouse-keymap -;;; does not include the AucTeX menus, then these disappear when we click -;;; onto a \cite command. Perhaps using bib-cite as a minor mode will fix -;;; this? For now, bib-cite must be loaded after these menus are built. -;;; It must therefore be loaded in a mode-hook. +;;; Even using overlays doesn't help here. If bib-highlight-mouse-keymap +;;; does not include the AucTeX menus, then these disappear when we click +;;; onto a \cite command. Perhaps using bib-cite as a minor mode will fix +;;; this? For now, bib-cite must be loaded after these menus are built. +;;; It must therefore be loaded in a mode-hook. (put-text-property s e 'local-map bib-highlight-mouse-keymap) (put-text-property s e 'mouse-face 'highlight) ;;(overlay-put this-overlay 'local-map bib-highlight-mouse-keymap) @@ -1462,8 +1453,8 @@ See variables bib-etags-command and bib-etags-filename" (if bib-label-help-echo-format (bib-label-help object bib-label-help-echo-format))) -;;; Balloon-help callback. Anders Stenman <sten...@isy.liu.se> -;;; Patched by Bruce Ravel <bruce.ra...@nist.gov> +;; Balloon-help callback. Anders Stenman <sten...@isy.liu.se> +;; Patched by Bruce Ravel <bruce.ra...@nist.gov> (defun bib-label-help (object &optional format) (or format (setq format "Use mouse button 2 to find the %s. Use mouse button 3 to display the %s.")) @@ -1655,11 +1646,11 @@ If within a multi-file document (in auctex only) (beginning-of-line) (show-entry))))) -(defvar bib-label-prompt-map nil) -(if bib-label-prompt-map - () - (setq bib-label-prompt-map (copy-keymap minibuffer-local-completion-map)) - (define-key bib-label-prompt-map " " 'self-insert-command)) +(defvar bib-label-prompt-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map minibuffer-local-completion-map) + (define-key map " " 'self-insert-command) + map)) (defun bib-guess-or-prompt-for-label () "Guess from context, or prompt the user for a label command." @@ -1788,7 +1779,7 @@ Does not save excursion." (goto-char the-point) (if (re-search-backward ;;; "\\(^\\|\^M\\)[ \t]*\\\\\\(sub\\)*section{\\([^}]*\\)}" nil t) -;;; Michael Steiner <stei...@cs.uni-sb.de> patch +;;; Michael Steiner <stei...@cs.uni-sb.de> patch "\\(^\\|\^M\\)[ \t]*\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*?\ {\\([^}]*\\)}" nil t) @@ -1808,10 +1799,10 @@ into '((\"label3\") (\"label4\") (\"label1\") (\"label2\") (\"label\"))" (mapcar 'list (bib-cite-mh-list-to-string the-list))) -;;; -;;; Following two functions from mh-utils.el (part of GNU emacs) -;;; I have changed the names in case these functions change what they do. -;;; +;; +;; Following two functions from mh-utils.el (part of GNU emacs) +;; I have changed the names in case these functions change what they do. +;; (defun bib-cite-mh-list-to-string (l) "Flattens the list L and make every element of the new list into a string." @@ -2004,7 +1995,7 @@ Return the-warnings as text." ;; Return the warnings... the-warnings)) -;;; Following contributed by Michael Steiner <stei...@cs.uni-sb.de> The +;; Following contributed by Michael Steiner <stei...@cs.uni-sb.de> The ;; @string abbreviation are not case-sensitive, so we replaced the `member' ;; test above with `member-cis' defined here: (defun member-cis (ELT LIST) @@ -2175,8 +2166,7 @@ Sets global variable bib-document-TeX-files-warnings." (let* ((masterfile (bib-master-file)) (dir (and masterfile (file-name-directory masterfile))) (tex-buffer (get-buffer-create "*tex-document*")) - (the-list (list masterfile)) - (the-file)) + (the-list (list masterfile))) (if (not masterfile) (progn (kill-buffer tex-buffer) @@ -2259,7 +2249,7 @@ Sets global variable bib-document-citekeys-obarray-warnings." (insert-file-contents auxfile)))) (goto-char 1) -;;; Patched by calva...@dis.uniroma1.it (Diego Calvanese) +;;; Patched by calva...@dis.uniroma1.it (Diego Calvanese) ;;; ;; look for \citation{gertsenshtein59} ;;; (while (re-search-forward "^\\\\citation{\\(.*\\)}$" nil t) ;;; (intern (buffer-substring (match-beginning 1)(match-end 1)) @@ -2528,19 +2518,19 @@ If FIRST-FILE is t, stop after first file is found." match)) -;;; (defun psg-checkfor-file-list (filename list) -;;; (let ((the-list list) -;;; (filespec)) -;;; (while the-list -;;; (if (not (car the-list)) ; it is nil -;;; (setq filespec (concat "~/" filename)) -;;; (setq filespec -;;; (concat (file-name-as-directory (car the-list)) filename))) -;;; (if (file-exists-p filespec) -;;; (setq the-list nil) -;;; (setq filespec nil) -;;; (setq the-list (cdr the-list)))) -;;; filespec)) +;; (defun psg-checkfor-file-list (filename list) +;; (let ((the-list list) +;; (filespec)) +;; (while the-list +;; (if (not (car the-list)) ; it is nil +;; (setq filespec (concat "~/" filename)) +;; (setq filespec +;; (concat (file-name-as-directory (car the-list)) filename))) +;; (if (file-exists-p filespec) +;; (setq the-list nil) +;; (setq filespec nil) +;; (setq the-list (cdr the-list)))) +;; filespec)) (or (fboundp 'dired-replace-in-string) ;; This code is part of GNU emacs diff --git a/style/babel.el b/style/babel.el index 88b10b2..e35177b 100644 --- a/style/babel.el +++ b/style/babel.el @@ -30,6 +30,8 @@ ;;; Code: +(eval-when-compile (require 'cl)) + (defvar LaTeX-babel-language-list '("afrikaans" "bahasa" "indonesian" "indon" "bahasai" "bahasam" "malay" "meyalu" @@ -107,12 +109,12 @@ ;; Append element to `active-languages' to respect loading order. ;; `babel' package uses as default language the last loaded one, ;; except if it is set with the `main' option. - (add-to-list 'active-languages elt t)))) + (pushnew elt active-languages :test #'equal)))) (if main-language - (add-to-list 'active-languages main-language t)) - active-languages)) + (pushnew main-language active-languages :test #'equal))) + (nreverse active-languages)) -(defun TeX-arg-babel-lang (optional &optional prompt) +(defun TeX-arg-babel-lang (_optional &optional _prompt) "Prompt for a language with completion and insert it as an argument." (TeX-argument-insert (completing-read "Language: " (LaTeX-babel-active-languages)) nil)) diff --git a/style/beamer.el b/style/beamer.el index 9b18c07..16c1f4b 100644 --- a/style/beamer.el +++ b/style/beamer.el @@ -29,7 +29,7 @@ ;;; Code: -(defun LaTeX-beamer-after-insert-env (env start end) +(defun LaTeX-beamer-after-insert-env (env start _end) "Do beamer-specific stuff after the insertion of an environment." ;; Add `fragile' as an optional argument to the frame environment if ;; a verbatim environment is inserted. @@ -190,14 +190,14 @@ (font-lock-set-defaults))) LaTeX-dialect) -(defun TeX-arg-beamer-overlay-spec (optional &optional prompt) +(defun TeX-arg-beamer-overlay-spec (_optional &optional _prompt) "Prompt for overlay specification." (let ((overlay (TeX-read-string "(Optional) Overlay: "))) (unless (zerop (length overlay)) (insert "<" overlay ">")) (indent-according-to-mode))) -(defun TeX-arg-beamer-frametitle (optional &optional prompt) +(defun TeX-arg-beamer-frametitle (_optional &optional _prompt) "Prompt for the frametitle." (let ((title (TeX-read-string "Title: " nil 'LaTeX-beamer-frametitle-history))) (if (not (zerop (length title))) @@ -221,7 +221,7 @@ unconditionally." (insert " ") (indent-according-to-mode)) -(defun TeX-arg-beamer-note (optional &optional prompt) +(defun TeX-arg-beamer-note (_optional &optional _prompt) "Prompt for overlay specification and optional argument." (let ((overlay (TeX-read-string "(Optional) Overlay: ")) (options (TeX-read-string "(Optional) Options: "))) @@ -257,7 +257,7 @@ also be a string. Then the length of the string is used." (substring file chars)))) (TeX-search-files nil exts t t)))))) -(defun LaTeX-arg-beamer-theme (&rest ignore) +(defun LaTeX-arg-beamer-theme (&rest _ignore) "Prompt for beamer theme with completion." (TeX-argument-insert (completing-read @@ -276,7 +276,7 @@ also be a string. Then the length of the string is used." nil nil nil) t)) -(defun LaTeX-arg-beamer-inner-theme (&rest ignore) +(defun LaTeX-arg-beamer-inner-theme (&rest _ignore) "Prompt for beamer inner theme with completion." (TeX-argument-insert (completing-read @@ -295,7 +295,7 @@ also be a string. Then the length of the string is used." nil nil nil) t)) -(defun LaTeX-arg-beamer-outer-theme (&rest ignore) +(defun LaTeX-arg-beamer-outer-theme (&rest _ignore) "Prompt for beamer outer theme with completion." (TeX-argument-insert (completing-read @@ -314,7 +314,7 @@ also be a string. Then the length of the string is used." nil nil nil) t)) -(defun LaTeX-arg-beamer-color-theme (&rest ignore) +(defun LaTeX-arg-beamer-color-theme (&rest _ignore) "Prompt for beamer color theme with completion." (TeX-argument-insert (completing-read @@ -333,7 +333,7 @@ also be a string. Then the length of the string is used." nil nil nil) t)) -(defun LaTeX-arg-beamer-font-theme (&rest ignore) +(defun LaTeX-arg-beamer-font-theme (&rest _ignore) "Prompt for beamer font theme with completion." (TeX-argument-insert (completing-read diff --git a/style/bigstrut.el b/style/bigstrut.el index 14269db..3ece300 100644 --- a/style/bigstrut.el +++ b/style/bigstrut.el @@ -1,6 +1,6 @@ ;;; bigstrut.el --- AUCTeX style for `bigstrut.sty' -;; Copyright (C) 2012 Free Software Foundation, Inc. +;; Copyright (C) 2012, 2014 Free Software Foundation, Inc. ;; Author: Mads Jensen <m...@inducks.org> ;; Maintainer: auctex-de...@gnu.org @@ -37,12 +37,13 @@ '("bigstrut" [ TeX-arg-bigstrut ]))) LaTeX-dialect) -(defun TeX-arg-bigstrut (optional &optional prompt) - "Prompt for the optional argument in \\bigstrut" +(defun TeX-arg-bigstrut (optional &optional _prompt) + "Prompt for the optional argument in \\bigstrut." (TeX-argument-insert (completing-read (TeX-argument-prompt optional "Strut to top (t) or bottom (b)" nil t) - (mapcar 'list '("t" "b")) nil t) optional)) + (mapcar 'list '("t" "b")) nil t) + optional)) (defvar LaTeX-bigstrut-package-options nil "Package options for the bigstrut package.") diff --git a/style/dinbrief.el b/style/dinbrief.el index ad88905..8ab4a84 100644 --- a/style/dinbrief.el +++ b/style/dinbrief.el @@ -213,8 +213,8 @@ (progn (goto-char (point-min)) ; insert before \end{document} (if (re-search-forward ".end.document." (point-max) t) - (beginning-of-line 1)) - (previous-line 1) + (beginning-of-line 1)) + (previous-line 1) ;FIXME: Use forward-line! (LaTeX-dinbrief-insert TeX-esc "address" TeX-grop name) (if (not (zerop (length str))) (progn diff --git a/style/emp.el b/style/emp.el index 0401667..e42b23c 100644 --- a/style/emp.el +++ b/style/emp.el @@ -64,7 +64,7 @@ Used for emp, empdef, and empgraph environments." (indent-according-to-mode) )) -(defun LaTeX-env-empfile (optional) +(defun LaTeX-env-empfile (_optional) "Ask for file. Insert empfile environment" (let ((empfile (TeX-read-string "empfile: " ""))) (if (not (zerop (length empfile))) diff --git a/style/epsf.el b/style/epsf.el index 69be611..92b3da2 100644 --- a/style/epsf.el +++ b/style/epsf.el @@ -19,7 +19,7 @@ "epsfllx" "epsflly" "epsfury" "epsfverbosetrue")) LaTeX-dialect) -(defun TeX-arg-epsfsize (optional &optional prompt definition) +(defun TeX-arg-epsfsize (_optional &optional _prompt _definition) "Create a line that print epsf figures at a certain percentage" (interactive) (let ((scale (TeX-read-string "Scale in percent (default 75): "))) diff --git a/style/fancyref.el b/style/fancyref.el index 9d870e7..94b7e15 100644 --- a/style/fancyref.el +++ b/style/fancyref.el @@ -1,6 +1,6 @@ ;;; fancyref.el --- AUCTeX style file with support for fancyref.sty -;; Copyright (C) 1999 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2014 Free Software Foundation, Inc. ;; Author: Carsten Dominik <domi...@strw.leidenuniv.nl> ;; Maintainer: auctex-de...@gnu.org @@ -106,7 +106,7 @@ (defun LaTeX-fancyref-formats () LaTeX-fancyref-formats) -(defun TeX-arg-fancyref-format (optional &optional prompt definition) +(defun TeX-arg-fancyref-format (optional &optional prompt _definition) "Prompt for a fancyref format name. If the user gives an unknown name, add it to the list." (let ((format (completing-read (TeX-argument-prompt optional prompt "Format") diff --git a/style/graphicx.el b/style/graphicx.el index 7f66e52..a894dad 100644 --- a/style/graphicx.el +++ b/style/graphicx.el @@ -91,7 +91,7 @@ doesn't works with Emacs 21.3 or XEmacs. See (string-match (LaTeX-includegraphics-extensions) fname)))) (TeX-master-directory))) -(defun LaTeX-arg-includegraphics (prefix) +(defun LaTeX-arg-includegraphics (_prefix) "Ask for mandantory and optional arguments for the \\includegraphics command. The extent of the optional arguments is determined by the prefix argument and diff --git a/style/harvard.el b/style/harvard.el index d0a37cb..08addb4 100644 --- a/style/harvard.el +++ b/style/harvard.el @@ -1,6 +1,6 @@ ;;; harvard.el --- Support for Harvard Citation style package for AUCTeX. -;; Copyright (C) 1994, 1997, 2005 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1997, 2005, 2012, 2014 Free Software Foundation, Inc. ;; Author: Berwin Turlach <sta...@nus.edu.sg> ;; Maintainer: auctex-de...@gnu.org @@ -25,89 +25,89 @@ ;;; Code: -(TeX-add-style-hook "harvard" - (function - (lambda () - - (LaTeX-add-environments - '("thebibliography" LaTeX-env-harvardbib ignore)) - - (TeX-add-symbols - "harvardand" - '("citeasnoun" - (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil) - TeX-arg-cite) - '("possessivecite" - (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil) - TeX-arg-cite) - '("citeaffixed" - (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil) - TeX-arg-cite "Affix") - '("citeyear" - (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil) - TeX-arg-cite) - '("citename" - (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil) - TeX-arg-cite) - '("citationstyle" - (TeX-arg-eval completing-read "Citation style: " '(("agsm") ("dcu")))) - '("citationmode" - (TeX-arg-eval completing-read "Citation mode: " - '(("full") ("abbr") ("default")))) - '("harvardparenthesis" - (TeX-arg-eval completing-read "Harvardparenthesis: " - '(("round") ("curly") ("angle") ("square")))) - '("bibliographystyle" - (TeX-arg-eval - completing-read "Bibliography style: " - '(("agsm") ("apsr") ("dcu") ("jmr") ("jphysicsB") ("kluwer") ("nederlands") ("econometrica"))) - ignore) - '("harvarditem" [ "Short citation" ] - "Complete citation" "Year" TeX-arg-define-cite)) - - (setq TeX-complete-list - (append '(("\\\\citeasnoun\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)" - 1 LaTeX-bibitem-list "}") - ("\\\\citeasnoun{\\([^{}\n\r\\%,]*\\)" 1 - LaTeX-bibitem-list "}") - ("\\\\possessivecite\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)" - 1 LaTeX-bibitem-list "}") - ("\\\\possessivecite{\\([^{}\n\r\\%,]*\\)" 1 - LaTeX-bibitem-list "}") - ("\\\\citename\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)" - 1 LaTeX-bibitem-list "}") - ("\\\\citename{\\([^{}\n\r\\%,]*\\)" 1 - LaTeX-bibitem-list "}") - ("\\\\citeaffixed\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)" - 1 LaTeX-bibitem-list "}") - ("\\\\citeaffixed{\\([^{}\n\r\\%,]*\\)" 1 - LaTeX-bibitem-list "}") - ("\\\\citeaffixed{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)" - 2 LaTeX-bibitem-list) - ("\\\\citeyear\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)" - 1 LaTeX-bibitem-list "}") - ("\\\\citeyear{\\([^{}\n\r\\%,]*\\)" 1 - LaTeX-bibitem-list "}") - ("\\\\citeyear{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)" - 2 LaTeX-bibitem-list)) - TeX-complete-list)) - - (setq LaTeX-auto-regexp-list - (append '(("\\\\harvarditem{\\([a-zA-Z][^%#'()={}]*\\)}{\\([0-9][^, %\"#'()={}]*\\)}{\\([a-zA-Z][^, %\"#'()={}]*\\)}" 3 LaTeX-auto-bibitem) - ("\\\\harvarditem\\[[^][\n\r]+\\]{\\([a-zA-Z][^%#'()={}]*\\)}{\\([0-9][^, %\"#'()={}]*\\)}{\\([a-zA-Z][^, %\"#'()={}]*\\)}" 3 LaTeX-auto-bibitem) - ) - LaTeX-auto-regexp-list)) - - (setq LaTeX-item-list - (cons '("thebibliography" . LaTeX-item-harvardbib) - LaTeX-item-list)) - - ;; Tell RefTeX - (when (fboundp 'reftex-set-cite-format) - (reftex-set-cite-format 'harvard)))) +(TeX-add-style-hook + "harvard" + #'(lambda () + + (LaTeX-add-environments + '("thebibliography" LaTeX-env-harvardbib ignore)) + + (TeX-add-symbols + "harvardand" + '("citeasnoun" + (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil) + TeX-arg-cite) + '("possessivecite" + (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil) + TeX-arg-cite) + '("citeaffixed" + (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil) + TeX-arg-cite "Affix") + '("citeyear" + (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil) + TeX-arg-cite) + '("citename" + (TeX-arg-conditional TeX-arg-cite-note-p ([ "Note" ]) nil) + TeX-arg-cite) + '("citationstyle" + (TeX-arg-eval completing-read "Citation style: " '(("agsm") ("dcu")))) + '("citationmode" + (TeX-arg-eval completing-read "Citation mode: " + '(("full") ("abbr") ("default")))) + '("harvardparenthesis" + (TeX-arg-eval completing-read "Harvardparenthesis: " + '(("round") ("curly") ("angle") ("square")))) + '("bibliographystyle" + (TeX-arg-eval + completing-read "Bibliography style: " + '(("agsm") ("apsr") ("dcu") ("jmr") ("jphysicsB") ("kluwer") ("nederlands") ("econometrica"))) + ignore) + '("harvarditem" [ "Short citation" ] + "Complete citation" "Year" TeX-arg-define-cite)) + + (setq TeX-complete-list + (append '(("\\\\citeasnoun\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)" + 1 LaTeX-bibitem-list "}") + ("\\\\citeasnoun{\\([^{}\n\r\\%,]*\\)" 1 + LaTeX-bibitem-list "}") + ("\\\\possessivecite\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)" + 1 LaTeX-bibitem-list "}") + ("\\\\possessivecite{\\([^{}\n\r\\%,]*\\)" 1 + LaTeX-bibitem-list "}") + ("\\\\citename\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)" + 1 LaTeX-bibitem-list "}") + ("\\\\citename{\\([^{}\n\r\\%,]*\\)" 1 + LaTeX-bibitem-list "}") + ("\\\\citeaffixed\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)" + 1 LaTeX-bibitem-list "}") + ("\\\\citeaffixed{\\([^{}\n\r\\%,]*\\)" 1 + LaTeX-bibitem-list "}") + ("\\\\citeaffixed{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)" + 2 LaTeX-bibitem-list) + ("\\\\citeyear\\[[^]\n\r\\%]*\\]{\\([^{}\n\r\\%,]*\\)" + 1 LaTeX-bibitem-list "}") + ("\\\\citeyear{\\([^{}\n\r\\%,]*\\)" 1 + LaTeX-bibitem-list "}") + ("\\\\citeyear{\\([^{}\n\r\\%]*,\\)\\([^{}\n\r\\%,]*\\)" + 2 LaTeX-bibitem-list)) + TeX-complete-list)) + + (setq LaTeX-auto-regexp-list + (append '(("\\\\harvarditem{\\([a-zA-Z][^%#'()={}]*\\)}{\\([0-9][^, %\"#'()={}]*\\)}{\\([a-zA-Z][^, %\"#'()={}]*\\)}" 3 LaTeX-auto-bibitem) + ("\\\\harvarditem\\[[^][\n\r]+\\]{\\([a-zA-Z][^%#'()={}]*\\)}{\\([0-9][^, %\"#'()={}]*\\)}{\\([a-zA-Z][^, %\"#'()={}]*\\)}" 3 LaTeX-auto-bibitem) + ) + LaTeX-auto-regexp-list)) + + (setq LaTeX-item-list + (cons '("thebibliography" . LaTeX-item-harvardbib) + LaTeX-item-list)) + + ;; Tell RefTeX + (when (fboundp 'reftex-set-cite-format) + (reftex-set-cite-format 'harvard))) LaTeX-dialect) -(defun LaTeX-env-harvardbib (environment &optional ignore) +(defun LaTeX-env-harvardbib (environment &optional _ignore) "Insert ENVIRONMENT with label for harvarditem." (LaTeX-insert-environment environment (concat TeX-grop "xx" TeX-grcl)) diff --git a/style/inputenc.el b/style/inputenc.el index e496cc6..53ba4f9 100644 --- a/style/inputenc.el +++ b/style/inputenc.el @@ -68,7 +68,7 @@ selected))) (TeX-read-string "Input encoding: "))) -(defun LaTeX-arg-inputenc-inputenc (optional) +(defun LaTeX-arg-inputenc-inputenc (_optional) "Prompt for input encoding." (TeX-argument-insert (LaTeX-inputenc-package-options) nil)) diff --git a/style/natbib.el b/style/natbib.el index 13cf229..a224c5b 100644 --- a/style/natbib.el +++ b/style/natbib.el @@ -108,7 +108,7 @@ (reftex-set-cite-format 'natbib)))) LaTeX-dialect) -(defun natbib-note-args (optional &optional prompt definition) +(defun natbib-note-args (optional &optional _prompt _definition) "Prompt for two note arguments a natbib citation command." (if TeX-arg-cite-note-p (let* ((pre (TeX-read-string diff --git a/style/pdfsync.el b/style/pdfsync.el index 39345f4..d2076fd 100644 --- a/style/pdfsync.el +++ b/style/pdfsync.el @@ -1,6 +1,6 @@ ;;; pdfsync.el --- AUCTeX style for `pdfsync.sty' -;; Copyright (C) 2005, 2008 Free Software Foundation, Inc. +;; Copyright (C) 2005, 2008, 2014 Free Software Foundation, Inc. ;; Author: Ralf Angeli <ang...@iwi.uni-sb.de> ;; Maintainer: auctex-de...@gnu.org @@ -40,7 +40,6 @@ (pdfsync-file (concat master ".pdfsync")) (buf-live-p (get-file-buffer pdfsync-file)) (sync-record "0") - (sync-line "-1") (sync-page "1") last-match) (when (file-exists-p pdfsync-file) @@ -65,7 +64,6 @@ (throw 'break nil)) (t (setq sync-record (match-string 1) - sync-line (match-string 2) last-match (match-beginning 0)))))) ;; Look for the page number. (goto-char (or last-match (point-min))) diff --git a/style/prosper.el b/style/prosper.el index 92b3bb6..4a4da17 100644 --- a/style/prosper.el +++ b/style/prosper.el @@ -52,12 +52,12 @@ ;; Constants: -;;;; This is partly working now, and it a little neater than it -;;;; was. The main problem is that the redefinition of "documentclass" -;;;; does not happen until its all too late, so that stuff never -;;;; happens correctly. This is easy enough to fix by fiddling with -;;;; auctex. I shall have to download the latest version, and see if -;;;; its already been fixed. +;; This is partly working now, and it a little neater than it +;; was. The main problem is that the redefinition of "documentclass" +;; does not happen until its all too late, so that stuff never +;; happens correctly. This is easy enough to fix by fiddling with +;; auctex. I shall have to download the latest version, and see if +;; its already been fixed. @@ -80,7 +80,7 @@ "alcatel" "gyom" "pascal" "rico" )) -(defun LaTeX-prosper-insert-title (optional) +(defun LaTeX-prosper-insert-title (_optional) (newline) (mapc (lambda(f) (TeX-insert-macro f) @@ -92,7 +92,7 @@ ;; Utility functions -(defun LaTeX-prosper-arg-pdftransition (environment) +(defun LaTeX-prosper-arg-pdftransition (_environment) (let ((default (if (boundp 'LaTeX-prosper-transition-history) (car LaTeX-prosper-transition-history) @@ -117,7 +117,7 @@ nil nil nil nil "default" )) -(defun LaTeX-prosper-insert-options(environment) +(defun LaTeX-prosper-insert-options(_environment) (insert "[" ) (insert (LaTeX-prosper-slide-style-prompt) " ") (mapc (lambda(f) @@ -131,7 +131,7 @@ (delete-char -1) (insert "]")) -(defun LaTeX-prosper-insert-slide (environment) +(defun LaTeX-prosper-insert-slide (_environment) (if (y-or-n-p "Surround with overlay ?") (progn (TeX-insert-macro "overlays") (if (search-backward "{" 0 t) diff --git a/style/psfig.el b/style/psfig.el index 10c902b..f829ef8 100644 --- a/style/psfig.el +++ b/style/psfig.el @@ -26,7 +26,7 @@ )) LaTeX-dialect) -(defun TeX-arg-psfig (optional) +(defun TeX-arg-psfig (_optional) "Ask for file, width and length. Insert psfig macro" (let ((psfile (read-file-name "PS-file: " "" "" nil)) (figwidth (TeX-read-string "Figure width: ")) @@ -43,7 +43,7 @@ ) -(defun LaTeX-env-psfigure (environment) +(defun LaTeX-env-psfigure (_environment) "Create with \\label and \\caption and \\psfig commands." (let ((float (TeX-read-string "Float to: " LaTeX-float)) (caption (TeX-read-string "Caption: ")) diff --git a/style/pst-node.el b/style/pst-node.el index 5da0553..cc6b151 100644 --- a/style/pst-node.el +++ b/style/pst-node.el @@ -1,6 +1,6 @@ ;;; pst-node.el --- AUCTeX style for `pst-node.sty' -;; Copyright (C) 2007, 2013 Free Software Foundation, Inc. +;; Copyright (C) 2007, 2013, 2014 Free Software Foundation, Inc. ;; Author: Holger Sparr <holger.sp...@gmx.net> ;; Created: 21 Jun 2007 @@ -87,34 +87,35 @@ (LaTeX-package-parameters optional "pstnode" preparam param)) ;;; Macros -(defun LaTeX-pstnode-macro-nput (optional &optional arg) +(defun LaTeX-pstnode-macro-nput (_optional &optional _arg) "Return \\nput arguments after querying." (insert "[rot=" (LaTeX-pst-angle) "]{" (LaTeX-pst-angle) "}{" (LaTeX-pst-node) "}")) -(defun LaTeX-pstnode-macro-cnodeput (optional &optional arg) +(defun LaTeX-pstnode-macro-cnodeput (_optional &optional _arg) "Return \\cnodeput arguments after querying." (let ((rotation (if current-prefix-arg (LaTeX-pst-angle) nil)) (pnt (if current-prefix-arg (LaTeX-pst-point) nil))) (insert (if rotation (format "{%s}" rotation) "") (if pnt (format "(%s)" pnt) "") "{" (LaTeX-pst-node) "}"))) -(defun LaTeX-pstnode-macro-nc (optional &optional arg) +(defun LaTeX-pstnode-macro-nc (_optional &optional _arg) "Return \\nc* arguments after querying." (let ((arrows (LaTeX-pst-arrows))) (insert (if arrows (format "{%s}" arrows) "") "{" (LaTeX-pst-node) "}{" (LaTeX-pst-node) "}"))) -(defun LaTeX-pstnode-macro-pc (optional &optional arg) +(defun LaTeX-pstnode-macro-pc (_optional &optional _arg) "Return \\pc* arguments after querying." (let ((arrows (LaTeX-pst-arrows))) (insert (if arrows (format "{%s}" arrows) "") "(" (LaTeX-pst-point) ")(" (LaTeX-pst-point) ")"))) -(defun LaTeX-pstnode-macro-tnabcput (optional &optional arg) +(defun LaTeX-pstnode-macro-tnabcput (optional &optional _arg) "Return \\t?put or \\n?put arguments after querying." (TeX-argument-insert (LaTeX-pstnode-parameters-pref-and-chosen - '("nrot" "npos")) optional)) + '("nrot" "npos")) + optional)) ;;; Environments (defun LaTeX-pstnode-env-psmatrix (env) diff --git a/style/pst-plot.el b/style/pst-plot.el index 74a2946..5cb3404 100644 --- a/style/pst-plot.el +++ b/style/pst-plot.el @@ -1,6 +1,6 @@ ;;; pst-plot.el --- AUCTeX style for `pst-plot.sty' -;; Copyright (C) 2007 Free Software Foundation, Inc. +;; Copyright (C) 2007, 2014 Free Software Foundation, Inc. ;; Author: Holger Sparr <holger.sp...@gmx.net> ;; Created: 21 Jun 2007 @@ -85,17 +85,17 @@ "A list of values for axesstyles in pst-plot.") ;;; Macros -(defun LaTeX-pst-macro-psaxes (optional &optional arg) +(defun LaTeX-pst-macro-psaxes (_optional &optional _arg) "Return \\psaxes arguments after querying." -(let* ((cpref (if current-prefix-arg (car current-prefix-arg) 0)) - (arrows (LaTeX-pst-arrows)) - (pnt1 (if (> cpref 4) (LaTeX-pst-point) nil)) - (pnt2 (if (> cpref 0) (LaTeX-pst-point) nil)) - (pnt3 (LaTeX-pst-point))) - ;; insert \psaxes arguments - (insert (if arrows (format "{%s}" arrows) "") - (if pnt1 (format "(%s)" pnt1) "") - (if pnt2 (format "(%s)" pnt2) "") "(" pnt3 ")"))) + (let* ((cpref (if current-prefix-arg (car current-prefix-arg) 0)) + (arrows (LaTeX-pst-arrows)) + (pnt1 (if (> cpref 4) (LaTeX-pst-point) nil)) + (pnt2 (if (> cpref 0) (LaTeX-pst-point) nil)) + (pnt3 (LaTeX-pst-point))) + ;; Insert \psaxes arguments. + (insert (if arrows (format "{%s}" arrows) "") + (if pnt1 (format "(%s)" pnt1) "") + (if pnt2 (format "(%s)" pnt2) "") "(" pnt3 ")"))) ;;; Derived defuns (defun LaTeX-pstplot-datasets-read () @@ -106,7 +106,7 @@ "pst-plot" (function (lambda () - (mapcar 'TeX-auto-add-regexp LaTeX-auto-pstplot-regexp-list) + (mapc #'TeX-auto-add-regexp LaTeX-auto-pstplot-regexp-list) (TeX-add-symbols '("readdata" "Macro Name" TeX-arg-file) '("savedata" "Macro Name" ["Values"]) diff --git a/style/pstricks.el b/style/pstricks.el index d5adbda..f6b3d92 100644 --- a/style/pstricks.el +++ b/style/pstricks.el @@ -226,7 +226,7 @@ package PNAME" (concat "Point (default " (car LaTeX-pst-point-history) ")") (car LaTeX-pst-point-history))) -(defun LaTeX-pst-point-in-parens (optional) +(defun LaTeX-pst-point-in-parens (_optional) "Enclose point in parentheses." (LaTeX-pst-enclose-obj 'LaTeX-pst-point ?( ?))) @@ -517,7 +517,7 @@ package PNAME" (TeX-arg-key-val optional LaTeX-pst-basic-parameters-list)) ;;; Macros -(defun LaTeX-pst-macro-psarc (optional &optional arg) +(defun LaTeX-pst-macro-psarc (_optional &optional _arg) "Return \\psarc arguments after querying." (let ((arrows (LaTeX-pst-arrows)) (pnt (if current-prefix-arg nil (LaTeX-pst-point)))) @@ -526,11 +526,11 @@ package PNAME" "{" (LaTeX-pst-extdir "Radius") "}{" (LaTeX-pst-angle) "}{" (LaTeX-pst-angle) "}"))) -(defun LaTeX-pst-macro-pscircle (optional &optional arg) +(defun LaTeX-pst-macro-pscircle (_optional &optional _arg) "Return \\pscircle arguments after querying." (insert "(" (LaTeX-pst-point) "){" (LaTeX-pst-extdir "Radius") "}")) -(defun LaTeX-pst-macro-rput (optional &optional arg) +(defun LaTeX-pst-macro-rput (_optional &optional _arg) "Return \\rput arguments after querying." (let ((refpoint (LaTeX-pst-refpoint)) (rotation (if current-prefix-arg (LaTeX-pst-angle) nil))) @@ -539,7 +539,7 @@ package PNAME" (concat "{" rotation "}") "") "(" (LaTeX-pst-point) ")"))) -(defun LaTeX-pst-macro-uput (optional &optional arg) +(defun LaTeX-pst-macro-uput (_optional &optional _arg) "Return \\uput arguments after querying." (let ((dist (LaTeX-pst-extdir "Distance")) (refpoint (LaTeX-pst-refpoint))) @@ -549,7 +549,7 @@ package PNAME" "[]") "{" (LaTeX-pst-angle) "}(" (LaTeX-pst-point) ")"))) -(defun LaTeX-pst-macro-multirputps (optional &optional arg) +(defun LaTeX-pst-macro-multirputps (_optional &optional _arg) "Return \\multirput or \\multips arguments after querying." (let ((refpoint (LaTeX-pst-refpoint)) (rotation (if current-prefix-arg (LaTeX-pst-angle) nil)) @@ -560,7 +560,7 @@ package PNAME" (if rotation (format "{%s}" rotation) "") "(" pnt ")(" dpnt "){" repi "}"))) -(defun LaTeX-pst-macro-psline (optional &optional arg) +(defun LaTeX-pst-macro-psline (_optional &optional _arg) "Return \\psline or \\ps[ce]?curve[*] arguments after querying." (let ((arrows (LaTeX-pst-arrows)) (pnt1 (LaTeX-pst-point)) @@ -571,7 +571,7 @@ package PNAME" (setq pnt1 pnt2) (setq pnt2 (LaTeX-pst-point))))) -(defun LaTeX-pst-macro-psdots (optional single) +(defun LaTeX-pst-macro-psdots (_optional single) "Return \\psdot[s]? arguments after querying." (let* ((pnt1 (LaTeX-pst-point)) (pnt2 (if single pnt1 (LaTeX-pst-point)))) @@ -581,13 +581,13 @@ package PNAME" (insert "(" pnt1 ")") (setq pnt2 (LaTeX-pst-point))))) -(defun LaTeX-pst-macro-parabola (optional &optional arg) +(defun LaTeX-pst-macro-parabola (_optional &optional _arg) "Return \\parabola arguments after querying." (let ((arrows (LaTeX-pst-arrows))) (insert (if arrows (format "{%s}" arrows) "") "(" (LaTeX-pst-point) ")(" (LaTeX-pst-point) ")"))) -(defun LaTeX-pst-macro-pnt-twolen (optional prompt1 prompt2) +(defun LaTeX-pst-macro-pnt-twolen (_optional prompt1 prompt2) "Return point and 2 paired lengths in separate parens as arguments." ;; insert \psellipse[*]?, \psdiamond or \pstriangle arguments (let ((pnt (if current-prefix-arg nil (LaTeX-pst-point)))) @@ -595,7 +595,7 @@ package PNAME" "(" (LaTeX-pst-extdir prompt1) "," (LaTeX-pst-extdir prompt2) ")"))) -(defun LaTeX-pst-macro-psbezier (optional &optional arg) +(defun LaTeX-pst-macro-psbezier (_optional &optional _arg) "Return \\psbezier arguments after querying." (let ((arrows (LaTeX-pst-arrows)) (pnt1 (LaTeX-pst-point)) @@ -608,7 +608,7 @@ package PNAME" (setq pnt2 pnt3) (setq pnt3 (LaTeX-pst-point))))) -(defun LaTeX-pst-macro-pspolygon (optional &optional arg) +(defun LaTeX-pst-macro-pspolygon (_optional &optional _arg) "Return \\pspolygon arguments after querying." (let ((pnt1 (LaTeX-pst-point)) (pnt2 (LaTeX-pst-point)) @@ -619,13 +619,13 @@ package PNAME" (setq pnt2 pnt3) (setq pnt3 (LaTeX-pst-point))))) -(defun LaTeX-pst-macro-psframe (optional &optional arg) +(defun LaTeX-pst-macro-psframe (_optional &optional _arg) "Return \\psframe arguments after querying." (let ((pnt1 (if current-prefix-arg nil (LaTeX-pst-point))) (pnt2 (LaTeX-pst-point))) (insert (if pnt1 (format "(%s)" pnt1) "") "(" pnt2 ")"))) -(defun LaTeX-pst-macro-psgrid (optional &optional arg) +(defun LaTeX-pst-macro-psgrid (_optional &optional _arg) "Return \\psgrid arguments after querying." (let* ((cpref (if current-prefix-arg (car current-prefix-arg) 0)) (pnt1 (if (> cpref 4) (LaTeX-pst-point) nil)) @@ -634,7 +634,7 @@ package PNAME" (insert (if pnt1 (format "(%s)" pnt1) "") (if pnt2 (format "(%s)(%s)" pnt2 pnt3) "")))) -(defun LaTeX-pst-macro-newpsobject (&optional arg) +(defun LaTeX-pst-macro-newpsobject (&optional _arg) "Return \\newpsobject arguments after querying." (insert "{" (TeX-read-string "New PSObject Name: ") "}" ;; FIXME: It would be better to use something more confined @@ -712,7 +712,7 @@ parameter\(s\) to the already existing ones at the end of the comma separated list. Point has to be within the sexp to modify." (interactive "P") (let ((newpara (LaTeX-pst-parameters-pref-and-chosen nil t)) - (regexp "\\(") beg end check) + (regexp "\\(") end check) (if arg (progn (re-search-backward "\\\\\\([a-zA-Z]\\)") diff --git a/style/shortvrb.el b/style/shortvrb.el index 0bc3ffb..49143f3 100644 --- a/style/shortvrb.el +++ b/style/shortvrb.el @@ -1,6 +1,6 @@ ;;; shortvrb.el --- AUCTeX style for `shortvrb.sty' -;; Copyright (C) 2009 Free Software Foundation, Inc. +;; Copyright (C) 2009, 2014 Free Software Foundation, Inc. ;; Author: Ralf Angeli <ang...@caeruleus.net> ;; Maintainer: auctex-de...@gnu.org @@ -71,10 +71,9 @@ your document actually defines shortvrb chars using (when (and LaTeX-shortvrb-chars (fboundp 'font-latex-set-syntactic-keywords) (eq TeX-install-font-lock 'font-latex-setup)) - (let (syntax-alist) - (dolist (char LaTeX-shortvrb-chars) - (add-to-list 'syntax-alist (cons char "|"))) - (font-latex-add-to-syntax-alist syntax-alist)))) + (font-latex-add-to-syntax-alist + (mapcar (lambda (char) (cons char "|")) + LaTeX-shortvrb-chars)))) LaTeX-dialect) ;; Don't look for file-local variables before this line, so that the example in diff --git a/tex.el b/tex.el index a81b7d0..df312a0 100644 --- a/tex.el +++ b/tex.el @@ -4617,14 +4617,10 @@ Brace insertion is only done if point is in a math construct and (defun TeX-mode-specific-command-menu (mode) "Return a Command menu specific to the major MODE." ;; COMPATIBILITY for Emacs < 21 - (if (and (not (featurep 'xemacs)) - (= emacs-major-version 20)) - (cons TeX-command-menu-name - (TeX-mode-specific-command-menu-entries mode)) - (list TeX-command-menu-name - :filter `(lambda (&rest ignored) - (TeX-mode-specific-command-menu-entries ',mode)) - "Bug."))) + (list TeX-command-menu-name + :filter `(lambda (&rest ignored) + (TeX-mode-specific-command-menu-entries ',mode)) + "Bug.")) (defun TeX-mode-specific-command-menu-entries (mode) "Return the entries for a Command menu specific to the major MODE."