(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
;;
(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."
(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))
'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.
(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)
(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))
(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)
(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)
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)
(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)
(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?
'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)
(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