summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/syntax.el
Commit message (Collapse)AuthorAgeFilesLines
* Give 'syntax-propertize-wholelines' a docstring.Philipp Stephani2021-05-301-0/+4
| | | | | | | This function is generally useful. * lisp/emacs-lisp/syntax.el (syntax-propertize-wholelines): Add docstring.
* * lisp/emacs-lisp/syntax.el (syntax-propertize-rules): Use `macroexp-let2`Stefan Monnier2021-03-111-6/+7
| | | | This also silences the recently introduced compilation warning.
* Prefer defvar-local in emacs-lisp/*.elStefan Kangas2021-01-311-2/+1
| | | | | | | | | | | | * lisp/emacs-lisp/chart.el (chart-local-object): * lisp/emacs-lisp/easy-mmode.el (define-minor-mode) (define-globalized-minor-mode): * lisp/emacs-lisp/edebug.el: * lisp/emacs-lisp/generic.el (generic-font-lock-keywords): * lisp/emacs-lisp/re-builder.el (reb-regexp, reb-regexp-src) (reb-overlays): * lisp/emacs-lisp/syntax.el (syntax-propertize-extend-region-functions): Prefer defvar-local.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Prefer setq-local in emacs-lisp/*.elStefan Kangas2020-12-041-1/+1
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/chart.el (chart-mode): * lisp/emacs-lisp/copyright.el (copyright-update): * lisp/emacs-lisp/eieio-custom.el (eieio-customize-object): * lisp/emacs-lisp/elint.el (elint-update-env, elint-init-form): * lisp/emacs-lisp/ert.el (ert--results-update-ewoc-hf): (ert--setup-results-buffer): * lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): * lisp/emacs-lisp/pp.el (pp-display-expression): * lisp/emacs-lisp/re-builder.el (reb-mode, reb-restart-font-lock): * lisp/emacs-lisp/shadow.el (load-path-shadows-mode): * lisp/emacs-lisp/smie.el (smie-setup): * lisp/emacs-lisp/syntax.el (syntax-propertize): * lisp/emacs-lisp/trace.el (trace-make-advice): Prefer setq-local.
* ; * lisp/emacs-lisp/syntax.el (syntax-propertize-function): Doc fix.Glenn Morris2020-09-201-1/+1
|
* Merge from origin/emacs-27Glenn Morris2020-09-201-1/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | df04f3e755 Fix a rare segfault in syntax.c fd1fe1e1ec Add doc to syntax-propertize-function saying it must do a ... fcd599bbea Minor copyedits of doc of 'with-silent-modifications' 759399cdb1 Improve documentation of 'max-mini-window-height' 3223302aa2 Use modern constant names for the NS pasteboard 985703d380 Fix doc string of 'toggle-menu-bar-mode-from-frame' 184a4977c7 Make vc-bzr tests work with brz 3.1 (bug#43314) # Conflicts: # lisp/emacs-lisp/syntax.el # src/syntax.c
| * Add doc to syntax-propertize-function saying it must do a 100% jobAlan Mackenzie2020-09-191-1/+6
| | | | | | | | | | | | | | | | | | | | and cannot be combined with other ways of applying syntax-table text properties. * lisp/emacs-lisp/syntax.el (syntax-propertize-function): Amend doc string. * doc/lispref/syntax.texi (Syntax Properties): Amend the description of the variable.
* | Allow back-references in syntax-propertize-rules.Tassilo Horn2020-05-191-10/+25
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/syntax.el (syntax-propertize--shift-groups-and-backrefs): Renamed from syntax-propertize--shift-groups, and also shift back-references. (syntax-propertize-rules): Adapt docstring and use renamed function. * test/lisp/emacs-lisp/syntax-tests.el: New test. (syntax-propertize--shift-groups-and-backrefs): New ERT test.
* | * lisp/emacs-lisp/syntax.el: Fix bug#41195Stefan Monnier2020-05-121-6/+18
| | | | | | | | | | | | | | | | Allow use of `syntax-ppss-flush-cache` in `syntax-propertize-function`. (syntax-propertize--inhibit-flush): New var. (syntax-propertize): Bind it. (syntax-ppss-flush-cache): Test it.
* | * lisp/emacs-lisp/syntax.el (syntax-propertize): Use run-hook-wrappedStefan Monnier2020-05-111-17/+21
|/ | | | | This way we avoid making assumptions about the content of syntax-propertize-extend-region-functions
* Shorten some ppss struct field namesNoam Postavsky2020-02-231-13/+13
| | | | | | | | | * lisp/emacs-lisp/syntax.el (ppss): Capitalize docstrings. (ppss-comment-depth): Renamed from ppss-comment-nesting. (ppss-quoted-p): Renamed from ppss-after-quote-p. (ppss-min-depth): Renamed from ppss-minimum-paren-depth. (ppss-open-parens): Renamed from ppss-open-paren-positions. * etc/NEWS: Announce the ppss-* accessors.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Revert "Move description of value to syntax-ppss function."Lars Ingebrigtsen2019-10-301-20/+0
| | | | | | This reverts commit 305dbc7e2be05748039aacb1a3d697f6f64bed4c. Both of the functions in question are used a lot in the sources, so move it back to the more basic function.
* Add a new ppss structure for syntax-ppss dataLars Ingebrigtsen2019-10-301-0/+34
| | | | | * lisp/emacs-lisp/syntax.el (ppss): Add a new structure to provide accessors to the syntax-ppss data.
* Move description of value to syntax-ppss function.Lars Ingebrigtsen2019-10-301-0/+20
| | | | | | | | | * lisp/emacs-lisp/syntax.el (syntax-ppss): Move the description of the return value from... * src/syntax.c (Fparse_partial_sexp): ... here because `syntax-ppss' is what's called over the place, and jumping through an indirection to get to the value description is inconvenient.
* Remove old commented out XEmacs compat code from syntax.el (Bug#37524)Stefan Kangas2019-10-011-15/+0
| | | | | * lisp/emacs-lisp/syntax.el: Remove ancient commented out XEmacs compat code. This code has been commented out since 2001.
* Document syntax-ppss-contextLars Ingebrigtsen2019-06-241-0/+4
| | | | | | | * doc/lispref/syntax.texi (Parser State): Document it. * lisp/emacs-lisp/syntax.el (syntax-ppss-context): Add a doc string (bug#32504).
* Do not use syntax-ppss-table in syntax-propertize when nil (Bug#36095)Dario Gjorgjevski2019-06-051-1/+1
| | | | | * lisp/emacs-lisp/syntax.el (syntax-propertize): Use (syntax-table) instead of syntax-ppss-table when the latter is nil.
* * lisp/emacs-lisp/syntax.el: Use syntax-ppss-table for syntax-propertize.Stefan Monnier2019-06-041-39/+40
| | | | | | | | | | | `syntax-ppss` uses `syntax-ppss-table` while parsing the buffer as well as when it calls `syntax-propertize`, but `syntax-propertize` can also be called directly rather than via `syntax-ppss` so it needs to explicitly use `syntax-ppss-table` as well in order to avoid using sometimes one table and sometimes another. (syntax-ppss-table): Move before new use. (syntax-propertize): Use it.
* * lisp/subr.el (add-hook): Turn `append` into `depth` (bug#35508)Stefan Monnier2019-05-291-6/+7
| | | | | | | | | | | | | | | | | | | Make it possible to control the relative ordering of functions on hooks by specifying `depth` in the same was as was possible with `add-function`. * lisp/electric.el (electric--sort-post-self-insertion-hook): Delete function. (electric-indent-mode, electric-layout-mode, electric-quote-mode): * lisp/elec-pair.el (electric-pair-mode): Use new `depth` arg instead of electric--sort-post-self-insertion-hook. * lisp/emacs-lisp/syntax.el (syntax-propertize, syntax-ppss): Use new `depth` arg to make sure noone accidentally gets added after syntax-ppss-flush-cache. * doc/lispref/modes.texi (Setting Hooks): Document new `depth` arg. * test/lisp/subr-tests.el (subr-tests-add-hook-depth): New test.
* 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.
* * lisp/emacs-lisp/syntax.el (syntax-propertize): `ignore` is like nilStefan Monnier2019-05-081-2/+3
| | | | | | (syntax-ppss-after-change-function): Mark it as obsolete. * lisp/font-lock.el (font-lock-apply-syntactic-highlight): Use syntax-ppss-flush-cache instead.
* * lisp/subr.el (combine-change-calls-1): Don't combine syntax-ppss flushesStefan Monnier2019-03-161-0/+5
|
* Use integers for syntax-pps-statsPaul Eggert2019-01-061-16/+16
| | | | | | | | | | * lisp/emacs-lisp/syntax.el (syntax-ppss-stats): Use integers, not floating-point, for stats, now that integers are unbounded. Almost always these should be fixnums. Add 1 to last slot’s car so that this addition need not be done at runtime. (syntax-pps-stats, syntax-ppss): Use integers for calculations. (syntax-ppss--update-stats): New convenience function. (syntax-ppss): Use it.
* 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)'.
* | * lisp/emacs-lisp/syntax.el (syntax-propertize-rules): Allow empty rulesStefan Monnier2018-11-021-2/+2
|/
* Remove outdated comment in syntax.elEli Zaretskii2018-03-031-6/+0
| | | | | * lisp/emacs-lisp/syntax.el (syntax-ppss-toplevel-pos): Remove outdated comment. (Bug#30617)
* * lisp/emacs-lisp/syntax.el (syntax-propertize): Fix bug#29767Stefan Monnier2018-01-111-0/+8
|
* Update copyright year to 2018Paul Eggert2018-01-011-1/+1
| | | | Run admin/update-copyright.
* Use a separate syntax-ppss cache for narrowed buffersDmitry Gutov2017-09-261-35/+72
| | | | | | | | | | | | * lisp/emacs-lisp/syntax.el (syntax-ppss-wide): New variable, to contain the data from `syntax-ppss-last' and `syntax-ppss-cache'. (syntax-ppss-cache, syntax-ppss-last): Remove. (syntax-ppss-narrow, syntax-ppss-narrow-start): New variables. (syntax-ppss-flush-cache): Flush both caches. (syntax-ppss--data): Return the appropriate last result and buffer cache for the current restriction. (syntax-ppss, syntax-ppss-debug): Use it (bug#22983).
* 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.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | | | | | Run admin/update-copyright.
* | * lisp/emacs-lisp/syntax.el (syntax-propertize): Flush extended region.Stefan Monnier2016-06-221-0/+3
| |
* | Merge from origin/emacs-25Paul Eggert2016-05-011-1/+1
|\| | | | | | | | | | | c695fb3 ; Spelling fixes 03750c0 * doc/misc/texinfo.tex: Sync from gnulib. 42fed3b * lisp/isearch.el (isearch-forward-symbol-at-point): Add isea...
| * ; Spelling fixesPaul Eggert2016-05-011-1/+1
| |
| * Clarify some doc stringsLars Ingebrigtsen2016-05-011-3/+4
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/syntax.el (syntax-propertize-via-font-lock): Clarify doc string (bug#8693). (syntax-propertize): Clarify doc string. (cherry picked from commit ad3ef417f3c40f086de9c547d6272e5685595e42)
* | Clarify some doc stringsLars Ingebrigtsen2016-04-281-3/+4
| | | | | | | | | | | | * lisp/emacs-lisp/syntax.el (syntax-propertize-via-font-lock): Clarify doc string (bug#8693). (syntax-propertize): Clarify doc string.
* | * lisp/emacs-lisp/syntax.el (syntax-ppss-table): New varStefan Monnier2016-01-161-1/+5
|/ | | | | (syntax-ppss): * lisp/font-lock.el (font-lock-fontify-syntactically-region): Use it.
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* (internal--syntax-propertize): Save match-data here (bug#21766)Stefan Monnier2015-10-281-6/+5
| | | | | * lisp/emacs-lisp/syntax.el (internal--syntax-propertize): Save match-data. * lisp/simple.el (delete-trailing-whitespace): Undo last change.
* * lisp/emacs-lisp/syntax.el (syntax-begin-function): Make obsoleteStefan Monnier2015-09-201-0/+1
|
* * lisp/font-lock.el (font-lock-beginning-of-syntax-function): RemoveStefan Monnier2015-09-171-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (font-lock-fontify-block): Don't let-bind it. (font-lock-compile-keywords): Don't use it. (font-lock-set-defaults): Don't set it. Allow the variable alist to start one slot earlier, instead. * lisp/emacs-lisp/syntax.el (font-lock-beginning-of-syntax-function): Don't declare. (syntax-ppss): Don't use it either. * lisp/font-core.el (font-lock-defaults): Remove SYNTAX-BEGIN from docstring. * doc/emacs/display.texi (Font Lock): Don't mention font-lock-beginning-of-syntax-function. * doc/lispref/modes.texi (Font Lock Basics): Update description of font-lock-defaults. (Syntactic Font Lock): Remove font-lock-beginning-of-syntax-function. * lisp/loadhist.el (unload-feature-special-hooks): Remove font-lock-beginning-of-syntax-function. * lisp/obsolete/lazy-lock.el (lazy-lock-fontify-region): * lisp/emacs-lisp/lisp.el (beginning-of-defun-raw): Don't let-bind font-lock-beginning-of-syntax-function.
* Merge syntax-propertize--done and parse-sexp-propertize-doneStefan Monnier2015-09-111-52/+53
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/syntax.el (syntax-propertize--done): Remove. (syntax-propertize): Set syntax-propertize--done even if syntax-propertize-function is nil. Avoid recursive invocations. (syntax-propertize-chunks): New var. (internal--syntax-propertize): Use it. Rename from syntax--jit-propertize. Simplify. (parse-sexp-propertize-function): Don't set any more. * src/syntax.c (SETUP_SYNTAX_TABLE): Call parse_sexp_propertize as needed. (parse_sexp_propertize): Don't assume charpos is not yet propertized. Call Qinternal__syntax_propertize instead of Vparse_sexp_propertize_function. Truncate e_property if needed. (update_syntax_table_forward): Streamline. (syms_of_syntax): Define Qinternal__syntax_propertize. (syntax_propertize__done): Rename from parse_sexp_propertize_done.
* Make syntax.c call syntax-propertize on demandStefan Monnier2015-09-091-0/+15
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/syntax.el (syntax--jit-propertize): New function. (parse-sexp-propertize-function): Use it. (syntax-propertize): Disable parse-sexp-propertize-function. * src/syntax.c (parse_sexp_propertize, update_syntax_table_forward): New functions. (syms_of_syntax): New vars `parse-sexp-propertize-done' and `parse-sexp-propertize-function'. * src/syntax.h (struct gl_state_s): Add `e_property_truncated' field. (UPDATE_SYNTAX_TABLE_FORWARD): Use update_syntax_table_forward. (SETUP_BUFFER_SYNTAX_TABLE): Set e_property_truncated. * lisp/progmodes/elisp-mode.el (elisp-byte-code-syntax-propertize): Don't assume `point' is set.
* Don't quote nil and t in doc stringsPaul Eggert2015-05-211-1/+1
| | | | | This is as per "Tips for Documentation Strings" in the elisp manual. For consistency, do the same in diagnostics and comments.
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.