summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Improve `C-h f` outputStefan Monnier2021-04-161-18/+20
| | | | Suggested by Michael Heerdegen <michael_heerdegen@web.de>.
* ; Fix typos: emacs lisp -> Emacs LispStefan Kangas2021-04-162-2/+2
|
* ; Remove some useless commentsStefan Kangas2021-04-163-12/+0
|
* * lisp/emacs-lisp/bindat.el: Allow non-fixed size of `strz`Stefan Monnier2021-04-151-9/+24
| | | | | | | | | (bindat--unpack-strz): Allow `len` to be nil. (bindat--pack-strz): New function. (bindat--type) <strz>: Make `len` arg optional. (bindat-type): Adjust debug spec and docstring accordingly. * doc/lispref/processes.texi (Bindat Types): Adjust accordingly.
* Add condition-case success handler (bug#47677)Mattias Engdegård2021-04-152-25/+42
| | | | | | | | | | | | | | | | | | | | Allow a condition-case handler on the form (:success BODY) to be specified as the success continuation of the protected form, with the specified variable bound to its result. * src/eval.c (Fcondition_case): Update the doc string. (internal_lisp_condition_case): Implement in interpreter. (syms_of_eval): Defsym :success. * lisp/emacs-lisp/bytecomp.el (byte-compile-condition-case): Implement in byte-compiler. * lisp/emacs-lisp/cl-macs.el (cl--self-tco): Allow self-TCO from success handler. * doc/lispref/control.texi (Handling Errors): Update manual. * etc/NEWS: Announce. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases) (bytecomp-condition-case-success): * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): Add test cases.
* * lisp/emacs-lisp/eieio-core.el (list-of): Don't quote lambdaStefan Monnier2021-04-131-6/+6
|
* Don't version-control generated file `grammat-wy.el`Stefan Monnier2021-04-121-2/+1
| | | | | | | | | | | | | | | | | | | This file is needed for CEDET's bootstrap, tho, so we now keep a copy of it under version control in `gram-wy-boot.el`, very much like we do with the `ldefs-boot.el` copy of `loaddefs.el`. * lisp/cedet/semantic/grm-wy-boot.el: Rename from `lisp/cedet/semantic/grammar-wy.el`. * lisp/cedet/semantic/grammar.el: Load `grm-wy-boot.el` if `grammar-wy.el` hasn't been generated yet. * admin/update_autogen: Also refresh `grm-wy-boot.el`. * admin/grammars/Makefile.in (WISENT): Add `grammar-wy.el` to the generated files. * .gitignore: Add `grammar-wy.el`.
* * lisp/emacs-lisp/smie.el: Fix URL. Remove redundant `:group` argsStefan Monnier2021-04-121-17/+17
| | | | | | (smie-indent-forward-token): Improve error message. (smie--funcall): New function. (smie-indent-calculate): Use it.
* * lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): SimplifyStefan Monnier2021-04-121-9/+9
|
* * lisp/emacs-lisp/float-sup.el (pi): Actually mark it as obsoleteStefan Monnier2021-04-121-0/+1
|
* * lisp/emacs-lisp/edebug.el (edebug--frame): Move docstring where it belongsStefan Monnier2021-04-121-2/+2
|
* (define-minor-mode): Warn about use of pre-Emacs-21 style argsStefan Monnier2021-04-121-99/+98
| | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Use `advertised-calling-convention` to avoid promoting the old style arguments. Emit a wanring when old-style arguments are used. Massage the docstring accordingly. * doc/lispref/modes.texi (Defining Minor Modes): Document the keyword arguments rather than the old-style positional arguments.
* * lisp/**/*.el: Avoid positional args to `define-minor-mode`Stefan Monnier2021-04-112-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back in Emacs-21.1, `define-minor-mode` grew keywords arguments to replace its old positional arguments. Let's make sure we don't use the old-style any more. * lisp/org/ox-beamer.el (org-beamer-mode-map): Move initialization into declaration. (org-beamer-mode): * lisp/textmodes/tildify.el (tildify-mode): * lisp/textmodes/sgml-mode.el (html-autoview-mode): * lisp/textmodes/rst.el (rst-minor-mode): * lisp/textmodes/remember.el (remember-notes-mode): * lisp/textmodes/ispell.el (ispell-minor-mode): * lisp/tar-mode.el (tar-subfile-mode): * lisp/strokes.el (strokes-mode): * lisp/so-long.el (so-long-minor-mode): * lisp/shell.el (shell-dirtrack-mode): * lisp/scroll-all.el (scroll-all-mode): * lisp/ruler-mode.el (ruler-mode): * lisp/rect.el (rectangle-mark-mode): * lisp/progmodes/sh-script.el (sh-electric-here-document-mode): * lisp/outline.el (outline-minor-mode): * lisp/org/org.el (org-cdlatex-mode): * lisp/org/org-table.el (org-table-header-line-mode) (org-table-follow-field-mode, orgtbl-mode): * lisp/org/org-src.el (org-src-mode): * lisp/org/org-list.el (org-list-checkbox-radio-mode): * lisp/org/org-indent.el (org-indent-mode): * lisp/org/org-capture.el (org-capture-mode): * lisp/obsolete/pc-select.el (pc-selection-mode): * lisp/obsolete/iswitchb.el (iswitchb-mode): * lisp/net/rcirc.el (rcirc-omit-mode, rcirc-multiline-minor-mode) (rcirc-track-minor-mode): * lisp/net/goto-addr.el (goto-address-mode, goto-address-prog-mode): * lisp/image-mode.el (image-minor-mode): * lisp/ibuf-ext.el (ibuffer-auto-mode): * lisp/gnus/gnus-cite.el (gnus-message-citation-mode): * lisp/font-core.el (font-lock-mode): * lisp/erc/erc.el (define-erc-module): * lisp/erc/erc-track.el (erc-track-minor-mode): * lisp/erc/erc-fill.el (erc-fill-mode): * lisp/epa-mail.el (epa-mail-mode): * lisp/emacs-lisp/checkdoc.el (checkdoc-minor-mode): * lisp/dirtrack.el (dirtrack-mode, dirtrack-debug-mode): * lisp/dired-aux.el (dired-isearch-filenames-mode): * lisp/cedet/semantic/idle.el (semantic-idle-scheduler-mode): * lisp/cedet/semantic/decorate/mode.el (semantic-decoration-mode): * lisp/autoarg.el (autoarg-mode, autoarg-kp-mode): * lisp/vc/pcvs.el (cvs-minor-mode): Avoid old-style positional args to `define-minor-mode`.
* Fix typo in cconvMattias Engdegård2021-04-111-1/+1
| | | | | | * lisp/emacs-lisp/cconv.el (cconv-convert): Typo. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test case.
* Edebug: Disable backtracking when hitting a &define keyword.Philipp Stephani2021-04-101-8/+10
| | | | | | | | | | | | | | | | | | | Edebug doesn't deal well with backtracking out of definitions, see Bug#41988. Rather than trying to support this rare situation (e.g. by implementing a multipass parser), prevent it by adding an implicit gate. * lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Disable backtracking when hitting a &define keyword. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-duplicate-&define): New unit test. (edebug-tests--duplicate-&define): New helper macro. * doc/lispref/edebug.texi (Backtracking): Mention &define in the list of constructs that disable backtracking. * etc/NEWS: Document new behavior.
* Fix condition-case optimiser bugMattias Engdegård2021-04-091-2/+8
| | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't perform incorrect optimisations when a condition-case variable shadows another lexical variable. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): New test case.
* Don't preserve window-line in tabulated-list-printStefan Kangas2021-04-091-15/+4
| | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-print): Don't try to preserve window-line. (Bug#42747)
* Self-TCO in `condition-case` error handlersMattias Engdegård2021-04-091-0/+7
| | | | | | | * lisp/emacs-lisp/cl-macs.el (cl--self-tco): Recognise `condition-case` handlers as being in the tail position. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): Extend test.
* Clarify obsoletion messages for easy-menu-{add,remove}Stefan Kangas2021-04-071-2/+6
| | | | | * lisp/emacs-lisp/easymenu.el (easy-menu-remove, easy-menu-add): Clarify obsoletion messages.
* Remove local uniquify functions in favour of seq-uniqStefan Kangas2021-04-051-0/+1
| | | | | | | | | | | | | * lisp/emacs-lisp/seq.el (seq-uniq): Add autoload cookie. * lisp/pcomplete.el: (pcomplete-uniquify-list): Use seq-uniq. * lisp/eshell/esh-util.el (eshell-uniqify-list) (eshell-uniquify-list): * lisp/nxml/rng-util.el (rng-uniquify-equal): * lisp/progmodes/idlwave.el (idlwave-uniquify): * lisp/textmodes/artist.el (artist-uniq): Make into obsolete function aliases for seq-uniq. Update callers. * lisp/nxml/rng-util.el (rng-uniquify-eq): Make obsolete in favor of seq-uniq. Update callers.
* Obsolete local set difference functions in favor of seq-differenceStefan Kangas2021-04-051-0/+1
| | | | | | | * lisp/emacs-lisp/seq.el (seq-difference): Add autoload cookie. * lisp/gnus/gnus-range.el (gnus-set-difference): * lisp/gnus/spam.el (spam-set-difference): Make obsolete in favor of seq-difference. Update callers.
* Replace two functions with seq-subseqStefan Kangas2021-04-031-0/+1
| | | | | | | | * lisp/emacs-lisp/seq.el (seq-subseq): Add autoload cookie. * lisp/eshell/esh-util.el (eshell-sublist): Redefine using seq-subseq and make obsolete. Update callers. * lisp/wid-edit.el (widget-sublist): Redefine as obsolete function alias for seq-subseq. Update callers.
* Use emacs-version instead of obsolete version variablesStefan Kangas2021-04-011-3/+6
| | | | | | | | | | | | | | * lisp/calendar/icalendar.el (icalendar-version): * lisp/dframe.el (dframe-version): * lisp/emacs-lisp/checkdoc.el (checkdoc-version): * lisp/emulation/edt.el (edt-version): * lisp/international/mule.el (mule-version): * lisp/linum.el (linum-version): * lisp/play/bubbles.el (bubbles-version): * lisp/textmodes/remember.el (remember-version): * lisp/url/url-vars.el (url-version): * lisp/woman.el (woman-version): Use emacs-version instead of obsolete version variables.
* Convert many more links to use HTTPSStefan Kangas2021-03-242-2/+2
|
* Move string-trim functions to subr.elLars Ingebrigtsen2021-03-242-25/+0
| | | | | | | | | | | | * doc/lispref/strings.texi (Creating Strings): Document them. * lisp/faces.el: Don't require subr-x, because that leads to build errors. * lisp/subr.el (string-trim, string-trim-right) (string-trim-left): Move here from subr-x.el. * lisp/emacs-lisp/shortdoc.el (string): Adjust.
* Fix cl-progv binding orderToby Cubitt2021-03-201-1/+2
| | | | | * lisp/emacs-lisp/cl-macs.el (cl-progv): Bind variables in the correct order (bug#47272).
* * lisp/emacs-lisp/bytecomp.el: Remember location of unresolved callsStefan Monnier2021-03-191-51/+20
| | | | | | | | | | | | | | | I've gotten tired of seeing the "function foo not known to be defined" warning without any line number information. So this patch adds as line number the position of the first use of that function in the file (well, approximately, as usual). (byte-compile-unresolved-functions): Add POSITIONs in the alist. (byte-compile-function-warn): Store the current position in `byte-compile-unresolved-functions`. (byte-compile-arglist-warn): Adjust accordingly. (byte-compile-print-syms): Delete unused function. (byte-compile-warn-about-unresolved-functions): Use the stored position to give more precise warnings.
* * lisp/emacs-lisp/pcase.el (pcase-compile-patterns): New function (bug#47261)Stefan Monnier2021-03-191-54/+93
| | | | | Extracted from `pcase--expand`. (pcase--expand): Use it.
* Fix copyright lines mistakenly treated as outline headersStefan Monnier2021-03-181-1/+1
| | | | | | | | | | | * lisp/emacs-lisp/generator.el: * test/lisp/cedet/semantic-utest.el: * test/lisp/cedet/semantic/format-tests.el: * test/lisp/cedet/semantic/fw-tests.el: * test/lisp/cedet/semantic/bovine/gcc-tests.el: * test/lisp/cedet/semantic/format-resources/test-fmt.el: * test/manual/cedet/semantic-tests.el: * lisp/obsolete/inversion.el: Use only 2 semi-colons before "Copyright".
* * lisp/emacs-lisp/cl-macs.el (cl--self-tco): Optimize the "return nil" caseStefan Monnier2021-03-181-6/+12
|
* Optimise tail calls in `and` and `or` forms in `cl-labels` functionsMattias Engdegård2021-03-181-0/+6
| | | | | | * lisp/emacs-lisp/cl-macs.el (cl--self-tco): Handle `and` and `or`. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): Add test cases.
* Compute chart-face-list dynamicallyLars Ingebrigtsen2021-03-181-28/+36
| | | | | | | | * lisp/emacs-lisp/chart.el (chart-face-list): Allow a function as the value (bug#47133) so that we can compute the faces dynamically on different displays. (chart--face-list): New function. (chart-draw-data): Use it.
* Make memory-report work with buffer-local unbound varsLars Ingebrigtsen2021-03-181-1/+1
| | | | | * lisp/emacs-lisp/memory-report.el (memory-report--buffer-data): Protect against buffer-local unbound variables (bug#47057).
* * lisp/emacs-lisp/benchmark.el (benchmark-call): New functionStefan Monnier2021-03-171-31/+67
| | | | | (benchmark-run, benchmark-run-compiled, benchmark): Use it. (benchmark--adaptive): New internal function.
* Init archive and add noconfirm to 'package-install-selected-packages'Gabriel do Nascimento Ribeiro2021-03-151-6/+10
| | | | | | * lisp/emacs-lisp/package.el (package-install-selected-packages): Add call to 'package--archives-initialize' and add optional argument NOCONFIRM to skip user confirmation when installing packages. (Bug#47124)
* Merge from origin/emacs-27Glenn Morris2021-03-121-2/+1
|\ | | | | | | | | 02a5cfce47 (origin/emacs-27) * lisp/mouse.el: Fix mouse-1-clock-follo... c881e990e3 * lisp/emacs-lisp/gv.el (edebug-after): Don't run the gett...
| * * lisp/emacs-lisp/gv.el (edebug-after): Don't run the getter in the setterStefan Monnier2021-03-051-2/+1
| | | | | | | | | | | | | | | | | | This fixes bug#46573 which was introduced by commit d79cf638f278e50c22feb53d6ba556f5ce9d7853. The new code is a middle ground, which makes sure the instrumentation point is used (so the coverage checker won't have ghost unreachable instrumentation points) yet without artificially running the getter when we only need to run the setter.
* | ; Fix typos in doc stringsMattias Engdegård2021-03-121-1/+1
| |
* | * lisp/emacs-lisp/cconv.el (cconv--analyze-use): Simplify (doh!)Stefan Monnier2021-03-111-1/+1
| |
* | * lisp/emacs-lisp/cconv.el (cconv--analyze-use): Tune down the warningStefan Monnier2021-03-111-1/+2
| | | | | | | | | | Don't warn for always-nil bindings if the binding is made explicit. Fixes bug#47080.
* | * 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.
* | Make byte-compiled uses of `define-minor-mode' more compatibleLars Ingebrigtsen2021-03-121-5/+13
| | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Be more defensive about accessing minor mode variables.
* | * lisp: Remove yet more always-nil variablesStefan Monnier2021-03-112-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/align.el (align-region): Remove always-nil variable `group-c`. * lisp/ido.el (ido-make-prompt): Remove always-nil variable `prefix`. * lisp/xdg.el (xdg-mime-collect-associations): Remove always-nil variable `end`. * lisp/calc/calc-yank.el (calc-edit): Remove always-nil variable `flag`. * lisp/calendar/todo-mode.el (todo-edit-item--header): Remove always-nil variable `dayname`. (todo-show-categories-table): Remove always-nil variable `sortkey`. * lisp/emacs-lisp/checkdoc.el (checkdoc-ispell-docstring-engine): Remove always-nil variable `err`. * lisp/emacs-lisp/tcover-ses.el: Remove always-nil variable `pause`. * lisp/eshell/em-ls.el (eshell-ls-files): Remove always-nil variable `ignore`. * lisp/net/ange-ftp.el (ange-ftp-copy-file-internal): Remove always-nil variable `temp2`. * lisp/progmodes/cperl-mode.el (cperl-tags-hier-init): Remove always-nil variables `l1`, `l2`, `l3`. (cperl-tags-treeify): Remove always-nil variable `l1`. * lisp/progmodes/ebrowse.el (ebrowse-tags-read-member+class-name): Remove always-nil variable `class`. * lisp/textmodes/artist.el (artist-draw-ellipse-with-0-height): Remove always-nil variable `fill-info`. * lisp/textmodes/flyspell.el (flyspell-emacs-popup): Remove always-nil variable `show-affix-info`. * lisp/textmodes/rst.el (rst-Ado): Remove always-nil variable `char`. * lisp/vc/vc.el (vc-diff-build-argument-list-internal): Remove always-nil variable `rev2-default`.
* | * lisp/emacs-lisp/cconv.el (cconv--analyze-use): Warn never-initialized varsStefan Monnier2021-03-111-5/+8
| | | | | | | | (byte-compile-not-lexical-var-p): Remove Emacs<24 compatibility.
* | Fix byte-compilation warning in benchmark-runLars Ingebrigtsen2021-03-101-1/+2
| | | | | | | | | | * lisp/emacs-lisp/benchmark.el (benchmark-run): Avoid a byte-compilation warning about an empty let body (bug#46819).
* | Mark string predicates side-effect-freeMattias Engdegård2021-03-101-0/+2
| | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Add string>, string-greaterp, string-empty-p, string-prefix-p, string-suffix-p and string-blank-p, all recently marked pure.
* | Fix duplicate ":" in ert-find-test-other-window promptStefan Kangas2021-03-101-1/+1
| | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-find-test-other-window): Don't insert duplicate ":" in prompt.
* | Do mode tagging in ert.elStefan Kangas2021-03-101-13/+14
| |
* | * lisp/emacs-lisp/cconv.el: Don't confuse a string for a docstringStefan Monnier2021-03-091-2/+3
| | | | | | | | | | | | | | (cconv--convert-funcbody): Check there's something after a docstring. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-string-vs-docstring): New corresponding test.
* | Fix structure of condition object in nested 'ert-fail'.Philipp Stephani2021-03-081-1/+1
| | | | | | | | | | | | | | | | | | See the test 'ert-test-fail' for the expected structure. * lisp/emacs-lisp/ert.el (ert--should-signal-hook): Condition list should be (SYMBOL . DATA), not (SYMBOL DATA). * test/lisp/emacs-lisp/ert-tests.el (ert-test-fail-inside-should): Fix unit test.