]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove some compat code for old versions and XEmacs
authorStefan Kangas <stefan@marxist.se>
Thu, 19 Nov 2020 05:42:46 +0000 (06:42 +0100)
committerStefan Kangas <stefan@marxist.se>
Thu, 19 Nov 2020 19:43:51 +0000 (20:43 +0100)
* 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
lisp/cedet/semantic/sort.el
lisp/cedet/semantic/symref/grep.el
lisp/ibuf-ext.el
lisp/mail/supercite.el
lisp/password-cache.el
lisp/progmodes/idlw-shell.el
lisp/progmodes/idlwave.el
test/lisp/cedet/semantic-utest.el

index bbed1d94f20ee16b9f4942b2070dae63a8f6eb0c..2f05b99e467feb97be88fef15b401e3ca2442895 100644 (file)
@@ -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
 ;;
index 89fc917e0c75da9a562f912af0c52b90850fbeb0..a565d878f15c34a9198828ece68c112d95d0d45a 100644 (file)
 (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."
index d8de8ead4e9156e0f8e916ee7dafcaa4f9f2f75d..29e88cda125a1e9454e2030b6b76f3c96a6cb67f 100644 (file)
@@ -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))
index 80c5b073985649752dd5636ac960d141a616ec1a..7934297674693168774eacf342f83b9f21db7299 100644 (file)
@@ -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)
index b2ccd3d9934bc26a055493c5a9fd71687522edcb..9b7af0111e2b0955f08c2c9132026c67b621f6d5 100644 (file)
@@ -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)
index 2443f374a842e67d9caa7a98a35248bbbd1ae05a..375d06c74fd44a1e72332835de4fa22204b93791 100644 (file)
@@ -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)
index efc51ec32c39d1429c9dcb00a812069743134646..155ab7ba4caedb54f6be4b57f09baccac69cd0d7 100644 (file)
@@ -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?
index 5c1e82240cb4570a7c893570b5463889a72e65f3..6dd8853b1a016d804d4489280cd664ca1c1e8826 100644 (file)
@@ -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)
 
index e537871528ca6e596c87ccbf81e4bc14929e88c8..bcbd7d686e37bbb48bdfb54423dc0752e54efe85 100644 (file)
 (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