Problem reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-08/msg00085.html
* lisp/calendar/diary-lib.el (diary-glob-file-regexp-prefix):
Omit unnecessary ‘\’ before ordinary char.
* lisp/cedet/inversion.el (inversion-decoders):
* lisp/org/ob-haskell.el (org-babel-haskell-export-to-lhs):
Omit unnecessary ‘?’ after nullable pattern.
* lisp/org/org-capture.el (org-capture-fill-template):
Match upper-case as well as lower-case letters.
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings)
(c-after-change-mark-abnormal-strings):
Simplify ‘.|\r’ to ‘.’.
* lisp/progmodes/gdb-mi.el (gdb-jsonify-buffer):
Put ‘-’ at end of bracket expression.
This fixes bug #36897.
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings): Check
string fence text properties are actually present on string delimiters before
trying to remove them.
(c-before-change): Amend the nesting of unwind-protect, widen,
c-restore-string-fences, and c-clear-string-fences. Move
invalidate-state-cache to outside of the widening.
(c-after-change): Amend the nesting of unwind-protect, widen,
c-restore-string-fences, and c-clear-string-fences.
* lisp/progmodes/cc-engine.el (c-full-lit-near-cache): Amend the definition
such that an element's END element will be nil if the pertinent literal is
open at EOB.
(c-full-pp-to-literal): Before setting the aforementioned END element, check
that we're no longer in a literal. (c-literal-limits): When
c-full-pp-to-literal returns a list with a nil END element, replace this by
(point-max) to keep the interface of c-literal-limits unchanged.
* lisp/progmodes/cc-mode.el (c-after-change-mark-abnormal-strings): Having
found a string quote, check it is not inside an unterminated comment (i.e. one
at EOB).
* lisp/progmodes/cc-engine.el (c-looking-at-c++-attribute)
(c-enclosing-c++-attribute, c-slow-enclosing-c++-attribute): New macro and
functions.
(c-crosses-statement-barrier-p): Add [ into skip-chars for C++ Mode, and use
it to detect and skip over an attribute whilst scanning forward.
(c-sws-lit-type): Use the new value 'attribute.
(c-invalidate-sws-region-before): Put a save-match-data around this function.
Detect and handle an enclosing attribute at either END or BEG.
(c-invalidate-sws-region-after): Handle C++ attributes.
(c-forward-sws, c-backward-sws): Handle C++ attributes.
* lisp/progmodes/cc-mode.el (c-fl-decl-end): Detect and handle point being
inside a C++ attribute.
For this introduce the text property c-fl-syn-tab to "mirror" syntax-table.
* lisp/progmodes/cc-defs.el (c-is-escaped, c-will-be-escaped, c-put-syn-tab)
(c-clear-syn-tab, c-clear-syn-tab-properties, c-with-extended-string-fences):
new macros.
(c-point): Use c-is-escaped
(c-search-forward-char-property, c-search-backward-char-property)
(c-search-forward-char-property-with-value-on-char)
(c-search-forward-char-property-without-value-on-char): Fix regexp error
involving \n.
* lisp/progmodes/cc-engine.el (c-semi-pp-to-literal): User
c-with-extended-string-fences around a parse-partial-sexp.
(c-full-get-near-cache-entry): Fix an off-by-one error.
(c-full-pp-to-literal): Avoid writing duplicate entries into a cache.
(c-after-change-unmark-raw-strings): Use c-clear-syn-tab-properties.
* lisp/progmodes/cc-mode.el (c-leave-cc-mode-mode): Clear the c-fl-syn-tab
properties, too.
(c-basic-common-init): Mark c-fl-syn-tab as a non-sticky text property.
(c-depropertize-new-text): Also handle c-fl-syn-tab.
(c-multiline-string-check-final-quote, c-parse-quotes-after-change): Use
c-is-escaped.
(c-fl-syn-tab-region): New variable.
(c-clear-string-fences, c-restore-string-fences, c-remove-string-fences): New
functions.
(c-before-change-check-unbalanced-strings)
(c-after-change-mark-abnormal-strings, c-after-change-escape-NL-in-string):
Use the new functions and macros.
(c-before-change, c-after-change, c-font-lock-fontify-region): Restore the
syntax-table text properties from c-fl-syn-tab text properties for these
functions.
(c-electric-pair-inhibit-predicate): Test the c-fl-syn-tab property rather
than syntax-table.
Also finishes the fix for bug #36423.
* lisp/progmodes/cc-mode.el (c-initialize-cc-mode): Add an `eval-after-load'
to set electric-pair-inhibit-predicate for existing CC Mode buffers when
elec-pair.elc gets loaded.
(c-basic-common-init): Set electric-pair-inhibit-predicate when a CC Mode mode
gets initialized.
(c-electric-pair-inhibit-predicate): New function.
Also fix two faulty regexps, save-match-data, and check c-major-mode-is
'c++-mode where needed.
* lis/progmodes/cc-langs.el (c-last-c-comment-end-on-line-re)
(c-last-open-c-comment-start-on-line-re): Handle repeated *s in regexp
correctly.
* lisp/progmodes/cc-engine.el (c-beginning-of-macro, c-end-of-macro): Protect
the match-data with save-match-data around regexp operations.
(c-end-of-macro): In the loop handling multiline block comments, check a
comment actually is multiline.
* lisp/progmodes/cc-mode.el (c-depropertize-CPP): Only call
c-depropertize-raw-strings-in-region in C++ Mode.
* lisp/progmodes/cc-fonts.el (c-before-font-lock-functions): Add function
c-after-change-escape-NL-in-string into value for most languages.
* lisp/progmodes/cc-mode.el (c-after-change-escape-NL-in-string): New
function.
(c-before-change-check-unbalanced-strings): Handle the making and breaking of
escaped newlines, by removal or addition of text.
This is because these variables are needed at runtime even when cc-fonts.el
hasn't been loaded, as in XEmacs when font locking hasn't been enabled.
* lisp/progmodes/cc-fonts.el (c-doc-line-join-re)
(c-doc-bright-comment-start-re, c-doc-line-join-end-ch): Move definitions to
cc-mode.el.
* lisp/progmodes/cc-defs.el: (c-syntax-table-hwm): Move the defvar to here
from cc-mode.el, since the variable is needed at compile time in
c-emacs-features.
(c-min-property-position): New macro.
(c-put-char-property, c-clear-char-property, c-clear-char-properties)
(c-clear-char-property-with-value-function)
(c-clear-char-property-with-value-on-char-function)
(c-put-char-properties-on-char): Adjust c-syntax-table-hwm appropriately when
syntax-table text properties are changed.
* lisp/progmodes/cc-engine.el (c-truncate-lit-pos-cache): Remove the now
unneeded setting of c-syntax-table-hwm, and the unneeded declaration of
c-syntax-table-hwm.
* lisp/progmodes/cc-engine.el (c-end-of-macro): Check for being in a
degenerate zero length "macro", when setting the macro cache.
(c-determine-+ve-limit): Add in a missing goto-char form for when start-pos is
non-nil.
(c-back-over-member-initializers): Add a search limit parameter.
* lisp/progmodes/cc-fonts.el (c-get-fontification-context): Add a search limit
to c-go-up-list-backward.
(c-font-lock-cut-off-declarators): Add a search limit to
c-back-over-member-initializers.
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings): Don't
set c-new-END to the end of logical line (which might be a long macro).
(c-after-change-mark-abnormal-strings): Calculate end-hwm in place of the
setting of c-new-END (above). Use this as a search limit rather than
c-new-END.
This variable was declared after an invocation of a defsubst which used it,
the defsubst being in another file.
* lisp/progmodes/cc-mode (c-syntax-table-hwm): Move the declaration to earlier
in the file.
* lisp/progmodes/cc-engine.el (c-truncate-lit-pos-cache): Maintain the new
variable c-syntax-table-hwm after buffer changes.
* lisp/progmodes/cc-mode.el (c-syntax-table-hwm): New variable.
(c-before-change): Set c-syntax-table-hwm to "infinity".
(c-after-change): Call syntax-ppss-flush-cache, just before a font locking is
due to take place.
(Final Commit)
* lisp/progmodes/cc-engine.el (c-semi-trim-near-cache): Correct a comparison
with the wrong ...-limit variable.
(c-semi-pp-to-literal): Remove a wrong setting of c-lit-pos-cache-limit.
(c-full-get-near-cache-entry): Eliminate extravagant and unneeded coding.
(c-state-cache-init, c-record-parse-state-state): No longer manipulate
c-lit-pos-cache, which is no longer regarded as part of c-parse-state.
* lisp/progmodes/cc-mode.el (c-basic-common-init): Call
c-truncate-lit-pos-cache to initialize the literal cache.
(Intermediate commit)
* lisp/progmodes/cc-engine.el, lisp/progmodes/cc-fonts.el
* lisp/progmodes/cc-mode.el : Rename:
c-state-semi-nonlit-pos-cache -> c-lit-pos-cache,
c-state-semi-nonlit-pos-cache-limit -> c-lit-pos-cache-limit,
c-state-semi-nonlit-near-cache -> c-semi-lit-near-cache,
c-truncate-semi-nonlit-pos-cache -> c-truncate-lit-pos-cache,
c-state-semi-trim-near-cache -> c-semi-trim-near-cache,
c-state-semi-get-near-cache-entry -> c-semi-get-near-cache-entry,
c-state-semi-put-near-cache-entry -> c-semi-put-near-cache-entry,
c-state-semi-pp-to-literal -> c-semi-pp-to-literal,
c-state-full-pp-to-literal -> c-full-pp-to-literal,
c-state-semi-trim-cache -> c-trim-lit-pos-cache.
* lisp/progmodes/cc-engine.el (c-semi-near-cache-limit): New variable.
(c-truncate-lit-pos-cache): This now truncates the cache variables for all
three lit- sub-caches.
(c-semi-put-near-cache-entry): Increase c-semi-near-cache-limit to the
position of the new entry.
(c-full-near-cache-limit, c-full-lit-near-cache): New variables.
(c-full-trim-near-cache, c-full-get-near-cache-entry)
(c-full-put-near-cache-entry): New functions.
(c-full-pp-to-literal): Amend to use the new functions, and to optimize the
use of the available caches, similarly to c-semi-pp-to-literal.
Make it possible to control the relative ordering of functions on hooks by
specifying `depth` in the same was as was possible with `add-function`.
* lisp/electric.el (electric--sort-post-self-insertion-hook):
Delete function.
(electric-indent-mode, electric-layout-mode, electric-quote-mode):
* lisp/elec-pair.el (electric-pair-mode): Use new `depth` arg instead of
electric--sort-post-self-insertion-hook.
* lisp/emacs-lisp/syntax.el (syntax-propertize, syntax-ppss):
Use new `depth` arg to make sure noone accidentally gets added
after syntax-ppss-flush-cache.
* doc/lispref/modes.texi (Setting Hooks): Document new `depth` arg.
* test/lisp/subr-tests.el (subr-tests-add-hook-depth): New test.
This is mainly by enhancing a parse-partial-sexp cache to retain recently
calculated values. Also, there are several miscellaneous optimizations and
bug fixes.
* lisp/progmodes/cc-engine.el (c-state-semi-nonlit-near-cache): New buffer
local variable.
(c-state-semi-trim-near-cache, c-state-semi-get-near-cache-entry)
(c-state-semi-put-near-cache-entry, c-state-semi-trim-cache): New functions.
(c-state-semi-pp-to-literal, c-state-full-pp-to-literal): Use the new "near"
cache.
(c-parse-ps-state-below): Use the new function c-state-semi-trim-cache.
(c-before-change-check-<>-operators): Check simply for < or > in the
neighbourhood before doing more expensive processing.
(c-maybe-re-mark-raw-string): Give a backward search limit to an operation
which was needlessly lacking one.
* lisp/progmodes/cc-mode.el (c-doc-fl-decl-start, c-doc-fl-decl-end): Check a
certain regexp is valid before performing the (somewhat expensive) actions of
these functions.
(c-fl-decl-start): In the search for a C++ lambda capture list, replace (slow)
calculation of c-parse-state by a (less slow) c-go-up-list-backward.
In particular, the second apostrophe must also get font-lock-warning-face.
* lisp/progmodes/cc-mode.el (c-parse-quotes-before-change)
(c-parse-quotes-after-change): Add cond arms to recognize and handle the
anomalous construct '\'. Correct the handling of c-new-BEG in
c-parse-quotes-before-change.
E.g., on typing the closing delimiter of a string continued onto a second
line, the opening delimiter retained its font-lock-warning-face.
* lisp/progmodes/cc-defs.el (c-c++-raw-string-opener-re)
(c-c++-raw-string-opener-1-re): New constants.
(c-sub-at-c++-raw-string-opener, c-at-c++-raw-string-opener): New macros.
* lisp/progmodes/cc-engine.el (c-raw-string-pos)
(c-depropertize-raw-strings-in-region, c-after-change-unmark-raw-strings):
Replace uses of open-coded raw string regexps by the new constants and macros
in cc-defs.el.
* lisp/progmodes/cc-fonts.el (c-font-lock-raw-strings): Ditto
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings): Set
c-new-BEG to the beginning of the string when we encounter its closing ".
When not in a raw string, but in a string, clear syntax-table properties from
its delimiters and set c-new-BEG/END to its limits.
(c-after-change-mark-abnormal-strings): When applying syntax-table properties
to string delimiters, also set c-new-BEG/END to ensure subsequent
fontification.
* lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare)
(c-font-lock-objc-methods) (c-font-lock-declarations, c-font-lock-enum-tail)
(c-font-lock-cut-off-declarators, c-font-lock-enclosing-decls): If the chunk
been fontified consists entirely of comments and strings, don't attempt to
perform the function's action.
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings): Don't
expand (c-new-BEG c-new-END) unnecessarily to the entire raw string being
fontified.
(c-fl-decl-start, c-fl-decl-end): When in a (raw or otherwise) string, don't
return a position outside of the string (which used to cause unneeded
fontification).
* lisp/progmodes/cc-engine.el (c-forward-sws, c-backward-sws): Recognize
matches of c-doc-line-join-re as syntactic whitespace.
(c-find-decl-prefix-search): Recognize and move over matches of
c-doc-line-join-re as whitespace.
(c-find-decl-spots): Before moving backward a char, check (bobp). Before
moving forward over a comment, check it isn't possibly a "bright" comment.
* lisp/progmodes/cc-fonts.el (c-get-doc-comment-style): New function,
extracted from c-compose-keywords-list.
(c-compose-keywords-list): Call the above new function.
(pike-font-lock-keywords, pike-font-lock-keywords-2)
(pike-font-lock-keywords-3): Call c-set-doc-comment-res.
(c-doc-line-join-re, c-doc-bright-comment-start-re, c-doc-line-join-end-ch):
New variables.
(c-set-doc-comment-re-element, c-set-doc-comment-char-list): New macros.
(c-set-doc-comment-res): New function.
(c-font-lock-doc-comments): For consistency and repeatability, in a sequence
of C++ style doc comments, don't fontify the region between BOL and the
comment marker.
(autodoc-line-join-re, autodoc-bright-comment-start-re)
(autodoc-line-join-end-ch): New variables.
* lisp/progmodes/cc-mode.el (c-doc-fl-decl-start, c-doc-fl-decl-end): New
functions.
(c-change-expand-fl-region, c-context-expand-fl-region): Call the above two
new functions for extra possibilities for the start and end of a construct.
* doc/misc/cc-mode.texi (Doc Comments): Add a sentence drawing attention to
the possibility of fontifying constructs within a doc comment.
Also fix the bug where the delimiters of '\033', etc. got the error face.
* lisp/progmodes/cc-langs.el (c-single-quotes-quote-strings): Enhance the docr
string.
(c-string-delims): Change doc string to doc comment.
* listp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings): In
searches and comparisons, take account of the string delimiters possibly
being '. Fix argument in call of c-before-change-check-unbalanced-strings.
(c-parse-quotes-before-change, c-parse-quotes-after-change): Bind
case-fold-search to nil. Analyze escape constructs inside character constants
more accurately, in particular accepting as valid more than one character
after /[0-7], /x, /u, and /U. Amend calculations to account for this extra
length.
Integrate the handling of raw string and ordinary string fontification.
* lisp/progmodes/cc-defs.el (c-font-lock-flush)
(c-search-forward-char-property-without-value-on-char): new macros.
(c-point): In the 'eoll arm, check for eobp.
(c-search-forward-char-property-with-value-on-char): Handle the &optional
limit argument being nil.
(c-clear-char-property-with-value-on-char-function)
(c-clear-char-property-with-value-on-char): Return the position of the first
cleared property.
* lisp/progmodes/cc-engine.el (c-find-decl-prefix-search): Don't spuriously
recognize the change of face at a ) as the start of a string (a
"pseudo match").
(c-old-beg-rs c-old-end-rs): New variables.
(c-raw-string-pos): Analyze raw string delimiters more carefully.
(c-raw-string-in-end-delim): New function.
(c-depropertize-raw-string): Largely rewritten.
(c-before-change-check-raw-strings): New functionality: only remove the
syntax-table text properties from raw strings whose delimiters are about to
change.
(c-propertize-raw-string-id): New function.
(c-after-change-re-mark-raw-strings): Remove, incorporating functionality into
other functions.
(c-propertize-raw-string-opener): Largely rewritten.
(c-after-change-re-mark-raw-strings): Removed.
(c-after-change-unmark-raw-strings, c-after-change-unmark-raw-strings): New
functions.
* lisp/progmodes/cc-fonts.el (c-font-lock-raw-strings): Largely rewritten.
* lisp/progmodes/cc-langs.el (c-before-font-lock-functions): Replace
c-after-change-re-mark-unbalanced-strings by
c-after-change-mark-abnormal-strings in the t, c+objc, c++ and java sections.
Add c-after-change-unmark-raw-strings and remove
c-after-change-re-mark-raw-strings from the c++ section.
* lisp/progmodes/cc-mode.el (c-old-BEG c-old-END): Remove.
(c-old-END-literality): New variable.
(c-depropertize-CPP): Remove syntax-table properties from raw strings within
macros.
(c-before-change-check-unbalanced-strings): Call
c-truncate-semi-nonlit-pos-cache to preserve the integrity of the cache.
(c-before-change-check-unbalanced-strings): Call
c-truncate-semi-nonlit-pos-cache, largely rewritten.
(c-after-change-re-mark-unbalanced-strings): Renamed to
c-after-change-mark-abnormal-strings. Call c-maybe-re-mark-raw-string.
while preserving the indentation of nested C++ uniform initialization.
* lisp/progmodes/cc-align.el (c-lineup-2nd-brace-entry-in-arglist)
(c-lineup-class-decl-init-+, c-lineup-class-decl-init-after-brace): New
indentation functions.
* lisp/progmodes/cc-engine.el (c-forward-class-decl): New function.
(c-do-declarators): New function, partially extracted from
c-font-lock-declarators, which now calls the new function.
(c-inside-bracelist-p): Amend the introductory comment.
(c-add-stmt-syntax): Add code to prevent the spurious recognition of a
'defun-block-intro when a brace pair is used as an initializer.
(c-evaluate-offset): No longer ignore vectors of length >= 2.
(c-calc-offset): Refactor clumsily nested `if'/`or' into a cond form.
* lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Replace the bulk of
this function by a call to the new c-forward-class-decl.
* lisp/progmodes/cc-langs.el (c-type-decl-prefix-key): Recognize "~" as a
type decl operator.
* lisp/progmodes/cc-mode.el (c-fl-decl-start): While searching backward for a
"}" at an EOD, deal with actually finding the end of a brace list.
* doc/misc/cc-mode.texi (List Line-Up): document
c-lineup-2nd-brace-entry-in-arglist, c-lineup-class-decl-init-+, and
c-lineup-class-decl-init-after-brace.
* lisp/progmodes/cc-styles.el (c-style-alist): In styles "gnu", "bsd",
"stroustrup", "python", and "java", change the offset for brace-list-intro
from the default value or c-lineup-arglist-intro-after-paren to a list
beginning with the symbol first, followed by two of the new alignment
functions, followed by +.
* lisp/progmodes/cc-vars.el (c-offset-alist): Change the default value of
brace-list-entry from c-lineup-under-anchor back to 0.
Fix handling of CC Mode's syntactic WS cache. Make noise-macro option
variables buffer local.
* lisp/progmodes/cc-engine.el (c-put-is-sws, c-put-in-sws, c-remove-is-sws)
(c-remove-in-sws c-remove-is-and-in-sws): Add edebug specs.
(c-invalidate-sws-region-before): Add a `beg' parameter. Handle noise
macros like other literals.
(c-invalidate-sws-region-after-del): Move the adjustment of (cdr
c-sws-lit-limits) due to buffer change to c-invalidate-sws-region-after.
(c-invalidate-sws-region-after-ins): Move (goto-char end) to the correct
place.
(c-invalidate-sws-region-after): Adjust (cdr c-sws-lit-limits) due to buffer
change. Handle noise macros.
(c-backward-sws): Set simple-ws-beg appropriately when the start point is in
the middle of a noise macro.
(c-forward-decl-or-cast-1): Recognize a function identifier being declared in
parentheses.
* lisp/promodes/cc-mode.el (c-before-change): Supply a `beg' argument to
c-invalidate-sws-region-before.
* lisp/progmodes/cc-vars.el (c-noise-macro-with-parens-name-re)
(c-noise-macro-name-re, c-noise-macro-names, c-noise-macro-with-parens-names):
Make these buffer local variables.
b94d767 (origin/emacs-26) Minor copyedits in last manual change
73508e6 Improve documentation of face numbers
bf235ce * doc/emacs/custom.texi (Authentication): Refer to the "Help ...
ceccb3c New node Authentication in the Emacs manual
9078f34 Fix a loop in c-fl-decl-start. This fixes bug #34186.
a177fe7 Fix LaTeX output of month and day from cal-tex.el
90177d7 Avoid elisp crash for OpenPGP User IDs with no e-mail address
68e55a0 image-mode: Do not use default scaling (bug#33990)
b6c762a create-image: Expand documentation (bug#33990)
928d342 Improve documentation of 'isearch-filter-predicate'
9034dd6 Fix cursor column positioning on Grep hits
# Conflicts:
# doc/emacs/custom.texi
* lisp/progmodes/cc-mode.el (c-fl-decl-start) In the pair of operations
c-syntactic-skip-backward and c-forward-syntactic-ws, ensure the latter
doesn't come back to the position before the former, and break out of the
enclosing loop if it does.
* lisp/progmodes/cc-mode.el (c-fl-decl-start): A c-forward-syntactic-ws leaves
point inside whitespace when moving over a comment at EOB which has no
terminating LF. Check this possibility and correct for it.
Fixes bug #33163
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings):
Use the correct variable `end' in place of the wrong `c-new-END'.
(c-after-change-re-mark-unbalanced-strings): Correct a logic error whilst
skipping over comments.
55c9bb9f3c Fix comint-get-old-input-default for output field case (Bu...
26819cd1c0 ; ChangeLog.3: Fix typo.
e35a08ea4b Prevent infloop in 'delete-trailing-whitespace'
* lisp/progmodes/cperl-mode.el:
* lisp/progmodes/cc-engine.el:
* lisp/progmodes/cc-mode.el: Fix tabs mixed with space preventing
commit hook from succeeding.
("Unconstrained" meaning that every string is multiline, without needing such
special marking as used by Pike Mode.)
* lisp/progmodes/cc-mode.el (c-pps-to-string-delim): Don't process the char
before BOB.
(c-multiline-string-check-final-quote): New function.
(c-bc-changed-stringiness): New variable.
(c-before-change-check-unbalanced-strings): Add handling for unconstrained
multiline strings.
(c-after-change-re-mark-unbalanced-strings): Add handling for unconstrained
multiline strings. Handle escaped double quotes more accurately.
Except for the important detail that it doesn't make temporary files,
the new flymake-cc backend doesn't yet behave much differently from
the old flymake-proc-legacy-flymake, i.e. it still needs a special
`check-syntax' Makefile target to provide the compiler and compilation
flags. However, the new infrastructure created should allow less
intrusive cleverer flag guessers (yet to be written) to replace that
mechanism.
* lisp/progmodes/cc-mode.el (c-mode, c++-mode): Add to
flymake-diagnostic-functions.
* lisp/progmodes/flymake-cc.el: New file.
* lisp/progmodes/cc-mode.el (c-before-change-check-unbalanced-strings): Before
going back a sexp from the \n marked with a string-fence syntax-table text
property, check that it is indeed a \n. If not, simply delete that text
property from the isolated quote, not the quote and the \n which otherwise
delimit an unterminated string. Should we encounter a double quote marked
with a string-fence syntax-table text property at the end of the last line,
remove that property.
String delimiters, including escaped new lines, of correctly terminated
strings are left in font-lock-string-face. All others get
font-lock-warning-face. The latter get syntax-table text properties on the
opening string delim and the "terminating EOL".
Correct two miscellaneous bugs: the handling of text properties on Java Mode's
generic delimiters; the handling of c-just-done-before-change.
* lisp/progmodes/cc-defs.el (c-point): New position 'eoll "end of logical line".
(c-characterp): New macro.
* lisp/progmodes/cc-fonts.el (c-font-lock-invalid-string): Removed.
(c-basic-matchers-before): Use a simple matcher in place of the form around
c-font-lock-invalid-string.
* lisp/progmodes/cc-langs.el (c-get-state-before-change-functions): Add
c-before-change-check-unbalanced-strings to the value for all modes except AWK
Mode. Also add c-before-change-check-<>-operators to Java Mode, correcting an
error in that mode's handling of generic delimiters.
(c-before-font-lock-functions): Add c-after-change-re-mark-unbalanced-strings
to the value for all modes except AWK Mode.
(c-single-quotes-quote-strings, c-string-delims): New lang variables for
future enhancements.
(c-string-innards-re-alist): New lang variable.
* lisp/progmodes/cc-mode.el (c-just-done-before-change): Do not set this
variable when a change is the alteration of text properties.
(c-basic-common-init): Set parse-sexp-lookup-properties (and the XEmacs
equivalent) also for Pike Mode.
(c-neutralize-CPP-line): No longer neutralize unbalanced quotes here.
(c-unescaped-nls-in-string-p, c-multiline-string-start-is-being-detached)
(c-pps-to-string-delim, c-before-change-check-unbalanced-strings)
(c-after-change-re-mark-unbalanced-strings): New functions.
(c-after-change): Fix a bug with the handling of c-just-done-before-change.