Make c-emacs-features use the proper binding of parse-sexp-lookup-properties
This is relevant for bug #58558, although it does not fix it. Due to a wrong ordering of with-current-buffer and a let form, the function overwrote the global value of parse-sexp-lookup-properties and two other variables. * lisp/progmodes/cc-defs.el (c-emacs-features): Change the nesting of with-current-buffer and let so that the let bindings get used.
This commit is contained in:
parent
c9e2a5ec26
commit
09bf476836
1 changed files with 66 additions and 73 deletions
|
@ -2153,20 +2153,13 @@ non-nil, a caret is prepended to invert the set."
|
||||||
;; Record whether the `category' text property works.
|
;; Record whether the `category' text property works.
|
||||||
(if c-use-category (setq list (cons 'category-properties list)))
|
(if c-use-category (setq list (cons 'category-properties list)))
|
||||||
|
|
||||||
(let ((buf (generate-new-buffer " test"))
|
(let ((buf (generate-new-buffer " test")))
|
||||||
parse-sexp-lookup-properties
|
|
||||||
parse-sexp-ignore-comments
|
|
||||||
lookup-syntax-properties) ; XEmacs
|
|
||||||
(with-current-buffer buf
|
(with-current-buffer buf
|
||||||
|
(let ((parse-sexp-lookup-properties t)
|
||||||
|
(parse-sexp-ignore-comments t)
|
||||||
|
(lookup-syntax-properties t))
|
||||||
(set-syntax-table (make-syntax-table))
|
(set-syntax-table (make-syntax-table))
|
||||||
|
|
||||||
;; For some reason we have to set some of these after the
|
|
||||||
;; buffer has been made current. (Specifically,
|
|
||||||
;; `parse-sexp-ignore-comments' in Emacs 21.)
|
|
||||||
(setq parse-sexp-lookup-properties t
|
|
||||||
parse-sexp-ignore-comments t
|
|
||||||
lookup-syntax-properties t)
|
|
||||||
|
|
||||||
;; Find out if the `syntax-table' text property works.
|
;; Find out if the `syntax-table' text property works.
|
||||||
(modify-syntax-entry ?< ".")
|
(modify-syntax-entry ?< ".")
|
||||||
(modify-syntax-entry ?> ".")
|
(modify-syntax-entry ?> ".")
|
||||||
|
@ -2232,7 +2225,7 @@ non-nil, a caret is prepended to invert the set."
|
||||||
(setq list (cons 'col-0-paren list)))))
|
(setq list (cons 'col-0-paren list)))))
|
||||||
|
|
||||||
(set-buffer-modified-p nil))
|
(set-buffer-modified-p nil))
|
||||||
(kill-buffer buf))
|
(kill-buffer buf)))
|
||||||
|
|
||||||
;; Check how many elements `parse-partial-sexp' returns.
|
;; Check how many elements `parse-partial-sexp' returns.
|
||||||
(let ((ppss-size (or (c-safe (length
|
(let ((ppss-size (or (c-safe (length
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue