aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2020-02-23 07:50:33 -0800
committerGlenn Morris2020-02-23 07:50:33 -0800
commiteb34c108e234c3195ae75f14ec6c5b0964f022ad (patch)
tree7f6d349aa681071783b493bbdfd99d79c1c1b975
parent4332964861a5a36a7f20daa2eeadab3bb5737193 (diff)
parentba7004b2a74c69450114c12ef4521768fc165e8e (diff)
downloademacs-eb34c108e234c3195ae75f14ec6c5b0964f022ad.tar.gz
emacs-eb34c108e234c3195ae75f14ec6c5b0964f022ad.zip
Merge from origin/emacs-27
ba7004b2a7 (origin/emacs-27) Shorten some ppss struct field names 693749c60f Java Mode: Fix fontification of variable decl inside `for' 884b68ca2c CC Mode: Fontify foo in "const auto foo :" correctly # Conflicts: # etc/NEWS
-rw-r--r--etc/NEWS.278
-rw-r--r--lisp/emacs-lisp/syntax.el26
-rw-r--r--lisp/progmodes/cc-engine.el30
3 files changed, 46 insertions, 18 deletions
diff --git a/etc/NEWS.27 b/etc/NEWS.27
index 380ac71260d..e9dfd266b46 100644
--- a/etc/NEWS.27
+++ b/etc/NEWS.27
@@ -3352,6 +3352,14 @@ backslash, although there is no harm in doing so to make the code
3352easier to edit with an older Emacs version. 3352easier to edit with an older Emacs version.
3353 3353
3354--- 3354---
3355** New symbolic accessor functions for a parse state list.
3356The new accessor functions 'ppss-depth', 'ppss-list-start',
3357'ppss-last-sexp-start', 'ppss-string-terminator', 'comment-depth',
3358'quoted-p', 'comment-style', 'comment-or-string-start', 'open-parens',
3359and 'two-character-syntax' can be used on the list value returned by
3360'parse-partial-sexp' and 'syntax-ppss'.
3361
3362---
3355** The 'server-name' and 'server-socket-dir' variables are set when a 3363** The 'server-name' and 'server-socket-dir' variables are set when a
3356socket has been passed to Emacs. 3364socket has been passed to Emacs.
3357 3365
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index 6b464bcb13a..11cc1988b1f 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -89,33 +89,33 @@ Put first the functions more likely to cause a change and cheaper to compute.")
89 (:constructor make-ppss) 89 (:constructor make-ppss)
90 (:copier nil) 90 (:copier nil)
91 (:type list)) 91 (:type list))
92 (depth nil :documentation "depth in parens") 92 (depth nil :documentation "Depth in parens.")
93 (innermost-start 93 (innermost-start
94 nil :documentation 94 nil :documentation
95 "character address of start of innermost containing list; nil if none.") 95 "Character address of start of innermost containing list; nil if none.")
96 (last-complete-sexp-start 96 (last-complete-sexp-start
97 nil :documentation 97 nil :documentation
98 "character address of start of last complete sexp terminated.") 98 "Character address of start of last complete sexp terminated.")
99 (string-terminator nil :documentation "\ 99 (string-terminator nil :documentation "\
100non-nil if inside a string. 100Non-nil if inside a string.
101(it is the character that will terminate the string, or t if the 101\(it is the character that will terminate the string, or t if the
102string should be terminated by a generic string delimiter.)") 102string should be terminated by a generic string delimiter.)")
103 (comment-nesting nil :documentation "\ 103 (comment-depth nil :documentation "\
104nil if outside a comment, t if inside a non-nestable comment, 104nil if outside a comment, t if inside a non-nestable comment,
105else an integer (the current comment nesting).") 105else an integer (the current comment nesting).")
106 (after-quote-p nil :documentation "t if following a quote character.") 106 (quoted-p nil :documentation "t if following a quote character.")
107 (minimum-paren-depth 107 (min-depth
108 nil :documentation "the minimum paren-depth encountered during this scan.") 108 nil :documentation "The minimum depth in parens encountered during this scan.")
109 (comment-style nil :documentation "style of comment, if any.") 109 (comment-style nil :documentation "Style of comment, if any.")
110 (comment-or-string-start 110 (comment-or-string-start
111 nil :documentation 111 nil :documentation
112 "character address of start of comment or string; nil if not in one.") 112 "Character address of start of comment or string; nil if not in one.")
113 (open-paren-positions 113 (open-parens
114 nil :documentation 114 nil :documentation
115 "List of positions of currently open parens, outermost first.") 115 "List of positions of currently open parens, outermost first.")
116 (two-character-syntax nil :documentation "\ 116 (two-character-syntax nil :documentation "\
117When the last position scanned holds the first character of a 117When the last position scanned holds the first character of a
118(potential) two character construct, the syntax of that position, 118\(potential) two character construct, the syntax of that position,
119otherwise nil. That construct can be a two character comment 119otherwise nil. That construct can be a two character comment
120delimiter or an Escaped or Char-quoted character.")) 120delimiter or an Escaped or Char-quoted character."))
121 121
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 0c338fa3868..bccef6890f8 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -9034,7 +9034,7 @@ point unchanged and return nil."
9034 (if (looking-at c-:-op-cont-regexp) 9034 (if (looking-at c-:-op-cont-regexp)
9035 (progn (goto-char (match-end 0)) t) 9035 (progn (goto-char (match-end 0)) t)
9036 (not 9036 (not
9037 (and (c-major-mode-is 'c++-mode) 9037 (and (c-major-mode-is '(c++-mode java-mode))
9038 (save-excursion 9038 (save-excursion
9039 (and 9039 (and
9040 (c-go-up-list-backward) 9040 (c-go-up-list-backward)
@@ -9275,9 +9275,10 @@ This function might do hidden buffer changes."
9275 ;; 9275 ;;
9276 ;; The third element of the return value is non-nil when the declaration 9276 ;; The third element of the return value is non-nil when the declaration
9277 ;; parsed might be an expression. The fourth element is the position of 9277 ;; parsed might be an expression. The fourth element is the position of
9278 ;; the start of the type identifier. The fifth element is t if either 9278 ;; the start of the type identifier, or the same as the first element when
9279 ;; CONTEXT was 'top, or the declaration is detected to be treated as top 9279 ;; there is no type identifier. The fifth element is t if either CONTEXT
9280 ;; level (e.g. with the keyword "extern"). 9280 ;; was 'top, or the declaration is detected to be treated as top level
9281 ;; (e.g. with the keyword "extern").
9281 ;; 9282 ;;
9282 ;; If a cast is parsed: 9283 ;; If a cast is parsed:
9283 ;; 9284 ;;
@@ -9680,7 +9681,26 @@ This function might do hidden buffer changes."
9680 (setq got-identifier (c-forward-name)) 9681 (setq got-identifier (c-forward-name))
9681 (setq name-start pos)) 9682 (setq name-start pos))
9682 (when (looking-at "[0-9]") 9683 (when (looking-at "[0-9]")
9683 (setq got-number t))) ; We've probably got an arithmetic expression. 9684 (setq got-number t)) ; We probably have an arithmetic expression.
9685 (and maybe-typeless
9686 (or (eq at-type 'maybe)
9687 (when (eq at-type 'found)
9688 ;; Remove the ostensible type from the found types list.
9689 (when type-start
9690 (c-unfind-type
9691 (buffer-substring-no-properties
9692 type-start
9693 (save-excursion
9694 (goto-char type-start)
9695 (c-end-of-token)
9696 (point)))))
9697 t))
9698 ;; The token which we assumed to be a type is actually the
9699 ;; identifier, and we have no explicit type.
9700 (setq at-type nil
9701 name-start type-start
9702 id-start type-start
9703 got-identifier t)))
9684 9704
9685 ;; Skip over type decl suffix operators and trailing noise macros. 9705 ;; Skip over type decl suffix operators and trailing noise macros.
9686 (while 9706 (while