summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp-mode.el
Commit message (Collapse)AuthorAgeFilesLines
* Get fewer false positives for :keyword and &optionsLars Ingebrigtsen2022-09-201-6/+21
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-mode--search-key): New function to check more carefully for start of :keywords and &options (bug#51574). (lisp-fdefs): Use it.
* Revert the changes to lisp-current-defun-nameLars Ingebrigtsen2022-08-231-55/+18
| | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Revert back to the old version before bug#49592. The new approach just doesn't work well enough -- we don't really have the data to know that, say, `make-obsolete-variable' is about the second symbol and not the first.
* Further lisp-current-defun-name tweaksLars Ingebrigtsen2022-08-151-2/+7
| | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Further tweaks to make (autoload 'foo) work again. Perhaps this should all be reverted to the original version and then given a new rething.
* Further lisp-current-defun-name tweaksLars Ingebrigtsen2022-08-091-1/+1
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Tweak so that cl-defmethod and friends work again.
* Another lisp-current-defun-name tweakMichael Heerdegen2022-08-091-1/+1
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Avoid error when edebug spec is the symbol t.
* Further lisp-current-defun-name tweaksLars Ingebrigtsen2022-08-081-2/+6
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Further tweaks to finding the symbol being defined (defalias).
* Make which-func-mode output less junkLars Ingebrigtsen2022-08-081-18/+46
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Use edebug specs to find the name (if they exist), and default to returning the top-level symbol if there isn't a define-like form (bug#49592).
* Fix `M-x lisp-fill-paragraph'Lars Ingebrigtsen2022-07-111-1/+4
| | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Fix filling when called directly with `M-x lisp-fill-paragraph' instead of via `M-q' (bug#56476).
* Prefer defcustom :safe to putting 'safe-local-variable'Stefan Kangas2022-07-061-7/+5
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-indent-offset) (lisp-body-indent, emacs-lisp-docstring-fill-column): * lisp/files.el (version-control): * lisp/progmodes/modula2.el (m2-indent): * lisp/progmodes/octave.el (octave-block-offset): * lisp/progmodes/sh-script.el (sh-basic-offset): * lisp/progmodes/tcl.el (tcl-indent-level) (tcl-continued-indent-level): * lisp/simple.el (fill-prefix): * lisp/textmodes/fill.el (colon-double-space): * lisp/textmodes/paragraphs.el (paragraph-start) (paragraph-separate, sentence-end-double-space) (sentence-end-without-period, sentence-end-without-space) (sentence-end, sentence-end-base, page-delimiter) (paragraph-ignore-fill-prefix): * lisp/textmodes/tex-mode.el (tex-fontify-script): * lisp/vc/add-log.el (add-log-dont-create-changelog-file): * lisp/vc/vc-hooks.el (vc-follow-symlinks): Prefer defcustom :safe to putting 'safe-local-variable'.
* Prefer defvar-keymap in emacs-lisp/*.elStefan Kangas2022-07-041-19/+16
| | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/backtrace.el (backtrace-mode-map): * lisp/emacs-lisp/bytecomp.el (emacs-lisp-compilation-mode-map): * lisp/emacs-lisp/checkdoc.el (checkdoc-minor-mode-map): * lisp/emacs-lisp/crm.el (crm-local-completion-map) (crm-local-must-match-map): * lisp/emacs-lisp/debug.el (debugger-mode-map): * lisp/emacs-lisp/edebug.el (edebug-mode-map, edebug-global-map) (edebug-eval-mode-map): * lisp/emacs-lisp/eieio-custom.el (eieio-custom-mode-map): * lisp/emacs-lisp/elp.el (elp-results-symname-map): * lisp/emacs-lisp/lisp-mode.el (lisp-mode-shared-map): * lisp/emacs-lisp/re-builder.el (reb-mode-map) (reb-lisp-mode-map, reb-subexp-mode-map): * lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode-map) (tabulated-list-sort-button-map): * lisp/emacs-lisp/timer-list.el (timer-list-mode-map):
* ; remove regexp ambiguityMattias Engdegård2022-07-041-4/+4
|
* Remove some useless `eval-when-compile`Mattias Engdegård2022-07-041-51/+45
| | | | | | | | | | | | | | | | | | | * lisp/cedet/semantic/java.el (semantic-java-number-regexp): * lisp/cedet/semantic/lex.el (semantic-lex-number-expression): * lisp/emacs-lisp/cl-indent.el (common-lisp-indent-function-1): * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression) (lisp--el-match-keyword, lisp-string-in-doc-position-p): * lisp/emacs-lisp/shorthands.el (shorthands-font-lock-shorthands): * lisp/net/socks.el (socks-send-command): * lisp/progmodes/meta-mode.el (meta-font-lock-keywords): * lisp/shell.el (shell--parse-pcomplete-arguments): * lisp/textmodes/sgml-mode.el (sgml-mode): * lisp/textmodes/tex-mode.el (tex--guess-mode) (tex-common-initialization, tex-input-files-re): * lisp/textmodes/tildify.el (tildify-mode): * lisp/xdg.el (xdg-line-regexp): Eliminate `eval-when-compile` when the argument would be evaluated by the compiler anyway.
* Replace lisp-mode-symbol-regexp with (rx lisp-mode-symbol)Mattias Engdegård2022-07-041-26/+30
| | | | | | | | | | | | | This is shorter, simplifies use inside rx expressions, and removes need for eval-when-compile elsewhere (for later exploitation). * lisp/emacs-lisp/lisp-mode.el (lisp-mode-symbol): New rx-define. (lisp-mode-symbol-regexp): Redefine using lisp-mode-symbol. (lisp-imenu-generic-expression, lisp--el-match-keyword) (lisp-fdefs, lisp-string-in-doc-position-p): * lisp/emacs-lisp/checkdoc.el (checkdoc--error-bad-format-p): * lisp/emacs-lisp/shorthands.el (shorthands-font-lock-shorthands): Use lisp-mode-symbol instead of lisp-mode-symbol-regexp.
* Simplify lisp-el-font-lock-keywords-2 definition slightlyStefan Kangas2022-07-031-8/+6
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Simplify slightly.
* Font lock \\<> and \\{} command substitutions in docstringsStefan Kangas2022-07-031-1/+5
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Support \\<> and \\{} command substitutions.
* Font lock \\`' command substitutions in docstringsStefan Kangas2022-07-021-2/+8
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Support \\`' command substitutions.
* Fix a recent Lisp mode filling test failureLars Ingebrigtsen2022-06-261-0/+12
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Restore the "fill first line separately" logic.
* Make `M-q' work on the first line of a multi-line string againLars Ingebrigtsen2022-06-251-2/+2
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Exclude the quote marks from the region so that filling works (bug#56197).
* Fix warnings introduced by the lisp-mode-autoload-regexp changeLars Ingebrigtsen2022-06-041-1/+1
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): The package name bit in ###;;;foo-autoload may be missing, so do a lax match (bug#55784).
* Add a face to \\= doc string escapesLars Ingebrigtsen2022-06-041-0/+3
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fdefs): Add a face to \\= doc string escapes (bug#55783).
* Speed up generation of loaddefs filesLars Ingebrigtsen2022-05-311-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/loading.texi (Autoload, Autoload by Prefix): Refer to loaddefs-generate instead of update-file-autoloads. * lisp/Makefile.in (LOADDEFS): Remove, because all the loaddefs files are created in one go now. (COMPILE_FIRST): Add loaddefs-gen/radix-tree, and drop autoload. ($(lisp)/loaddefs.el): Use loaddefs-gen. (MH_E_DIR, $(TRAMP_DIR)/tramp-loaddefs.el) ($(MH_E_DIR)/mh-loaddefs.el, $(CAL_DIR)/cal-loaddefs.el) ($(CAL_DIR)/diary-loaddefs.el, $(CAL_DIR)/hol-loaddefs.el): Remove. * lisp/generic-x.el: Inhibit computing prefixes, because the namespace here is all wonky. * lisp/w32-fns.el (w32-batch-update-autoloads): Removed -- unused function. * lisp/calendar/holidays.el ("holiday-loaddefs"): Renamed from hol-loaddefs to have a more regular name. * lisp/cedet/ede/proj-elisp.el (ede-emacs-cedet-autogen-compiler): Refer to loaddefs-gen instead of autoload. * lisp/emacs-lisp/autoload.el (make-autoload, autoload-rubric) (autoload-insert-section-header): Made into aliases of loaddefs-gen functions. (autoload--make-defs-autoload): Ditto. (autoload-ignored-definitions, autoload-compute-prefixes): Moved to loaddefs-gen. * lisp/emacs-lisp/lisp-mode.el (lisp-mode-autoload-regexp): New constant. (lisp-fdefs, lisp-mode-variables, lisp-outline-level): Use it to recognize all ;;;###autoload forms. * lisp/emacs-lisp/loaddefs-gen.el: New file. * lisp/emacs-lisp/package.el: Use loaddefs-generate instead of make-directory-autoloads. * test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-faulty-bzr-autoloads): Use loaddefs instead of autoloads.
* Fix font-locking of (defun foo (function ...))Lars Ingebrigtsen2022-05-201-0/+3
| | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp--el-funcall-position-p): Don't colorize the `function' in (defun foo (function ...)) as a special form (bug#37074).
* Make imenu find defalias entriesLars Ingebrigtsen2022-05-101-0/+9
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Also find defalias (bug#7855).
* Tweak how `M-q' in emacs-lisp-mode worksLars Ingebrigtsen2022-04-131-21/+41
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Only fill as strings inside strings (bug#31656). (lisp--fill-line-simple): New function to do simple sexp-based filling.
* Merge from origin/emacs-28Eli Zaretskii2022-01-011-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year. 86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year ebe8772f65 ; Minor fixes related to copyright years 23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye... 8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t. 19dcb237b5 ; Add 2022 to copyright years. # Conflicts: # etc/NEWS # etc/refcards/ru-refcard.tex # lib/cdefs.h # lisp/erc/erc-dcc.el # lisp/erc/erc-imenu.el # lisp/erc/erc-replace.el # lisp/image-dired.el # lisp/progmodes/xref.el # m4/alloca.m4 # m4/byteswap.m4 # m4/errno_h.m4 # m4/getopt.m4 # m4/gnulib-common.m4 # m4/inttypes.m4 # m4/stddef_h.m4 # m4/stdint.m4 # m4/sys_socket_h.m4
| * ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
| |
* | Indent `closure' forms betterLars Ingebrigtsen2021-11-251-0/+1
| | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (closure): Indent `closure' forms better (bug#52063).
* | ; * lisp/emacs-lisp/lisp-mode.el: Restore one check in flet handlingakater2021-11-091-6/+6
| | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p): Do check backward-up-list executing without errors (bug#9622).
* | lisp/emacs-lisp/lisp-mode.el: Fix parser state corruption.akater2021-11-081-6/+7
| | | | | | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p): Preserve the point. * test/lisp/progmodes/elisp-mode-resources/flet.erts: Add corresponding test example (bug#9622).
* | Indent cl-flet-like forms correctly in incomplete expressionsakater2021-10-281-42/+32
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p): Support incomplete sexps * test/lisp/progmodes/elisp-mode-resources/flet.erts: Add tests for incomplete sexps (bug#9622).
* | Merge from origin/emacs-28Glenn Morris2021-10-221-4/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b0d64be0bc (origin/emacs-28) Improve some NEWS entries 7fde84e881 Improve documentation of syntax-ppss-context slightly 5ecbed01b2 ; * test/lisp/mh-e/mh-utils-tests.el: Update macro declara... 168665da59 Move some xwidget entries efde024361 time-stamp-tests: improvements to test macros 06c944cff1 Fix rfc6068-parse-mailto-url autoload 9b6b5e37ef Regexp-quote github domains in bug-reference 1f6cdeb12c Ensure valid end/beginning lines in message-mark-inserted-... 9b46150ab0 * etc/NEWS: Improve 'repeat-mode' entry. 9c37b812da ; * lisp/repeat.el (repeat-mode): Fix docstring typo. caf87d80fa * lisp/repeat.el (repeat-keep-prefix): Expand description. 24083c8d13 * lisp/net/eww.el (eww-retrieve-command): Add :tag. cf7d8fb1d7 Add description of cards to etc/refcards/README d2849cc645 Fix 'calculate-lisp-indent' when "[" starts containing sex... 2a0a368ddc Fix typo in doc/emacs/anti.texi 9529e1d2fb Update doc of Edebug specification for macros 5bc522b4f4 ; * lisp/simple.el (kill-region): A better fix for bug#51320. ee6bdd6eef Fix non-interactive behavior of 'kill-region' 2b7655ca0e ; More accurate doc string for 'tab-bar-format' 2841e26744 * test/lisp/dabbrev-tests.el: Use 'kbd' for readable keys. 1cdb4d2077 * lisp/menu-bar.el (menu-bar-keymap): Add optional arg KEY... # Conflicts: # etc/NEWS # lisp/progmodes/bug-reference.el
| * Fix 'calculate-lisp-indent' when "[" starts containing sexp (Bug#51312)Martin Rudalics2021-10-221-4/+5
| | | | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (calculate-lisp-indent): Handle arbitrary paren syntax after skipping whitespace backwards within containing sexp (Bug#51312).
* | Add indentation rules for DEFUN's def* functionsLars Ingebrigtsen2021-10-181-0/+7
| |
* | Remove the "def" indentation heuristicLars Ingebrigtsen2021-10-181-3/+0
| | | | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): Don't indent function calls with names that that start with "def" specially (bug#43329).
* | Fontify :doc keywords as documentationLars Ingebrigtsen2021-10-181-1/+3
| | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-string-after-doc-keyword-p): Extend to :doc, too (bug#51230).
* | Merge from origin/emacs-28Glenn Morris2021-10-051-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 63abe976ce (origin/emacs-28) Document minibuffer-default-prompt-forma... b5afbedc90 Backward compatibility option for 'nobreak-char-display' ea1b728a06 ; * lisp/dired.el: Fix typo. 984eafeb98 Unbreak the build after Gnulib update 5946370cd1 Check, whether an FUSE mount has been broken in Tramp 90575a6c0c Disable 'nobreak-char-display' in Eldoc buffers 570e2c9a17 Fix small error in comint-send-input fd7bb31412 Update documentation of search-whitespace-regexp 1f4ced47a1 Fix cc-compat.el syntax error b431f54c1b Mention `seq-uniq' in `delete-dups' documentation 0a7bab689c ; Minor stylistic fixes found by checkdoc e2861e2d08 ; * etc/NEWS: Fix typo. 1a65d49931 Port recent Gnulib changes to MS-Windows 68a256c892 Update from Gnulib 63cb65dcce * Fix mh tests for native comp builds (bug#50975) e606cc6f40 * Fix `batch-native-compile' not to spawn a subprocess 894dfe70da Fix native-compilation build from tarball on Cygwin 2ce5e08058 Remove U+FE0F from script-representative-chars # Conflicts: # etc/NEWS
| * ; Minor stylistic fixes found by checkdocStefan Kangas2021-10-051-2/+2
| |
* | Change the call convention for `defvar-keymap'Lars Ingebrigtsen2021-10-051-40/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/keymaps.texi (Changing Key Bindings): Adjust documentation. * lisp/simple.el (special-mode-map): * lisp/net/shr.el (shr-map): * lisp/net/eww.el (eww-link-keymap): (eww-mode-map): (eww-submit-map): (eww-textarea-map): (eww-bookmark-mode-map): (eww-history-mode-map): (eww-buffers-mode-map): * lisp/gnus/message.el (message-mode-map): * lisp/gnus/gnus-html.el (gnus-html-image-map): * lisp/gnus/gnus-eform.el (gnus-edit-form-mode-map): * lisp/gnus/gnus-dired.el (gnus-dired-mode-map): * lisp/gnus/gnus-bookmark.el (gnus-bookmark-bmenu-mode-map): Adjust usage of `defvar-keymap'. * lisp/subr.el (define-keymap, define-keymap--define): Change how these functions call each other. (defvar-keymap): Change interface to be more like `define-keymap'. * lisp/emacs-lisp/lisp-mode.el (lisp-indent--defvar-keymap): Remove. (lisp-indent-function): Don't use it.
* | Add 'define-keymap' and 'defvar-keymap'Lars Ingebrigtsen2021-10-041-23/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/keymaps.texi (Changing Key Bindings): Document define-keymap and defvar-keymap. * lisp/subr.el (define-keymap): New function. (define-keymap--define): New function. (defvar-keymap): New macro. * lisp/emacs-lisp/lisp-mode.el (lisp-indent--defvar-keymap): New function. (lisp-indent-function): Use it to indent defvar-keymap.
* | Restore the flet indentation fixesakater2021-10-011-10/+72
|/ | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p): New function. (lisp-indent-function): Use it to fix cl-flet indentation.
* Revert "Indent bodies of local function definitions properly in elisp-mode"Mattias Engdegård2021-09-301-35/+10
| | | | This reverts commit 38037e04cb05cb1f2b604f0b1602d36b0bcf6985.
* Revert "Fix regressions in cl-flet indentation"Mattias Engdegård2021-09-301-43/+10
| | | | This reverts commit c42af5aee74f310bdcd63aac96b1c02ec07a1c50.
* Fix regressions in cl-flet indentationakater2021-09-301-10/+43
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p): Rename (from -p-less form) and fix indentation regression introduced by 38037e04cb05cb1f2b604f0b1602d36b0bcf6985 (bug#9622). Also add cl-macrolet cl-flet* cl-symbol-macrolet.
* Indent bodies of local function definitions properly in elisp-modeakater2021-09-251-10/+35
| | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): Check for local defforms (`cl-flet' and `cl-labels'). (lisp--local-defform-body): New auxiliary function (bug#9622).
* ; More stylistic docfixes in emacs-lisp/*.el found by checkdocStefan Kangas2021-09-181-1/+1
|
* Support '...' quoting in Lisp filesEli Zaretskii2021-09-161-2/+2
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2): Support quoting 'like this'.
* ; More minor docfixes found by checkdocStefan Kangas2021-09-141-1/+1
|
* Fix quoting style in Lisp commentsEli Zaretskii2021-09-121-1/+1
| | | | | | | | | | | * lisp/textmodes/rst.el: * lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions): * lisp/org/org.el: * lisp/org/org-list.el (org-list-to-generic): * lisp/org/org-compat.el: * lisp/hexl.el (hexl-ascii-region): * lisp/emacs-lisp/lisp-mode.el: * lisp/calendar/calendar.el: In comments, quote 'like this'.
* ; Fix symbol quoting typosStefan Kangas2021-09-121-1/+1
|
* Adjust docstring of lisp-mode (bug#49278)João Távora2021-06-301-1/+1
| | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-mode): Mention that this mode is primarily for Common Lisp.