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
This commit is contained in:
Glenn Morris 2020-02-23 07:50:33 -08:00
commit eb34c108e2
3 changed files with 46 additions and 18 deletions

View file

@ -3351,6 +3351,14 @@ brackets at the start of a line inside documentation strings with a
backslash, although there is no harm in doing so to make the code
easier to edit with an older Emacs version.
---
** New symbolic accessor functions for a parse state list.
The new accessor functions 'ppss-depth', 'ppss-list-start',
'ppss-last-sexp-start', 'ppss-string-terminator', 'comment-depth',
'quoted-p', 'comment-style', 'comment-or-string-start', 'open-parens',
and 'two-character-syntax' can be used on the list value returned by
'parse-partial-sexp' and 'syntax-ppss'.
---
** The 'server-name' and 'server-socket-dir' variables are set when a
socket has been passed to Emacs.

View file

@ -89,33 +89,33 @@ Put first the functions more likely to cause a change and cheaper to compute.")
(:constructor make-ppss)
(:copier nil)
(:type list))
(depth nil :documentation "depth in parens")
(depth nil :documentation "Depth in parens.")
(innermost-start
nil :documentation
"character address of start of innermost containing list; nil if none.")
"Character address of start of innermost containing list; nil if none.")
(last-complete-sexp-start
nil :documentation
"character address of start of last complete sexp terminated.")
"Character address of start of last complete sexp terminated.")
(string-terminator nil :documentation "\
non-nil if inside a string.
(it is the character that will terminate the string, or t if the
Non-nil if inside a string.
\(it is the character that will terminate the string, or t if the
string should be terminated by a generic string delimiter.)")
(comment-nesting nil :documentation "\
(comment-depth nil :documentation "\
nil if outside a comment, t if inside a non-nestable comment,
else an integer (the current comment nesting).")
(after-quote-p nil :documentation "t if following a quote character.")
(minimum-paren-depth
nil :documentation "the minimum paren-depth encountered during this scan.")
(comment-style nil :documentation "style of comment, if any.")
(quoted-p nil :documentation "t if following a quote character.")
(min-depth
nil :documentation "The minimum depth in parens encountered during this scan.")
(comment-style nil :documentation "Style of comment, if any.")
(comment-or-string-start
nil :documentation
"character address of start of comment or string; nil if not in one.")
(open-paren-positions
"Character address of start of comment or string; nil if not in one.")
(open-parens
nil :documentation
"List of positions of currently open parens, outermost first.")
(two-character-syntax nil :documentation "\
When the last position scanned holds the first character of a
(potential) two character construct, the syntax of that position,
\(potential) two character construct, the syntax of that position,
otherwise nil. That construct can be a two character comment
delimiter or an Escaped or Char-quoted character."))

View file

@ -9034,7 +9034,7 @@ point unchanged and return nil."
(if (looking-at c-:-op-cont-regexp)
(progn (goto-char (match-end 0)) t)
(not
(and (c-major-mode-is 'c++-mode)
(and (c-major-mode-is '(c++-mode java-mode))
(save-excursion
(and
(c-go-up-list-backward)
@ -9275,9 +9275,10 @@ This function might do hidden buffer changes."
;;
;; The third element of the return value is non-nil when the declaration
;; parsed might be an expression. The fourth element is the position of
;; the start of the type identifier. The fifth element is t if either
;; CONTEXT was 'top, or the declaration is detected to be treated as top
;; level (e.g. with the keyword "extern").
;; the start of the type identifier, or the same as the first element when
;; there is no type identifier. The fifth element is t if either CONTEXT
;; was 'top, or the declaration is detected to be treated as top level
;; (e.g. with the keyword "extern").
;;
;; If a cast is parsed:
;;
@ -9680,7 +9681,26 @@ This function might do hidden buffer changes."
(setq got-identifier (c-forward-name))
(setq name-start pos))
(when (looking-at "[0-9]")
(setq got-number t))) ; We've probably got an arithmetic expression.
(setq got-number t)) ; We probably have an arithmetic expression.
(and maybe-typeless
(or (eq at-type 'maybe)
(when (eq at-type 'found)
;; Remove the ostensible type from the found types list.
(when type-start
(c-unfind-type
(buffer-substring-no-properties
type-start
(save-excursion
(goto-char type-start)
(c-end-of-token)
(point)))))
t))
;; The token which we assumed to be a type is actually the
;; identifier, and we have no explicit type.
(setq at-type nil
name-start type-start
id-start type-start
got-identifier t)))
;; Skip over type decl suffix operators and trailing noise macros.
(while