aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/cc-align.el (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2026 to copyright years.Sean Whitton2026-01-011-1/+1
|
* CC Mode: Don't indent a construct in a class after a templateAlan Mackenzie2025-09-191-0/+10
| | | | | | | | | | | | | | This fixes bug#79438. * lisp/progmodes/cc-align.el (c-lineup-class-field-cont): New function. * lisp/progmodes/cc-vars.el (c-offsets-alist): Change the entry for class-field-cont from + to c-lineup-class-field-cont. * doc/misc/cc-mode.texi (Misc Line-Up): Add a new entry for c-lineup-class-field-cont.
* CC Mode: Remove workarounds for missing "\_<", "\_>" in XEmacsAlan Mackenzie2025-06-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also start using `symbols' as the PAREN argument to regexp-opt. lisp/progmodes/cc-defs.el (c-make-keywords-re): Simplify, remove the redundant `appendable' value of the ADORN parameter, use the `symbols' value of the PAREN argument to regexp. (c-emacs-features): Test that "\_<" and "\_>" work in regexps before allowing CC Mode to start. lisp/progmodes/cc-engine.el (c-looking-at-decl-block): When GOTO-START is set, leave point at the _last_ Java annotation, if any. Clarify this in the doc string. (c-guess-basic-syntax CASE 5G): Replace a not needed t GOTO-START argument to c-looking-at-decl-block with nil. lisp/progmodes/cc-langs.el (c-make-mode-syntax-table): Make the syntax of ?@ in Java Mode symbol for processing annotations. (c-opt-identifier-concat-key, c-opt-identifier-prefix-key) (c-opt-after-id-concat-key, c-identifier-key) (c-cpp-message-directives-re, c-cpp-include-key, c-pack-key) (c-brace-stack-thing-key, c-brace-stack-no-semi-key): Replace the `appendable' value of the ADORN argument to c-make-keywords-re with t. (c-annotation-re): New lang const and lang var. (c-keywords-obarray): Replace an explicit (apply 'nconc (mapcar ... )) with c--mapcan, now that the obscure bug with mapcan in Emacs has been resolved. lisp/progmodes/cc-align.el (c-lineup-gnu-DEFUN-intro-cont) (c-lineup-java-throws, c-snug-do-while) lisp/progmodes/cc-awk.el (c-awk-pre-exp-alphanum-kwd-re) (c-awk-after-if-for-while-condition-p) (c-awk-after-function-decl-param-list) (c-awk-after-continue-token) (c-awk-after-rbrace-or-statement-semicolon) (awk-font-lock-keywords) lisp/progmodes/cc-cmds.el (c-defun-name-1) lisp/progmodes/cc-engine.el (c-beginning-of-statement-1) (c-forward-<>-arglist, c-forward-label, c-skip-conditional) (c-looking-at-c++-lambda-expression, c-add-stmt-syntax) (c-guess-basic-syntax CASE 11, CASE 12, CASE 13, CASE 15) (CASE 5C.3, CASE 5D.4, CASE 7D) lisp/progmodes/cc-fonts.el (c-cpp-matchers) (c-basic-matchers-before, c-font-lock-declarations) (c-font-lock-c++-modules, c-simple-decl-matchers) (c-complex-decl-matchers, c-basic-matchers-after) lisp/progmodes/cc-langs.el (c-paragraph-start) (c-stmt-block-only-keywords-regexp) (c-type-decl-prefix-keywords-key, c-type-decl-prefix-key) (c-type-decl-suffix-key, c-known-type-key) (c-enum-clause-introduction-re) lisp/progmodes/cc-menus.el (cc-imenu-c++-generic-expression) lisp/progmodes/cc-vars.el (c-make-noise-macro-regexps) (c-make-macro-with-semi-re): Replace explicit "\<" and "\>" with "\_<" and "\_>". Replace explicit specification of non-'_' character after word end with "\_>". Replace concatenation of "\<" and "\>" with regexps with (regexp-opt ... 'symbols). Use (regexp-opt ... 'symbols) in general.
* Fix typo in bug#19867 correction (CC Mode indentation bugs)Alan Mackenzie2025-04-301-1/+1
| | | | | | * lisp/progmodes/cc-align.el (c-lineup-item-after-paren-at-boi): Replace an erroneous skip-syntax-backward with skip-chars-backward.
* C++ Mode: Fix some indentation bugs. FIxes bug#19867Alan Mackenzie2025-03-271-22/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Fix closing paren aligning with trailing comment on line with matching open paren. 2. Fix indentation of first identifier inside a comma separated list aligning with the type rather than the subsequent identifiers. 3. Fix lambda expressions inside a brace list aligning like a single statement. * lisp/progmodes/cc-align.el (c-lineup-arglist): Take into account any preceding comments when lining up the arguments in the arglist. (c-lineup-arglist-intro-after-paren): Handle comments properly, and don't line up the closing parenthesis with a trailing comment on the first line. (c-lineup-item-after-paren-at-boi): Also allow a paren to count as being at BOI when it is preceded only by open parens on that line. (c-lineup-runin-statements, c-lineup-ObjC-method-call): Hanle comments better. * lisp/progmodes/cc-engine.el (c-forward-comments) Introduce an optional limit parameter. Use this limit in calls from cc-align.el and cc-mode.el. (c-just-after-func-arglist-p): Handle the presence of a protection keyword such as "public". (c-at-bracelist-p): Renamed from c-inside-bracelist-p, after dropping the accept-in-paren parameter, having removed its functionality. (c-looking-at-statement-block-1): New function, based on the old c-looking-at-statement-block. Enhanced to handle C++ lambda expressions, and to return the symbol `maybe' when the contents of a brace delimited block fail to determine whether it is a statement block. (c-looking-at-statement-block): Enhanced to examine the context of a brace delimited block when the contents are ambiguous. (c-looking-at-c++-lambda-expression): Check the character after point is a < before calling c-forward-<>-arglist. (c-add-stmt-syntax): Make the context more accurate by calling c-looking-at-statement-block. (c-guess-basic-syntax, CASE 5D.5): Replace the syntactic symbol topmost-intro-cont with the new symbol class-field-cont, additionally determining the position of the enclosing brace as an extra anchor point. (c-guess-basic-syntax, CASE 5V): New case for an identifier following a type inside class braces. (c-guess-basic-syntax, CASE 9): Use c-looking-at-statement-block to detect a brace list more accurately. * lisp/progmodes/cc-fonts.el (c-get-fontification-context): Rename the call to c-inside-bracelist-p to c-at-bracelist-p. * lisp/progmodes/cc-langs.el (c-protection-kwds): Add an entry for java-mode. (c-stmt-block-only-keywords-regexp): Prevent this regexp also matching a character preceding the keyword. * /lisp/progmodes/cc-mode.el (c-before-change-include-<>) (c-after-change-include-<>): Use the new limit argument to c-forward-comments. * lisp/progmodes/cc-styles.el (c-style-alist, "gnu" and "java" styles): Change the offset for arglist-close to c-lineup-arglist-close-under-paren. * lisp/progmodes/cc-vars.el (c-offsets-alist): Introduce the new syntactic symbol class-field-cont, giving it default offset +. * doc/misc/cc-mode.texi (Syntactic Symbols, Class Symbols): Document the new syntactic symbol class-field-cont.
* Update copyright year to 2025Paul Eggert2025-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* CC Mode: Fix various minor indentation bugsAlan Mackenzie2024-12-311-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of this, introduce a second anchor point to the syntactic symbols brace-list-intro and enum-intro, the position of the opening brace. * lisp/progmodes/cc-align.el (c-lineup-item-after-paren-at-boi): New function. * /lisp/progmodes/cc-engine.el (c-foreign-truncate-lit-pos-cache) (c-foreign-init-lit-pos-cache): Use c-truncate-lit-pos/state-cache in place of an older function. (c-no-bracelist-cache): Update its definition to exclude conses. (c-strip-conses): New function. (c-inside-bracelist-p): Use c-strip-conses. (c-add-stmt-syntax): In the "go out a block" loop, go out of a brace at BOI when there's non-whitespace text after it. Refactor an `if' form containing a cond form into a cond form. Add the new second second anchor point into syntactic contexts with brace-list-intro and enum-intro. Anchor brace-list-close and enum-close elements on the individual declarations in struct, etc., variable declarations. (c-guess-basic-syntax, CASE 20): Use the new constraint-cont syntactic symbol. (c-guess-basic-syntax, CASE 9B): Anchor brace-list-close and enum-close elements on the individual declarations in struct, etc., variable declarations. (c-guess-basic-syntax, CASEs 9C, 9D): Add the new second anchor point into brace-list-intro and enum-intro syntactic contexts. * lisp/progmodes/cc-mode.el (c-locate-first-punctuation-prop): New function. (c-depropertize-CPP): Use c-locate-first-punctuation-prop. * lisp/progmodes/cc-vars.el (c-offsets-alist): Amend the entries for constraint-cont, brace-list-intro, and enum-intro, using c-lineup-item-after-paren-at-boi. * doc/misc/cc-mode.texi (List Line-Up): Add a description of c-lineup-item-after-paren-at-boi.
* CC Mode: Parse C++ lambda functions more correctlyAlan Mackenzie2024-09-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bug#72695. * lisp/progmodes/cc-align.el (c-lineup-topmost-intro-cont): Do not indent further a line following a closing brace of a requires clause. * lisp/progmodes/cc-engine.el (c-forward-keyword-clause): Separate the handling of "any-paren-kwds" into "type-paren-kwds" and "nontype-paren-kwds", simplifying the handling of the latter. (c-forward-primary-expression): Recognize (...) followed by { as a primary expression. (c-looking-at-or-maybe-in-bracelist): No longer recognize an enum list as a brace list. Remove the handling of enum lists. (c-looking-at-c++-lambda-expression) (c-backward-over-lambda-expression): New functions. (c-c++-vsemi-p): Don't recognize the end of requires clauses as virtual semicolons. (c-guess-basic-syntax): CASE 5U - new cond arm to recognize being after a requires clause. These lines now get syntax topmost-intro-cont rather than topmost-intro, and their anchor positions are now on the topmost-intro line rather than the previous topmost-intro-cont. Throughout the file: simplify handling of c-fun-name-substitute-key, where there is no need to check for a following _ character, and introduce c-requires-clause-key for greater accuracy in parsing, even though both of these are just "requires". * lisp/progmodes/cc-fonts.el (c-get-fontification-context): Tidy up the handling of c-fun-name-substitue-key, as in cc-engine.el. * lisp/progmodes/cc-langs.el (c-lambda-spec-kwds) (c-lambda-spec-key): New lang vars. (c-fun-name-substitute-key): Now an adorned expression. (c-requires-clause-kwds, c-requires-clause-key): New lang vars.
* CC Mode: Separate indentation of enums from that of brace listsAlan Mackenzie2024-09-241-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow enums to be indented as in the GNU coding standards without affecting brace lists. * lisp/progmodes/cc-align.el (c-lineup-arglist-intro-after-paren) (c-lineup-arglist-close-under-paren) (c-lineup-whitesmith-in-block) (c-lineup-after-whitesmith-blocks): Amend doc strings to indicate they can be used for enum-* syntactic symbols too. * lisp/progmodes/cc-engine.el (c-looking-at-decl-block) (c-backward-typed-enum-colon, c-backward-over-enum-header): Rename c-after-brace-list-key to c-after-enum-list-key and c-brace-list-key to c-enum-list-key. (c-at-enum-brace): New function. (c-inside-bracelist-p): Don't check for enums any more. (c-add-stmt-syntax): New cond arm for enums. (c-guess-continued-construct CASE B.6) New code for enum-open. (c-guess-basic-syntax CASE 5A.3, CASE 7B, CASE 9, CASE 9B) (CASE 9C, CASE 9D): Use the new function c-at-enum-brace, and use enum-* syntactic symbols rather than brace-list-* ones where appropriate. (c-used-syntactic-symbols): New dynamic variable. (c-evaluate-offset): Add handling for a different syntactic symbol as the cdr of a c-offsets-alist element. * lisp/progmodes/cc-fonts.el (c-get-fontification-context): Add a call to c-at-enum-brace since c-inside-bracelist-p no longer handles enums. (c-font-lock-enum-body, c-font-lock-enum-tail): Condense calls to c-backward-over-enum-header to c-at-enum-brace. (c-basic-matchers-after): Replace a c-brace-list-decl-kwds with c-enum-list-kwds. * lisp/progmodes/cc-langs.el (c-enum-list-kwds) (c-enum-list-key): New names for c-brace-list-decl-kwds and c-brace-list-key. (c-after-enum-list-kwds, c-after-enum-list-key): New names for c-after-brace-list-decl-kwds and c-after-brace-list-key. (c-enum-list-key, c-after-enum-list-key): Add code to use a value of an old name, should a derived mode still use that. (c-defun-type-name-decl-kwds, c-typedef-decl-kwds) (c-typeless-decl-kwds, c-prefix-spec-kwds) (c-brace-id-list-kwds, c-enum-clause-introduction-re): Use c-enum-list-kwds rather than c-brace-list-decl-kwds. * lisp/progmodes/cc-styles.el (c-read-offset): Add "a syntactic symbol" into an error message text. * lisp/progmodes/cc-vars.el (c-valid-offset): Allow for a syntactic symbol as the parameter. (c-offsets-alist): Add new syntactic symbols enum-open, enum-close, enum-intro, and enum-entry. * doc/misc/cc-mode.texi (Syntactic Symbols): Add a note that anchor points are briefly documented in cc-vars.el. Correct the suffix "-block-intro" to "-intro". Remove "an enum or" from the descriptions of the brace-list-* syntactic symbols. Add in new descriptions for the enum-* syntactic symbols. (Brace List Symbols): Remove references to enums. Add a note that enums are no longer brace-lists. (Enum Symbols): A new subsection documenting the new enum-* syntactic symbols. (c-offsets-alist): Document the new possibility, syntactic symbol, for the cdr of an alist entry. (Brace/Paren Line-Up, List Line-Up): Note that the new enum syntactic symbols can be handled by these lineup functions.
* Merge from savannah/emacs-29Po Lu2024-01-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dc4e6b13296 ; Update copyright years in more files 64b37776318 ; Run set-copyright from admin.el 8e1c56ae467 ; Add 2024 to copyright years # Conflicts: # doc/misc/modus-themes.org # doc/misc/texinfo.tex # etc/NEWS # etc/refcards/ru-refcard.tex # etc/themes/modus-operandi-theme.el # etc/themes/modus-themes.el # etc/themes/modus-vivendi-theme.el # lib/alloca.in.h # lib/binary-io.h # lib/c-ctype.h # lib/c-strcasecmp.c # lib/c-strncasecmp.c # lib/careadlinkat.c # lib/cloexec.c # lib/close-stream.c # lib/diffseq.h # lib/dup2.c # lib/filemode.h # lib/fpending.c # lib/fpending.h # lib/fsusage.c # lib/getgroups.c # lib/getloadavg.c # lib/gettext.h # lib/gettime.c # lib/gettimeofday.c # lib/group-member.c # lib/malloc.c # lib/md5-stream.c # lib/md5.c # lib/md5.h # lib/memmem.c # lib/memrchr.c # lib/nanosleep.c # lib/save-cwd.h # lib/sha1.c # lib/sig2str.c # lib/stdlib.in.h # lib/strtoimax.c # lib/strtol.c # lib/strtoll.c # lib/time_r.c # lib/xalloc-oversized.h # lisp/auth-source-pass.el # lisp/emacs-lisp/lisp-mnt.el # lisp/emacs-lisp/timer.el # lisp/info-look.el # lisp/jit-lock.el # lisp/loadhist.el # lisp/mail/rmail.el # lisp/net/ntlm.el # lisp/net/webjump.el # lisp/progmodes/asm-mode.el # lisp/progmodes/project.el # lisp/progmodes/sh-script.el # lisp/textmodes/flyspell.el # lisp/textmodes/reftex-toc.el # lisp/textmodes/reftex.el # lisp/textmodes/tex-mode.el # lisp/url/url-gw.el # m4/alloca.m4 # m4/clock_time.m4 # m4/d-type.m4 # m4/dirent_h.m4 # m4/dup2.m4 # m4/euidaccess.m4 # m4/fchmodat.m4 # m4/filemode.m4 # m4/fsusage.m4 # m4/getgroups.m4 # m4/getloadavg.m4 # m4/getrandom.m4 # m4/gettime.m4 # m4/gettimeofday.m4 # m4/gnulib-common.m4 # m4/group-member.m4 # m4/inttypes.m4 # m4/malloc.m4 # m4/manywarnings.m4 # m4/mempcpy.m4 # m4/memrchr.m4 # m4/mkostemp.m4 # m4/mktime.m4 # m4/nproc.m4 # m4/nstrftime.m4 # m4/pathmax.m4 # m4/pipe2.m4 # m4/pselect.m4 # m4/pthread_sigmask.m4 # m4/readlink.m4 # m4/realloc.m4 # m4/sig2str.m4 # m4/ssize_t.m4 # m4/stat-time.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/stdio_h.m4 # m4/stdlib_h.m4 # m4/stpcpy.m4 # m4/strnlen.m4 # m4/strtoimax.m4 # m4/strtoll.m4 # m4/time_h.m4 # m4/timegm.m4 # m4/timer_time.m4 # m4/timespec.m4 # m4/unistd_h.m4 # m4/warnings.m4 # nt/configure.bat # nt/preprep.c # test/lisp/register-tests.el
| * ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
| |
* | Correct handling of template markers on deletion/insertionAlan Mackenzie2023-06-211-0/+10
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bug#62841. In particular, correct the syntax-table text properties on the remaining <...>s. * lisp/progmodes/cc-align.el (c-lineup-template-args-indented-from-margin): New lineup function. * lisp/progmodes/cc-defs.el (c-put-char-properties): New macro. (c-search-forward-non-nil-char-property): Handle terminating limit correctly. * lisp/progmodes/cc-engine.el (c-clear-<-pair-props-if-match-after) (c-clear->-pair-props-if-match-before): Return the position outside the matching < or >, not merely t. (c-end-of-literal): New function. (c-unmark-<>-around-region): New function. (c-before-change-check-<>-operators): Refactor, calling c-unmark-<>-around-region. (c-<>-get-restricted): New function, extracted from c-restore-<>-properties. (c-restore-<>-properties): Handle ">" characters whose matching "<" has not yet been encountered. (c-ml-string-opener-at-or-around-point): Fix an off by one error. (c-backward-<>-arglist): New parameter restricted-function, a function which calculates c-restricted-<>-arglists for the current operation. * lisp/progmodes/cc-fonts.el (c-font-lock-c++-using): Check point is less than limit in the loop. * lisp/progmodes/cc-langs.el (c-get-state-before-change-functions) (c-before-font-lock-functions): Add the new function c-unmark-<>-around-region into the C++ and Java values of the variable. * lisp/progmodes/cc-mode.el (c-clear-string-fences) (c-restore-string-fences): Neutralize and restore the syntax-table properties between an unbalanced " and EOL. * lisp/progmodes/cc-vars.el (c-offsets-alist): Put new lineup function c-lineup-template-args-indented-from-margin into entry for template-args-cont. * doc/misc/cc-mode.texi (List Line-Up): Document c-lineup-template-args-indented-from-margin.
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* CC Mode: Handle C++20 conceptsAlan Mackenzie2022-09-261-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/cc-align.el (c-lineup-topmost-intro-cont): Amend so as not to indent lines following a requires line. * lisp/progmodes/cc-engine.el (c-forward-primary-expression) (c-forward-c++-requires-clause): New functions. (c-forward-declarator): Skip forward over any trailing requires clause. (c-forward-decl-or-cast-1): Skip requires clauses before and after the type. Amend the second element of the return list to include information on two consecutive identifiers in <...>. (c-looking-at-or-maybe-in-bracelist): Don't recognize braces in requires expressions as brace lists. (c-guess-basic-syntax): CASE 5D.7: New case to handle the continuation of a "concept foo = " line. * lisp/progmodes/cc-fonts.el (c-basic-matchers-before): Add a new clause to handle the declaration of a concept. (c-get-fontification-context): Treat the arglist of a requires construct as a declaration arglist. * lisp/progmodes/cc-langs.el (c-equals-nontype-decl-kwds/key) (c-fun-name-substitute-kwds/key, c-pre-concept-<>-kwds/key): New c-lang-consts/vars. (c-constant-key): New c-lang-var. (c-type-decl-suffix-key): Include "requires" in the keywords matched. * lisp/progmodes/cc-mode.el (c-fl-decl-start): Fix an off by one error. Use equal rather than eq to compare two syntax contexts.
* CC Mode: New alignment function c-lineup-argcont-+Alan Mackenzie2022-04-231-47/+73
| | | | | | | | | | | | This fixes bug #21409. * lisp/progmodes/cc-align.el (c-lineup-argcont-1): New function, mainly extracted from c-lineup-argcont. (c-lineup-argcont): Refactored to use the new function above. (c-lineup-argcont-+): New function. * doc/misc/cc-mode.texi (Operator Line-Up): Add a new piece for c-lineup-argcont-+.
* ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
|
* ; Minor stylistic fixes found by checkdocStefan Kangas2021-09-161-4/+4
|
* Convert CC Mode to lexical binding in EmacsAlan Mackenzie2021-04-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lisp/progmodes/cc-align.el, lisp/progmodes/cc-awk.el, lisp/progmodes/cc-bytecomp.el, lisp/progmodes/cc-cmds.el, lisp/progmodes/cc-defs.el, lisp/progmodes/cc-engine.el, lisp/progmodes/cc-fonts.el, lisp/progmodes/cc-guess.el, lisp/progmodes/cc-langs.el, lisp/progmodes/cc-menus.el, lisp/progmodes/cc-mode.el, lisp/progmodes/cc-styles.el, lisp/progmodes/cc-subword.el, lisp/progmodes/cc-vars.el: Mark these files with a `lexical-binding' setting in line 1. lisp/progmodes/cc-align.el, lisp/progmodes/cc-engine.el, lisp/progmodes/cc-vars.el (c-syntactic-context, c-syntactic-element): Declare these as special variables. lisp/progmodes/cc-bytecomp.el (cc-bytecomp-debug-msg): prefix the parameter ARGS with a _, and remove an `ignore' call. lisp/progmodes/cc-cmds.el (c-where-wrt-brace-construct): Remove `kluge-start', an unused variable. (c-while-widening-to-decl-block): Add an extra parameter, which suppresses the generation of a setting of variable `where'. (c-defun-name-and-limits): Remove variable `where' from the function and use the new argument to the previous macro. lisp/progmodes/cc-engine.el (c-cache-to-parse-ps-state): Remove two unneeded variables, `last' and `intermediate'. lisp/progmodes/cc-fonts.el (c-font-lock-c++-using): Remove unused variable. lisp/progmodes/cc-langs.el (c-vsemi-status-unknown-p-fn): Replace the doc string with the more precise one from stand-alone CC Mode. lisp/progmodes/cc-styles.el (c-set-offset): Give the `ignored' parameter a leading _.
* CC Mode: Fix analysis of brace lists, particularly in C++ ModeAlan Mackenzie2021-03-021-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Fix some alignment functionality in cc-align.el. * lisp/progmodes/cc-align.el (c-lineup-arglist-intro-after-paren): Align the next line under the previous entry rather than one to the right of the paren. (c-lineup-2nd-brace-entry-in-arglist): Take the anchor point from the brace-list-entry element, not the brace-list-intro one. * lisp/progmodes/cc-engine.el (c-looking-at-decl-block): Use c-looking-at-statement-block to test whether "struct A {" begins a brace list or a struct declaration. (c-looking-at-or-maybe-in-bracelist): Several detailed amendments, correctly to recognize brace lists. (c-looking-at-statement-block): No longer search for commas, as they are not reliable indicators of a brace list. Search now for a restricted set of keywords, since some can appear in brace lists in C++ mode. * lisp/progmodes/cc-langs.el (c-stmt-block-only-keywords) (c-stmt-block-only-keywords-regexp): New lang consts/vars. (c-pre-id-bracelist-kwds): New lang const. (c-pre-id-bracelist-key): Derive now from the above. (c-pre-brace-non-bracelist-key): New lang const/var.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* CC Mode: fix many compiler warnings which would appear with lexical bindingAlan Mackenzie2020-11-091-3/+3
| | | | | | | | | | | | | * lisp/progmodes/cc-align.el (three places) prefix langelem with a _. * lisp/progmodes/cc-{cmds,engine}.el: Remove superfluous local variables. * lisp/progmodes/cc-defs.el (c-will-be-unescaped): Remove unused parameter end. * lisp/progmodes/cc-engine.el (c-looking-at-decl-block): Remove unused parameter containing-sexp. (c-looking-at-special-brace-list); Remove unused parameter lim. (c-add-class-syntax): Remove unused parameter paren-state.
* Bug #41061 patch: Fix typos and amend code slightlyAlan Mackenzie2020-06-011-11/+11
| | | | | * 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/+32
| | | | | | | | | | | | | | | 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.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* CC-Mode: Remove unneeded backslashes from doc strings and regular expressionsAlan Mackenzie2019-10-121-2/+2
| | | | | | | | | | | | | | | Also make miscellaneous amendments. * lisp/progmodes/cc-align.el, lisp/progmodes/cc-cmds.el * lisp/progmodes/cc-defs.el, lisp/progmodes/cc-engine.el * lisp/progmodes/cc-langs.el, lisp/progmodes/cc-vars.el: Remove lots of unneeded backslashes. * lisp/progmodes/cc-langs.el (c-string-innards-re-alist): Remove redundant "\\|\r" from regular expression. * lisp/progmodes/cc-mode.el (c-make-mode-syntax-table): Correct the name of the hook normal-erase-is-backspace-MODE-hook from a non-existant hook name.
* C Mode: Fix indentation of DEFUN's function's argument list.Alan Mackenzie2019-05-211-6/+6
| | | | | | | | | Formally, when DEFUNs still used knr argument lists, these were indented by the syntactic context knr-argdecl-intro (5 columns). Since this is no longer the case, we now just use c-basic-offset (2 columns in "gnu" style). * lisp/progmodes/cc-align.el (c-indent-gnu-DEFUN-intro-cont): Modernize the indentation. Amend the doc string accordingly.
* Correct the indentation of CC Mode brace listsAlan Mackenzie2019-03-121-0/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)'.
* | Implement the C++11 "using" type definition.Alan Mackenzie2018-06-091-6/+5
|/ | | | | | | | | | | | | | | | | | | Cease using the long obsolete c++-template-syntax-table. * lisp/progmodes/cc-align.el (c-lineup-template-args): Cease using c++-template-syntax-table. * lisp/progmodes/cc-engine.el (c-beginning-of-inheritance-list) (c-search-decl-header-end, c-beginning-of-decl-1, c-end-of-decl-1) (c-guess-continued-construct, c-guess-basic-syntax): Cease using c++-template-syntax-table. (c-guess-basic-syntax): Add CASE 5D.6 to handle C++11's "using" type definition. * lisp/progmodes/cc-langs.el (c++-make-template-syntax-table) (c++-template-syntax-table): Remove. (c-equals-type-clause-kwds, c-equals-type-clause-key): New language constants/variables.
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* 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.
* * lisp/progmodes/cc-align.el: Mark unused argumentsStefan Monnier2017-07-041-15/+15
|
* Allow C++ nested brace-list-entries to be better indented.Alan Mackenzie2017-02-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | Run admin/update-copyright.
* Fix problems caused by new implementation of sub-word modeEli Zaretskii2016-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/subr.el (forward-word-strictly, backward-word-strictly): New functions. (word-move-empty-char-table): New variable. * etc/NEWS: Mention 'forward-word-strictly' and 'backward-word-strictly'. * doc/lispref/positions.texi (Word Motion): Document 'find-word-boundary-function-table', 'forward-word-strictly', and 'backward-word-strictly'. (Bug#22560) * src/syntax.c (syms_of_syntax) <find-word-boundary-function-table>: Doc fix. * lisp/wdired.el (wdired-xcase-word): * lisp/textmodes/texnfo-upd.el (texinfo-copy-node-name) (texinfo-copy-section-title, texinfo-start-menu-description) (texinfo-copy-menu-title, texinfo-specific-section-type) (texinfo-insert-node-lines, texinfo-copy-next-section-title): * lisp/textmodes/texinfo.el (texinfo-clone-environment) (texinfo-insert-@end): * lisp/textmodes/texinfmt.el (texinfo-format-scan) (texinfo-anchor, texinfo-multitable-widths) (texinfo-multitable-item): * lisp/textmodes/tex-mode.el (latex-env-before-change): * lisp/textmodes/flyspell.el (texinfo-mode-flyspell-verify): * lisp/skeleton.el (skeleton-insert): * lisp/simple.el (count-words): * lisp/progmodes/vhdl-mode.el (vhdl-beginning-of-libunit) (vhdl-beginning-of-defun, vhdl-beginning-of-statement-1) (vhdl-update-sensitivity-list, vhdl-template-block) (vhdl-template-break, vhdl-template-case, vhdl-template-default) (vhdl-template-default-indent, vhdl-template-for-loop) (vhdl-template-if-then-use, vhdl-template-bare-loop) (vhdl-template-nature, vhdl-template-procedural) (vhdl-template-process, vhdl-template-selected-signal-asst) (vhdl-template-type, vhdl-template-variable) (vhdl-template-while-loop, vhdl-beginning-of-block) (vhdl-hooked-abbrev, vhdl-port-copy, vhdl-hs-forward-sexp-func): * lisp/progmodes/verilog-mode.el (verilog-backward-sexp) (verilog-forward-sexp, verilog-beg-of-statement) (verilog-set-auto-endcomments, verilog-backward-token) (verilog-do-indent): * lisp/progmodes/vera-mode.el (vera-guess-basic-syntax) (vera-indent-block-closing): * lisp/progmodes/simula.el (simula-context) (simula-backward-up-level, simula-forward-down-level) (simula-previous-statement, simula-next-statement) (simula-skip-comment-backward, simula-calculate-indent) (simula-find-if, simula-electric-keyword): * lisp/progmodes/sh-script.el (sh-smie--rc-newline-semi-p): * lisp/progmodes/ruby-mode.el (ruby-smie--redundant-do-p) (ruby-smie--forward-token, ruby-smie--backward-token) (ruby-singleton-class-p, ruby-calculate-indent) (ruby-forward-sexp, ruby-backward-sexp): * lisp/progmodes/ps-mode.el (ps-run-goto-error): * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function) (perl-syntax-propertize-special-constructs) (perl-backward-to-start-of-continued-exp): * lisp/progmodes/pascal.el (pascal-indent-declaration): * lisp/progmodes/octave.el (octave-function-file-p): * lisp/progmodes/mantemp.el (mantemp-insert-cxx-syntax): * lisp/progmodes/js.el (js--forward-function-decl): * lisp/progmodes/idlwave.el (idlwave-show-begin-check) (idlwave-beginning-of-block, idlwave-end-of-block) (idlwave-block-jump-out, idlwave-determine-class): * lisp/progmodes/icon.el (icon-is-continuation-line) (icon-backward-to-start-of-continued-exp, end-of-icon-defun): * lisp/progmodes/hideif.el (hide-ifdef-define): * lisp/progmodes/f90.el (f90-change-keywords): * lisp/progmodes/cperl-mode.el (cperl-electric-pod) (cperl-linefeed, cperl-electric-terminator) (cperl-find-pods-heres, cperl-fix-line-spacing) (cperl-invert-if-unless): * lisp/progmodes/cc-engine.el (c-forward-<>-arglist-recur): * lisp/progmodes/cc-align.el (c-lineup-java-inher): * lisp/progmodes/ada-mode.el (ada-compile-goto-error) (ada-adjust-case-skeleton, ada-create-case-exception) (ada-create-case-exception-substring) (ada-case-read-exceptions-from-file, ada-after-keyword-p) (ada-scan-paramlist, ada-get-current-indent, ada-get-indent-end) (ada-get-indent-if, ada-get-indent-block-start) (ada-get-indent-loop, ada-get-indent-type) (ada-search-prev-end-stmt, ada-check-defun-name) (ada-goto-decl-start, ada-goto-matching-start) (ada-goto-matching-end, ada-looking-at-semi-or) (ada-looking-at-semi-private, ada-in-paramlist-p) (ada-search-ignore-complex-boolean, ada-move-to-start) (ada-move-to-end, ada-which-function, ada-gen-treat-proc): * lisp/net/quickurl.el (quickurl-grab-url): * lisp/mail/sendmail.el (mail-do-fcc): * lisp/mail/rmail.el (rmail-resend): * lisp/mail/mailabbrev.el (mail-abbrev-complete-alias): * lisp/mail/mail-extr.el (mail-extract-address-components): * lisp/json.el (json-read-keyword): * lisp/files.el (insert-directory): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/completion.el (symbol-under-point, symbol-before-point) (symbol-before-point-for-complete, next-cdabbrev) (add-completions-from-c-buffer): * lisp/cedet/semantic/texi.el (semantic-up-context) (semantic-beginning-of-context): * lisp/cedet/semantic/bovine/el.el (semantic-get-local-variables): use 'forward-word-strictly' and 'backward-word-strictly' instead of 'forward-word' and 'backward-word'.
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Backslash cleanup in Elisp source filesPaul Eggert2015-09-171-8/+8
| | | | | | | | | | | This patch should not change behavior. It typically omits backslashes where they are redundant (e.g., in the string literal "^\$"). In a few places, insert backslashes where they make regular expressions clearer: e.g., replace "^\*" (equivalent to "^*") with "^\\*", which has the same effect as a regular expression. Also, use ‘\ %’ instead of ‘\%’ when avoiding confusion with SCCS IDs, and similarly use ‘\ $’ instead of ‘\$’ when avoiding confusion with RCS IDs, as that makes it clearer that the backslash is intended.
* Prefer directed to neutral quotesPaul Eggert2015-08-241-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefer directed to neutral quotes in docstings and diagnostics. In docstrings, escape apostrophes that would otherwise be translated to curved quotes using the newer, simpler rules. * admin/unidata/unidata-gen.el (unidata-gen-table): * lisp/align.el (align-region): * lisp/allout.el (allout-mode, allout-solicit-alternate-bullet): * lisp/bookmark.el (bookmark-default-annotation-text): * lisp/calc/calc-aent.el (math-read-if, math-read-factor): * lisp/calc/calc-lang.el (math-read-giac-subscr) (math-read-math-subscr): * lisp/calc/calc-misc.el (report-calc-bug): * lisp/calc/calc-prog.el (calc-fix-token-name) (calc-read-parse-table-part): * lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules): * lisp/cedet/semantic/complete.el (semantic-displayor-show-request): * lisp/dabbrev.el (dabbrev-expand): * lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/emacs-lisp/lisp-mnt.el (lm-verify): * lisp/emulation/viper-cmd.el (viper-toggle-search-style): * lisp/erc/erc-button.el (erc-nick-popup): * lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login): * lisp/eshell/em-dirs.el (eshell/cd): * lisp/eshell/em-glob.el (eshell-glob-regexp): * lisp/eshell/em-pred.el (eshell-parse-modifiers): * lisp/eshell/esh-arg.el (eshell-parse-arguments): * lisp/eshell/esh-opt.el (eshell-show-usage): * lisp/files-x.el (modify-file-local-variable): * lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer) (filesets-update-pre010505): * lisp/find-cmd.el (find-generic, find-to-string): * lisp/gnus/auth-source.el (auth-source-netrc-parse-entries): * lisp/gnus/gnus-agent.el (gnus-agent-check-overview-buffer) (gnus-agent-fetch-headers): * lisp/gnus/gnus-int.el (gnus-start-news-server): * lisp/gnus/gnus-registry.el: (gnus-registry--split-fancy-with-parent-internal): * lisp/gnus/gnus-score.el (gnus-summary-increase-score): * lisp/gnus/gnus-start.el (gnus-convert-old-newsrc): * lisp/gnus/gnus-topic.el (gnus-topic-rename): * lisp/gnus/legacy-gnus-agent.el (gnus-agent-unlist-expire-days): * lisp/gnus/nnmairix.el (nnmairix-widget-create-query): * lisp/gnus/spam.el (spam-check-blackholes): * lisp/mail/feedmail.el (feedmail-run-the-queue): * lisp/mpc.el (mpc-playlist-rename): * lisp/net/ange-ftp.el (ange-ftp-shell-command): * lisp/net/mairix.el (mairix-widget-create-query): * lisp/net/tramp-cache.el: * lisp/obsolete/otodo-mode.el (todo-more-important-p): * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): * lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region): * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region): * lisp/org/ob-core.el (org-babel-goto-named-src-block) (org-babel-goto-named-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/ob-ref.el (org-babel-ref-resolve): * lisp/org/org-agenda.el (org-agenda-prepare): * lisp/org/org-bibtex.el (org-bibtex-fields): * lisp/org/org-clock.el (org-clock-notify-once-if-expired) (org-clock-resolve): * lisp/org/org-feed.el (org-feed-parse-atom-entry): * lisp/org/org-habit.el (org-habit-parse-todo): * lisp/org/org-mouse.el (org-mouse-popup-global-menu) (org-mouse-context-menu): * lisp/org/org-table.el (org-table-edit-formulas): * lisp/org/ox.el (org-export-async-start): * lisp/play/dunnet.el (dun-score, dun-help, dun-endgame-question) (dun-rooms, dun-endgame-questions): * lisp/progmodes/ada-mode.el (ada-goto-matching-start): * lisp/progmodes/ada-xref.el (ada-find-executable): * lisp/progmodes/antlr-mode.el (antlr-options-alists): * lisp/progmodes/flymake.el (flymake-parse-err-lines) (flymake-start-syntax-check-process): * lisp/progmodes/python.el (python-define-auxiliary-skeleton): * lisp/progmodes/sql.el (sql-comint): * lisp/progmodes/verilog-mode.el (verilog-load-file-at-point): * lisp/server.el (server-get-auth-key): * lisp/subr.el (version-to-list): * lisp/textmodes/reftex-ref.el (reftex-label): * lisp/textmodes/reftex-toc.el (reftex-toc-rename-label): * lisp/vc/ediff-diff.el (ediff-same-contents): * lisp/vc/vc-cvs.el (vc-cvs-mode-line-string): * test/automated/tramp-tests.el (tramp-test33-asynchronous-requests): Use directed rather than neutral quotes in diagnostics.
* * lisp/progmodes/cc-*.el: Fix up commenting styleStefan Monnier2015-08-211-4/+4
| | | | | | | | | | | * lisp/progmodes/cc-vars.el, lisp/progmodes/cc-styles.el: * lisp/progmodes/cc-mode.el, lisp/progmodes/cc-menus.el: * lisp/progmodes/cc-langs.el, lisp/progmodes/cc-guess.el: * lisp/progmodes/cc-fonts.el, lisp/progmodes/cc-engine.el: * lisp/progmodes/cc-defs.el, lisp/progmodes/cc-cmds.el: * lisp/progmodes/cc-bytecomp.el, lisp/progmodes/cc-awk.el: * lisp/progmodes/cc-align.el, lisp/net/soap-client.el: Fix up commenting style.
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.
* Merge some of the differences from the standalone CC-mode.Stefan Monnier2014-12-011-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main change is to only use the `category' text-property only when available. For that many calls are changed to use c-get-char-property, c-next-single-property-change, c-sc-scan-lists, c-sc-parse-partial-sexp, c-unmark-<->-as-paren. * lisp/progmodes/cc-align.el (c-lineup-respect-col-0): New function. * lisp/progmodes/cc-cmds.el (c-forward-into-nomenclature) (c-backward-into-nomenclature): Use cc-subword if subword-mode is not available. (c-beginning-of-defun, c-end-of-defun, c-mark-function) (c-indent-line-or-region): Use c-region-is-active-p. * lisp/progmodes/cc-defs.el (c-version): Bump up to 5.33. (c-use-category): New const. (c-next-single-property-change): New macro. (c-region-is-active-p): Prefer region-active-p when available. (c-search-backward-char-property): Fix old min/max typo; probably a copy/paste error. (c-mark-<-as-paren, c-mark->-as-paren, c-unmark-<->-as-paren): Turn them into macros that obey c-use-category. (c-sc-scan-lists-no-category+1+1, c-sc-scan-lists-no-category+1-1) (c-sc-scan-lists-no-category-1+1, c-sc-scan-lists-no-category-1-1) (c-sc-scan-lists, c-sc-parse-partial-sexp) (c-looking-at-non-alphnumspace): New macros. (c-sc-parse-partial-sexp-no-category): New function. (c-emacs-features): Add `category-properties' element. * lisp/progmodes/cc-engine.el (c-invalidate-state-cache, c-parse-state): Handle the case where categories are not available. (c-record-parse-state-state, c-replay-parse-state-state): Handle marker values. (c-before-change-check-<>-operators): Look for the `syntax-table' property rather than for the corresponding `category'. (c-looking-at-decl-block): Remove unused var `c-disallow-comma-in-<>-arglists'. (c-forward-<>-arglist-recur): Remove unused var `orig-record-found-types'. * lisp/progmodes/cc-langs.el (c-modified-constant): New lang var. (c-known-type-key): Don't make a list just to throw it away. * lisp/progmodes/cc-bytecomp.el (cc-bytecomp-unbound-variables) (cc-bytecomp-original-functions, cc-bytecomp-original-properties) (cc-bytecomp-loaded-files): Re-set each time the file is loaded. (cc-bytecomp-obsolete-var, cc-bytecomp-ignore-obsolete) (cc-bytecomp-obsolete-fun): Delete unused functions. * lisp/progmodes/cc-mode.el (c-just-done-before-change): New var. (c-basic-common-init): Initialize it. (c-common-init): Only use mode-require-final-newline when available. (c-before-change): Check and set c-just-done-before-change. (c-after-change): Re-set c-just-done-before-change. (c-advise-fl-for-region): New macro. (lazy-lock-defer-rest-after-change, lazy-lock-defer-line-after-change) (font-lock-after-change-function, jit-lock-after-change): Advise if needed.
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* Correct the position of point in some line-up functions.Alan Mackenzie2013-03-061-1/+3
| | | | | | | | progmodes/cc-align.el (c-lineup-whitesmith-in-block, c-lineup-assignments) (c-lineup-gcc-asm-reg ): take position of point at column 0 rather than at a random place in the line. doc/misc/cc-mode.texi (Custom Line-Up): State explicitly that point starts at a random position in the line being indented.
* Replace `last-command-event' by `last-command-char' in XEmacs.Alan Mackenzie2013-03-041-9/+9
| | | | | | | | | | | | progmodes/cc-defs.el (c-last-command-char): New macro. progmodes/cc-align.el (c-semi&comma-inside-parenlist) (c-semi&comma-no-newlines-before-nonblanks) (c-semi&comma-no-newlines-for-oneline-inliners): Use the new macro in place of `last-command-event'. progmodes/cc-cmds.el (c-electric-pound, c-electric-brace) (c-electric-slash, c-electric-semi&comma, c-electric-lt-gt) (c-electric-paren, c-electric-continued-statement): Use the new macro in place of `last-command-event'.
* In doc, use standard American English style for e.g., etc., i.e.Paul Eggert2013-02-121-15/+15
|
* Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
|
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
|
* Refill some long/short copyright headers.Glenn Morris2011-01-261-2/+1
|
* Convert consecutive FSF copyright years to ranges.Glenn Morris2011-01-241-2/+1
|