emacs-diffs
[Top][All Lists]
Advanced

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

master 75555b5 1/4: Remove some compat code for old versions and XEmacs


From: Stefan Kangas
Subject: master 75555b5 1/4: Remove some compat code for old versions and XEmacs
Date: Thu, 19 Nov 2020 14:50:17 -0500 (EST)

branch: master
commit 75555b5b6bc517911404fc769b02f583e40f6c35
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Remove some compat code for old versions and XEmacs
    
    * lisp/ibuf-ext.el (ibuffer-old-saved-filters-warning)
    (ibuffer-maybe-save-stuff): Assume customize-save-variable is
    bound; it is autoloaded.
    * lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search):
    * lisp/password-cache.el (password-cache-remove):
    * lisp/cedet/semantic/bovine/el.el (semantic-dependency-tag-file):
    Remove Emacs 21 compat code.
    * lisp/cedet/semantic/sort.el (semantic-string-lessp-ci):
    Remove Emacs 20 compat code.
    * test/lisp/cedet/semantic-utest.el (semantic-utest-temp-directory):
    * lisp/mail/supercite.el (sc-ask): Remove XEmacs compat code.
    * lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
    * lisp/progmodes/idlwave.el (idlwave-mode): Remove commented out
    compat code.
---
 lisp/cedet/semantic/bovine/el.el   | 26 +++++---------------------
 lisp/cedet/semantic/sort.el        |  6 +-----
 lisp/cedet/semantic/symref/grep.el | 22 ++++------------------
 lisp/ibuf-ext.el                   | 19 +++++++------------
 lisp/mail/supercite.el             |  9 +--------
 lisp/password-cache.el             |  4 +---
 lisp/progmodes/idlw-shell.el       |  4 ----
 lisp/progmodes/idlwave.el          |  5 -----
 test/lisp/cedet/semantic-utest.el  |  7 +------
 9 files changed, 20 insertions(+), 82 deletions(-)

diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el
index bbed1d9..2f05b99 100644
--- a/lisp/cedet/semantic/bovine/el.el
+++ b/lisp/cedet/semantic/bovine/el.el
@@ -464,27 +464,11 @@ Return a bovination list to use."
 (define-mode-local-override semantic-dependency-tag-file
   emacs-lisp-mode (tag)
   "Find the file BUFFER depends on described by TAG."
-  (if (fboundp 'find-library-name)
-      (condition-case nil
-         ;; Try an Emacs 22 fcn.  This throws errors.
-         (find-library-name (semantic-tag-name tag))
-       (error
-        (message "semantic: cannot find source file %s"
-                 (semantic-tag-name tag))))
-    ;; No handy function available.  (Older Emacsen)
-    (let* ((lib (locate-library (semantic-tag-name tag)))
-          (name (if lib (file-name-sans-extension lib) nil))
-          (nameel (concat name ".el")))
-      (cond
-       ((and name (file-exists-p nameel)) nameel)
-       ((and name (file-exists-p (concat name ".el.gz")))
-       ;; This is the linux distro case.
-       (concat name ".el.gz"))
-       ;; Source file does not exist.
-       (name
-       (message "semantic: cannot find source file %s" (concat name ".el")))
-       (t
-       nil)))))
+  (condition-case nil
+      (find-library-name (semantic-tag-name tag))
+    (error
+     (message "semantic: cannot find source file %s"
+              (semantic-tag-name tag)))))
 
 ;;; DOC Strings
 ;;
