aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc/cc-mode.texi (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Bug #41061 patch: Fix typos and amend code slightlyAlan Mackenzie2020-06-011-2/+2
| | | | | * lisp/progmodes/cc-align.el (c-lineup-ternary-bodies) * doc/misc/cc-mode.texi (Operator Line-Up): Fix typos and amend code.
* cc-mode: add ‘c-lineup-ternary-bodies’ (bug#41061)Michal Nazarewicz2020-05-091-0/+20
| | | | | | | | | | | | | | | Introduce ‘c-lineup-ternary-bodies’ function which, when used as a c lineup function, aligns question mark and colon of a ternary operator. For example: return arg % 2 == 0 ? arg / 2 : (3 * arg + 1); * lisp/progmodes/cc-align.el (c-lineup-ternary-bodies): New function. * doc/misc/cc-mode.texi (Operator Line-Up Functions): Document the new function. * test/lisp/progmodes/cc-mode-tests.el (c-lineup-ternary-bodies): New test case.
* cc-mode: document Doxygen ‘c-doc-comment-style’ (bug#40877)Michal Nazarewicz2020-05-031-0/+5
| | | | * doc/misc/cc-mode.texi (Documentation Comments): mention Doxygen markup.
* CC Mode: allow specified directives (e.g. pragma) to be indented as statementsAlan Mackenzie2020-03-081-2/+50
| | | | | | | | | | | | | | | | | | | * lisp/progmodes/cc-cmds.el (c-align-cpp-indent-to-body) (c-cpp-indent-to-body-flag, c-electric-pragma) (c-add-indent-to-body-to-abbrev-table, c-clear-stale-indent-to-body-abbrevs) (c-toggle-cpp-indent-to-body): New functions and variables. * lisp/progmodes/cc-langs.el (c-std-abbrev-keywords): New lang const/var. * lisp/progmodes/cc-mode.el (c-populate-abbrev-table): New function. (c-basic-common-init): call the c-populate-abbrev-table. (c-mode, c++-mode, objc-mode, java-mode, idl-mode, pike-mode, awk-mode): Remove the setting of MODE-abbrev-table. * lisp/progmodes/cc-vars.el (c-cpp-indent-to-body-directives): New defcustom. * doc/misc/cc-mode.texi (Custom Macros): Introduce and refer to .... (Indenting Directives): New page documenting the new mechanism.
* Finish the documentation for c-noise-macro-{,with-parens-}names.Alan Mackenzie2020-01-271-10/+12
| | | | | | | | | | | The doc strings and pertinent CC Mode manual page failed to mention that these variables could also be regular expressions. Amend them. * lisp/progmodes/cc-vars.el (c-noise-macro-names) (c-noise-macro-with-parens-names): Amend the doc strings. * doc/misc/cc-mode.texi (Noise Macros): Amend the descriptions of the two variables.
* 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-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update some URLsPaul Eggert2019-09-231-6/+6
| | | | | | | | | | | | | | | | | This mostly changes http: to https: in URLs. It also updates some URLs that have moved, removes some URLs that no longer work, recommends against using procmail (procmail.org no longer works), and removes some mentions of the no-longer-existing Gmane, LPF and VTW. It doesn't update all URLs, just the ones I had time for. * GNUmakefile (help): * admin/admin.el (manual-doctype-string): * admin/charsets/Makefile.in (${charsetdir}/ALTERNATIVNYJ.map): * admin/charsets/mapconv: * lisp/net/soap-client.el (soap-create-envelope): * lisp/org/org.el (org-doi-server-url): * lisp/textmodes/bibtex.el (bibtex-generate-url-list): Prefer https: to http: un URLs.
* Update CC Mode's version number to 5.34Alan Mackenzie2019-06-191-2/+2
| | | | | * doc/misc/cc-mode.texi (top level, "Introduction"), lisp/progmodes/cc-defs.el (c-version): Update version number to 5.34.
* Change default offset of CC Mode syntactic symbol inlambda to 0Alan Mackenzie2019-06-021-5/+7
| | | | | | | | | | | It's previous default was c-lineup-inexpr-block. This change is mainly to prevent excessive indentation of the innards of C++ lambda functions. * lisp/progmodes/cc-vars.el (c-offsets-alist): Amend the offset for inlambda to 0. * doc/misc/cc-mode.texi (FAQ): Amend the answer to the question about this matter.
* Merge from origin/emacs-26Glenn Morris2019-06-011-3/+3
|\ | | | | | | | | | | | | | | | | | | | | 2168165 ; * doc/lispref/nonascii.texi (Explicit Encoding): Fix typo. 8f18d12 Improve documentation of decoding into a unibyte buffer 7681a57 Remove redundants "See" before @xref or @pxref (Bug#35793) 9bee762 ; * src/coding.c: Improve commentary. (Bug#34765) e61349c Fix customization type of recentf-max-saved-items # Conflicts: # src/coding.c
| * Remove redundants "See" before @xref or @pxref (Bug#35793)Mauro Aranda2019-05-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/control.texi (Control Structures): * doc/lispref/modes.texi (Search-based Fontification): * doc/misc/cc-mode.texi (Filling and Line Breaking Commands) (Auto-newline Insertion, Other Special Indentations): * doc/misc/dbus.texi (Errors and Events): * doc/misc/dired-x.texi (Find File At Point): * doc/misc/eudc.texi (Display of Query Results, Inline Query Expansion): * doc/misc/gnus-faq.texi (FAQ 3-11): * doc/misc/gnus.texi (Group Parameters, Posting Styles) (Spam Package Introduction): * doc/misc/org.texi (LaTeX fragments, Previewing LaTeX fragments): * doc/misc/reftex.texi (Commands): Remove redundant "See" before cross references. * doc/lispref/functions.texi (Function Safety): Redundant "see" is in ignored text, but remove it anyway. * doc/lispref/positions.texi (Skipping Characters): Remove redundant "See" before cross references. Change @xref to @pxref, which is more suitable when at the end of a sentence. Most of the redundants "See" found by Noam Postavsky.
* | Fix Pike Mode's autodoc doc comments style's continued lines.Alan Mackenzie2019-04-201-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Merge from origin/emacs-26Glenn Morris2019-03-201-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 24b6e6e (origin/emacs-26) * etc/AUTHORS: Update. 2f22a17 * ; ChangeLog.3 update 0f523de Improve indexing of the user manual bd5795e Fix url-copy-file arglist eaa188a ; * admin/notes/bugtracker: Minor additions and updates. 5ed05fb Fix downloading updates for packages with non-ASCII descriptions e9f2d1f * etc/NEWS: Remove temporary markers. 24fc133 * doc/misc/cc-mode.texi (Config Basics): in @itemize, @asis -... 0f325d1 Don't clobber 'comint-input-autoexpand' in 'read-shell-command' bc75589 Document restrictions when setting window margins, fringes or... cc4cebf More improvements for 'read-buffer's doc string d026d9a * lisp/progmodes/cc-defs.el: Update c-version to 5.33.2 for E... 5dbf08b * src/minibuf.c (Fread_buffer): Minor doc fixes. (Bug#34749) # Conflicts: # etc/NEWS # lisp/url/url-handlers.el
| * * doc/misc/cc-mode.texi (Config Basics): in @itemize, @asis -> @w{}Alan Mackenzie2019-03-151-1/+1
| |
* | Correct the indentation of CC Mode brace listsAlan Mackenzie2019-03-121-3/+122
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* cc-mode.texi: Work around makeinfo alignment bug. Fix problem with ss indexAlan Mackenzie2019-03-081-0/+24
| | | | | | | | | | * doc/misc/cc-mode.texi (top level): Using txicommandconditionals to differentiate between the C and perl versions of Texinfo, create an "ss index" unless we are both using the C Texinfo and are building the .dvi output format. (Config Basics): Work around a perl Texinfo alignment bug by writing a separate version of an item list structure for this version, simplifying it considerably.
* Minor spelling and grammar fixes (bug#34756)Basil L. Contovounesios2019-03-051-2/+2
| | | | | | | | | | | | | | doc/misc/cc-mode.texi (Style Variables, Customizing Indentation): doc/misc/ede.texi (Extending EDE, ede-project-placeholder) (ede-target, ede-proj-target, ede-compilation-program, ede-compiler) (ede-linker): Remove apostrophe from possessive "it's". doc/lispintro/emacs-lisp-intro.texi (Find a File): doc/misc/gnus-faq.texi (FAQ 2-2): Write "an other" as a single word. doc/misc/gnus.texi (Article Buttons): lisp/gnus/gnus-art.el (gnus-button-mid-or-mail-heuristic-alist) (gnus-button-mid-or-mail-heuristic): Write singular number of Message-IDs, rather than plural. lisp/gnus/message.el (message-user-fqdn): Capitalize initialism.
* Fix copyright years by handPaul Eggert2019-01-011-1/+1
| | | | | These are dates that admin/update-copyright did not update, or updated incorrectly.
* ; Spelling fixesPaul Eggert2018-03-041-1/+1
|
* Mark keys consistently in manualsMichael Albinus2018-02-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/killing.texi: * doc/lispintro/emacs-lisp-intro.texi: * doc/misc/calc.texi: * doc/misc/cc-mode.texi: * doc/misc/dired-x.texi: * doc/misc/ede.texi: * doc/misc/edt.texi: * doc/misc/efaq.texi: * doc/misc/erc.texi: * doc/misc/eshell.texi: * doc/misc/gnus-faq.texi: * doc/misc/gnus-news.texi: * doc/misc/idlwave.texi: * doc/misc/ido.texi: * doc/misc/mairix-el.texi: * doc/misc/message.texi: * doc/misc/mh-e.texi: * doc/misc/newsticker.texi: * doc/misc/org.texi: * doc/misc/pcl-cvs.texi: * doc/misc/ses.texi: * doc/misc/sieve.texi: * doc/misc/smtpmail.texi: * doc/misc/speedbar.texi: * doc/misc/srecode.texi: * doc/misc/vhdl-mode.texi: * doc/misc/vip.texi: * doc/misc/viper.texi: Mark keys consistently.
* Remove @key{} markups from @kindex entries in manualsMichael Albinus2018-02-261-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/basic.texi: * doc/emacs/buffers.texi: * doc/emacs/building.texi: * doc/emacs/calendar.texi: * doc/emacs/custom.texi: * doc/emacs/dired.texi: * doc/emacs/display.texi: * doc/emacs/files.texi: * doc/emacs/frames.texi: * doc/emacs/help.texi: * doc/emacs/indent.texi: * doc/emacs/killing.texi: * doc/emacs/kmacro.texi: * doc/emacs/mark.texi: * doc/emacs/mini.texi: * doc/emacs/misc.texi: * doc/emacs/modes.texi: * doc/emacs/msdos-xtra.texi: * doc/emacs/msdos.texi: * doc/emacs/mule.texi: * doc/emacs/picture-xtra.texi: * doc/emacs/programs.texi: * doc/emacs/regs.texi: * doc/emacs/rmail.texi: * doc/emacs/screen.texi: * doc/emacs/search.texi: * doc/emacs/sending.texi: * doc/emacs/text.texi: * doc/emacs/trouble.texi: * doc/misc/calc.texi: * doc/misc/cc-mode.texi: * doc/misc/ediff.texi: * doc/misc/ert.texi: * doc/misc/eww.texi: * doc/misc/forms.texi: * doc/misc/gnus.texi: * doc/misc/idlwave.texi: * doc/misc/info.texi: * doc/misc/message.texi: * doc/misc/mh-e.texi: * doc/misc/newsticker.texi: * doc/misc/org.texi: * doc/misc/pcl-cvs.texi: * doc/misc/rcirc.texi: * doc/misc/reftex.texi: * doc/misc/sc.texi: * doc/misc/sieve.texi: * doc/misc/vhdl-mode.texi: * doc/misc/vip.texi: * doc/misc/viper.texi: * doc/misc/woman.texi: Remove @key{} markups from @kindex entries.
* Fix @kindex entries in manualsMichael Albinus2018-02-251-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/basic.texi: * doc/emacs/buffers.texi: * doc/emacs/building.texi: * doc/emacs/calendar.texi: * doc/emacs/custom.texi: * doc/emacs/dired.texi: * doc/emacs/display.texi: * doc/emacs/files.texi: * doc/emacs/frames.texi: * doc/emacs/help.texi: * doc/emacs/indent.texi: * doc/emacs/killing.texi: * doc/emacs/kmacro.texi: * doc/emacs/mark.texi: * doc/emacs/mini.texi: * doc/emacs/misc.texi: * doc/emacs/modes.texi: * doc/emacs/msdos-xtra.texi: * doc/emacs/msdos.texi: * doc/emacs/mule.texi: * doc/emacs/picture-xtra.texi: * doc/emacs/programs.texi: * doc/emacs/regs.texi: * doc/emacs/rmail.texi: * doc/emacs/screen.texi: * doc/emacs/search.texi: * doc/emacs/sending.texi: * doc/emacs/text.texi: * doc/emacs/trouble.texi: * doc/lispref/files.texi: * doc/misc/calc.texi: * doc/misc/cc-mode.texi: * doc/misc/ediff.texi: * doc/misc/epa.texi: * doc/misc/ert.texi: * doc/misc/eww.texi: * doc/misc/forms.texi: * doc/misc/gnus.texi: * doc/misc/info.texi: * doc/misc/mairix-el.texi: * doc/misc/message.texi: * doc/misc/mh-e.texi: * doc/misc/newsticker.texi: * doc/misc/org.texi: * doc/misc/pcl-cvs.texi: * doc/misc/rcirc.texi: * doc/misc/sc.texi: * doc/misc/sieve.texi: * doc/misc/vhdl-mode.texi: * doc/misc/vip.texi: * doc/misc/viper.texi: * doc/misc/woman.texi: Fix @kindex entries. Mark keys consistently.
* Fix @cindex entries in manualsMichael Albinus2018-02-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/custom.texi: * doc/emacs/dired.texi: * doc/emacs/display.texi: * doc/emacs/files.texi: * doc/emacs/frames.texi: * doc/emacs/killing.texi: * doc/emacs/maintaining.texi: * doc/emacs/misc.texi: * doc/emacs/msdos-xtra.texi: * doc/emacs/msdos.texi: * doc/emacs/search.texi: * doc/emacs/text.texi: * doc/emacs/trouble.texi: * doc/lispintro/emacs-lisp-intro.texi: * doc/lispref/strings.texi: * doc/lispref/text.texi: * doc/misc/cc-mode.texi: * doc/misc/efaq.texi: * doc/misc/eieio.texi: * doc/misc/emacs-mime.texi: * doc/misc/gnus.texi: * doc/misc/htmlfontify.texi: * doc/misc/idlwave.texi: * doc/misc/message.texi: * doc/misc/mh-e.texi: * doc/misc/sem-user.texi: * doc/misc/ses.texi: * doc/misc/tramp.texi: * doc/misc/vhdl-mode.texi: Fix @cindex entries.
* ; Use @minus for negative numbers in some texi filesGlenn Morris2018-02-231-1/+1
|
* Fix @findex and @vindex entries in manualsMichael Albinus2018-02-231-172/+172
| | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/building.texi: * doc/emacs/calendar.texi: * doc/emacs/cmdargs.texi: * doc/emacs/mini.texi: * doc/emacs/misc.texi: * doc/emacs/trouble.texi: * doc/emacs/windows.texi: * doc/lispintro/emacs-lisp-intro.texi: * doc/lispref/edebug.texi: * doc/lispref/frames.texi: * doc/lispref/os.texi: * doc/lispref/windows.texi: * doc/misc/cc-mode.texi: * doc/misc/dired-x.texi: * doc/misc/ediff.texi: * doc/misc/mh-e.texi: * doc/misc/pcl-cvs.texi: * doc/misc/reftex.texi: * doc/misc/sc.texi: * doc/misc/vhdl-mode.texi: * doc/misc/viper.texi: Fix @findex and @vindex entries.
* ; Fix doc typos related to indefinite articlesGlenn Morris2018-02-161-1/+1
|
* Fix @examples in cc-mode.info, where lines were getting glued together.Alan Mackenzie2018-01-301-3/+3
| | | | | | | This happened because of false @c's in macro lines. * /doc/misc/cc-mode.texi (Line-up Functions): Remove the unneeded @c from macros sssTBasicOffset, sssTsssTBasicOffset, and hereFn.
* Fix copyright years by handPaul Eggert2018-01-011-1/+1
| | | | | These are dates that admin/update-copyright did not update, or updated incorrectly.
* ; Fix typoCharles A. Roelli2017-11-051-1/+1
| | | | * doc/misc/cc-mode.texi (Other Commands): Fix typo.
* Introduce a function to CC Mode which displays the current function nameAlan Mackenzie2017-11-031-0/+13
| | | | | | | | | | | | | Remove an erroneous interactive specification from two functions. * lisp/progmodes/cc-cmds.el (c-display-defun-name): New command. (c-defun-name, c-cpp-define-name): Remove interactive specification. * lisp/progmodes/cc-mode.el (c-mode-base-map): Add binding C-c C-z for the new command. * doc/misc/cc-mode.texi (Other Commands): Add documentation for the new command.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-131-2/+2
| | | | | | | | | | | | | 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.
* Create a toggle between block and line comments in CC Mode.Alan Mackenzie2017-06-151-14/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also (unrelated change) initialize the modes' keymaps at each loading. * lisp/progmodes/cc-cmds.el (c-update-modeline): amend for the new information on the modeline. (c-block-comment-flag): New variable. (c-toggle-comment-style): New function. * lisp/progmodes/cc-langs.el (c-block-comment-starter) (c-line-comment-starter): Make them c-lang-defvars. (c-block-comment-is-default): New c-lang-defvar. (comment-start, comment-end): Make the default values dependent on c-block-comment-is-default. * lisp/progmodes/cc-mode.el (c-mode-base-map): Define C-c C-k in this map. (c-basic-common-init): Initialize c-block-comment-flag. (c-mode-map, c++-mode-map, objc-mode-map, java-mode-map, idl-mode-map) (pike-mode-map, awk-mode-map): Make entries in these key maps each time the mode is loaded rather than just once per Emacs session. * doc/misc/cc-mode.texi (Comment Commands): Introduce the notion of comment style. (Minor Modes): Define comment style. Describe how comment style influences the information displayed on the modeline. Document c-toggle-comment-style. (FAQ): Add a question about toggling the comment style.
* Fix C++ fontification problems 500 bytes after typing a space, and other bugsAlan Mackenzie2017-03-301-2/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix chaotic indentation of C++ lambda. Enhance documentation thereofAlan Mackenzie2017-03-191-2/+33
| | | | | | | | | | | | | | * lisp/progmodes/cc-engine.el (c-looking-at-inexpr-block): qualify an invocation of c-on-identifier with a check we're not at the _end_ of an identifier. * doc/misc/cc-mode.texi: (Tex title page): Remove @subtitlefont because the perl versions of texi2dvi haven't implemented it. (Syntactic Symbols): Note that `inlambda' is also used in C++ Mode, not just in Pike Mode. (Statement Block Symbols): Add a section illustrating a C++ lambda function. (FAQ): Add a question about "excessive" indentation of the contents of a C++ lambda function, and how to get rid of it.
* Allow C++ nested brace-list-entries to be better indented.Alan Mackenzie2017-02-011-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bug #24431. The key change of this bug fix is correctly analyzing nested brace lists when the opening element stands on the same line as both its introductory brace and an enclosing parameter list parenthesis. * list/progmodes/cc-align.el (c-lineup-under-anchor): New line-up function. * list/progmodes/cc-engine.el (c-looking-at-or-maybe-in-bracelist): Accept the presence of exactly an identifier between an open parenthesis and an open brace as evidence of the brace starting a brace list. (c-looking-at-statement-block): New function, extracted from c-looking-at-inexpr-block. Enhance it to analyze inner blocks recursively when needed. (c-looking-at-inexpr-block): Extract new function (see above) and call it. (c-add-stmt-syntax): Enhance, with new &optional parameter, to supply the prime syntactic symbol with a fixed anchor point. When this is used, restrict all added syntactic symbols to those having an anchor point on the same line. Add, in addition to the current additional symbols, c-brace-list-entry when needed; use c-looking-at-statement-block to determine the latter. (c-guess-basic-syntax, CASE 9D): Use c-add-stmt-syntax rather than just c-add-syntax, to assemble the syntactic context of a 'brace-list-entry, thus getting, possibly, several accompanying syntactic entries. * lisp/progmodes/cc-styles.el (c-style-alist, "gnu" style): New entry for 'brace-list-intro, namely c-lineup-arglist-intro-after-paren. * lisp/progmodes/cc-vars.el (c-offsets-alist): Change the factory default offset for 'brace-list-entry from 0 to c-lineup-under-anchor. * doc/misc/cc-mode.texi (Syntactic Symbols): Amend the definition of brace-list-intro. (Brace List Symbols): Amend the example to show the new analysis of brace lists when the first element comes on the same line as the opening brace. (Misc Line-Up): Document the new line-up function c-lineup-under-anchor.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Fix copyright years by handPaul Eggert2017-01-011-1/+1
| | | | | | | | | | These are dates that admin/update-copyright did not update, or updated incorrectly.
* | Merge from origin/emacs-25Paul Eggert2016-10-101-4/+5
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | 4f406e9 CC Mode manual: remove reference to former Emacs variable las... 44e402e Allow to disable compaction of font caches 4ff4b66 Allow selection of font for symbols as in Emacs 24.x c03d44b ; Fix last commit d4be4f3 ; Fix indexing in lispref manual ed399f2 ; Minor improvement in documentation of generators 197a6bc Fix horizontal scrolling during Isearch 3566644 Fix infloop in redisplay due to truncated lines and invisible... # Conflicts: # etc/NEWS
| * CC Mode manual: remove reference to former Emacs variable last-command-charAlan Mackenzie2016-10-091-4/+5
| | | | | | | | | | * doc/misc/cc-mode.texi (Hanging Semicolons and Commas): Replace reference to variable last-command-char by one to macro c-last-command-char.
| * Add documentation note from AlexJohn Wiegley2016-10-051-1/+3
| |
* | Add documentation note from AlexJohn Wiegley2016-10-041-1/+3
| |
* | Fix C-M-a in a C function finding the start of a macro preceding it.Alan Mackenzie2016-06-291-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Also amend some pertinent documentation. This fixes bug #23818. * lisp/progmodes/cc-engine.el (c-beginning-of-decl-1): Also check for a virtual semicolon at a place where we check for other types of statement ends. * lisp/progmodes/cc-vars.el (c-macro-nacmes-with-semicolon): Remove from the doc string the bit saying that the variable is a prototype and liable to change. * doc/misc/cc-mode.texi (Macros with ;): Enhance, stating that configuring macros with semicolon can prevent C-M-a missing the beginning of defun.
* | CC Mode now uses the new :after-hook feature of define-derived-modeAlan Mackenzie2016-05-091-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It now runs internal variable setting functions after the mode hooks, no longer runs the mode hooks twice, and declares the configuration variables for noise macros and macros with semicolons as safe variables (when given suitable arguments). Fixes bug #16759 and bug #23476. * .dir-locals: Put the c-noise-macros-with-paren-names setting back into the C Mode value. * lisp/progmodes/cc-mode.el: (c-basic-common-init): Remove the call to c-make-macro-with-semi-re. (c-mode, c++-mode, objc-mode, java-mode, idl-mode, pike-mode, awk-mode): Move c-make-noise-macro-regexps and c-make-macro-with-semi-re (where appropriate) and c-update-modeline into the :after-hook form. Remove the explicit settings of the syntax table, the abbreviation table and the local key map, since they duplicate forms generated by define-derived-mode. Remove the explicit invocation of each mode's mode hook, since they duplicate ones generated by define-derived-mode. * lisp/progmodes/cc-vars.el: (c-string-list-p, c-string-or-string-list-p): New functions. (c-noise-macro-names, c-noise-macro-with-parens-names): give the save-local-variable property c-string-list-p. (c-macro-names-with-semicolon): give the save-local-variable property c-string-or-string-list-p. * doc/misc/cc-mode.texi: (Macros with ;, Noise Macros): Note that it's not necessary to call the regexp generating functions after setting the pertinent configuration values in a mode hook.
* | Merge from origin/emacs-25John Wiegley2016-03-031-3/+18
|\ \ | |/ | | | | | | | | | | | | | | | | | | d6f6b7d * etc/AUTHORS: Update the AUTHORS file 5cf7c39 authors.el updates a26f193 ; fix changelog entries fbc85c7 ; make change-history-commit 06da00c Fix Bug#22859 ab30bf5 ; * src/w32proc.c: Update the commentary to sys_select. 1481029 Fix reordering of bidi text in an isolate inside an override 60e0596 Document c-guess-basic-syntax in the CC Mode manual.
| * Document c-guess-basic-syntax in the CC Mode manual.Alan Mackenzie2016-03-011-3/+18
| | | | | | | | | | | | | | * doc/misc/cc-mode.texi (Syntactic Analysis): Document the function, adding pxrefs to Custom Line-Up and Other Indentation. (Custom Line-Up): Add a note on using c-guess-basic-syntax with a pxref to Syntactic Analysis.
* | Handle "noise" macros and compiler directives.Alan Mackenzie2016-02-291-5/+63
|/ | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/cc-langs.el (c-symbol-char-key): New language variable. * lisp/progmodes/cc-vars.el (c-noise-macro-names) (c-noise-macro-with-parens-names): New customizable variables. (c-noise-macro-name-re, c-noise-macro-with-parens-name-re): New variables. (c-make-noise-macro-regexps): New function. * lisp/progmodes/cc-engine.el (c-forward-sws, c-backward-sws): Adapt to treat members of c-noise-macro-names as whitespace. (c-forward-noise-clause): New function. (c-forward-keyword-prefixed-id, c-forward-type, c-forward-declarator) (c-forward-decl-or-cast-1, c-backward-over-enum-header) (c-guess-basic-syntax CASE 5A.3, CASE 5A.5, CASE 9A): Handle "noise clauses" in parallel with, e.g., "hangon key clauses". * lisp/progmodes/cc-fonts.el (c-complex-decl-matchers): Handle "noise clauses" in parallel with "prefix-spec keywords". * lisp/progmodes/cc-mode.el (c-mode, c++-mode, objc-mode): call c-make-noise-macro-regexps to initialize the internal variables. * doc/misc/cc-mode.texi ("Noise Macros"): New section documenting the new facilities.
* Fix copyright years by handPaul Eggert2016-01-011-1/+1
| | | | | These are dates that admin/update-copyright did not update, or updated incorrectly.
* Fix typos in CC Mode manualEli Zaretskii2015-12-291-3/+3
| | | | | * doc/misc/cc-mode.texi (c-offsets-alist, Style Variables): Fix typos. (Bug#22267)
* CC Mode: Respect users' settings of open-paren-in-column-0-is-defun-start.Alan Mackenzie2015-11-111-2/+2
| | | | | | | | | | | | | | | | | lisp/progmodes/cc-engine.el (c-backward-single-comment, c-backward-comments) (c-invalidate-state-cache-1, c-parse-state-1, c-guess-basic-syntax): remove bindings of open-paren-in-column-0-is-defun-start to nil. (c-get-fallback-scan-pos): "New" function (existed several years ago). (c-parse-state-get-strategy): Reintroduce the 'BOD strategy, using c-get-fallback-scan-pos. (c-parse-state-1): Handle 'BOD strategy. lisp/progmodes/cc-mode.el (c-before-change, c-after-change) c-font-lock-fontify-region): remove bindings of open-paren-in-column-0-is-defun-start to nil. cc-mode.texi (Performance Issues, Limitations and Known Bugs): Fix mix up between @chapter and @appendix.