diff options
Diffstat (limited to 'lisp/cedet/semantic')
-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 |
6 files changed, 55 insertions, 23 deletions
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))) |