diff --git a/lisp/cedet/semantic/sort.el b/lisp/cedet/semantic/sort.el
index 89fc917..a565d87 100644
--- a/lisp/cedet/semantic/sort.el
+++ b/lisp/cedet/semantic/sort.el
@@ -46,11 +46,7 @@
 (defun semantic-string-lessp-ci (s1 s2)
   "Case insensitive version of `string-lessp'.
 Argument S1 and S2 are the strings to compare."
-  ;; Use downcase instead of upcase because an average name
-  ;; has more lower case characters.
-  (if (fboundp 'compare-strings)
-      (eq (compare-strings s1 0 nil s2 0 nil t) -1)
-    (string-lessp (downcase s1) (downcase s2))))
+  (eq (compare-strings s1 0 nil s2 0 nil t) -1))
 
 (defun semantic-sort-tag-type (tag)
   "Return a type string for TAG guaranteed to be a string."
diff --git a/lisp/cedet/semantic/symref/grep.el 
b/lisp/cedet/semantic/symref/grep.el
index d8de8ea..29e88cd 100644
--- a/lisp/cedet/semantic/symref/grep.el
+++ b/lisp/cedet/semantic/symref/grep.el
@@ -167,24 +167,10 @@ This shell should support pipe redirect syntax."
     (with-current-buffer b
       (erase-buffer)
       (setq default-directory rootdir)
-
-      (if (not (fboundp 'grep-compute-defaults))
-
-         ;; find . -type f -print0 | xargs -0 -e grep -nH -e
-         ;; Note : I removed -e as it is not posix, nor necessary it seems.
-
-         (let ((cmd (concat "find " (file-local-name rootdir)
-                             " -type f " filepattern " -print0 "
-                            "| xargs -0 grep -H " grepflags "-e " greppat)))
-           ;;(message "Old command: %s" cmd)
-           (process-file semantic-symref-grep-shell nil b nil
-                          shell-command-switch cmd)
-           )
-       (let ((cmd (semantic-symref-grep-use-template
-                    (file-local-name rootdir) filepattern grepflags greppat)))
-         (process-file semantic-symref-grep-shell nil b nil
-                        shell-command-switch cmd))
-       ))
+      (let ((cmd (semantic-symref-grep-use-template
+                  (file-local-name rootdir) filepattern grepflags greppat)))
+        (process-file semantic-symref-grep-shell nil b nil
+                      shell-command-switch cmd)))
     (setq ans (semantic-symref-parse-tool-output tool b))
     ;; Return the answer
     ans))
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 80c5b07..7934297 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -208,11 +208,9 @@ either clicking or hitting return "
            'follow-link t
            'help-echo "Click or RET: save new value in customize"
            'action (lambda (_)
-                     (if (not (fboundp 'customize-save-variable))
-                         (message "Customize not available; value not saved")
-                       (customize-save-variable 'ibuffer-saved-filters
-                                                ibuffer-saved-filters)
-                       (message "Saved updated ibuffer-saved-filters."))))
+                     (customize-save-variable 'ibuffer-saved-filters
+                                              ibuffer-saved-filters)
+                     (message "Saved updated ibuffer-saved-filters.")))
           ".  See below for
 an explanation and alternative ways to save the repaired value.
 
@@ -1116,13 +1114,10 @@ filter into parts."
 
 (defun ibuffer-maybe-save-stuff ()
   (when ibuffer-save-with-custom
-    (if (fboundp 'customize-save-variable)
-       (progn
-         (customize-save-variable 'ibuffer-saved-filters
-                                  ibuffer-saved-filters)
-         (customize-save-variable 'ibuffer-saved-filter-groups
-                                  ibuffer-saved-filter-groups))
-      (message "Not saved permanently: Customize not available"))))
+    (customize-save-variable 'ibuffer-saved-filters
+                             ibuffer-saved-filters)
+    (customize-save-variable 'ibuffer-saved-filter-groups
+                             ibuffer-saved-filter-groups)))
 
 ;;;###autoload
 (defun ibuffer-save-filters (name filters)
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el
index b2ccd3d..9b7af01 100644
--- a/lisp/mail/supercite.el
+++ b/lisp/mail/supercite.el
@@ -618,10 +618,7 @@ the list should be unique."
                   (lambda (elt) (char-to-string (cdr elt))) alist "/")
                  ") "))
         (p prompt)
