emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] scratch/auctex-lexbind 25e7150 07/11: Miscellaneous minor changes


From: Stefan Monnier
Subject: [elpa] scratch/auctex-lexbind 25e7150 07/11: Miscellaneous minor changes
Date: Tue, 23 Mar 2021 11:34:01 -0400 (EDT)

branch: scratch/auctex-lexbind
commit 25e71506dc4ddf23e2d7ab44ba499a56ac9fba58
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    Miscellaneous minor changes
    
    Move to the next line arguments that are easy to misread.
    Fix some commenting style to obey `outline-minor-mode`.
    
    * auctex.el: Don't require `cl-lib` since it's bundled with Emacs-24.3.
    
    * README: Prefer HTTPS over HTTP/FTP for gnu.org sites.
    
    * bib-cite.el (bib-find-next): Simplify.
    
    * latex.el: Use a non-nil default value for `LaTeX-label-function`
    so RefTeX can override it with `add-function`.
    (LaTeX-label--default): New function, extracted from `LaTeX-label`.
    (LaTeX-label): Use it.
    (LaTeX-label-function): Use it as default value.
    
    * toolbar-x.el (toolbarx-emacs-mount-popup-menu): Make the control&data
    flow a bit simpler.
    (toolbarx-test-image-type, toolbarx-process-dropdown-group):
    Use `car-safe` and strength-reduce `eval` to `symbol-value`.
    
    * style/dinbrief.el: Remove redundant comment.
    
    * style/kpfonts.el (<toplevel>): Simplify.
    
    * style/latexinfo.el (LaTeXinfo-mode-map): Move initialization into
    the declaration.
    
    * style/url.el (TeX-arg-urlstyle):
    * style/prosper.el (LaTeX-prosper-slide-style-prompt):
    Completion tables can be lists of strings.
    
    * style/tikz.el (TeX-TikZ-single-macro-arg): Strength-reduce `eval` to
    `apply`.
    
    More misc changes
---
 README             | 18 +++++++++---------
 auctex.el          |  2 +-
 bib-cite.el        |  9 ++++-----
 latex.el           | 49 ++++++++++++++++++++++++++-----------------------
 preview.el         | 11 ++++++-----
 style/dinbrief.el  |  2 --
 style/fontenc.el   |  3 ++-
 style/kpfonts.el   |  8 ++++----
 style/latexinfo.el | 20 +++++++++-----------
 style/prosper.el   |  2 +-
 style/tikz.el      | 18 +++++++++---------
 style/ulem.el      |  3 ++-
 style/url.el       |  4 ++--
 tex-fold.el        |  1 -
 tex-font.el        |  6 +++---
 tex-info.el        |  3 ++-
 tex.el             |  4 +++-
 toolbar-x.el       | 53 ++++++++++++++++++++++++++---------------------------
 18 files changed, 109 insertions(+), 107 deletions(-)

diff --git a/README b/README
index fe474cf..1596aeb 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 This is the README file for the AUCTeX distribution.
 
-     Copyright (C) 2008, 2017 Free Software Foundation, Inc.
+     Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
      Copying and distribution of this file, with or without
      modification, are permitted in any medium without royalty provided
@@ -48,10 +48,10 @@ new features for your own needs.  It is a GNU project and 
distributed
 under the 'GNU General Public License Version 3'.
 
 The most recent version is always available at
-<http://ftp.gnu.org/pub/gnu/auctex/>.
+<https://ftp.gnu.org/pub/gnu/auctex/>.
 
 WWW users may want to check out the AUCTeX page at
-<http://www.gnu.org/software/auctex/>.
+<https://www.gnu.org/software/auctex/>.
 
 For comprehensive information about how to install AUCTeX read the file
 'INSTALL' or 'INSTALL.windows', respectively.
@@ -175,7 +175,7 @@ case, 'dvipng' will be used for converting DVI files and 
Ghostscript
 (with a 'PNG' device) for converting PDF files.  'dvipng' is much faster
 than the combination of Dvips and Ghostscript.  You can get downloads,
 access to its CVS archive and further information from its project site
