auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] [elpa] externals/auctex b587fdb 04/12: Resolve constant f


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex b587fdb 04/12: Resolve constant fboundp/boundp/featurep
Date: Sat, 17 Apr 2021 15:13:21 -0400 (EDT)

branch: externals/auctex
commit b587fdbeb82f48831fd1a27d6807a2d052003bc6
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>

    Resolve constant fboundp/boundp/featurep
    
    * bib-cite.el (bib-apropos-keyword-at-point):
    * context.el (ConTeXt-menu-update)
    (ConTeXt-mode-common-initialization):
    * latex.el (LaTeX-math-initialize)
    (LaTeX-fill-move-to-break-point):
    * multi-prompt.el (multi-prompt-next):
    * preview.el.in (preview-transparent-border)
    (preview-place-preview, preview-reinstate-preview):
    * style/kpfonts.el (math):
    * style/dk-bib.el (LaTeX-dk-bib-package-options):
    * tex-buf.el (TeX-shell-command-option, TeX-check-engine):
    * tex-fold.el (TeX-fold-item, TeX-fold-post-command):
    * tex.el (TeX-source-specials-view-start-server)
    (TeX-auto-private, TeX-style-private, TeX-complete-symbol)
    (VirTeX-common-initialization, TeX-token-char)
    (TeX-mode-specific-command-menu-entries)
    (TeX-math-input-method-off, TeX-abbrev-mode-setup):
    Simplify conditionals containing `fboundp', `boundp' and `featurep'
    which evaluate to constant.
    
    * latex.el (LaTeX-math-initialize, LaTeX-fold-math-spec-list):
    Simplify by not using `decode-char'.  Now that emacs is unicode based,
    (decode-char 'ucs ARG) is trivial operation which just returns ARG.
    Code point in ucs is the same as emacs char.
    
    * multi-prompt (multi-prompt): Use #' to quote function names.
    (multi-prompt-next-must-match): Use
    `minibuffer-contents-no-properties' instead of
    `buffer-substring-no-properties'.
---
 bib-cite.el      |  4 +---
 context.el       |  3 ---
 latex.el         | 12 +++++-------
 multi-prompt.el  | 17 +++++++----------
 preview.el.in    |  8 +++-----
 style/dk-bib.el  |  4 +---
 style/kpfonts.el |  4 ++--
 tex-buf.el       | 12 +++---------
 tex-fold.el      | 10 +++-------
 tex.el           | 39 +++++++++++++--------------------------
 10 files changed, 38 insertions(+), 75 deletions(-)

diff --git a/bib-cite.el b/bib-cite.el
index 25ca90d..465f18f 100644
--- a/bib-cite.el
+++ b/bib-cite.el
@@ -1331,9 +1331,7 @@ e.g.: \\cite{Wadhams81,Bourke.et.al87,SchneiderBudeus94}
        ((and (re-search-backward "[\n{, ]" nil t)
              (string-equal "{" (buffer-substring (match-beginning 0)
                                                  (match-end 0))))
-        (if (fboundp 'buffer-substring-no-properties)
-            (buffer-substring-no-properties (1+ (point)) here)
-        (buffer-substring (1+ (point)) here)))))))
+        (buffer-substring-no-properties (1+ (point)) here))))))
 
 ;;--------------------------------------------------------------------------
 ;; Functions for Displaying or moving to matching \ref or \label command
diff --git a/context.el b/context.el
index 435bd18..eac68e4 100644
--- a/context.el
+++ b/context.el
@@ -1550,7 +1550,6 @@ else.  There might be text before point."
   "Update entries on AUCTeX menu."
   (or (not (memq major-mode '(context-mode)))
       (null ConTeXt-menu-changed)
-      (not (fboundp 'easy-menu-change))
       (progn
         (TeX-update-style)
         (setq ConTeXt-menu-changed nil)
@@ -1770,8 +1769,6 @@ i.e. you do _not_ have to cater for this yourself by 
adding \\\\' or $."
   (use-local-map ConTeXt-mode-map)
   (setq ConTeXt-menu-changed t)
 
-  (if (fboundp 'make-local-hook)
-      (make-local-hook 'activate-menubar-hook))
   (add-hook 'activate-menubar-hook #'ConTeXt-menu-update nil t)
 
   ;; Outline support
diff --git a/latex.el b/latex.el
index 1c3b213..5ce3a02 100644
--- a/latex.el
+++ b/latex.el
@@ -4006,9 +4006,7 @@ space does not end a sentence, so don't break a line 
there."
   "Move to the position where the line should be broken."
   (fill-move-to-break-point linebeg)
   ;; Prevent line break between 2-byte char and 1-byte char.
-  (when (and (featurep 'mule)
-             enable-multibyte-characters
-             (or (and (not (looking-at LaTeX-nospace-between-char-regexp))
+  (when (and (or (and (not (looking-at LaTeX-nospace-between-char-regexp))
                       (TeX-looking-at-backward
                        LaTeX-nospace-between-char-regexp 1))
                  (and (not (TeX-looking-at-backward
@@ -5362,7 +5360,7 @@ MENU and CHARACTER, see `LaTeX-math-list' for details.")
 (defun LaTeX-math-initialize ()
   (let ((math (reverse (append LaTeX-math-list LaTeX-math-default)))
         (map LaTeX-math-keymap)
-        (unicode (and LaTeX-math-menu-unicode (fboundp 'decode-char))))
+        (unicode LaTeX-math-menu-unicode))
     (while math
       (let* ((entry (car math))
              (key (nth 0 entry))
@@ -5372,7 +5370,7 @@ MENU and CHARACTER, see `LaTeX-math-list' for details.")
              value menu name)
         (setq math (cdr math))
         (if (and prefix
-                 (setq prefix (decode-char 'ucs (nth 3 entry))))
+                 (setq prefix (nth 3 entry)))
             (setq prefix (concat (string prefix) " \\"))
           (setq prefix "\\"))
         (if (listp (cdr entry))
@@ -5550,8 +5548,8 @@ char."
                           (submenu   (nth 2 elt))
                           (unicode   (nth 3 elt))
                           uchar noargp)
-                      (when (and (fboundp 'decode-char) (integerp unicode))
-                        (setq uchar (decode-char 'ucs unicode)))
+                      (when (integerp unicode)
+                        (setq uchar unicode))
                       (when (listp submenu) (setq submenu (nth 1 submenu)))
                       (setq noargp
                             (not (string-match
diff --git a/multi-prompt.el b/multi-prompt.el
index 409e1d0..dacc85d 100644
--- a/multi-prompt.el
+++ b/multi-prompt.el
@@ -39,6 +39,9 @@
 (defvar multi-prompt-found nil
   "List of entries currently added during a `multi-prompt'.")
 
+;; FIXME: Modify all caller (including ones in reftex-auc.el) to use
+;; more sophisticated crm.el.  After that, we no longer need the
+;; former half of this file.
 ;;;###autoload
 (defun multi-prompt (separator
                      unique prompt table
@@ -54,8 +57,8 @@ are the arguments to `completing-read'.  See that."
         (new-map (make-sparse-keymap)))
     (set-keymap-parent new-map old-map)
     (define-key new-map separator (if require-match
-                                      'multi-prompt-next-must-match
-                                    'multi-prompt-next))
+                                      #'multi-prompt-next-must-match
+                                    #'multi-prompt-next))
     (define-key new-map "\C-?" #'multi-prompt-delete)
     (let* ((minibuffer-local-completion-map new-map)
            (minibuffer-local-must-match-map new-map)
@@ -104,18 +107,12 @@ are the arguments to `completing-read'.  See that."
 (defun multi-prompt-next ()
   (interactive)
   (throw 'multi-prompt-next
-         (cond
-          ((fboundp 'minibuffer-contents-no-properties)
-           ;; buffer-substring no longer works in emacs-21, it returns 
-           ;; the whole prompt line. Use this instead.
-           (minibuffer-contents-no-properties))
-          (t
-           (buffer-substring-no-properties (point-min) (point-max))))))
+         (minibuffer-contents-no-properties)))
          
 (defun multi-prompt-next-must-match ()
   (interactive)
   (when  (call-interactively #'minibuffer-complete)
-    (let ((content (buffer-substring-no-properties (point-min) (point-max))))
+    (let ((content (minibuffer-contents-no-properties)))
       (when (or ;; (not require-match)
                 (assoc content minibuffer-completion-table))
         (throw 'multi-prompt-next content)))))
diff --git a/preview.el.in b/preview.el.in
index 79dbfe2..d848431 100644
--- a/preview.el.in
+++ b/preview.el.in
@@ -1701,7 +1701,7 @@ to the default background in most other cases."
 ;; 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)
+(defcustom preview-transparent-border nil
   "Width of transparent border for previews in pt.
 Setting this to a numeric value will add a border of
 `preview-transparent-color' around images, and will turn
@@ -2590,8 +2590,7 @@ Those lists get concatenated together and get passed
 to the close hook."
   (preview-clearout start end tempdir)
   (let ((ov (make-overlay start end nil nil nil)))
-    (when (fboundp 'TeX-overlay-prioritize)
-      (overlay-put ov 'priority (TeX-overlay-prioritize start end)))
+    (overlay-put ov 'priority (TeX-overlay-prioritize start end))
     (overlay-put ov 'preview-map
                  (preview-make-clickable
                   nil nil nil
@@ -2674,8 +2673,7 @@ if any."
       (setcdr filename TeX-active-tempdir)
       (setq filename (list filename)))
     (let ((ov (make-overlay start end nil nil nil)))
-      (when (fboundp 'TeX-overlay-prioritize)
-        (overlay-put ov 'priority (TeX-overlay-prioritize start end)))
+      (overlay-put ov 'priority (TeX-overlay-prioritize start end))
       (overlay-put ov 'preview-map
                    (preview-make-clickable
                     nil nil nil
diff --git a/style/dk-bib.el b/style/dk-bib.el
index 21422a5..18db014 100644
--- a/style/dk-bib.el
+++ b/style/dk-bib.el
@@ -44,9 +44,7 @@
     (when (string-match "\\(ordinaldepth=\\)\\([^0-9]\\|$\\)" options)
       (while (or (< depth 0)
                  (> depth 20))
-        (setq depth (if (fboundp 'read-number)
-                        (read-number "Ordinal depth: ")
-                      (string-to-number (TeX-read-string "Ordinal depth: "))))
+        (setq depth (read-number "Ordinal depth: "))
         (when (or (< depth 0)
                   (> depth 20))
           (message "Ordinal depth must be between 0 and 20")
diff --git a/style/kpfonts.el b/style/kpfonts.el
index 6483b2e..654378f 100644
--- a/style/kpfonts.el
+++ b/style/kpfonts.el
@@ -442,7 +442,7 @@ the sequence by initializing this variable.")
 
 (let ((math (reverse LaTeX-kpfonts-default))
       (map LaTeX-kpfonts-keymap)
-      (unicode (and LaTeX-math-menu-unicode (fboundp 'decode-char))))
+      (unicode LaTeX-math-menu-unicode))
   (while math
     (let* ((entry (car math))
            (key (nth 0 entry))
@@ -452,7 +452,7 @@ the sequence by initializing this variable.")
            value menu name)
       (setq math (cdr math))
       (setq prefix (if (and prefix
-                            (setq prefix (decode-char 'ucs (nth 3 entry))))
+                            (setq prefix (nth 3 entry)))
                        (concat (string prefix) " \\")
                      "\\"))
       (if (listp (cdr entry))
diff --git a/tex-buf.el b/tex-buf.el
index 96fab0a..114ceac 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -48,13 +48,8 @@
   :type 'file)
 
 (defcustom TeX-shell-command-option
-  (cond ((memq system-type '(ms-dos emx windows-nt) )
-         (cond ((boundp 'shell-command-option)
-                shell-command-option)
-               ((boundp 'shell-command-switch)
-                shell-command-switch)
-               (t
-                "/c")))
+  (cond ((memq system-type '(ms-dos emx windows-nt))
+         shell-command-switch)
         (t                              ;Unix & EMX (Emacs 19 port to OS/2)
          "-c"))
   "Shell argument indicating that next argument is the command."
@@ -476,8 +471,7 @@ Do you want to select one of these engines? "
              ;; make it nil.
              (setq TeX-check-engine-list nil))))
        (TeX-engine-set engine)
-       (when (and (fboundp 'add-file-local-variable)
-                  (y-or-n-p "Do you want to remember the choice? "))
+       (when (y-or-n-p "Do you want to remember the choice? ")
          (add-file-local-variable 'TeX-engine engine)
          (save-buffer))))))
 
diff --git a/tex-fold.el b/tex-fold.el
index 963690a..ba7e9c0 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -455,9 +455,7 @@ Return non-nil if an item was found and folded, nil 
otherwise."
                                    (t
                                     (concat (regexp-quote TeX-esc)
                                             "\\([A-Za-z@*]+\\)"))))
-                            (if (fboundp 'match-string-no-properties)
-                                (match-string-no-properties 1)
-                              (match-string 1))))
+                            (match-string-no-properties 1)))
                (fold-list (cond ((eq type 'env) 
TeX-fold-env-spec-list-internal)
                                 ((eq type 'math)
                                  TeX-fold-math-spec-list-internal)
@@ -845,10 +843,8 @@ Remove the respective properties from the overlay OV."
                            TeX-fold-open-spots))
                    (old-ols (mapcar #'cdr (car spots))))
               (setq TeX-fold-open-spots (cdr spots))
-              (when (or (and (boundp 'disable-point-adjustment)
-                             disable-point-adjustment)
-                        (and (boundp 'global-disable-point-adjustment)
-                             global-disable-point-adjustment)
+              (when (or disable-point-adjustment
+                        global-disable-point-adjustment
                         ;; See preview.el on how to make this configurable.
                         (memq this-command
                               (list (key-binding [left]) (key-binding [right])
diff --git a/tex.el b/tex.el
index 7a7ba9b..f596737 100644
--- a/tex.el
+++ b/tex.el
@@ -1658,15 +1658,14 @@ The function should take no arguments and return the 
page numer
 as a string.")
 (make-variable-buffer-local 'TeX-source-correlate-output-page-function)
 
+(define-obsolete-variable-alias 'TeX-source-specials-view-start-server
+  'TeX-source-correlate-start-server)
 (defcustom TeX-source-correlate-start-server 'ask
   "Control if server should be started for inverse search."
   :type '(choice (const :tag "Always" t)
                  (const :tag "Never" nil)
                  (const :tag "Ask" ask))
   :group 'TeX-view)
-(when (fboundp 'defvaralias)
-  (defvaralias 'TeX-source-specials-view-start-server
-    'TeX-source-correlate-start-server))
 
 (defvar TeX-source-correlate-start-server-asked nil
   "Keep track if question about server start search was asked.")
@@ -2702,8 +2701,7 @@ are returned."
 
 (defcustom TeX-auto-private
   (list (expand-file-name TeX-auto-local
-                          (or (and (boundp 'user-emacs-directory)
-                                   (concat user-emacs-directory "auctex/"))
+                          (or (concat user-emacs-directory "auctex/")
                               "~/.emacs.d/auctex/")))
   "List of directories containing automatically generated AUCTeX style files.
 
@@ -2716,8 +2714,7 @@ These correspond to the personal TeX macros."
 
 (defcustom TeX-style-private
   (list (expand-file-name TeX-style-local
-                          (or (and (boundp 'user-emacs-directory)
-                                   (concat user-emacs-directory "auctex/"))
+                          (or (concat user-emacs-directory "auctex/")
                               "~/.emacs.d/auctex/")))
   "List of directories containing hand-generated AUCTeX style files.
 
@@ -3220,15 +3217,8 @@ Or alternatively:
                    (let ((window (get-buffer-window buf-name)))
                      (when window (delete-window window))))
                   (t
-                   (if (fboundp 'completion-in-region)
-                       (completion-in-region begin end
-                                             (all-completions symbol list nil))
-                     (message "Making completion list...")
-                     (let ((list (all-completions symbol list nil)))
-                       (with-output-to-temp-buffer buf-name
-                         (display-completion-list list)))
-                     (set-window-dedicated-p (get-buffer-window buf-name) 
'soft)
-                     (message "Making completion list...done")))))
+                   (completion-in-region begin end
+                                         (all-completions symbol list nil)))))
         (funcall (nth 1 entry))))))
 
 (defun TeX--completion-at-point ()
@@ -3782,9 +3772,8 @@ The algorithm is as follows:
            #'TeX--prettify-symbols-compose-p)))
 
   ;; Standard Emacs completion-at-point support
-  (when (boundp 'completion-at-point-functions)
-    (add-hook 'completion-at-point-functions
-              #'TeX--completion-at-point nil t))
+  (add-hook 'completion-at-point-functions
+            #'TeX--completion-at-point nil t)
 
   ;; Let `TeX-master-file' be called after a new file was opened and
   ;; call `TeX-update-style' on any file opened.  (The addition to the
@@ -3811,6 +3800,7 @@ The algorithm is as follows:
 
 ;;; Hilighting
 
+;; FIXME: It's likely that `hilit-patterns-alist' is much obsolete.
 (if (boundp 'hilit-patterns-alist)
     (let ((latex-patterns (cdr-safe (assq 'latex-mode hilit-patterns-alist)))
           (plain-tex-patterns (cdr-safe (assq 'plain-tex-mode
@@ -4192,9 +4182,7 @@ If SKIP is not-nil, don't insert code for SKIP."
   "List of regular expressions guaranteed to match nothing.")
 
 (defvar TeX-token-char
-  (if (featurep 'mule)
-      "\\(?:[a-zA-Z]\\|\\cj\\)"
-    "[a-zA-Z]")
+  "\\(?:[a-zA-Z]\\|\\cj\\)"
   "Regexp matching a character in a TeX macro.
 
 Please use a shy group if you use a grouping construct, because
@@ -5030,7 +5018,7 @@ Brace insertion is only done if point is in a math 
construct and
       :visible TeX-parse-all-errors]
      ["Error Overview" TeX-error-overview
       :help "Open an overview of errors occured in the last TeX run"
-      :visible (and TeX-parse-all-errors (fboundp 'tabulated-list-mode))]
+      :visible TeX-parse-all-errors]
      ["Quick View" TeX-view
       :help "Start a viewer without prompting"]
      "-"
@@ -5972,7 +5960,7 @@ sign.  With optional ARG, insert that many dollar signs."
   "Toggle off input method when entering math mode."
   (and TeX-math-toggle-off-input-method
        (texmathp)
-       (boundp 'current-input-method) current-input-method
+       current-input-method
        (string-match TeX-math-input-method-off-regexp current-input-method)
        (deactivate-input-method)))
 
@@ -6595,8 +6583,7 @@ error."
        (defvar ,symbol nil
          ,(format "Abbrev table for %s mode." name))
        (define-abbrev-table ',symbol nil)
-       (when (fboundp 'abbrev-table-put)
-         (abbrev-table-put ,symbol :parents (list text-mode-abbrev-table))))))
+       (abbrev-table-put ,symbol :parents (list text-mode-abbrev-table)))))
 
 
 ;;; Special provisions for other modes and libraries




reply via email to

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