1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

Prefer setq-local in cedet

* lisp/cedet/data-debug.el (data-debug-mode):
* lisp/cedet/ede/custom.el (ede-customize-project):
* lisp/cedet/ede/project-am.el (project-am-load-makefile):
* lisp/cedet/mode-local.el (mode-local--activate-bindings):
* lisp/cedet/semantic.el (semantic--set-buffer-cache):
* lisp/cedet/semantic/analyze/debug.el
(semantic-analyzer-debug-add-buttons):
* lisp/cedet/semantic/grammar.el (semantic-grammar-mode):
* lisp/cedet/semantic/senator.el (senator-search-set-tag-class-filter):
(senator-isearch-mode-hook):
* lisp/cedet/semantic/symref/list.el
(semantic-symref-produce-list-on-results)
(semantic-symref-results-mode):
* lisp/cedet/semantic/util-modes.el (semantic-stickyfunc-mode):
* lisp/cedet/semantic/wisent/python.el (wisent-python-default-setup):
* lisp/cedet/srecode/srt-mode.el (srecode-template-mode):
Prefer setq-local.
This commit is contained in:
Stefan Kangas 2020-12-04 17:55:46 +01:00
parent e6320b11f0
commit a5fa79d50e
12 changed files with 59 additions and 68 deletions

View file

@ -881,9 +881,8 @@ If PARENT is non-nil, it is somehow related as a parent to thing."
(setq-local comment-start-skip
"\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
(buffer-disable-undo)
(set (make-local-variable 'font-lock-global-modes) nil)
(font-lock-mode -1)
)
(setq-local font-lock-global-modes nil)
(font-lock-mode -1))
;;;###autoload
(defun data-debug-new-buffer (name)

View file

@ -50,8 +50,7 @@
(let* ((ov (oref (ede-current-project) local-variables))
(cp (ede-current-project)))
(ede-customize cp)
(make-local-variable 'eieio-ede-old-variables)
(setq eieio-ede-old-variables ov)))
(setq-local eieio-ede-old-variables ov)))
;;;###autoload
(defalias 'customize-project 'ede-customize-project)

View file

@ -493,8 +493,7 @@ This is used when subprojects are made in named subdirectories."
:file fn)))
(oset ampf directory (file-name-directory fn))
(oset ampf configureoutputfiles cof)
(make-local-variable 'ede-object)
(setq ede-object ampf)
(setq-local ede-object ampf)
;; Move the rescan after we set ede-object to prevent recursion
(project-rescan ampf)
ampf))))

View file

