summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* * lisp/tab-bar.el: Use customizable button icons (bug#51309, bug#51648)Juri Linkov2022-10-241-11/+14
| | | | | | | | | | | | | | * lisp/tab-bar.el (tab-bar--load-buttons): Use 'define-icon' to define icons for tab-bar-new, tab-bar-close, tab-bar-menu-bar. Also set tab-bar-new-button, tab-bar-close-button, tab-bar-menu-bar-button to the specified icon-string. (tab-bar-history-mode): Use 'define-icon' to define icons for tab-bar-back, tab-bar-forward. Also set tab-bar-back-button, tab-bar-forward-button to the specified icon-string. * lisp/emacs-lisp/icons.el (icons--create)<image>: Allow to easy add new image props by using 'apply' on them. Add :margin.
* Audit some plist uses with new predicate argumentBasil L. Contovounesios2022-10-223-66/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/lists.texi (Plist Access): Improve description of default predicate. * lisp/emacs-lisp/cl-extra.el (cl-getf, cl--set-getf): Assume plist-member always returns a cons. * lisp/emacs-lisp/gv.el (plist-get): Support new optional predicate argument (bug#47425#91). * lisp/emacs-lisp/map.el: Bump minor version. (map--dispatch): Remove now that bug#58563 is fixed. Break two remaining uses out into corresponding cl-defmethods. (map--plist-p): Add docstring. (map--plist-has-predicate, map--plist-member-1, map--plist-member) (map--plist-put-1, map--plist-put): New definitions for supporting predicate argument backward compatibly. (map-elt): Fix generalized variable getter under a predicate (bug#58531). Use predicate when given a plist. (map-put): Avoid gratuitous warnings when called without the hidden predicate argument. Improve obsoletion message. (map-put!): Use predicate when given a plist. (map-contains-key): Ditto. Declare forgotten advertised-calling-convention (bug#58531#19). (map--put): Group definition in file together with that of map-put!. * lisp/files-x.el (connection-local-normalize-criteria): Simplify using mapcan + plist-get. * lisp/net/eudc.el (eudc--plist-member): New convenience function. (eudc-plist-member, eudc-plist-get, eudc-lax-plist-get): Use it instead of open-coding plist-member. * src/fns.c (Fplist_get, plist_get, Fplist_put, plist_put): Pass the plist element as the first argument to the predicate, for consistency with assoc + alist-get. (Fplist_member, plist_member): Move from widget to plist section. Open-code the EQ case in plist_member, and call it from Fplist_member in that case, rather than the other way around. * test/lisp/apropos-tests.el (apropos-tests-format-plist): Avoid polluting obarray. * test/lisp/emacs-lisp/cl-extra-tests.el (cl-getf): Extend test with generalized variables, degenerate plists, and improper lists. * test/lisp/emacs-lisp/gv-tests.el: Byte-compile file; in the meantime bug#24402 seems to have been fixed or worked around. (gv-setter-edebug): Inhibit printing messages. (gv-plist-get): Avoid modifying constant literals. Also test with a predicate argument. * test/lisp/emacs-lisp/map-tests.el (with-maps-do): Simplify docstring. (test-map-elt-testfn): Rename... (test-map-elt-testfn-alist): ...to this. Also test with a predicate argument. (test-map-elt-testfn-plist, test-map-elt-gv, test-map-elt-signature) (test-map-put!-plist, test-map-put!-signature) (test-map-contains-key-signature, test-map-plist-member) (test-map-plist-put): New tests. (test-map-contains-key-testfn): Also test with a predicate argument. (test-map-setf-alist-overwrite-key, test-map-setf-plist-insert-key) (test-map-setf-plist-overwrite-key): Avoid modifying constant literals. (test-hash-table-setf-insert-key) (test-hash-table-setf-overwrite-key): Fix indentation. (test-setf-map-with-function): Make test more precise. * test/lisp/net/eudc-tests.el: New file. * test/lisp/subr-tests.el (test-plistp): Extend test with circular list. * test/src/fns-tests.el (test-cycle-equal, test-cycle-nconc): Move from plist section to circular list section. (plist-put/odd-number-of-elements): Avoid modifying constant literals. (plist-member/improper-list): Simplify. (test-plist): Move to plist section. Also test with a predicate argument.
* Bindat (src, strz): Operate on vectors tooNacho Barrientos2022-10-211-2/+4
| | | | | | | | | | Copyright-paperwork-exempt: yes * lisp/emacs-lisp/bindat.el (bindat--unpack-str, bindat--unpack-strz): Fix the non-string case. * test/lisp/emacs-lisp/bindat-tests.el (bindat-test--strz-array-unpack) (bindat-test--str-simple-array-unpack,bindat-test--str-combined-array-unpack): New tests.
* Improve and extend documentation of ElDocEli Zaretskii2022-10-211-59/+68
| | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/eldoc.el (eldoc-documentation-strategy) (eldoc-documentation-enthusiast) (eldoc-documentation-compose-eagerly) (eldoc-documentation-compose, eldoc-documentation-default) (eldoc-minibuffer-message, eldoc-idle-delay) (eldoc-print-after-edit) (eldoc-echo-area-display-truncation-message) (eldoc-echo-area-use-multiline-p) (eldoc-echo-area-prefer-doc-buffer): Doc string fixes. * doc/emacs/emacs.texi (Top): * doc/emacs/programs.texi (Documentation, Programming Language Doc): Rename "Lisp Doc" to "Programming Language Doc", including in parent menus. All references changed. (Programming Language Doc): Formerly "Lisp Doc". Rewrite to not be specific to Emacs Lisp. Improve markup and wording. Document more commands and variables. * doc/emacs/maintaining.texi (Maintaining): Improve indexing.
* * Fix async native compilation (bug#58637)Andrea Corallo2022-10-191-1/+2
| | | | | * lisp/emacs-lisp/comp.el (comp--native-compile): Fix gate condition. (comp-run-async-workers): Add assetion.
* (byte-compile--first-symbol-with-pos): Fix bug#58601Stefan Monnier2022-10-181-21/+17
| | | | | * lisp/emacs-lisp/bytecomp.el: Require `subr-x`. (byte-compile--first-symbol-with-pos): Avoid inf-loops on circular data.
* Fix previous loaddefs-gen fixLars Ingebrigtsen2022-10-181-3/+2
|
* Fix faulty loaddefs detectionLars Ingebrigtsen2022-10-181-1/+2
| | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--emacs-batch): Fix faulty loaddefs detection.
* * Prevent potential native compilation infinite recursionsAndrea Corallo2022-10-181-83/+85
| | | | | | * lisp/emacs-lisp/comp.el (comp-no-spawn): New var. (comp-subr-trampoline-install, comp-final, comp-run-async-workers) (comp--native-compile): Update.
* Improve native-compile-prune-cache messagesStefan Kangas2022-10-171-1/+1
| | | | | * lisp/emacs-lisp/comp.el (native-compile-prune-cache): Quote name of pruned directory.
* Don't prune *.eln files in parent of eln-load-pathStefan Kangas2022-10-171-1/+3
| | | | | | | | * lisp/emacs-lisp/comp.el (native-compile-prune-cache): Don't prune *.eln files in parent directory of `native-comp-eln-load-path'. * test/lisp/emacs-lisp/comp-tests.el (test-native-compile-prune-cache/dont-delete-in-parent-of-cache): New test.
* Fix spurious "Compilation finished" native-comp messagesLars Ingebrigtsen2022-10-171-3/+8
| | | | | | | | * lisp/emacs-lisp/comp.el (native--compile-async): Don't start the async compilation if we didn't add anything. This avoids spurious "Compilation finished" messages in the *Async* buffer when it turned out that all the files we considered nativecomping were skipped.
* Avoid having the async compile log saying it's compiling loaddefsLars Ingebrigtsen2022-10-172-3/+10
| | | | | | | | | | | | | * lisp/loadup.el (featurep): Define the hash table in nativecomp builds (but not otherwise). A more natural place to define this would be in comp.el, but comp.el isn't loaded yet when we load the .elc file that updates comp--no-native-compile. We could change the load order and move the definition to comp.el, though. * lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Allow inhibiting nativecomp earlier (bug#57627). * lisp/emacs-lisp/comp.el (native-compile-async-skip-p): Use the data.
* cl-generic: Fix `advertised-calling-convention` declarationsStefan Monnier2022-10-163-6/+15
| | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-generic.el (cl-generic-define-method): Preserve the `advertised-calling-convention`, if any (bug#58563). * lisp/subr.el (declare): Warn when we hit this. * lisp/emacs-lisp/byte-run.el (get-advertised-calling-convention): New fun. * lisp/progmodes/elisp-mode.el (elisp-get-fnsym-args-string): * lisp/help-fns.el (help-fns--signature): * lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition): Use it. * test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-tests--acc): New fun. (cl-generic-tests--advertised-calling-convention-bug58563): New test.
* Handle ;;;###theme-autoload comments in etc/themesPhilip Kaludercic2022-10-151-1/+8
| | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--emacs-batch): Extract the autoloads and have them loaded along with loaddefs.el. * etc/NEWS: Mention the new feature. (Bug#57639)
* Tag themes with propertiesPhilip Kaludercic2022-10-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/custom.texi (Custom Themes): Document 'theme-choose-variant'. * doc/lispref/customize.texi (Custom Themes): Document the new optional argument to 'deftheme'. (Autoload): Mention that 'deftheme' is not copied verbatim. * etc/themes/adwaita-theme.el (adwaita): Add properties. * etc/themes/deeper-blue-theme.el (deeper-blue): Add properties. * etc/themes/dichromacy-theme.el (dichromacy): Add properties. * etc/themes/light-blue-theme.el (light-blue): Add properties. * etc/themes/manoj-dark-theme.el (manoj-dark): Add properties. * etc/themes/misterioso-theme.el (misterioso): Add properties. * etc/themes/tango-dark-theme.el (tango-dark): Add properties. * etc/themes/tango-theme.el (tango): Add properties. * etc/themes/tsdh-dark-theme.el (tsdh-dark): Add properties. * etc/themes/tsdh-light-theme.el (tsdh-light): Add properties. * etc/themes/wheatgrass-theme.el (wheatgrass): Add properties. * etc/themes/whiteboard-theme.el (whiteboard): Add properties. * etc/themes/wombat-theme.el (wombat): Add properties. * etc/themes/modus-operandi-theme.el: Add properties. * etc/themes/modus-vivendi-theme.el: Add properties. * etc/themes/leuven-dark-theme.el (leuven-dark): Add properties. * etc/themes/leuven-theme.el (leuven): Add properties. * lisp/custom.el (deftheme): Allow for optional arguments to set the property list. (custom-declare-theme): Accept the same optional arguments as 'deftheme'. (theme-list-variants): Add new function. (theme-choose-variant): Add new command for switching between members of a theme family. (toggle-theme): Add an alias for 'theme-choose-variant'. * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload): Handle 'defcustom's by extracting the properties. (Bug#57639)
* Use file-size-human-readable in memory-report--formatStefan Kangas2022-10-151-6/+1
| | | | | * lisp/emacs-lisp/memory-report.el (memory-report--format): Use file-size-human-readable.
* Add trampoline AOT compilation target (bug#58318)Andrea Corallo2022-10-111-0/+11
| | | | | | | * Makefile.in (trampolines): New target. * lisp/Makefile.in (trampolines): Likewise. * lisp/emacs-lisp/comp.el (comp-compile-all-trampolines): New function.
* package.el: Understand a few more variations in tarball formatsStefan Monnier2022-10-081-3/+7
| | | | | | | | | | * lisp/emacs-lisp/package.el (package-untar-buffer): Fix thinko. (package-tar-file-info): Handle the case where the first file is in a subdirectory. * test/lisp/emacs-lisp/package-tests.el (package-test-bug58367): New test. * test/lisp/emacs-lisp/package-resources/ustar-withsub-0.1.tar: * test/lisp/emacs-lisp/package-resources/v7-withsub-0.1.tar: New files.
* Fix vtable-insert-object line insertionLars Ingebrigtsen2022-10-081-3/+11
| | | | | | * lisp/emacs-lisp/vtable.el (vtable-insert-object): Pass in the correct ellipsis values (bug#58370). (vtable--insert-line): Don't bug out on missing optional arguments.
* Mention seq-keep in shortdocLars Ingebrigtsen2022-10-081-0/+2
| | | | * lisp/emacs-lisp/shortdoc.el (sequence): Mention seq-keep.
* ; Silence byte-compiler in benchmark.elStefan Kangas2022-10-071-0/+1
| | | | * lisp/emacs-lisp/benchmark.el (cl-lib): Require.
* Clearer byte-compiler arity warnings (bug#58319)Mattias EngdegÄrd2022-10-071-1/+3
| | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-signature-string): Replace '3+' and '3-4' with '3 or more' and '3 or 4', respectively.
* Improve package-check-signature docstringStefan Kangas2022-10-071-10/+17
| | | | | * lisp/emacs-lisp/package.el (package-check-signature): Improve docstring.
* Fix calling `package-reinstall' just after quick initialization.Matt Armstrong2022-10-061-4/+8
| | | | | | | | * lisp/emacs-lisp/package.el (package-reinstall): call `package--archives-initialize', just like `package-install' does. This populates `package-alist', and so fixes calling `package-reinstall' as the first thing done after package "quick init" (Bug#53527).
* Add 'seq-keep'Lars Ingebrigtsen2022-10-041-0/+4
| | | | | * doc/lispref/sequences.texi (Sequence Functions): Document it. * lisp/emacs-lisp/seq.el (seq-keep): New function (bug#58278).
* Make `eq' obsolete as a generalized variableLars Ingebrigtsen2022-10-041-0/+1
| | | | | * lisp/emacs-lisp/gv.el (eq): Make obsolete as a generalized variable.
* Make loaddefs-generate more resilientLars Ingebrigtsen2022-10-041-1/+1
| | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Don't bug out when there's an existing loaddefs file that's not formatted properly (bug#58280).
* Don't bug out in advice--make-docstring when there's not doc stringLars Ingebrigtsen2022-10-041-1/+2
| | | | | * lisp/emacs-lisp/nadvice.el (advice--make-docstring): Don't bug out on functions with no documentation (bug#58284).
* ; Fix logic of $HOME adjustment for 'ert-remote-temporary-file-directory'Jim Porter2022-10-031-1/+1
| | | | | * lisp/emacs-lisp/ert-x.el (ert-remote-temporary-file-directory): Only adjust $HOME when it doesn't exist (bug#58265).
* Rename to inhibit-automatic-native-compilationLars Ingebrigtsen2022-10-031-1/+1
| | | | | | | | | | | | | * src/comp.c (maybe_defer_native_compilation): (syms_of_comp): * lisp/subr.el (native-comp-deferred-compilation): * lisp/startup.el (inhibit-native-compilation): (normal-top-level): * lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load): * lisp/emacs-lisp/comp.el (comp-trampoline-compile): * etc/NEWS: * doc/lispref/compile.texi (Native-Compilation Variables): Rename inhibit-native-compilation to inhibit-automatic-native-compilation.
* Add new variable 'inhibit-native-compilation'Lars Ingebrigtsen2022-10-031-16/+20
| | | | | | | | | | | | | | | | | | | | * doc/lispref/compile.texi (Native-Compilation Variables): Document it. * lisp/startup.el (normal-top-level): Set inhibit-native-compilation from environment variable. * lisp/subr.el (native-comp-deferred-compilation): Make obsolete. * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Don't write trampolines to disk. * lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load): Adjust. * src/comp.c (syms_of_comp): New variable inhibit-native-compilation. (maybe_defer_native_compilation): Use it.
* Fix more overly long docstrings in eieioStefan Kangas2022-10-031-8/+11
| | | | | * lisp/emacs-lisp/eieio.el (defclass): Fix more overly long docstrings. (Bug#58252)
* Fix overly wide docstrings generated by eieioStefan Kangas2022-10-021-6/+12
| | | | | | * lisp/emacs-lisp/eieio-core.el (eieio-make-class-predicate) (eieio-make-child-predicate, eieio-defclass-internal): Don't generate overly wide docstrings. (Bug#58252)
* ; Fix typos (prefer American spelling)Stefan Kangas2022-09-291-2/+2
|
* package-update would always re-install packageLin Sun2022-09-281-2/+2
| | | | | | * lisp/emacs-lisp/package.el (package--updateable-packages): fix version comparison between available packages and archived packages (bug#58129).
* ert-x: Improve realism of `ert-with-test-buffer-selected'Richard Hansen2022-09-271-1/+9
| | | | | | * lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected): Set `inhibit-read-only' and `buffer-read-only' to nil when executing the body to provide a more realistic test environment.
* Fix percentage width computation in vtableLars Ingebrigtsen2022-09-261-1/+2
| | | | | * lisp/emacs-lisp/vtable.el (vtable--compute-width): Fix percentage computation (bug#58067).
* ; Clarify wording of some doc strings in shortdoc.elEli Zaretskii2022-09-251-4/+4
| | | | | | * lisp/emacs-lisp/shortdoc.el (shortdoc-next, shortdoc-previous) (shortdoc-next-section, shortdoc-previous-section): Clarify wording.
* Boolean constant detection additionsMattias EngdegÄrd2022-09-251-1/+2
| | | | | | * lisp/emacs-lisp/byte-opt.el (byte-opt--bool-value-form): `set` is boolean identity in its second argument. (byte-compile-trueconstp): `set-marker` is always true.
* Add :buffer argument to ert-with-temp-fileStefan Kangas2022-09-251-2/+16
| | | | | | * lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Add new keyword argument :buffer SYMBOL to visit the file with `find-file-literally' before running the body, and cleaning up after.
* Improve shortdoc documentationStefan Kangas2022-09-251-8/+17
| | | | | | | | | * doc/emacs/help.texi (Name Help): * doc/lispref/help.texi (Documentation Groups): Refer to 'shortdoc' convenience alias instead of 'shortdoc-display-group'. * lisp/emacs-lisp/shortdoc.el: Add Commentary. (shortdoc-next, shortdoc-previous) (shortdoc-next-section, shortdoc-previous-section): Doc fixes.
* Fix shortdoc movement commandsStefan Kangas2022-09-251-1/+1
| | | | | * lisp/emacs-lisp/shortdoc.el (shortdoc--goto-section): Don't skip over current function or section when searching.
* Add new command 'shortdoc-copy-function-as-kill'Stefan Kangas2022-09-251-1/+16
| | | | | | * lisp/emacs-lisp/shortdoc.el (shortdoc-copy-function-as-kill): New command. (shortdoc-mode-map): Bind above new command to "w".
* Bind "N"/"P" to next/prev section in shortdocStefan Kangas2022-09-251-0/+2
| | | | | * lisp/emacs-lisp/shortdoc.el (shortdoc-mode-map): Bind "N" and "P" to 'shortdoc-next-section' and 'shortdoc-previous-section'.
* * lisp/emacs-lisp/icons.el (icons--create): Use default rotation 0 (bug#57813)Juri Linkov2022-09-241-1/+1
|
* Remove "manual" package--builtin-versions updatesLars Ingebrigtsen2022-09-242-10/+1
| | | | | | | * lisp/emacs-lisp/nadvice.el: * lisp/emacs-lisp/cl-generic.el: Don't push to package--builtin-versions "manually", because loaddefs-gen does this correctly now.
* Tweak how :override advice is formatted in *Help*Lars Ingebrigtsen2022-09-241-12/+28
| | | | | | * lisp/emacs-lisp/nadvice.el (advice--make-single-doc): Format :overrides specially (bug#57974). (advice--make-docstring): Put overrides at the front.
* Rename file-name-directoryLars Ingebrigtsen2022-09-241-5/+5
| | | | | | | * lisp/emacs-lisp/shortdoc.el (file-name): * doc/lispref/files.texi (Directory Names): Adjust. * lisp/files.el (file-name-parent-directory): Rename from `file-name-directory' (bug#58039).
* * lisp/emacs-lisp/shortdoc.el (file-name): Improve examples.Stefan Kangas2022-09-241-4/+2
|