-        (event
-         (if (fboundp 'allocate-event)
-             (allocate-event)
-           nil)))
+         event)
     (while (stringp p)
       (if (let ((cursor-in-echo-area t)
                (inhibit-quit t))
@@ -630,8 +627,6 @@ the list should be unique."
            (prog1 quit-flag (setq quit-flag nil)))
          (progn
            (message "%s%s" p (single-key-description event))
-           (if (fboundp 'deallocate-event)
-               (deallocate-event event))
            (setq quit-flag nil)
            (signal 'quit '())))
       (let ((char event)
@@ -650,8 +645,6 @@ the list should be unique."
          (discard-input)
          (if (eq p prompt)
              (setq p (concat "Try again.  " prompt)))))))
-    (if (fboundp 'deallocate-event)
-       (deallocate-event event))
     p))
 
 (defun sc-scan-info-alist (alist)
diff --git a/lisp/password-cache.el b/lisp/password-cache.el
index 2443f37..375d06c 100644
--- a/lisp/password-cache.el
+++ b/lisp/password-cache.el
@@ -103,9 +103,7 @@ that a password is invalid, so that `password-read' query 
the
 user again."
   (let ((password (gethash key password-data)))
     (when (stringp password)
-      (if (fboundp 'clear-string)
-          (clear-string password)
-        (fillarray password ?_)))
+      (clear-string password))
     (remhash key password-data)))
 
 (defun password-cache-add (key password)
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index efc51ec..155ab7b 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -967,8 +967,6 @@ IDL has currently stepped.")
   (setq idlwave-shell-default-directory default-directory)
   (setq idlwave-shell-hide-output nil)
 
-  ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
-  ;; (make-local-hook 'kill-buffer-hook)
   (add-hook 'kill-buffer-hook 'idlwave-shell-kill-shell-buffer-confirm
            nil 'local)
   (add-hook 'kill-buffer-hook 'idlwave-shell-delete-temp-files nil 'local)
@@ -1007,8 +1005,6 @@ IDL has currently stepped.")
   (set (make-local-variable 'comment-start) ";")
   (setq abbrev-mode t)
 
-  ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
-  ;; make-local-hook 'post-command-hook)
   (add-hook 'post-command-hook 'idlwave-command-hook nil t)
 
   ;; Read the command history?
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 5c1e822..6dd8853 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -1920,15 +1920,10 @@ The main features of this mode are
                     'idlwave-forward-block nil))
 
   ;; Make a local post-command-hook and add our hook to it
-  ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
-  ;; (make-local-hook 'post-command-hook)
   (add-hook 'post-command-hook 'idlwave-command-hook nil 'local)
 
   ;; Make local hooks for buffer updates
-  ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
-  ;; (make-local-hook 'kill-buffer-hook)
   (add-hook 'kill-buffer-hook 'idlwave-kill-buffer-update nil 'local)
-  ;; (make-local-hook 'after-save-hook)
   (add-hook 'after-save-hook 'idlwave-save-buffer-update nil 'local)
   (add-hook 'after-save-hook 'idlwave-revoke-license-to-kill nil 'local)
 
diff --git a/test/lisp/cedet/semantic-utest.el 
b/test/lisp/cedet/semantic-utest.el
index e537871..bcbd7d6 100644
--- a/test/lisp/cedet/semantic-utest.el
+++ b/test/lisp/cedet/semantic-utest.el
@@ -38,14 +38,9 @@
 (defvar semantic-utest-test-directory (expand-file-name "tests" 
cedet-utest-directory)
   "Location of test files.")
 
-(defvar semantic-utest-temp-directory (if (fboundp 'temp-directory)
-                                         (temp-directory)
-                                       temporary-file-directory)
-  "Temporary directory to use when creating files.")
-
 (defun semantic-utest-fname (name)
   "Create a filename for NAME in /tmp."
-  (expand-file-name name semantic-utest-temp-directory))
+  (expand-file-name name temporary-file-directory))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Data for C tests



reply via email to

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