@ -314,7 +314,7 @@ Elements are (SYMBOL . PREVIOUS-VALUE), describing one variable."
;; Do the normal thing.
(let (modes table old-locals)
(unless mode
(set (make-local-variable 'mode-local--init-mode) major-mode)
(setq-local mode-local--init-mode major-mode)
(setq mode major-mode))
;; Get MODE's parents & MODE in the right order.
(while mode

View file

@ -495,8 +495,7 @@ is requested."
(setq semantic--buffer-cache tagtable
semantic-unmatched-syntax-cache-check nil)
;; This is specific to the bovine parser.
(set (make-local-variable 'semantic-bovinate-nonterminal-check-obarray)
nil)
(setq-local semantic-bovinate-nonterminal-check-obarray nil)
(semantic-parse-tree-set-up-to-date)
(add-hook 'after-change-functions 'semantic-change-function nil t)
(run-hook-with-args 'semantic-after-toplevel-cache-change-hook

View file

@ -590,7 +590,7 @@ Look for key expressions, and add push-buttons near them."
(with-current-buffer "*Help*"
(let ((inhibit-read-only t))
(goto-char (point-min))
(set (make-local-variable 'semantic-analyzer-debug-orig) orig-buffer)
(setq-local semantic-analyzer-debug-orig orig-buffer)
;; First, add do-in buttons to recommendations.
(while (re-search-forward "^\\s-*M-x \\(\\(\\w\\|\\s_\\)+\\) " nil t)
(let ((fcn (match-string 1)))

View file

@ -1303,28 +1303,25 @@ the change bounds to encompass the whole nonterminal tag."
"Initialize a buffer for editing Semantic grammars.
\\{semantic-grammar-mode-map}"
(set (make-local-variable 'parse-sexp-ignore-comments) t)
(set (make-local-variable 'comment-start) ";;")
(setq-local parse-sexp-ignore-comments t)
(setq-local comment-start ";;")
;; 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]\\)\\(\\\\\\\\\\)*\\);+ *")
(set (make-local-variable 'indent-line-function)
'semantic-grammar-indent)
(set (make-local-variable 'fill-paragraph-function)
'lisp-fill-paragraph)
(set (make-local-variable 'font-lock-multiline)
'undecided)
(set (make-local-variable 'font-lock-defaults)
'((semantic-grammar-mode-keywords
semantic-grammar-mode-keywords-1
semantic-grammar-mode-keywords-2
semantic-grammar-mode-keywords-3)
nil ;; perform string/comment fontification
nil ;; keywords are case sensitive.
;; This puts _ & - as a word constituent,
;; simplifying our keywords significantly
((?_ . "w") (?- . "w"))))
(setq-local comment-start-skip
"\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
(setq-local indent-line-function #'semantic-grammar-indent)
(setq-local fill-paragraph-function #'lisp-fill-paragraph)
(setq-local font-lock-multiline 'undecided)
(setq-local font-lock-defaults
'((semantic-grammar-mode-keywords
semantic-grammar-mode-keywords-1
semantic-grammar-mode-keywords-2
semantic-grammar-mode-keywords-3)
nil ;; perform string/comment fontification
nil ;; keywords are case sensitive.
;; This puts _ & - as a word constituent,
;; simplifying our keywords significantly
((?_ . "w") (?- . "w"))))
;; Setup Semantic to parse grammar
(semantic-grammar-wy--install-parser)
(setq semantic-lex-comment-regex ";;"
@ -1338,16 +1335,14 @@ the change bounds to encompass the whole nonterminal tag."
(nonterminal . "Nonterminal")
(rule . "Rule")
))
(set (make-local-variable 'semantic-format-face-alist)
'(
(code . default)
(keyword . font-lock-keyword-face)
(token . font-lock-type-face)
(nonterminal . font-lock-function-name-face)
(rule . default)
))
(set (make-local-variable 'semantic-stickyfunc-sticky-classes)
'(nonterminal))
(setq-local semantic-format-face-alist
'((code . default)
(keyword . font-lock-keyword-face)
(token . font-lock-type-face)
(nonterminal . font-lock-function-name-face)
(rule . default)))
(setq-local semantic-stickyfunc-sticky-classes
'(nonterminal))
;; Before each change, clear the cached regexp used to highlight
;; macros local in this grammar.
(add-hook 'before-change-functions

View file

@ -472,9 +472,9 @@ filters in `senator-search-tag-filter-functions' remain active."
(if classes
(let ((tag (make-symbol "tag"))
(names (mapconcat 'symbol-name classes "', `")))
(set (make-local-variable 'senator--search-filter)
`(lambda (,tag)
(memq (semantic-tag-class ,tag) ',classes)))
(setq-local senator--search-filter
`(lambda (,tag)
(memq (semantic-tag-class ,tag) ',classes)))
(add-hook 'senator-search-tag-filter-functions
senator--search-filter nil t)
(message "Limit search to `%s' tags" names))
@ -857,17 +857,17 @@ Use a senator search function when semantic isearch mode is enabled."
;; senator one.
(when (and (local-variable-p 'isearch-search-fun-function)
(not (local-variable-p 'senator-old-isearch-search-fun)))
(set (make-local-variable 'senator-old-isearch-search-fun)
isearch-search-fun-function))
(set (make-local-variable 'isearch-search-fun-function)
'senator-isearch-search-fun))
(setq-local senator-old-isearch-search-fun
isearch-search-fun-function))
(setq-local isearch-search-fun-function
'senator-isearch-search-fun))
;; When `senator-isearch-semantic-mode' is off restore the
;; previous `isearch-search-fun-function'.
(when (eq isearch-search-fun-function 'senator-isearch-search-fun)
(if (local-variable-p 'senator-old-isearch-search-fun)
(progn
(set (make-local-variable 'isearch-search-fun-function)
senator-old-isearch-search-fun)
(setq-local isearch-search-fun-function
senator-old-isearch-search-fun)
(kill-local-variable 'senator-old-isearch-search-fun))
(kill-local-variable 'isearch-search-fun-function)))))

View file

@ -176,7 +176,7 @@ Display the references in `semantic-symref-results-mode'."
(switch-to-buffer-other-window buff)
(set-buffer buff)
(semantic-symref-results-mode)
(set (make-local-variable 'semantic-symref-current-results) res)
(setq-local semantic-symref-current-results res)
(semantic-symref-results-dump res)
(goto-char (point-min))))
@ -184,7 +184,7 @@ Display the references in `semantic-symref-results-mode'."
"Major-mode for displaying Semantic Symbol Reference results."
(buffer-disable-undo)
;; FIXME: Why bother turning off font-lock?
(set (make-local-variable 'font-lock-global-modes) nil)
(setq-local font-lock-global-modes nil)
(font-lock-mode -1))
(defcustom semantic-symref-results-summary-function 'semantic-format-tag-prototype

View file

@ -701,8 +701,8 @@ non-nil if the minor mode is enabled."
(when (and (local-variable-p 'header-line-format (current-buffer))
(not (eq header-line-format
semantic-stickyfunc-header-line-format)))
(set (make-local-variable 'semantic-stickyfunc-old-hlf)
header-line-format))
(setq-local semantic-stickyfunc-old-hlf
header-line-format))
(setq header-line-format semantic-stickyfunc-header-line-format))
;; Disable sticky func mode
;; Restore previous buffer local value of header line format if

View file

@ -503,10 +503,10 @@ Shortens `code' tags, but passes through for others."
(defun wisent-python-default-setup ()
"Setup buffer for parse."
(wisent-python-wy--install-parser)
(set (make-local-variable 'parse-sexp-ignore-comments) t)
(setq-local parse-sexp-ignore-comments t)
;; Give python modes the possibility to overwrite this:
(if (not comment-start-skip)
(set (make-local-variable 'comment-start-skip) "#+\\s-*"))
(setq-local comment-start-skip "#+\\s-*"))
(setq
;; Character used to separation a parent/child relationship
semantic-type-relation-separator-character '(".")

View file

@ -191,18 +191,18 @@ we can tell font lock about them.")
(define-derived-mode srecode-template-mode fundamental-mode "SRecode"
;; FIXME: Shouldn't it derive from prog-mode?
"Major-mode for writing SRecode macros."
(set (make-local-variable 'comment-start) ";;")
(set (make-local-variable 'comment-end) "")
(set (make-local-variable 'parse-sexp-ignore-comments) t)
(set (make-local-variable 'comment-start-skip)
"\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
(set (make-local-variable 'font-lock-defaults)
'(srecode-font-lock-keywords
nil ;; perform string/comment fontification
nil ;; keywords are case sensitive.
;; This puts _ & - as a word constituent,
;; simplifying our keywords significantly
((?_ . "w") (?- . "w")))))
(setq-local comment-start ";;")
(setq-local comment-end "")
(setq-local parse-sexp-ignore-comments t)
(setq-local comment-start-skip
"\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
(setq-local font-lock-defaults
'(srecode-font-lock-keywords
nil ;; perform string/comment fontification
nil ;; keywords are case sensitive.
;; This puts _ & - as a word constituent,
;; simplifying our keywords significantly
((?_ . "w") (?- . "w")))))
;;;###autoload
(defalias 'srt-mode 'srecode-template-mode)