-(http://savannah.nongnu.org/projects/dvipng).
+(https://savannah.nongnu.org/projects/dvipng).
 
 5 More documentation
 ********************
@@ -204,11 +204,11 @@ will display it.
 **************
 
 The preview-latex project is now part of AUCTeX and accessible as part
-of the AUCTeX project page (http://savannah.gnu.org/projects/auctex).
+of the AUCTeX project page (https://savannah.gnu.org/projects/auctex).
 You can get its files from the AUCTeX download area
-(ftp://ftp.gnu.org/pub/gnu/auctex).  As of AUCTeX 11.81, preview-latex
-should already be integrated into AUCTeX, so no separate download will
-be necessary.
+(https://ftp.gnu.org/pub/gnu/auctex/).  As of AUCTeX 11.81,
+preview-latex should already be integrated into AUCTeX, so no separate
+download will be necessary.
 
 You will also find '.rpm' files there for Fedora and possibly SuSE.
 Anonymous Git is available as well.
@@ -222,7 +222,7 @@ installation fails (but this should be a rare event), 
report bugs to
 <bug-auctex@gnu.org>.
 
 There is a general discussion list for AUCTeX which also covers
-preview-latex, look at <http://lists.gnu.org/mailman/listinfo/auctex>.
+preview-latex, look at <https://lists.gnu.org/mailman/listinfo/auctex>.
 For more information on the mailing list, send a message with just the
 word "help" as subject or body to <auctex-request@gnu.org>.  For the
 developers, there is the <auctex-devel@gnu.org> list; it would probably
diff --git a/auctex.el b/auctex.el
index ea9d858..2fb1867 100644
--- a/auctex.el
+++ b/auctex.el
@@ -6,7 +6,7 @@
 ;; URL: https://www.gnu.org/software/auctex/
 ;; Maintainer: auctex-devel@gnu.org
 ;; Notifications-To: auctex-diffs@gnu.org
-;; Package-Requires: ((emacs "24.3") (cl-lib "1.0"))
+;; Package-Requires: ((emacs "24.3"))
 ;; Keywords: TeX LaTeX Texinfo ConTeXt docTeX preview-latex
 
 ;; This file is part of GNU Emacs.
diff --git a/bib-cite.el b/bib-cite.el
index d8d5606..3ae2c79 100644
--- a/bib-cite.el
+++ b/bib-cite.el
@@ -737,7 +737,7 @@ A opening curly bracket is appended to the regexp.")
   "Toggle bib-cite mode.
 When bib-cite mode is enabled, citations, labels and refs are highlighted
 when the mouse is over them.  Clicking on these highlights with [mouse-2]
-runs bib-find, and [mouse-3] runs bib-display."
+runs `bib-find', and [mouse-3] runs `bib-display'."
   (interactive "P")
   (set (make-local-variable 'bib-cite-minor-mode)
        (if arg
@@ -956,9 +956,7 @@ find the next occurrence of a regexp."
   (if (bib-master-file)                 ;Multi-file document
       ;; FIXME: `find-tag' is replaced by `xref-find-definitions' in
       ;; Emacs 25.1.  AUCTeX should track this change, sometime ...
-      (if prev-p
-          (find-tag t '- t)
-        (find-tag t t t))
+      (find-tag t (if prev-p '- t) t)
     (if bib-cite-search-ring
         ;;FIXME: Should first make sure I move off initial \ref{}.
         (let ((regexp (concat bib-ref-regexpc bib-cite-search-ring "}")))
@@ -1284,7 +1282,8 @@ Use mouse button 3 to display the %s."))
     (let* ((string (extent-string object))
            (type (cond ((string-match "^\\\\[A-Za-z]*cite[A-Za-z]*" string) 
"citation")
                        ((string-match
-                         (concat "^" bib-ref-regexp) string) "\\label{}")
+                         (concat "^" bib-ref-regexp) string)
+                        "\\label{}")
                        ((string-match "^\\\\label" string) "\\ref{}")
                        (t "this (unknown) reference"))))
       (format format type type))))
diff --git a/latex.el b/latex.el
index 744695d..bf42d4e 100644
--- a/latex.el
+++ b/latex.el
@@ -986,10 +986,10 @@ optional argument is omitted.)"
   "Adding labels for LaTeX commands in AUCTeX."
   :group 'LaTeX)
 
-(defcustom LaTeX-label-function nil
+(defcustom LaTeX-label-function #'LaTeX-label--default
   "A function inserting a label at point or returning a label string.
-Sole mandatory argument of the function is the environment.  The
-function has to return the label inserted, or nil if no label was
+Called with two argument NAME and NO-INSERT where NAME is the environment.
+The function has to return the label inserted, or nil if no label was
 inserted.  If the optional argument NO-INSERT is non-nil, then
 the function has to return the label as string without any
 insertion or nil if no label was read in."
@@ -1133,21 +1133,23 @@ returned, nil if it is empty."
     (when (symbolp TeX-read-label-prefix)
       (setq TeX-read-label-prefix (symbol-value TeX-read-label-prefix)))
     (when TeX-read-label-prefix
-      (if (and (fboundp LaTeX-label-function))
-          (funcall LaTeX-label-function name no-insert)
-        ;; Use completing-read as we do with `C-c C-m \label RET'
-        (setq label (TeX-read-label t "What label" t))
-        ;; No label or empty string entered?
-        (if (or (string= TeX-read-label-prefix label)
-                (string= "" label))
-            (setq label nil)
-          ;; We have a label; when NO-INSERT is nil, insert
-          ;; \label{label} in the buffer, add new label to list of
-          ;; known labels and return it
-          (unless no-insert
-            (insert TeX-esc "label" TeX-grop label TeX-grcl))
-          (LaTeX-add-labels label)
-          label)))))
+      (funcall (or LaTeX-label-function #'LaTeX-label--default)
+               name no-insert))))
+
+(defun LaTeX-label--default (_name no-insert)
+  ;; Use completing-read as we do with `C-c C-m \label RET'
+  (let ((label (TeX-read-label t "What label" t)))
+    ;; No label or empty string entered?
+    (if (or (string= TeX-read-label-prefix label)
+            (string= "" label))
+        (setq label nil)
+      ;; We have a label; when NO-INSERT is nil, insert
+      ;; \label{label} in the buffer, add new label to list of
+      ;; known labels and return it
+      (unless no-insert
+        (insert TeX-esc "label" TeX-grop label TeX-grcl))
+      (LaTeX-add-labels label)
+      label)))
 
 (defcustom LaTeX-short-caption-prompt-length 40
   "The length that the caption of a figure should be before
@@ -4554,9 +4556,7 @@ value of NO-SUBSECTIONS."
         (re-search-backward (concat "\\(" (LaTeX-outline-regexp)
                                     "\\|\\`\\)")))
     (outline-mark-subtree)
-    (when (and (boundp 'transient-mark-mode)
-               transient-mark-mode
-               (boundp 'mark-active)
+    (when (and transient-mark-mode
                (not mark-active))
       (setq mark-active t)
       (run-hooks 'activate-mark-hook)))
@@ -6056,6 +6056,7 @@ This happens when \\left is inserted."
 
 ;;;###autoload
 (defun TeX-latex-mode ()
+  ;; FIXME: Use `define-derived-mode'.
   "Major mode in AUCTeX for editing LaTeX files.
 See info under AUCTeX for full documentation.
 
@@ -6081,7 +6082,8 @@ of `LaTeX-mode-hook'."
   (add-hook 'TeX-update-style-hook
             (lambda ()
               (if (local-variable-p 'LaTeX-biblatex-use-Biber (current-buffer))
-                  (setq LaTeX-using-Biber LaTeX-biblatex-use-Biber))) nil t)
+                  (setq LaTeX-using-Biber LaTeX-biblatex-use-Biber)))
+            nil t)
 
   ;; Run style hooks associated with class options.
   (add-hook 'TeX-update-style-hook
@@ -6791,7 +6793,8 @@ function would return non-nil and `(match-string 1)' 
would return
   ;;  get DVI output.  Ugh.
   (TeX-add-style-hook "ifpdf" (lambda ()
                                 (TeX-PDF-mode-on)
-                                (TeX-PDF-mode-off)) :classopt)
+                                (TeX-PDF-mode-off))
+                      :classopt)
   ;; ifpdf indicates that we cater for either.  So calling both
   ;; functions will make sure that the default will get used unless the
   ;; user overrode it.
diff --git a/preview.el b/preview.el
index 96fea04..5ef159b 100644
--- a/preview.el
+++ b/preview.el
@@ -1690,10 +1690,10 @@ to the default background in most other cases."
                         (const :tag "Foreground" :value :foreground))))
   :group 'preview-appearance)
 
-;;; Note that the following default introduces a border only when
-;;; Emacs blinks politely when point is on an image (the tested
-;;; unrelated function was introduced at about the time image blinking
-;;; became tolerable).
+;; Note that the following default introduces a border only when
+;; Emacs blinks politely when point is on an image (the tested
+;; unrelated function was introduced at about the time image blinking
+;; became tolerable).
 (defcustom preview-transparent-border (unless (fboundp 'posn-object-x-y) 1.5)
   "Width of transparent border for previews in pt.
 Setting this to a numeric value will add a border of
@@ -4185,7 +4185,8 @@ internal parameters, STR may be a log to insert into the 
current log."
                (preview-do-replacements
                 command
                 preview-undump-replacements)
-             command) file))))
+             command)
+           file))))
     (condition-case err
         (progn
           (when str
diff --git a/style/dinbrief.el b/style/dinbrief.el
index 035d4ec..e676ca4 100644
--- a/style/dinbrief.el
+++ b/style/dinbrief.el
@@ -23,8 +23,6 @@
 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 ;; 02110-1301, USA.
 
-;;; dinbrief.el - Special code for LaTeX class dinbrief.
-
 ;;; Commentary:
 
 ;; LaTeX Class: dinbrief.cls
diff --git a/style/fontenc.el b/style/fontenc.el
index 0fe194b..ba430db 100644
--- a/style/fontenc.el
+++ b/style/fontenc.el
@@ -49,6 +49,7 @@
   (mapconcat #'identity
              (TeX-completing-read-multiple
               "Encoding(s): "
-              LaTeX-fontenc-package-options-list) ","))
+              LaTeX-fontenc-package-options-list)
+             ","))
 
 ;;; fontenc.el ends here
diff --git a/style/kpfonts.el b/style/kpfonts.el
index a3672ea..09ba8a2 100644
--- a/style/kpfonts.el
+++ b/style/kpfonts.el
@@ -451,10 +451,10 @@ the sequence by initializing this variable.")
                  (nth 3 entry)))
            value menu name)
       (setq math (cdr math))
-      (if (and prefix
-               (setq prefix (decode-char 'ucs (nth 3 entry))))
-          (setq prefix (concat (string prefix) " \\"))
-        (setq prefix "\\"))
+      (setq prefix (if (and prefix
+                            (setq prefix (decode-char 'ucs (nth 3 entry))))
+                       (concat (string prefix) " \\")
+                     "\\"))
       (if (listp (cdr entry))
           (setq value (nth 1 entry)
                 menu (nth 2 entry))
diff --git a/style/latexinfo.el b/style/latexinfo.el
index 3796967..9eb68ad 100644
--- a/style/latexinfo.el
+++ b/style/latexinfo.el
@@ -35,19 +35,17 @@ We ignore next, previous and up fields.")
   "Non-nil means LaTeXinfo minor mode is active.")
   (make-variable-buffer-local 'LaTeXinfo-mode)
 
-(defvar LaTeXinfo-mode-map nil
+(defvar LaTeXinfo-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "\C-c\C-u\C-b" #'latexinfo-format-buffer)
+    (define-key map "\C-c\C-u\C-r" #'latexinfo-format-region)
+    (define-key map "\C-c\C-u\C-s" #'latexinfo-show-structure)
+    (define-key map "\C-c\C-ud" #'makke:latexinfo-delete-structure)
+    (define-key map "\C-c\C-ug" #'latexinfo-goto-node)
+    (define-key map "\C-c\C-ui" #'makke:latexinfo-structure)
+    map)
   "Keymap containing LaTeXinfo commands.")
 
-(if LaTeXinfo-mode-map
-    ()
-  (setq LaTeXinfo-mode-map (make-sparse-keymap))
-  (define-key LaTeXinfo-mode-map "\C-c\C-u\C-b" #'latexinfo-format-buffer)
-  (define-key LaTeXinfo-mode-map "\C-c\C-u\C-r" #'latexinfo-format-region)
-  (define-key LaTeXinfo-mode-map "\C-c\C-u\C-s" #'latexinfo-show-structure)
-  (define-key LaTeXinfo-mode-map "\C-c\C-ud" 
#'makke:latexinfo-delete-structure)
-  (define-key LaTeXinfo-mode-map "\C-c\C-ug" #'latexinfo-goto-node)
-  (define-key LaTeXinfo-mode-map "\C-c\C-ui" #'makke:latexinfo-structure))
-
 (or (assq 'LaTeXinfo-mode minor-mode-map-alist)
     (setq minor-mode-map-alist
           (cons (cons 'LaTeXinfo-mode LaTeXinfo-mode-map)
diff --git a/style/prosper.el b/style/prosper.el
index 98c1298..f1b7adc 100644
--- a/style/prosper.el
+++ b/style/prosper.el
@@ -114,7 +114,7 @@
 (defun LaTeX-prosper-slide-style-prompt()
   (completing-read
    "Slide Style?"
-   (mapcar 'list LaTeX-prosper-slide-styles)
+   LaTeX-prosper-slide-styles
    nil nil nil nil "default" ))
 
 
diff --git a/style/tikz.el b/style/tikz.el
index a9c7314..f3a50bc 100644
--- a/style/tikz.el
+++ b/style/tikz.el
@@ -1,6 +1,6 @@
 ;;; tikz.el --- AUCTeX style for `tikz.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2016, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2016-2021  Free Software Foundation, Inc.
 
 ;; Author: Matthew Leach <matthew@mattleach.net>
 ;; Maintainer: auctex-devel@gnu.org
@@ -161,14 +161,14 @@ optional input."
          (selected-mapping (assoc selected-argument-type
                                   fn-alist-with-optional-elm)))
 
-    (eval
-     ;; Build the form we wish to evaluate.  This will be the function
-     ;; to be called (the second element in the assoc element),
-     ;; followed by the type name (the first element), followed by any
-     ;; other elements in the list as extra arguments.
-     `(,(cadr selected-mapping)
-       ,(car selected-mapping)
-       ,@(cddr selected-mapping)))))
+    ;; Build the funcall we wish to evaluate.  This will be the function
+    ;; to be called (the second element in the assoc element),
+    ;; followed by the type name (the first element), followed by any
+    ;; other elements in the list as extra arguments.
+    (apply
+     (cadr selected-mapping)
+     (car selected-mapping)
+     (cddr selected-mapping))))
 
 
 (defun TeX-TikZ-macro-arg (function-alist)
diff --git a/style/ulem.el b/style/ulem.el
index 7db5716..70ea7a8 100644
--- a/style/ulem.el
+++ b/style/ulem.el
@@ -105,7 +105,8 @@
                             (mapcar (lambda (str) (concat "\\" str))
                                     '("uline" "uuline"
                                       "uwave" "sout" "xout")))
-                    nil t) optional))
+                    nil t)
+   optional))
 
 (defvar LaTeX-ulem-package-options
   '("UWforbf" "ULforem" "normalbf" "normalem")
diff --git a/style/url.el b/style/url.el
index 98f691b..eafbd90 100644
--- a/style/url.el
+++ b/style/url.el
@@ -1,6 +1,6 @@
 ;;; url.el --- AUCTeX style for `url.sty'  -*- lexical-binding: t; -*-
 
-;; Copyright (C) 2004-2005, 2018, 2020 Free Software Foundation, Inc.
+;; Copyright (C) 2004-2021  Free Software Foundation, Inc.
 
 ;; Author: Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -101,7 +101,7 @@
   "Prompt for style used in \\urlstyle with completion."
   (TeX-argument-insert
    (completing-read (TeX-argument-prompt optional prompt "Style")
-                    (mapcar 'list '("rm" "same" "sf" "tt"))
+                    '("rm" "same" "sf" "tt")
                     nil t)
    optional))
 
diff --git a/tex-fold.el b/tex-fold.el
index 9fa310d..d448890 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -855,7 +855,6 @@ Remove the respective properties from the overlay OV."
                                     'mouse-set-point)))
                 ;; Open new overlays.
                 (dolist (ol (nconc (when (and TeX-fold-unfold-around-mark
-                                              (boundp 'mark-active)
                                               mark-active)
                                      (overlays-at (mark)))
                                    (overlays-at (point))))
diff --git a/tex-font.el b/tex-font.el
index 99077d5..9fa53b3 100644
--- a/tex-font.el
+++ b/tex-font.el
@@ -1,7 +1,6 @@
 ;;; tex-font.el --- Font-Lock support stolen from Emacs 21.
 ;;
-;; Copyright (C) 1985, 86, 89, 92, 94, 95, 96, 97, 98, 1999
-;;       Free Software Foundation, Inc.
+;; Copyright (C) 1985-2021  Free Software Foundation, Inc.
 
 ;; Maintainer: auctex-devel@gnu.org
 ;; Keywords: tex, faces
@@ -89,7 +88,8 @@
             (let* (;;
                    ;; Names of commands whose arg should be fontified with 
fonts.
                    (bold (regexp-opt '("textbf" "textsc" "textup"
-                                       "boldsymbol" "pmb") t))
+                                       "boldsymbol" "pmb")
+                                     t))
                    (italic (regexp-opt '("textit" "textsl" "emph") t))
                    (type (regexp-opt '("texttt" "textmd" "textrm" "textsf") t))
                    ;;
diff --git a/tex-info.el b/tex-info.el
index 2055760..e50fccc 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -216,7 +216,8 @@ the section."
                     (beginning-of-line)
                     (when
                         (re-search-forward (concat section-re
-                                                   "\\|^\\s-*@bye\\_>" ) nil t)
+                                                   "\\|^\\s-*@bye\\_>" )
+                                           nil t)
                       (save-match-data
                         (beginning-of-line)
                         (point))))
diff --git a/tex.el b/tex.el
index 2ed3d91..a295a21 100644
--- a/tex.el
+++ b/tex.el
@@ -6445,6 +6445,7 @@ NAME may be a package, a command, or a document."
                                 (throw 'found t)))))
           ;; Setup completion list in a format suitable for `completing-read'.
           (dolist (elt docs)
+            ;; FIXME: Probably not needed!
             (setq completions (nconc (mapcar #'list (car elt)) completions)))
           ;; Query user.
           (setq name (completing-read
@@ -6500,7 +6501,8 @@ NAME may be a package, a command, or a document."
                         "\\).*\\("
                         (mapconcat #'regexp-quote
                                    (cons (file-name-nondirectory name)
-                                         (TeX-style-list)) "\\|")
+                                         (TeX-style-list))
+                                   "\\|")
                         "\\)\\.\\("
                         (mapconcat #'identity TeX-file-extensions "\\|")
                         "\\)\\'"))
diff --git a/toolbar-x.el b/toolbar-x.el
index 8b7af51..e17ee02 100644
--- a/toolbar-x.el
+++ b/toolbar-x.el
@@ -270,22 +270,24 @@ inside Emacs. See documentation of that function for 
more."
          (count 1)
          (used-symbols '(nil))
          (key)
-         (real-type (if (eq type 'toggle) 'toggle 'radio))
-         (real-save (when save (if (eq save 'offer) 'offer 'always))))
-    ;; warn if type is not `radio' ot `toggle'; use `radio' if incorrect.
-    (unless (eq type real-type)
-      (display-warning 'toolbarx
-                       (format (concat "TYPE should be symbols `radio' or "
-                                       "`toggle', but %s found; using `radio'")
-                               type)))
-    ;; warn if save is not `nil', `offer' or `always'; use nil when incorrect
-    (unless (eq save real-save)
-      (setq real-save nil)
-      (display-warning 'toolbarx
-                       (format (concat "SAVE should be symbols `nil', "
-                                       "`offer' or `always', but %s found; "
-                                       "using `nil'")
-                               save)))
+         (real-type
+          (pcase type
+            ((or `toggle `radio) type)
+            ;; Warn if type is not `radio' or `toggle'.
+            (_ (display-warning 'toolbarx
+                                (format "TYPE should be symbols `radio' or 
`toggle', but %s found; using `radio'"
+                                        type))
+               ;; Use `radio' if incorrect.
+               'radio)))
+         (real-save
+          (pcase save
+            ((or `nil `offer `always) save)
+            ;; Warn if save is not `nil', `offer' or ;; `always'.
+            (_ (display-warning 'toolbarx
+                                (format "SAVE should be symbols `nil', `offer' 
or `always', but %s found; using `nil'"
+                                        save))
+               ;; Use nil when incorrect.
+               nil))))
     (dolist (i strings)
       ;; finding a new symbol
       (let* ((aux-count 0)
@@ -400,13 +402,12 @@ documentation of function `toolbarx-process-symbol')."
                   (all-obj-ok t)
                   (good-obj
                    (or (stringp val)      ; string
-                       (and (consp val) ; or image descriptor
-                            (eq (car val) 'image))
+                       (eq (car-safe val) 'image) ; or image descriptor
                        (and (symbolp val) ; or a symbol bound to a
                             (boundp val)  ; image descriptor
                                         ; (defined with `defimage')
-                            (consp (eval val))
-                            (eq (car (eval val)) 'image))
+                            (consp (symbol-value val))
+                            (eq (car (symbol-value val)) 'image))
                        (and (listp val) ; or list with 4 strings or
                                         ; image descriptors
                             (= (length val) 4)
@@ -414,9 +415,7 @@ documentation of function `toolbarx-process-symbol')."
                               (setq all-obj-ok
                                     (and all-obj-ok
                                          (or (stringp i)
-                                             (and (consp i)
-                                                  (eq (car i)
-                                                      'image))))))))))
+                                             (eq (car-safe i) 'image)))))))))
              (cons good-obj val)))))
     (toolbarx-eval-function-or-symbol obj toolbarx-test-image-type-simple)))
 
@@ -888,7 +887,7 @@ in the end of SWITCHES, which is returned."
         (set variable default)))
     ;; now check `variable' content
     (set variable
-         (let ((val (eval variable)))
+         (let ((val (symbol-value variable)))
            (if (eq type 'toggle)
                (if (listp val)
                    val
@@ -1089,9 +1088,9 @@ function `toolbar-install-toolbar'."
                    ((and (symbolp image) ; or a symbol bound to a
                          (boundp image)  ; image descriptor (defined
                                         ; with `defimage')g
-                         (consp (eval image))
-                         (eq (car (eval image)) 'image))
-                    (eval image))
+                         (consp (symbol-value image))
+                         (eq (car (symbol-value image)) 'image))
+                    (symbol-value image))
                    (t                   ; otherwise, must be a list
                                         ; with 4 strings or image
                                         ; descriptors



reply via email to

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