diff options
Diffstat (limited to 'lisp/cedet')
-rw-r--r-- | lisp/cedet/data-debug.el | 40 | ||||
-rw-r--r-- | lisp/cedet/ede.el | 16 | ||||
-rw-r--r-- | lisp/cedet/ede/cpp-root.el | 15 | ||||
-rw-r--r-- | lisp/cedet/ede/pconf.el | 5 | ||||
-rw-r--r-- | lisp/cedet/semantic/complete.el | 8 | ||||
-rw-r--r-- | lisp/cedet/semantic/db-ebrowse.el | 5 | ||||
-rw-r--r-- | lisp/cedet/semantic/grammar.el | 47 | ||||
-rw-r--r-- | lisp/cedet/semantic/imenu.el | 5 | ||||
-rw-r--r-- | lisp/cedet/semantic/wisent/comp.el | 4 | ||||
-rw-r--r-- | lisp/cedet/semantic/wisent/wisent.el | 9 | ||||
-rw-r--r-- | lisp/cedet/srecode/document.el | 14 | ||||
-rw-r--r-- | lisp/cedet/srecode/semantic.el | 2 | ||||
-rw-r--r-- | lisp/cedet/srecode/srt-mode.el | 2 |
13 files changed, 96 insertions, 76 deletions
diff --git a/lisp/cedet/data-debug.el b/lisp/cedet/data-debug.el index 78a72dd889c..604fc40926c 100644 --- a/lisp/cedet/data-debug.el +++ b/lisp/cedet/data-debug.el @@ -49,9 +49,9 @@ ;;; Compatibility ;; -(defalias 'data-debug-overlay-properties 'overlay-properties) -(defalias 'data-debug-overlay-p 'overlayp) -(defalias 'dd-propertize 'propertize) +(define-obsolete-function-alias 'data-debug-overlay-properties 'overlay-properties "28.1") +(define-obsolete-function-alias 'data-debug-overlay-p 'overlayp "28.1") +(define-obsolete-function-alias 'dd-propertize 'propertize "28.1") ;;; GENERIC STUFF ;; @@ -73,7 +73,7 @@ The attributes belong to the tag PARENT." "Insert all the parts of OVERLAY. PREFIX specifies what to insert at the start of each line." (let ((attrprefix (concat (make-string (length prefix) ? ) "# ")) - (proplist (data-debug-overlay-properties overlay))) + (proplist (overlay-properties overlay))) (data-debug-insert-property-list proplist attrprefix) ) @@ -393,10 +393,10 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." (lambda (key value) (data-debug-insert-thing key prefix - (dd-propertize "key " 'face font-lock-comment-face)) + (propertize "key " 'face font-lock-comment-face)) (data-debug-insert-thing value prefix - (dd-propertize "val " 'face font-lock-comment-face))) + (propertize "val " 'face font-lock-comment-face))) hash-table)) (defun data-debug-insert-hash-table-from-point (point) @@ -415,9 +415,9 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." (defun data-debug-insert-hash-table-button (hash-table prefix prebuttontext) "Insert HASH-TABLE as expandable button with recursive prefix PREFIX and PREBUTTONTEXT in front of the button text." - (let ((string (dd-propertize (format "%s" hash-table) + (let ((string (propertize (format "%s" hash-table) 'face 'font-lock-keyword-face))) - (insert (dd-propertize + (insert (propertize (concat prefix prebuttontext string) 'ddebug hash-table 'ddebug-indent (length prefix) @@ -444,7 +444,7 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." (data-debug-insert-thing (car (cdr rest)) prefix (concat - (dd-propertize (format "%s" (car rest)) + (propertize (format "%s" (car rest)) 'face font-lock-comment-face) " : ")) (setq rest (cdr (cdr rest)))) @@ -468,9 +468,9 @@ PREBUTTONTEXT is some text between prefix and the stuff list button." A Symbol is a simple thing, but this provides some face and prefix rules. PREFIX is the text that precedes the button. PREBUTTONTEXT is some text between prefix and the thing." - (let ((string (dd-propertize (format "#<WIDGET %s>" (car widget)) + (let ((string (propertize (format "#<WIDGET %s>" (car widget)) 'face 'font-lock-keyword-face))) - (insert (dd-propertize + (insert (propertize (concat prefix prebuttontext string) 'ddebug widget 'ddebug-indent (length prefix) @@ -613,7 +613,7 @@ PREBUTTONTEXT is some text between prefix and the stuff vector button." (symbol-value symbol) (concat (make-string indent ? ) "> ") (concat - (dd-propertize "value" + (propertize "value" 'face 'font-lock-comment-face) " "))) (data-debug-insert-property-list @@ -628,13 +628,13 @@ PREFIX is the text that precedes the button. PREBUTTONTEXT is some text between prefix and the symbol button." (let ((string (cond ((fboundp symbol) - (dd-propertize (concat "#'" (symbol-name symbol)) + (propertize (concat "#'" (symbol-name symbol)) 'face 'font-lock-function-name-face)) ((boundp symbol) - (dd-propertize (concat "'" (symbol-name symbol)) + (propertize (concat "'" (symbol-name symbol)) 'face 'font-lock-variable-name-face)) (t (format "'%s" symbol))))) - (insert (dd-propertize + (insert (propertize (concat prefix prebuttontext string) 'ddebug symbol 'ddebug-indent (length prefix) @@ -657,7 +657,7 @@ PREBUTTONTEXT is some text between prefix and the thing." (while (string-match "\t" newstr) (setq newstr (replace-match "\\t" t t newstr))) (insert prefix prebuttontext - (dd-propertize (format "\"%s\"" newstr) + (propertize (format "\"%s\"" newstr) 'face font-lock-string-face) "\n" ))) @@ -668,7 +668,7 @@ A Symbol is a simple thing, but this provides some face and prefix rules. PREFIX is the text that precedes the button. PREBUTTONTEXT is some text between prefix and the thing." (insert prefix prebuttontext - (dd-propertize (format "%S" thing) + (propertize (format "%S" thing) 'face font-lock-string-face) "\n")) @@ -737,10 +737,10 @@ FACE is the face to use." (null . data-debug-insert-nil) ;; Overlay - (data-debug-overlay-p . data-debug-insert-overlay-button) + (overlayp . data-debug-insert-overlay-button) ;; Overlay list - ((lambda (thing) (and (consp thing) (data-debug-overlay-p (car thing)))) . + ((lambda (thing) (and (consp thing) (overlayp (car thing)))) . data-debug-insert-overlay-list-button) ;; Buffer @@ -880,7 +880,7 @@ If PARENT is non-nil, it is somehow related as a parent to thing." comment-end "" buffer-read-only t) (setq-local comment-start-skip - "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") + "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") (buffer-disable-undo) (set (make-local-variable 'font-lock-global-modes) nil) (font-lock-mode -1) diff --git a/lisp/cedet/ede.el b/lisp/cedet/ede.el index 1418ad9539d..41252815734 100644 --- a/lisp/cedet/ede.el +++ b/lisp/cedet/ede.el @@ -470,7 +470,7 @@ To be used in hook functions." ;; Emacs 21 has no buffer file name for directory edits. ;; so we need to add these hacks in. (eq major-mode 'dired-mode) - (eq major-mode 'vc-dired-mode)) + (eq major-mode 'vc-dir-mode)) (ede-minor-mode 1))) (define-minor-mode ede-minor-mode @@ -481,7 +481,7 @@ controlled project, then this mode is activated automatically provided `global-ede-mode' is enabled." :group 'ede (cond ((or (eq major-mode 'dired-mode) - (eq major-mode 'vc-dired-mode)) + (eq major-mode 'vc-dir-mode)) (ede-dired-minor-mode (if ede-minor-mode 1 -1))) (ede-minor-mode (if (not ede-constructing) @@ -1515,8 +1515,11 @@ It does not apply the value to buffers." (when project-dir (ede-directory-get-open-project project-dir 'ROOT)))) -(cl-defmethod project-roots ((project ede-project)) - (list (ede-project-root-directory project))) +(cl-defmethod project-root ((project ede-project)) + (ede-project-root-directory project)) + +;;; FIXME: Could someone look into implementing `project-ignores' for +;;; EDE and/or a faster `project-files'? (add-hook 'project-find-functions #'project-try-ede) @@ -1527,8 +1530,7 @@ It does not apply the value to buffers." ;; If this does not occur after the provide, we can get a recursive ;; load. Yuck! -(if (featurep 'speedbar) - (ede-speedbar-file-setup) - (add-hook 'speedbar-load-hook 'ede-speedbar-file-setup)) +(with-eval-after-load 'speedbar + (ede-speedbar-file-setup)) ;;; ede.el ends here diff --git a/lisp/cedet/ede/cpp-root.el b/lisp/cedet/ede/cpp-root.el index ee8aa5db1b7..f0dbccb7fc1 100644 --- a/lisp/cedet/ede/cpp-root.el +++ b/lisp/cedet/ede/cpp-root.el @@ -478,21 +478,6 @@ Argument COMMAND is the command to use for compiling the target." "Don't rescan this project from the sources." (message "cpp-root has nothing to rescan.")) -;;; Quick Hack -(defun ede-create-lots-of-projects-under-dir (dir projfile &rest attributes) - "Create a bunch of projects under directory DIR. -PROJFILE is a file name sans directory that indicates a subdirectory -is a project directory. -Generic ATTRIBUTES, such as :include-path can be added. -Note: This needs some work." - (let ((files (directory-files dir t))) - (dolist (F files) - (if (file-exists-p (expand-file-name projfile F)) - `(ede-cpp-root-project (file-name-nondirectory F) - :name (file-name-nondirectory F) - :file (expand-file-name projfile F) - attributes))))) - (provide 'ede/cpp-root) ;; Local variables: diff --git a/lisp/cedet/ede/pconf.el b/lisp/cedet/ede/pconf.el index 63fb62b5a57..b85b397af2d 100644 --- a/lisp/cedet/ede/pconf.el +++ b/lisp/cedet/ede/pconf.el @@ -56,8 +56,9 @@ don't do it. A value of nil means to just do it.") (and (eq ede-pconf-create-file-query 'ask) (not (eq ede-pconf-create-file-query 'never)) (not (y-or-n-p - (format "I had to create the %s file for you. Ok? " file))) - (error "Quit"))))))) + (format "I had to create the %s file for you. Ok? " + file)))) + (error "Quit")))))) (cl-defmethod ede-proj-configure-synchronize ((this ede-proj-project)) diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index 7abc4360f64..b262ab710f6 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el @@ -1635,10 +1635,10 @@ This will not happen if you directly set this variable via `setq'." :group 'semantic :version "24.3" :type 'integer - :set '(lambda (sym var) - (set-default sym var) - (when (boundp 'x-max-tooltip-size) - (setcdr x-max-tooltip-size (max (1+ var) (cdr x-max-tooltip-size)))))) + :set (lambda (sym var) + (set-default sym var) + (when (boundp 'x-max-tooltip-size) + (setcdr x-max-tooltip-size (max (1+ var) (cdr x-max-tooltip-size)))))) (defclass semantic-displayer-tooltip (semantic-displayer-traditional) diff --git a/lisp/cedet/semantic/db-ebrowse.el b/lisp/cedet/semantic/db-ebrowse.el index a3219af7d3e..d63e5bc4869 100644 --- a/lisp/cedet/semantic/db-ebrowse.el +++ b/lisp/cedet/semantic/db-ebrowse.el @@ -74,7 +74,7 @@ By default, include only headers since the semantic use of EBrowse is only for searching via semanticdb, and thus only headers would be searched." :group 'semanticdb - :type 'string) + :type 'regexp) ;;; SEMANTIC Database related Code ;;; Classes: @@ -181,7 +181,8 @@ is specified by `semanticdb-default-save-directory'." "Load all semanticdb controlled EBROWSE caches." (interactive) (let ((f (directory-files semanticdb-default-save-directory - t (concat semanticdb-ebrowse-default-file-name + t (concat (regexp-quote + semanticdb-ebrowse-default-file-name) "-load\\.el\\'") t))) (while f diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index 62c86f9d12d..1ed18339a72 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el @@ -1306,7 +1306,7 @@ the change bounds to encompass the whole nonterminal tag." ;; Look within the line for a ; following an even number of backslashes ;; after either a non-backslash or the line beginning. (set (make-local-variable 'comment-start-skip) - "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") + "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") (set (make-local-variable 'indent-line-function) 'semantic-grammar-indent) (set (make-local-variable 'fill-paragraph-function) @@ -1663,6 +1663,42 @@ Select the buffer containing the tag's definition, and move point there." (defvar semantic-grammar-eldoc-last-data (cons nil nil)) +(defun semantic--docstring-format-sym-doc (prefix doc &optional face) + "Combine PREFIX and DOC, and shorten the result to fit in the echo area. + +When PREFIX is a symbol, propertize its symbol name with FACE +before combining it with DOC. If FACE is not provided, just +apply the nil face. + +See also: `eldoc-echo-area-use-multiline-p'." + ;; Hoisted from old `eldoc-docstring-format-sym-doc'. + ;; If the entire line cannot fit in the echo area, the symbol name may be + ;; truncated or eliminated entirely from the output to make room for the + ;; description. + (when (symbolp prefix) + (setq prefix (concat (propertize (symbol-name prefix) 'face face) ": "))) + (let* ((ea-multi eldoc-echo-area-use-multiline-p) + ;; Subtract 1 from window width since emacs will not write + ;; any chars to the last column, or in later versions, will + ;; cause a wraparound and resize of the echo area. + (ea-width (1- (window-width (minibuffer-window)))) + (strip (- (+ (length prefix) + (length doc)) + ea-width))) + (cond ((or (<= strip 0) + (eq ea-multi t) + (and ea-multi (> (length doc) ea-width))) + (concat prefix doc)) + ((> (length doc) ea-width) + (substring (format "%s" doc) 0 ea-width)) + ((>= strip (string-match-p ":? *\\'" prefix)) + doc) + (t + ;; Show the end of the partial symbol name, rather + ;; than the beginning, since the former is more likely + ;; to be unique given package namespace conventions. + (concat (substring prefix strip) doc))))) + (defun semantic-grammar-eldoc-get-macro-docstring (macro expander) "Return a one-line docstring for the given grammar MACRO. EXPANDER is the name of the function that expands MACRO." @@ -1681,19 +1717,18 @@ EXPANDER is the name of the function that expands MACRO." (setq doc (eldoc-function-argstring expander)))) (when doc (setq doc - (eldoc-docstring-format-sym-doc + (semantic--docstring-format-sym-doc macro (format "==> %s %s" expander doc) 'default)) (setq semantic-grammar-eldoc-last-data (cons expander doc))) doc)) ((fboundp 'elisp-get-fnsym-args-string) ;; Emacsā„25 - (elisp-get-fnsym-args-string - expander nil - (concat (propertize (symbol-name macro) + (concat (propertize (symbol-name macro) 'face 'font-lock-keyword-face) " ==> " (propertize (symbol-name macro) 'face 'font-lock-function-name-face) - ": "))))) + ": " + (elisp-get-fnsym-args-string expander nil ))))) (define-mode-local-override semantic-idle-summary-current-symbol-info semantic-grammar-mode () diff --git a/lisp/cedet/semantic/imenu.el b/lisp/cedet/semantic/imenu.el index 19e0515ac63..cdf0a23fa07 100644 --- a/lisp/cedet/semantic/imenu.el +++ b/lisp/cedet/semantic/imenu.el @@ -44,9 +44,8 @@ ;; Because semantic imenu tags will hose the current imenu handling ;; code in speedbar, force semantic/sb in. -(if (featurep 'speedbar) - (require 'semantic/sb) - (add-hook 'speedbar-load-hook (lambda () (require 'semantic/sb)))) +(with-eval-after-load 'speedbar + (require 'semantic/sb)) (defgroup semantic-imenu nil "Semantic interface to Imenu." diff --git a/lisp/cedet/semantic/wisent/comp.el b/lisp/cedet/semantic/wisent/comp.el index 4e9927f23f1..42c5756b987 100644 --- a/lisp/cedet/semantic/wisent/comp.el +++ b/lisp/cedet/semantic/wisent/comp.el @@ -3053,7 +3053,7 @@ one.") (defsubst wisent-ISVALID-TOKEN (x) "Return non-nil if X is a character or an allowed symbol." - (or (wisent-char-p x) + (or (characterp x) (wisent-ISVALID-VAR x))) (defun wisent-push-token (symbol &optional nocheck) @@ -3143,7 +3143,7 @@ the rule." (cond ((or (memq item token-list) (memq item var-list))) ;; Create new literal character token - ((wisent-char-p item) (wisent-push-token item t)) + ((characterp item) (wisent-push-token item t)) ((error "Symbol `%s' is used, but is not defined as a token and has no rules" item)))) (setq rhl (1+ rhl) diff --git a/lisp/cedet/semantic/wisent/wisent.el b/lisp/cedet/semantic/wisent/wisent.el index d8a35d3e7d3..a0a8bed1eaf 100644 --- a/lisp/cedet/semantic/wisent/wisent.el +++ b/lisp/cedet/semantic/wisent/wisent.el @@ -55,11 +55,8 @@ ;;;; Runtime stuff ;;;; ------------- -;;; Compatibility -(eval-and-compile - (if (fboundp 'char-valid-p) - (defalias 'wisent-char-p 'char-valid-p) - (defalias 'wisent-char-p 'char-or-char-int-p))) +(define-obsolete-function-alias 'wisent-char-p + #'characterp "28.1") ;;; Printed representation of terminals and nonterminals (defconst wisent-escape-sequence-strings @@ -80,7 +77,7 @@ (defsubst wisent-item-to-string (item) "Return a printed representation of ITEM. ITEM can be a nonterminal or terminal symbol, or a character literal." - (if (wisent-char-p item) + (if (characterp item) (or (cdr (assq item wisent-escape-sequence-strings)) (format "'%c'" item)) (symbol-name item))) diff --git a/lisp/cedet/srecode/document.el b/lisp/cedet/srecode/document.el index 4151b17c885..fdb44695918 100644 --- a/lisp/cedet/srecode/document.el +++ b/lisp/cedet/srecode/document.el @@ -89,7 +89,7 @@ versions of names. This is an alist with each element of the form: MATCH is a regexp to match in the type field. RESULT is a string." :group 'document - :type '(repeat (cons (string :tag "Regexp") + :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) (defcustom srecode-document-autocomment-function-alist @@ -145,7 +145,7 @@ see how best to describe what can be returned. Doesn't always work correctly, but that is just because English doesn't always work correctly." :group 'document - :type '(repeat (cons (string :tag "Regexp") + :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) (defcustom srecode-document-autocomment-common-nouns-abbrevs @@ -176,7 +176,7 @@ versions of names. This is an alist with each element of the form: MATCH is a regexp to match in the type field. RESULT is a string." :group 'document - :type '(repeat (cons (string :tag "Regexp") + :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) (defcustom srecode-document-autocomment-return-first-alist @@ -193,7 +193,7 @@ This is an alist with each element of the form: MATCH is a regexp to match in the type field. RESULT is a string." :group 'document - :type '(repeat (cons (string :tag "Regexp") + :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) (defcustom srecode-document-autocomment-return-last-alist @@ -214,7 +214,7 @@ MATCH is a regexp to match in the type field. RESULT is a string, which can contain %s, which is replaced with `match-string' 1." :group 'document - :type '(repeat (cons (string :tag "Regexp") + :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) (defcustom srecode-document-autocomment-param-alist @@ -234,7 +234,7 @@ RESULT is a string of text to use to describe MATCH. When one is encountered, document-insert-parameters will automatically place this comment after the parameter name." :group 'document - :type '(repeat (cons (string :tag "Regexp") + :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) (defcustom srecode-document-autocomment-param-type-alist @@ -259,7 +259,7 @@ This is an alist with each element of the form: MATCH is a regexp to match in the type field. RESULT is a string." :group 'document - :type '(repeat (cons (string :tag "Regexp") + :type '(repeat (cons (regexp :tag "Regexp") (string :tag "Doc Text")))) ;;;###autoload diff --git a/lisp/cedet/srecode/semantic.el b/lisp/cedet/srecode/semantic.el index 26c14892efd..5b2dd034743 100644 --- a/lisp/cedet/srecode/semantic.el +++ b/lisp/cedet/srecode/semantic.el @@ -201,7 +201,7 @@ variable default values, and other things." (let ((tag (or srecode-semantic-selected-tag (srecode-semantic-tag-from-kill-ring)))) (when (not tag) - "No tag for current template. Use the semantic kill-ring.") + (error "No tag for current template. Use the semantic kill-ring.")) (srecode-semantic-apply-tag-to-dict (srecode-semantic-tag (semantic-tag-name tag) :prime tag) diff --git a/lisp/cedet/srecode/srt-mode.el b/lisp/cedet/srecode/srt-mode.el index 6b8c3034a4c..4c1e030fceb 100644 --- a/lisp/cedet/srecode/srt-mode.el +++ b/lisp/cedet/srecode/srt-mode.el @@ -195,7 +195,7 @@ we can tell font lock about them.") (set (make-local-variable 'comment-end) "") (set (make-local-variable 'parse-sexp-ignore-comments) t) (set (make-local-variable 'comment-start-skip) - "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") + "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *") (set (make-local-variable 'font-lock-defaults) '(srecode-font-lock-keywords nil ;; perform string/comment fontification |