Commit 75555b5b authored by Stefan Kangas's avatar Stefan Kangas

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.
parent 3963aea4
......@@ -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
;;
......
......@@ -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."
......
......@@ -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))
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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?
......
......@@ -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)
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment