summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-awk.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* CC Mode. Make AWK Mode work with electric-pair-modeAlan Mackenzie2022-09-241-10/+15
| | | | | | | | | | | | | | | | Also fix some minor anomalies with other CC Mode modes in electric-pair-mode. This fixes bug #53446. * lisp/progmodes/cc-mode.el (c-open-string-opener): New buffer local variable. (c-after-change-mark-abnormal-strings): Set c-open-string-opener when an unbalanced string is detected. (c-before-change): Initilize c-open-string-opener to nil, each buffer change. (c-electric-pair-inhibit-predicate): Use the value of c-open-string-opener to flag an unbalaced string rather than trying to calculate it again. * lisp/progmodes/cc-awk.el (c-awk-syntax-tablify-string): Set c-open-string-opener when an unbalanced string is detected.
* Fix mis-spelling of c-awk-old-ByLL and really make it buffer-localPaul A. Patience2022-08-191-1/+1
| | | | | | | * lisp/progmodes/cc-awk.el (c-awk-old-ByLL): Make the correct variable buffer-local (bug#57294). Copyright-paperwork-exempt: yes
* CC Mode: Restore string fence properties at each relevant external entry pointAlan Mackenzie2022-05-221-57/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes bug #55230. * lisp/progmodes/cc-defs.el (c-string-fences-set-flag, c-with-string-fences): New variable and macro. * lisp/progmodes/cc-mode.el (c-called-from-text-property-change-p): Add remove-text-properties to the list of accepted functions. (c-clear-string-fences, c-restore-string-fences): Surround the functions' innards with c-save-buffer-state to prevent text property changes causing change functions to be called. (c-before-change, c-after-change, c-font-lock-fontify-region): Replace the explicit calls to c-restore-string-fences and c-clear-string-fences with invocations of the new macro c-with-string-fences. * lisp/progmodes/cc-awk.el (c-awk-extend-and-syntax-tablify-region) (c-awk-end-of-defun) * lisp/progmodes/cc-cmds.el (c-show-syntactic-information) (c-electric-backspace, c-hungry-delete-backwards, c-electric-delete-forward) (c-hungry-delete-forward, c-electric-pound, c-electric-brace) (c-electric-slash, c-electric-star, c-electric-semi&comma, c-electric-colon) (c-electric-lt-gt, c-electric-paren, c-beginning-of-defun, c-end-of-defun) (c-display-defun-name, c-mark-function, c-beginning-of-statement) (c-end-of-statement, c-indent-command, c-indent-exp, c-indent-defun) (c-indent-line-or-region, c-fill-paragraph, c-indent-new-comment-line) (c-context-line-break) * lisp/progmodes/cc-guess.el (c-guess-region-no-install): These are all "boundary" functions to CC Mode. Surround each by c-with-string-fences.
* ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
|
* ; Minor stylistic fixes found by checkdocStefan Kangas2021-09-161-3/+4
|
* ; Fix typosStefan Kangas2021-09-031-1/+1
|
* ; Normalize and add missing first and last linesStefan Kangas2021-04-191-1/+1
|
* Convert CC Mode to lexical binding in EmacsAlan Mackenzie2021-04-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 _.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* CC Mode. Fix AWK Mode fontification bug, remove some unused variablesAlan Mackenzie2020-12-311-1/+1
| | | | | | | | * lisp/progmodes/cc-awk.el (awk-font-lock-keywords): Replace a hard use of c-preprocessor-face-name by an `eval' expression which evaluates it. * lisp/progmodes/cc-engine.el (c-in-knr-argdecl, c-laomib-put-cache) (c-laomib-fix-elt): Remove unused bound variables.
* CC Mode: Add newish AWK Mode facilities, as used in gawk-4.Alan Mackenzie2020-12-281-14/+87
| | | | | | | | | | | | | | | | | | | | * lisp/progmodes/cc-awk.el (c-awk-font-lock-invalid-namespace-separators): New function. (c-awk-context-expand-fl-region): New function. (awk-font-lock-keywords): Enhance handling of function declarations to include :: tokens. Fontify new system variable names FPAT, FUNCTAB, PREC, ROUNDMODE, SYNTAB. Fontify new keywords BEGINFILE and ENDFILE. Fontify new system functions asorti, dcngettext, isarray, patsplit, typeof. Fontify the new directives @include, @load, @namespace. Call c-awk-font-lock-invalid-namespace-separators as a matcher. * lisp/progmodes/cc-fonts.el (top level): No longer require 'cc-awk. * lisp/progmodes/cc-langs.el (c-before-context-fontification-functions): Give AWK the value c-awk-context-expand-fl-region rather than nil. * lisp/progmodes/cc-mode.el (top level): Declare awk-mode-syntax-table as a variable.
* Add and remove backslashes in regexpsMattias Engdegård2020-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | These irregularities were found by relint; see https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00949.html . * doc/lispref/modes.texi (Example Major Modes): * etc/srecode/el.srt: * lisp/cedet/data-debug.el (data-debug-mode): * lisp/cedet/semantic/grammar.el (semantic-grammar-mode): * lisp/cedet/srecode/srt-mode.el (srecode-template-mode): * lisp/comint.el (comint--unquote&requote-argument): * lisp/emacs-lisp/lisp-mode.el (lisp-mode): * lisp/gnus/mm-uu.el (mm-uu-type-alist): * lisp/progmodes/cc-awk.el (c-awk-harmless-pattern-characters*): * lisp/progmodes/cfengine.el (cfengine-common-settings): * lisp/progmodes/cperl-mode.el (cperl-after-sub-regexp, cperl-init-faces): * lisp/shell.el (shell-chdrive-regexp, shell--unquote&requote-argument): * lisp/textmodes/tex-mode.el (tex-common-initialization): Remove duplicated backslashes in character alternatives. * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): * lisp/progmodes/opascal.el (opascal--syntax-propertize): * lisp/progmodes/pascal.el (pascal--syntax-propertize): Remove backslashes escaping non-special characters. * lisp/progmodes/fortran.el (fortran-font-lock-keywords-3): Escape '*'. * lisp/progmodes/perl-mode.el (perl-syntax-propertize-function): Escape '^'.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* * lisp/progmodes/cc-awk.el (c-awk-var-num-ket-re): Remove /x80-/xff from it.Alan Mackenzie2019-07-251-3/+3
|
* Go back to "Maintainer: emacs-devel@gnu.org"Paul Eggert2019-05-251-0/+1
| | | | | | Restore lines saying "Maintainer: emacs-devel@gnu.org" when there is no special maintainer for a file. Although this wasn't documented it was common practice and removing the lines didn't have consensus.
* Fixes for "Maintainer:" and related linesPaul Eggert2019-05-191-1/+0
| | | | | | Mostly, this just removes "Maintainer: emacs-devel@gnu.org" lines, which are not that useful. It also cleans up and regularizes a few similar lines.
* Fix regexp branches that subsume other branchesPaul Eggert2019-04-191-1/+1
| | | | | | | | | | | | | | | Problems reported by Mattias Engdegård in: https://lists.gnu.org/r/emacs-devel/2019-04/msg00803.html * lisp/arc-mode.el (archive-rar-summarize): * lisp/eshell/em-hist.el (eshell-hist-word-designator): * lisp/info.el (Info-dir-remove-duplicates): * lisp/international/ja-dic-cnv.el (skkdic-convert-postfix) (skkdic-convert-prefix, skkdic-collect-okuri-nasi): * lisp/progmodes/cc-awk.el (c-awk-esc-pair-re): * lisp/xml.el (xml-att-type-re): Omit regexp branches that subsume other branches. * lisp/progmodes/cperl-mode.el (cperl-beautify-regexp-piece): $ and ^ aren’t simple-codes.
* CC Mode: Correct some incorrect regular expressions:Alan Mackenzie2019-03-091-2/+2
| | | | | | | | * lisp/progmodes/cc-awk.el (c-awk-regexp-char-list-re): "^" -> "\\^". R*x?R* -> \(R*x\)?R*. * lisp/progmodes/cc-mode.el (c-after-change-re-mark-unbalanced-strings): "|" -> "\\|".
* Correct some slightly incorrect regular expressions:Alan Mackenzie2019-03-031-3/+3
| | | | | | | | | | | * lisp/progmodes/cc-awk.el (c-awk-harmless-char-re) (c-awk-harmless-line-char-re, c-awk-_-harmless-nonws-char-re): [...\\\\...] -> [...\\...]. * lisp/progmodes/cc-engine.el (c-literal-limits): "*/" -> "\\*/". * lisp/progmodes/cc-mode.el (c-after-change-re-mark-unbalanced-strings): "\\\r" -> "\r".
* Update copyright year to 2019Paul Eggert2019-01-011-1/+1
| | | | Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
* 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-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.
* * lisp/progmodes/cc-awk.el: Mark unused argsStefan Monnier2017-07-041-2/+2
|
* Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | Run admin/update-copyright.
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* CC Mode: Eliminate compiler warning messages.Alan Mackenzie2015-11-241-8/+11
| | | | | | | | | | | * lisp/progmodes/cc-mode.el (top level): remove compile time declaration of `font-lock-syntactic-keywords' (which CC Mode doesn't use). * lisp/progmodes/cc-awk.el (awk-mode-syntax-table) (c-awk-set-syntax-table-properties): Clarify comments about `font-lock-syntactic-keywords'. * lisp/progmodes/cc-bytecomp.el (cc-bytecomp-load): Create a dummy declaration of this before the real (interpreted) one, to satisfy the byte compiler.
* Backslash cleanup in Elisp source filesPaul Eggert2015-09-171-3/+3
| | | | | | | | | | | 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.
* * 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.
* Quieten cc-mode compilationGlenn Morris2015-05-061-0/+1
| | | | | | * lisp/progmodes/cc-awk.el (c-forward-sws): * lisp/progmodes/cc-cmds.el (c-forward-subword, c-backward-subword): Declare.
* 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/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge trivially safe differences from standalone CC-mode.Stefan Monnier2014-10-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/cc-mode.el (c-initialize-cc-mode): Don't quote a symbol just to then pass it to `symbol-value'. (prog-mode): Provide fallback definition, if needed. * lisp/progmodes/cc-langs.el: Always load `cl'. Don't load `cl-lib'. Remove "cl-" prefix accordingly. * lisp/progmodes/cc-fonts.el (c-font-lock-invalid-string): Use integerp or characterp depending on the type of characters. (c-font-lock-enum-tail): Remove unused var `start'. * lisp/progmodes/cc-engine.el: Load CL at compile-time. (c-declare-lang-variables): Use mapcan. (c-append-to-state-cache): Remove unused var `ce+1'. (c-parse-state-state): Make buffer-local. (c-ssb-lit-begin): Remove unused var `pps-end-pos'. (c-just-after-func-arglist-p): Remove unused var `end'. * lisp/progmodes/cc-defs.el: Load cc-fix if delete-dups is undefined. (c-<-as-paren-syntax, c->-as-paren-syntax): Move definition earlier. (c-make-keywords-re): Use delete-dups. (c-get-current-file): Avoid file-name-base. * lisp/progmodes/cc-cmds.el (c-electric-lt-gt): Remove unused var `close-paren-inserted'. * lisp/progmodes/cc-awk.el (c-forward-sws): Remove unused declaration.
* CC Mode: revert recent changes and fix bug 17463 (cc-langs.elc getsAlan Mackenzie2014-09-101-327/+344
| | | | | | | | loaded at run-time). * progmodes/cc-langs.el (c-no-parens-syntax-table): Rename the c-lang-const to c-make-no-parens-syntax-table and correct the logic. (c-no-parens-syntax-table): Correct the logic of the c-lang-defvar.
* * lisp/progmodes/cc-awk.el: Remove unneeded cc-bytecomp use.Stefan Monnier2014-09-091-344/+327
| | | | | Change doc comments into docstrings. * lisp/Makefile.in: Remove cc-awk dependency.
* Replace "Maintainer: FSF" with the emacs-devel mailing addressGlenn Morris2014-02-091-1/+1
|
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* * lisp/progmodes/cc-awk.el (c-forward-sws): Declare.Glenn Morris2013-09-041-0/+1
|
* Handle "/"s more accurately in test for virtual semicolons (AWK Mode).Alan Mackenzie2013-08-251-29/+52
| | | | | | | | | | | | | | | | * progmodes/cc-awk.el (c-awk-one-line-possibly-open-string-re) (c-awk-regexp-one-line-possibly-open-char-list-re) (c-awk-one-line-possibly-open-regexp-re) (c-awk-one-line-non-syn-ws*-re): Remove. (c-awk-possibly-open-string-re, c-awk-non-/-syn-ws*-re) (c-awk-space*-/-re, c-awk-space*-regexp-/-re) (c-awk-space*-unclosed-regexp-/-re): New constants. (c-awk-at-vsemi-p): Reformulate better to recognize "/"s which aren't regexp delimiters. * progmodes/cc-engine.el (c-crosses-statement-barrier-p): Add in handling for a rare situation in AWK Mode involving unterminated strings/regexps.
* Spelling fixes.Paul Eggert2013-02-011-2/+3
|
* Amend to fontify /regexp/s in actions correctly.Alan Mackenzie2013-01-291-22/+48
| | | | | | | | | | | | | | | cc-awk.el (c-awk-harmless-char-re, c-awk-harmless-string*-re): (c-awk-harmless-string*-here-re): braces, parens and semicolons are no longer included. (c-awk-harmless-line-char-re, c-awk-harmless-line-string*-re): What used to be these variables without "-line" in the name. (c-awk-neutral-re): { is no longer neutral. Escaped newlines now are. (c-awk-non-arith-op-bra-re): Now also matches {. (c-awk-pre-exp-alphanum-kwd-re): New regexp to match "print", "return", and "case". (c-awk-kwd-regexp-sign-re): New, to match "print", etc., followed by /. (c-awk-syntax-tablify-/): Check special cases "print /re/", etc. (c-awk-set-syntax-table-properties): Extend FSM to handle {,},(,),;.
* Update copyright notices for 2013.Paul Eggert2013-01-011-1/+2
|
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
|
* Add the switch statement to AWK Mode.Alan Mackenzie2011-12-131-3/+3
|
* Spelling fixes.Paul Eggert2011-12-111-1/+1
|
* Spelling fixes.Paul Eggert2011-11-191-1/+1
|
* Spelling fixes.Paul Eggert2011-11-191-2/+2
|
* Spelling fixes.Paul Eggert2011-11-171-1/+1
|
* Fix typos.Juanma Barranquero2011-11-151-2/+2
|