summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-fonts.el
Commit message (Collapse)AuthorAgeFilesLines
* Orthographical amendments to commit 145aab0672ae259736ee9230f8e0ff4effa5f4fdAlan Mackenzie2020-06-091-9/+9
| | | | | | | * etc/NEWS: Correct the spelling of CC Mode. * lisp/progmodes/cc-fonts.el (doxygen-font-lock-doc-comments): Replace curly quotes in comments by ASCII ones.
* cc-mode: add support for Doxygen documentation styleMichal Nazarewicz2020-05-011-0/+78
| | | | | | | | * lisp/progmodes/cc-fonts.el (doxygen-font-lock-doc-comments, doxygen-font-lock-keywords): New constants defining Doxygen comment style support. * lisp/progmodes/cc-vars.el (c-doc-comment-style): Updated docstring to mention now-supported Doxygen mode.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* CC Mode. Allow fontification of "wrong" style comments with warning face.Alan Mackenzie2019-11-091-1/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bug #4192. * etc/NEWS: Add a new entry. * lisp/progmodes/cc-defs.el (c-font-lock-flush): New macro. * lisp/progmodes/cc-cmds.el (c-toggle-comment-style): On toggling the comment style, invoke c-font-lock-flush when c-mark-wrong-style-of-comment is non-nil, to cause that marking to be done instead on the other style of comment. * lisp/progmodes/cc-fonts.el (c-maybe-font-lock-wrong-style-comments): New function. (c-cpp-matchers): Call c-maybe-font-lock-wrong-style-comments when appropriate. * lisp/progmodes/cc-vars.el (c-mark-wrong-style-of-comment): New customizable option. * doc/misc/cc-mode.texi (top level, Indentation Commands, Guessing the Style, Custom Macros): For some opening quote marks, correct '' to ``. (Minor Modes): Add an xref to the new page "Wrong Comment Style" in a footnote. (Wrong Comment Style): New page.
* CC Mode. Fix slow scrolling by adding a search limit.Alan Mackenzie2019-11-021-1/+1
| | | | | | | This fixes bug #10149. * lisp/progmodes/cc-fonts.el (c-font-lock-single-decl) Limit the search by c-go-up-list-backwards to 500 non-literal characters.
* CC Mode: Stop /**/ spuriously fontifying as a doc comment under gtkdocAlan Mackenzie2019-07-271-1/+1
| | | | | | | | | | | Also fix infinite loops by correcting two regexps. * lisp/progmodes/cc-langs.el (c-last-c-comment-end-on-line-re) (c-last-open-c-comment-start-on-line-re): Correct the regexp fragments "\\*+[^/]" to "\\*+\\([^*/]\\|$\\)". * lisp/progmodes/cc-fonts.el (gtkdoc-font-lock-keywords): Disallow /**/ for doc comment fontification.
* * lisp/progmodes/cc-fonts.el (gtkdoc-font-lock-keywords): Fix faulty regexpAlan Mackenzie2019-07-171-1/+1
|
* C++ Mode: change the default doc comment style from nothing to gtkdocAlan Mackenzie2019-06-301-1/+1
| | | | | | | | | | | Also amend a pertinent regular expression. This fixes bug #11865. * lisp/progmodes/cc-vars.el (c-doc-comment-style): Insert an entry for c++-mode, namely gtkdoc. * lisp/progmodes/cc-fonts.el (gtkdoc-font-lock-keywords): Amend the regexp recognizing the introductory "/**" to allow subsequent characters on that line.
* Move defvars of c-doc-line-join-re + two others from cc-fonts.el to cc-mode.elAlan Mackenzie2019-06-171-4/+4
| | | | | | | | | 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.
* CC Mode: Remedy recent loss in performanceAlan Mackenzie2019-06-161-2/+6
| | | | | | | | | * lisp/progmodes/cc-engine.el (c-back-over-member-initializers): call c-parse-state outside of the narrowing operation. * lisp/progmodes/cc-fonts.el (c-get-fontification-context) (c-font-lock-cut-off-declarators): Replace calls to c-determine-limit with crude position calculations for speed.
* Depessimize bits of CC Mode for long C macros.Alan Mackenzie2019-06-131-2/+2
| | | | | | | | | | | | | | | | | | | * 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.
* Tidy up the literal cacheing in CC Mode, optimizing c-full-pp-to-literalAlan Mackenzie2019-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* Update author/maintainer infoPaul Eggert2019-05-261-2/+2
| | | | | Update email addresses and fix spellings of some author and maintainer names.
* Add standard unmatchable regexpMattias EngdegÄrd2019-05-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add `regexp-unmatchable' as a standard unmatchable regexp, defined as "\\`a\\`". Use it where such a regexp is needed, replacing slower expressions in several places. From a suggestion by Philippe Schnoebelen. * lisp/subr.el (regexp-unmatchable): New defconst. * etc/NEWS (Lisp Changes): Mention `regexp-unmatchable'. * doc/lispref/searching.texi (Regexp Functions): Document it. * lisp/emacs-lisp/regexp-opt.el (regexp-opt) * lisp/progmodes/cc-defs.el (cc-conditional-require-after-load) (c-make-keywords-re) * lisp/progmodes/cc-engine.el (c-beginning-of-statement-1) (c-forward-<>-arglist-recur, c-forward-decl-or-cast-1) (c-looking-at-decl-block) * lisp/progmodes/cc-fonts.el (c-doc-line-join-re) (c-doc-bright-comment-start-re) * lisp/progmodes/cc-langs.el (c-populate-syntax-table) (c-assignment-op-regexp) (c-block-comment-ender-regexp, c-font-lock-comment-end-skip) (c-block-comment-start-regexp, c-line-comment-start-regexp) (c-doc-comment-start-regexp, c-decl-start-colon-kwd-re) (c-type-decl-prefix-key, c-type-decl-operator-prefix-key) (c-pre-id-bracelist-key, c-enum-clause-introduction-re) (c-nonlabel-token-2-key) * lisp/progmodes/cc-mode.el (c-doc-fl-decl-start, c-doc-fl-decl-end) * lisp/progmodes/cc-vars.el (c-noise-macro-with-parens-name-re) (c-noise-macro-name-re, c-make-noise-macro-regexps) * lisp/progmodes/octave.el (octave-help-mode) * lisp/vc/vc-bzr.el (vc-bzr-log-view-mode, vc-bzr-revision-completion-table) * lisp/vc/vc-git.el (vc-git-log-view-mode) * lisp/vc/vc-hg.el (vc-hg-log-view-mode) * lisp/vc/vc-mtn.el (vc-mtn-log-view-mode): Use `regexp-unmatchable'. * lisp/textmodes/ispell.el (ispell-non-empty-string): Use `regexp-unmatchable', fixing a broken never-match regexp.
* * lisp/progmodes/cc-fonts.el: Silence some compiler warningsStefan Monnier2019-04-301-1/+1
| | | | (c-font-lock-declarators): Mark `id_end` and `not-top` as unused.
* CC Mode: in certain font lock loops, check point is not beyond limit.Alan Mackenzie2019-04-301-2/+4
| | | | | | | * /lisp/progmodes/cc-fonts.el (c-font-lock-enum-body) (autodoc-font-lock-line-markup): As part of the `while' condition, check that the previous iteration of the loop hasn't moved point past `limit', thus obviating "wrong side of point" errors in re-search-forward, etc.
* Restore fontification of delimiters of multiline CC Mode strings.Alan Mackenzie2019-04-251-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Optimize for typing characters into long C++ raw strings.Alan Mackenzie2019-04-231-395/+409
| | | | | | | | | | | | | | | * 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).
* Fix Pike Mode's autodoc doc comments style's continued lines.Alan Mackenzie2019-04-201-7/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Improve C++ raw string fontification.Alan Mackenzie2019-03-271-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Correct the indentation of CC Mode brace listsAlan Mackenzie2019-03-121-108/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
|\ | | | | | | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
| * Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | | | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* | Merge from origin/emacs-26Glenn Morris2018-12-201-2/+2
|\ \ | |/ | | | | | | 081fb69 (origin/emacs-26) Check result from c-backward-token-2 to avo... f4ea746 cl-make-random-state was not copying its arg
| * Check result from c-backward-token-2 to avoid infinite loopAlan Mackenzie2018-12-201-2/+2
| | | | | | | | | | | | | | This fixes bug #33784. * lisp/progmodes/cc-fonts.el (c-get-fontification-context): While moving back over enclosing parentheses, check that c-backward-token-2 actually moves.
* | Merge from origin/emacs-26Glenn Morris2018-12-101-3/+5
|\ \ | |/ | | | | 2075864 (origin/emacs-26) CC Mode: stop extra parens on expression ca...
| * CC Mode: stop extra parens on expression causing false fontification as typeAlan Mackenzie2018-12-101-3/+5
| | | | | | | | | | | | * lisp/progmodes/cc-fonts.el (c-get-fontification-context): recognize arithmetic operator followed by several open parentheses, not just one, as not being an argument list.
* | Replace insignificant backquotesMichael Heerdegen2018-11-251-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace most insignificant occurrences of '`' with a straight quote, sharp quote or nothing. This includes backquotes in 'pcase' patterns. * admin/admin.el: * lisp/apropos.el: * lisp/arc-mode.el: * lisp/auth-source.el: * lisp/avoid.el: * lisp/bindings.el: * lisp/bs.el: * lisp/calculator.el: * lisp/calendar/todo-mode.el: * lisp/cedet/semantic.el: * lisp/cedet/semantic/analyze/debug.el: * lisp/cedet/semantic/bovine.el: * lisp/cedet/semantic/dep.el: * lisp/cedet/semantic/grammar.el: * lisp/cedet/semantic/wisent/comp.el: * lisp/cedet/semantic/wisent/grammar.el: * lisp/cedet/srecode/mode.el: * lisp/cus-edit.el: * lisp/doc-view.el: * lisp/elec-pair.el: * lisp/electric.el: * lisp/emacs-lisp/autoload.el: * lisp/emacs-lisp/benchmark.el: * lisp/emacs-lisp/byte-opt.el: * lisp/emacs-lisp/bytecomp.el: * lisp/emacs-lisp/cconv.el: * lisp/emacs-lisp/cl-extra.el: * lisp/emacs-lisp/cl-generic.el: * lisp/emacs-lisp/cl-macs.el: * lisp/emacs-lisp/copyright.el: * lisp/emacs-lisp/debug.el: * lisp/emacs-lisp/eieio-compat.el: * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/generator.el: * lisp/emacs-lisp/inline.el: * lisp/emacs-lisp/macroexp.el: * lisp/emacs-lisp/map.el: * lisp/emacs-lisp/package-x.el: * lisp/emacs-lisp/package.el: * lisp/emacs-lisp/radix-tree.el: * lisp/emacs-lisp/smie.el: * lisp/epa.el: * lisp/erc/erc-dcc.el: * lisp/erc/erc-track.el: * lisp/erc/erc.el: * lisp/eshell/em-ls.el: * lisp/eshell/esh-cmd.el: * lisp/files.el: * lisp/filesets.el: * lisp/font-lock.el: * lisp/frameset.el: * lisp/gnus/gnus-agent.el: * lisp/gnus/gnus-art.el: * lisp/gnus/gnus-cite.el: * lisp/gnus/gnus-group.el: * lisp/gnus/gnus-msg.el: * lisp/gnus/gnus-salt.el: * lisp/gnus/gnus-srvr.el: * lisp/gnus/gnus-sum.el: * lisp/gnus/gnus-topic.el: * lisp/gnus/gnus-util.el: * lisp/gnus/gnus.el: * lisp/gnus/message.el: * lisp/gnus/mm-util.el: * lisp/gnus/mml.el: * lisp/gnus/nnheader.el: * lisp/gnus/nnimap.el: * lisp/gnus/nnmairix.el: * lisp/gnus/spam.el: * lisp/hexl.el: * lisp/hi-lock.el: * lisp/ibuf-ext.el: * lisp/ibuffer.el: * lisp/ido.el: * lisp/info.el: * lisp/international/mule-cmds.el: * lisp/international/mule-util.el: * lisp/json.el: * lisp/jsonrpc.el: * lisp/language/cyrillic.el: * lisp/language/european.el: * lisp/language/georgian.el: * lisp/language/tibetan.el: * lisp/language/utf-8-lang.el: * lisp/language/vietnamese.el: * lisp/ldefs-boot.el: * lisp/mail/mail-extr.el: * lisp/man.el: * lisp/menu-bar.el: * lisp/mh-e/mh-acros.el: * lisp/mh-e/mh-folder.el: * lisp/mh-e/mh-mime.el: * lisp/mh-e/mh-show.el: * lisp/mh-e/mh-speed.el: * lisp/minibuffer.el: * lisp/mpc.el: * lisp/net/ange-ftp.el: * lisp/net/hmac-def.el: * lisp/net/newst-backend.el: * lisp/net/quickurl.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-compat.el: * lisp/notifications.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/xesam.el: * lisp/org/ob-C.el: * lisp/org/ob-core.el: * lisp/org/ob-exp.el: * lisp/org/ob-groovy.el: * lisp/org/ob-haskell.el: * lisp/org/ob-io.el: * lisp/org/ob-lisp.el: * lisp/org/ob-lob.el: * lisp/org/ob-lua.el: * lisp/org/ob-octave.el: * lisp/org/ob-perl.el: * lisp/org/ob-python.el: * lisp/org/ob-ref.el: * lisp/org/ob-ruby.el: * lisp/org/ob-sql.el: * lisp/org/org-agenda.el: * lisp/org/org-capture.el: * lisp/org/org-clock.el: * lisp/org/org-colview.el: * lisp/org/org-duration.el: * lisp/org/org-element.el: * lisp/org/org-entities.el: * lisp/org/org-gnus.el: * lisp/org/org-indent.el: * lisp/org/org-info.el: * lisp/org/org-inlinetask.el: * lisp/org/org-lint.el: * lisp/org/org-list.el: * lisp/org/org-mouse.el: * lisp/org/org-plot.el: * lisp/org/org-src.el: * lisp/org/org-table.el: * lisp/org/org.el: * lisp/org/ox-ascii.el: * lisp/org/ox-html.el: * lisp/org/ox-latex.el: * lisp/org/ox-man.el: * lisp/org/ox-md.el: * lisp/org/ox-org.el: * lisp/org/ox-publish.el: * lisp/org/ox-texinfo.el: * lisp/org/ox.el: * lisp/play/bubbles.el: * lisp/play/gamegrid.el: * lisp/progmodes/autoconf.el: * lisp/progmodes/cc-defs.el: * lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-fonts.el: * lisp/progmodes/cc-langs.el: * lisp/progmodes/cperl-mode.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/elisp-mode.el: * lisp/progmodes/flymake-cc.el: * lisp/progmodes/flymake.el: * lisp/progmodes/fortran.el: * lisp/progmodes/grep.el: * lisp/progmodes/gud.el: * lisp/progmodes/idlwave.el: * lisp/progmodes/js.el: * lisp/progmodes/m4-mode.el: * lisp/progmodes/make-mode.el: * lisp/progmodes/mixal-mode.el: * lisp/progmodes/modula2.el: * lisp/progmodes/octave.el: * lisp/progmodes/opascal.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/python.el: * lisp/progmodes/ruby-mode.el: * lisp/progmodes/sh-script.el: * lisp/progmodes/sql.el: * lisp/progmodes/verilog-mode.el: * lisp/ps-mule.el: * lisp/rtree.el: * lisp/ruler-mode.el: * lisp/ses.el: * lisp/simple.el: * lisp/startup.el: * lisp/subr.el: * lisp/term/ns-win.el: * lisp/textmodes/bibtex.el: * lisp/textmodes/conf-mode.el: * lisp/textmodes/css-mode.el: * lisp/textmodes/refill.el: * lisp/textmodes/sgml-mode.el: * lisp/textmodes/tex-mode.el: * lisp/tutorial.el: * lisp/url/url-dav.el: * lisp/url/url-gw.el: * lisp/url/url-http.el: * lisp/url/url-methods.el: * lisp/url/url-privacy.el: * lisp/vc/cvs-status.el: * lisp/vc/diff-mode.el: * lisp/vc/ediff-init.el: * lisp/vc/ediff-ptch.el: * lisp/vc/log-edit.el: * lisp/vc/log-view.el: * lisp/vc/pcvs-info.el: * lisp/vc/pcvs.el: * lisp/vc/smerge-mode.el: * lisp/vc/vc-git.el: * lisp/vc/vc-hg.el: * lisp/vc/vc-mtn.el: * lisp/vc/vc-rcs.el: * lisp/whitespace.el: * lisp/window.el: * test/lisp/electric-tests.el: * test/lisp/emacs-lisp/cl-lib-tests.el: * test/lisp/emacs-lisp/ert-tests.el: * test/lisp/epg-tests.el: * test/lisp/jsonrpc-tests.el: * test/src/data-tests.el: * test/src/json-tests.el: Replace most insignificant backquotes.
* | Add ~44 edebug specs to CC Mode.Alan Mackenzie2018-10-151-0/+3
| | | | | | | | | | | | | | | | | | * lisp/progmodes/cc-cmds.el, lisp/progmodes/cc-defs.el lisp/progmodes/cc-engine.el, lisp/progmodes/cc-fonts.el lisp/progmodes/cc-langs.el: Add lots of edebug specs. * lisp/progmodes/cc-engine.el (c-state-maybe-marker): Tidy up so as to evaluate an argument only once at runtime.
* | Enhance CC Mode's fontification, etc., of unterminated strings.Alan Mackenzie2018-05-201-33/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | CC Mode: Fix an enum intro being parsed as defun-block-introAlan Mackenzie2018-02-021-4/+3
|/ | | | | | | | | | | * lisp/progmodes/cc-engine.el (c-inside-bracelist-p): Return a bufpos rather than t for the enum case. (c-add-stmt-syntax, c-guess-continued-construct): Replace c-looking-at-or-maybe-in-bracelist by c-inside-bracelist-p, since the former does not recognize enum brace lists, but the latter does. * lisp/progmodes/cc-fonts.el (c-get-fontification-context): Replace c-looking-at-or-maybe-in-bracelist by c-inside-bracelist-p.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Fix loss of documentation face in certain CC Mode doc comment situationsAlan Mackenzie2017-12-211-3/+10
| | | | | | | * lisp/progmodes/cc-fonts.el (c-font-lock-doc-comments): Take into account the possibility of font-lock-comment-delimiter-face. Test rigorously for "/**" (etc.) being itself inside a literal, rather than just depending on the face of the previous character.
* Don't misfontify "foo ()" inside C++ initialization parentheses as a typeAlan Mackenzie2017-12-131-1/+13
| | | | | | | | | | | | | | | | | Also recognize and handle function names introduced by "extern" inside a function. * lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): Add a new element to the result list which is t when our declaration is, or is to be treated as, being at top level. * lisp/progmodes/cc-fonts.el (c-get-fontification-context): Detect being inside a C++ uniform initialization and return (not-decl nil) for this case. (c-font-lock-declarations): Use the new element 4 of the result of c-forward-decl-or-cast-1. * lisp/progmodes/cc-langs.el (c-make-top-level-kwds, c-make-top-level-key): New lang consts/vars.
* Fix another "wrong side of point" error in CC Mode.Alan Mackenzie2017-10-261-4/+11
| | | | | | | | | | | | | | | This fixes (a follow-up to) bug #28850. A internal generated form for scanning text to fontify had a LIMIT parameter. It also locally bound LIMIT to a value possibly beyond the original LIMIT, allowing point to move beyond the original LIMIT, and to create the wrong side error. Fix it by checking point is not beyond LIMIT in the outer context before using it. * lisp/progmodes/cc-fonts.el (c-make-font-lock-search-form): Add a new parameter CHECK-POINT which, when non-nil, directs the function to generate a check on point. (c-make-font-lock-context-search-function): Invoke the above function with new argument value t.
* Fix a "wrong side of point" error in CC Mode. Fixes bug #28850.Alan Mackenzie2017-10-251-2/+2
| | | | | | | | | | | | The cause was a scanning over a bracket pair taking us beyond the supplied LIMIT parameter in c-forward-declarator. * lisp/progmodes/cc-engine.el (c-forward-declarator): Add three checks (< (point) limit) whilst dealing with tokens after the declared identifier. * lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Don't supply a LIMIT argument to `c-forward-declarator' (twice), since we want to fontify up till the end of a declarator, not an arbitrary jit-lock chunk end.
* Refactor c-forward-token-2 with new function c-forward-over-token-and-ws.Alan Mackenzie2017-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | Use the new function directly in several places where c-forward-token-2 wouldn't move over the last token in the buffer. This caused an infinite loop in c-restore-<>-properties. * lisp/progmodes/cc-engine.el (c-forward-over-token-and-ws): New function, extracted from c-forward-token-2. (c-forward-token-2): Refactor, calling the new function. (c-restore-<>-properties): Fix infinite loop. (c-forward-<>-arglist-recur, c-in-knr-argdecl) (c-looking-at-or-maybe-in-bracelist): Call the new function directly in place of c-forward-token-2. * lisp/progmodes/cc-cmds.el (c-defun-name) Call the new function directly in place of c-forward-token-2. * lisp/progmodes/cc-fonts.el (c-font-lock-enclosing-decls): Call the new function directly in place of c-forward-token-2.
* Fix irregularities with CC Mode fontification, particularly with "known types"Alan Mackenzie2017-10-051-105/+44
| | | | | | | | | | | | | | | | * lisp/progmodes/cc-fonts.el (c-font-lock-declarators): Introduce a new optional parameter, template-class. In "class <X = Y>", fontify "Y" as a type. (c-font-lock-single-decl): New variable template-class, set to non-nil when we have a construct like the above. Pass this as argument to c-font-lock-declarators. (c-font-lock-cut-off-declarators): Check more rigorously that a declaration being processed starts before the function's starting position. (c-complex-decl-matchers): Remove the redundant clause which fontified "types preceded by, e.g., "struct"". * lisp/progmodes/cc-langs.el (c-template-typename-kwds) (c-template-typename-key): New lang defconsts and defvar.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-1/+1
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Correct the fontification of C++ Mode enclosed declarations.Alan Mackenzie2017-08-311-12/+10
| | | | | | * lisp/progmodes/cc-fonts.el (c-font-lock-enclosing-decls): abolish the spurious check that the character before the start of an enclosed declaration must be ; or }. It might also be {.
* Fix C++ class initializers not always being fontified at mode start.Alan Mackenzie2017-07-271-3/+10
| | | | | | | | | | | | The problem here happened when an "outer list" of declarations moved beyond an "inner list" containing class initializers. These weren't being checked for by the code. Also, fix places in c-get-fontification-context where point is undefined. * lisp/progmodes/cc-fonts.el (c-get-fontification-context): when argument not-front-decl is set, test for class initializers. Also, anchor point in places where it is moved and is otherwise undefined.
* Fix variables in C++ "for" statement not always being fontified.Alan Mackenzie2017-07-271-4/+9
| | | | | | | The error happened when there was a comma inside template delimiters. * lisp/progmodes/cc-fonts.el (c-get-fontification-context): In "for" statements, recognise template delimiters containing "," and "&".
* Make C++ digit separators work. Amend the handling of single quotes generallyAlan Mackenzie2017-07-011-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Single quotes, even in strings and comments, are now marked with the "punctuation" syntax-table property, except where they are validly bounding a character literal. They are font locked with font-lock-warning-face except where they are valid. This is done in C, C++, ObjC, and Java Modes. * lisp/progmodes/cc-defs.el (c-clear-char-property-with-value-on-char-function) (c-clear-char-property-with-value-on-char, c-put-char-properties-on-char): New functions/macros. * lisp/progmodes/cc-fonts.el (c-font-lock-invalid-single-quotes): New function. (c-basic-matchers-before): invoke c-font-lock-invalid-single-quotes. * lisp/progmodes/cc-langs.el (c-get-state-before-change-functions): Remove c-before-after-change-digit-quote from wherever it occurs. Insert c-parse-quotes-before-change into the entries for the languages where it is needed. (c-before-font-lock-functions): Remove c-before-after-change-digit-quote from wherever it occurs. Insert c-parse-quotes-after-change into the entries for the languages which need it. (c-has-quoted-numbers): New lang-defconst/-defvar. * lisp/progmodes/cc-mode.el (c-before-after-change-digit-quote): Remove. (c-maybe-quoted-number-head, c-maybe-quoted-number-tail) (c-maybe-quoted-number): New defconsts. (c-quoted-number-head-before-point, c-quoted-number-tail-after-point) (c-quoted-number-straddling-point, c-parse-quotes-before-change) (c-parse-quotes-after-change): New functions.
* * lisp/progmodes/cc-fonts.el: Remove/mark unused varsStefan Monnier2017-06-251-7/+6
| | | | | | (c-font-lock-declarators): Remove unused vars `id-end', `paren-depth', and `brackets-after-id'. (c-font-lock-objc-methods): Mark unused args.
* Make CC Mode load cl-lib rather than cl in Emacs 26.Alan Mackenzie2017-06-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/cc-cmds.el (c-declaration-limits): Remove unused local variable. * lisp/progmodes/cc-defs.el (c--mapcan-status): Remove. (c--cl-library): New variable. (Top level): Amend the form which requires library cl or cl-lib. (c--mapcan, c--set-difference, c--intersection, c--macroexpand-all) (c--delete-duplicate): Amend to use c--cl-library instead of c--mapcan-status. * lisp/progmodes/cc-engine.el (c-syntactic-skip-backward) (c-back-over-compound-identifier): Remove unused local variables. * lisp/progmodes/cc-fonts.el (c-font-lock-declarations): Remove an unused local variable. * lisp/progmodes/cc-langs.el (Top level): Amend to use c--cl-library instead of c--mapcan-status. * lisp/progmodes/cc-styles.el (Top level): Add a cc-bytecomp-defun to try to silence a compiler warning.
* Ensure C++ initializer lists don't get fontified.Alan Mackenzie2017-06-161-74/+103
| | | | | | | | | | | | | | | * lisp/progmodes/cc-cmds.el (c-block-comment-flag): Move declaration to solve compiler warning. * lisp/progmodes/cc-fonts.el (c-get-fontification-context): Add an extra clause to handle C++ member initialization lists. (c-font-lock-single-decl): New function, extracted from c-font-lock-declarations. (c-font-lock-declarations): Call c-font-lock-single-decl in place of inline code. (c-font-lock-cut-off-declarators): Make more rigorous by calling c-get-fontification-context, c-forward-decl-or-cast-1, and c-font-lock-single-decl in place of rather approximate code.
* Fix fontification of C++ declaration with type FOO::FOO.Alan Mackenzie2017-04-221-1/+1
| | | | | | | | | | | * lisp/progmodes/cc-engine.el (c-find-decl-spots): Initialize cfd-top-level properly. (c-forward-decl-or-cast-1): On finding FOO::FOO, check it is followed by "(" before deciding it is a constructor. * lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare): Negate the result of the c-bs-at-toplevel-p call passed to c-font-lock-declarators (simple bug fix).
* Fix C++ fontification problems 500 bytes after typing a space, and other bugsAlan Mackenzie2017-03-301-89/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also implement the "asymmetric space" rule for fontifying otherwise ambiguous declarations/expressions. * lisp/progmodes/cc-engine.el (c-before-change-check-<>-operators): Don't set c-new-BEG or c-new-END when there is no need. (c-forward-decl-or-cast-1): Add "CASE 17.5" to implement the "asymmetric space" rule. * lisp/progmodes/cc-fonts.el (c-get-fontification-context): New function, extracted from c-font-lock-declarations. Add to this function processing to make `context' 'decl for lines contained within parens when these are also declarations. (c-font-lock-declarations): Call the newly extracted function above in place of inline code. * lisp/progmodes/cc-mode.el (c-fl-decl-start): Set point before calling c-literal-start. * lisp/progmodes/cc-vars.el (c-asymmetry-fontification-flag): New user option. * doc/misc/cc-mode.texi (Misc Font Locking): New node documenting the new "asymmetric fontification" rule, including the variable c-asymmetric-fontification-flag.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | | | | | Run admin/update-copyright.