auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] Silence compilation warnings


From: Stefan Monnier
Subject: [AUCTeX-devel] Silence compilation warnings
Date: Wed, 03 Dec 2014 10:19:13 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Here's another patch which silences various compilation warnings, and
fixes a few commenting conventions (noticeable when using
outline-minor-mode).


        Stefan


diff --git a/bib-cite.el b/bib-cite.el
index 9ecbc81..164385a 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 <address@hidden>
-;;;             Patched by Bruce Ravel <address@hidden>
+;; Balloon-help callback. Anders Stenman <address@hidden>
+;;             Patched by Bruce Ravel <address@hidden>
 (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 <address@hidden> patch
+;;;  Michael Steiner <address@hidden> 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 <address@hidden> The
+;; Following contributed by Michael Steiner <address@hidden> 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 address@hidden (Diego Calvanese)
+;;;  Patched by address@hidden (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..36d4fef 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 <address@hidden>
 ;; Maintainer: address@hidden
@@ -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 9506d15..ccddfb0 100644
--- a/style/dinbrief.el
+++ b/style/dinbrief.el
@@ -216,7 +216,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)
+         (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 c8ac8bc..ab5b022 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 <address@hidden>
 ;; Maintainer: address@hidden
@@ -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 35892b7..16e12f5 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, 2012 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1997, 2005, 2012, 2014 Free Software Foundation, Inc.
 
 ;; Author: Berwin Turlach <address@hidden>
 ;; Maintainer: address@hidden
@@ -107,7 +107,7 @@
       (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 <address@hidden>
 ;; Maintainer: address@hidden
@@ -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 8974cec..5e0c6d8 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 637065a..3d44a65 100644
--- a/style/psfig.el
+++ b/style/psfig.el
@@ -25,7 +25,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: "))
@@ -42,7 +42,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 <address@hidden>
 ;; 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 <address@hidden>
 ;; 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 <address@hidden>
 ;; Maintainer: address@hidden
@@ -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 7dfba89..a1b878e 100644
--- a/tex.el
+++ b/tex.el
@@ -4613,14 +4613,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."



reply via email to

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