From ee7df9f0c8e9dedfca46fe9456ca8463cda096df Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 10 Apr 2015 00:17:19 -0400 Subject: [PATCH] * lisp/cedet/semantic: Remove some dead code * lisp/cedet/semantic/util-modes.el (semantic-stickyfunc-header-line-format): Emacs<22 is not supported any more. * lisp/cedet/semantic/fw.el (semantic-buffer-local-value): Emacs<21 is not supported any more. (semantic-safe): Use `declare'. * lisp/cedet/semantic/decorate.el (semantic-set-tag-intangible) (semantic-tag-intangible-p): Remove unused functions. * lisp/cedet/semantic/complete.el (semantic-displayor-window-edges): Remove unused function. --- lisp/cedet/semantic/complete.el | 9 --------- lisp/cedet/semantic/decorate.el | 14 -------------- lisp/cedet/semantic/decorate/mode.el | 2 +- lisp/cedet/semantic/fw.el | 10 +++------- lisp/cedet/semantic/util-modes.el | 10 +++------- 5 files changed, 7 insertions(+), 38 deletions(-) diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index ad931785aff..267e292647a 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el @@ -1707,15 +1707,6 @@ Display mechanism using tooltip for a list of possible completions.") ;;; Compatibility ;; -(eval-and-compile - (if (fboundp 'window-inside-edges) - ;; Emacs devel. - (defalias 'semantic-displayor-window-edges - 'window-inside-edges) - ;; Emacs 21 - (defalias 'semantic-displayor-window-edges - 'window-edges) - )) (defun semantic-displayor-point-position () "Return the location of POINT as positioned on the selected frame. diff --git a/lisp/cedet/semantic/decorate.el b/lisp/cedet/semantic/decorate.el index 38c359e53a8..6707fdff40c 100644 --- a/lisp/cedet/semantic/decorate.el +++ b/lisp/cedet/semantic/decorate.el @@ -88,20 +88,6 @@ If VISIBLE is non-nil, make the text visible." "Return non-nil if TAG is invisible." (semantic-overlay-get (semantic-tag-overlay tag) 'invisible)) -(defun semantic-set-tag-intangible (tag &optional tangible) - "Enable the text in TAG to be made intangible. -If TANGIBLE is non-nil, make the text visible. -This function does not have meaning in XEmacs because it seems that -the extent 'intangible' property does not exist." - (semantic-overlay-put (semantic-tag-overlay tag) 'intangible - (not tangible))) - -(defun semantic-tag-intangible-p (tag) - "Return non-nil if TAG is intangible. -This function does not have meaning in XEmacs because it seems that -the extent 'intangible' property does not exist." - (semantic-overlay-get (semantic-tag-overlay tag) 'intangible)) - (defun semantic-overlay-signal-read-only (overlay after start end &optional len) "Hook used in modification hooks to prevent modification. diff --git a/lisp/cedet/semantic/decorate/mode.el b/lisp/cedet/semantic/decorate/mode.el index 2a88eb7337b..9192ec15165 100644 --- a/lisp/cedet/semantic/decorate/mode.el +++ b/lisp/cedet/semantic/decorate/mode.el @@ -393,7 +393,7 @@ must return non-nil to indicate that the tag should be decorated by `NAME-highlight'. To put primary decorations on a tag `NAME-highlight' must use -functions like `semantic-set-tag-face', `semantic-set-tag-intangible', +functions like `semantic-set-tag-face', `semantic-set-tag-read-only', etc., found in the semantic-decorate library. To add other kind of decorations on a tag, `NAME-highlight' must use diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el index a0c36944d48..e36f3598c0f 100644 --- a/lisp/cedet/semantic/fw.el +++ b/lisp/cedet/semantic/fw.el @@ -38,6 +38,7 @@ (if (featurep 'xemacs) (progn (defalias 'semantic-buffer-local-value 'symbol-value-in-buffer) + ;; FIXME: Why not just (require 'overlay)? (defalias 'semantic-overlay-live-p (lambda (o) (and (extent-live-p o) @@ -113,12 +114,8 @@ "Extract the window from EVENT." (car (car (cdr event)))) - (if (> emacs-major-version 21) - (defalias 'semantic-buffer-local-value 'buffer-local-value) + (defalias 'semantic-buffer-local-value 'buffer-local-value) - (defun semantic-buffer-local-value (sym &optional buf) - "Get the value of SYM from buffer local variable in BUF." - (cdr (assoc sym (buffer-local-variables buf))))) ) @@ -306,7 +303,7 @@ error message. If `debug-on-error' is set, errors are not caught, so that you can debug them. Avoid using a large BODY since it is duplicated." - ;;(declare (debug t) (indent 1)) + (declare (debug t) (indent 1)) `(if debug-on-error ;;(let ((inhibit-quit nil)) ,@body) ;; Note to self: Doing the above screws up the wisent parser. @@ -317,7 +314,6 @@ Avoid using a large BODY since it is duplicated." (message ,format (format "%S - %s" (current-buffer) (error-message-string err))) nil)))) -(put 'semantic-safe 'lisp-indent-function 1) ;;; Misc utilities ;; diff --git a/lisp/cedet/semantic/util-modes.el b/lisp/cedet/semantic/util-modes.el index 6914c4b1b0b..c080642f670 100644 --- a/lisp/cedet/semantic/util-modes.el +++ b/lisp/cedet/semantic/util-modes.el @@ -684,15 +684,11 @@ when it lands in the sticky line." (defconst semantic-stickyfunc-header-line-format (cond ((featurep 'xemacs) nil) - ((>= emacs-major-version 22) + (t '(:eval (list ;; Magic bit I found on emacswiki. (propertize " " 'display '((space :align-to 0))) - (semantic-stickyfunc-fetch-stickyline)))) - ((= emacs-major-version 21) - '(:eval (list semantic-stickyfunc-indent-string - (semantic-stickyfunc-fetch-stickyline)))) - (t nil)) + (semantic-stickyfunc-fetch-stickyline))))) "The header line format used by stickyfunc mode.") ;;;###autoload @@ -719,7 +715,7 @@ minor mode is enabled." (unless (boundp 'default-header-line-format) ;; Disable if there are no header lines to use. (setq semantic-stickyfunc-mode nil) - (error "Sticky Function mode requires Emacs 21")) + (error "Sticky Function mode requires Emacs")) ;; Enable the mode ;; Save previous buffer local value of header line format. (when (and (local-variable-p 'header-line-format (current-buffer)) -- 2.39.2