summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* cl-symbol-macrolet: Fix recent regressionStefan Monnier2022-09-061-133/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recent fix for bug#57397 introduced a regression, breaking the `cl-lib-symbol-macrolet-hide` test. It turned out that the origin of the problem was that `gv.el` uses `macroexpand-1` which does not (can't) use `macroexpand` but `cl-symbol-macrolet` failed to advise `macroexpand-1` the way it advised `macroexpand`. To fix this, we change `cl-symbol-macrolet` so it advises both, and we do that with a new `macroexpand` advice which delegates the bulk of the work to `macroexpand-1`. Along the way, I bumped into another bug in the interaction between `cl-letf` and `cl-symbol-macrolet`, which I tried to fix in `cl-letf`. I hear the war on `cl-symbol-macrolet` was a failure. Maybe ... just say no? * lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand-1): New function, extracted from `cl--sm-macroexpand`. (cl--sm-macroexpand): Rewrite completely. (cl-symbol-macrolet): Advise both `macroexpand` and `macroexpand-1`. (cl--letf): Don't use the "simple variable" code for symbol macros. * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-symbol-macrolet-hide): Revert last change because the test was right. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-test--symbol-macrolet): Add a test case.
* Fit the re-builder window to the bufferJuri Linkov2022-09-051-1/+2
| | | | | * lisp/emacs-lisp/re-builder.el (re-builder): Fit the height to the buffer (bug#56772).
* Merge from origin/emacs-28Stefan Kangas2022-09-051-2/+5
|\ | | | | | | | | 5713c730f2 Update to Org 9.5.5 aad38d6010 * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail m...
| * * lisp/emacs-lisp/comp.el (comp-run-async-workers): Fail more gracefullyStefan Monnier2022-09-031-2/+5
| | | | | | | | | | | | Otherwise Emacs may fail to start if it can't find a writable `~/.emacs.d/eln-cache` directory. Fixes bug#57562. See also Debian's bug #1017739.
* | Add new function `seq-positions'Damien Cassou2022-09-042-0/+21
| | | | | | | | | | | | | | | | | | | | | | * doc/lispref/sequences.texi (Sequence Functions): Document it. * lisp/emacs-lisp/seq.el (seq-positions): New function. * lisp/emacs-lisp/shortdoc.el (sequence): Mention it. * test/lisp/emacs-lisp/seq-tests.el (test-seq-positions): Test it (bug#57548).
* | Add new function `seq-remove-at-position'Damien Cassou2022-09-042-0/+17
| | | | | | | | | | | | | | | | | | | | | | * doc/lispref/sequences.texi (Sequence Functions): Document it. * lisp/emacs-lisp/seq.el (seq-remove-at-position): New function. * lisp/emacs-lisp/shortdoc.el (sequence): Mention it. * test/lisp/emacs-lisp/seq-tests.el (test-seq-remove-at-position): Test it.
* | Improve documentation of several functions in seq.elDamien Cassou2022-09-041-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/sequences.texi (Sequence Functions): * lisp/emacs-lisp/seq.el (seq-contains): (seq-contains-p): (seq-set-equal-p): (seq-position): (seq-union): (seq-intersection): (seq-difference): Use more standard wording in the docstrings (bug#57561).
* | gv.el and cl-macs.el: Fix bug#57397Stefan Monnier2022-09-032-2/+6
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/gv.el (gv-get): Obey symbol macros. * lisp/emacs-lisp/cl-macs.el (cl--letf): Remove workaround placed to try and handle symbol macros. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-test--symbol-macrolet): Add new testcase.
* | lisp/emacs-lisp/seq.el: remove unnecessary compatibility codeMattias Engdegård2022-09-031-17/+1
| | | | | | | | | | | | * lisp/emacs-lisp/seq.el (seq-take, seq--activate-font-lock-keywords): Simplify unnecessarily guarded code, as this file will only ever be used with the same version of Emacs.
* | * lisp/emacs-lisp/macroexp.el (macroexp--compiler-macro): Soften messageStefan Monnier2022-09-031-1/+2
| | | | | | | | Clarify that the error is "harmless".
* | * lisp/emacs-lisp/cl-macs.el: Use `define-symbol-prop` (bug#50869)Stefan Monnier2022-09-031-4/+4
| | | | | | | | | | | | (cl-define-compiler-macro, cl-defstruct, cl-deftype): Prefer `define-symbol-prop` over `put` so `unload-feature` can undo those definitions.
* | Inhibit nativecomp of loaddefs filesLars Ingebrigtsen2022-09-032-4/+11
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/generate-lisp-file.el (generate-lisp-file-trailer): Allow inhibiting nativecomp. * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric): Inhibit native-comp, because it's not very useful for loaddefs files.
* | Teach 'max-char' about the Unicode code rangeEli Zaretskii2022-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * src/character.c (Fmax_char): Accept an optional argument UNICODE, and, if non-nil, return the maximum codepoint defined by Unicode. * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Update the signature of 'max-char'. * etc/NEWS: * doc/lispref/nonascii.texi (Character Codes): Update the documentation of 'max-char'.
* | Fix define-minor-mode :keymap obsoletion warningLars Ingebrigtsen2022-09-021-1/+4
| | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Fix some warning.
* | Make easy-mmode-define-keymap obsoleteLars Ingebrigtsen2022-09-011-0/+3
| | | | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode-define-keymap): Make obsolete. (define-minor-mode): Add comment.
* | Make easy-mmode-defmap obsolete and adjust only callerLars Ingebrigtsen2022-09-011-3/+1
| | | | | | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode-defmap): Make obsolete. * lisp/progmodes/gud.el (gud-menu-map): Use easy-menu-define.
* | Fix warning about obsoleted generalized variablesLars Ingebrigtsen2022-08-251-0/+1
| | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Autoload so that the call here from gv.el (about obsolete generalized variables) doesn't bug out (bug#57394).
* | Make frame-width obsolete as a generalized variableLars Ingebrigtsen2022-08-251-0/+2
| | | | | | | | | | * lisp/emacs-lisp/gv.el (frame-width): Make obsolete as generalized variable.
* | Add NEWS entry about obsoleted generalized variablesLars Ingebrigtsen2022-08-231-1/+2
| |
* | Make XEmacs compat alias face-background-pixmap obsoleteStefan Kangas2022-08-232-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/faces.el (face-background-pixmap) (set-face-background-pixmap): Make XEmacs compat aliases obsolete in favor of 'face-stipple' and 'set-face-stipple'. Update callers. * lisp/emacs-lisp/gv.el (face-background-pixmap): Make XEmacs alias obsolete as a generalized variable. (face-stipple): New generalized variable. * doc/misc/cl.texi (Setf Extensions): Refer to above new generalized variable instead of the obsolete one.
* | ; Minor doc fix in easy-menu-{add,remove}Stefan Kangas2022-08-231-16/+2
| | | | | | | | | | * lisp/emacs-lisp/easymenu.el (easy-menu-remove, easy-menu-add): Minor doc fix: don't explain what this does in XEmacs.
* | 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.
* | Make buffer-local-value obsolete as a generalized variableLars Ingebrigtsen2022-08-231-12/+13
| | | | | | | | | | | | | | | | | | | | * lisp/electric.el (electric-indent-local-mode) (electric-layout-local-mode, electric-quote-local-mode): * lisp/elec-pair.el (electric-pair-local-mode): Adjust usage. * lisp/emacs-lisp/gv.el (make-obsolete-generalized-variable): Move since we're using it earlier in the file. (buffer-local-value): Make obsolete as a generalized variable since the semantics are unclear (bug#26624).
* | Make point-at-eol and point-at-bol obsoleteStefan Kangas2022-08-233-4/+5
| | | | | | | | | | | | | | * lisp/subr.el (point-at-eol, point-at-bol): Make XEmacs compat aliases obsolete in favor of `pos-bol'/'line-beginning-position' or 'pos-eol'/'line-end-position'. Update callers. Ref: https://lists.gnu.org/r/emacs-devel/2022-08/msg00853.html
* | Fix some no-X build warningsLars Ingebrigtsen2022-08-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/cus-edit.el (fringe-bitmap-p): Autoload. * lisp/image.el (clear-image-cache): Declare. * lisp/mouse.el (dnd-begin-file-dram): Autoload. * lisp/thumbs.el (image-supported-file-p): Declare (bug#57342). * lisp/mail/rmailmm.el (rmail-mime-set-bulk-data): * lisp/emacs-lisp/icons.el (icons--create): Avoid warnings on no-X builds.
* | Prefer pos-bol and pos-eol in tabulated-list.elStefan Kangas2022-08-221-8/+8
| | | | | | | | | | | | | | * lisp/emacs-lisp/tabulated-list.el (tabulated-list-print) (tabulated-list-print-entry, tabulated-list-delete-entry) (tabulated-list-set-col, tabulated-list-previous-column): Prefer pos-bol and pos-eol.
* | ; * lisp/emacs-lisp/shortdoc.el (buffer): Improve sorting.Stefan Kangas2022-08-221-2/+2
| |
* | Remove probably debugging code in reb-fontify-string-reLars Ingebrigtsen2022-08-221-2/+1
| | | | | | | | | | | | * lisp/emacs-lisp/re-builder.el (reb-fontify-string-re): Remove code that looks like left-over debugging code. This fixes a compilation warning.
* | * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix some type specAndrea Corallo2022-08-221-6/+16
| |
* | Revert "Make the generalized buffer-local-variable obsolete"Lars Ingebrigtsen2022-08-222-14/+12
| | | | | | | | | | | | This reverts commit bfe222288e02472bff0e1ab5ba7ef26af6a2769a. This led to the local modes not working.
* | Make the generalized buffer-local-variable obsoleteLars Ingebrigtsen2022-08-212-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/paren.el (show-paren-local-mode): * lisp/electric.el (electric-indent-local-mode) (electric-layout-local-mode, electric-quote-local-mode): * lisp/elec-pair.el (electric-pair-local-mode): Don't use it. * lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Autoload. * lisp/emacs-lisp/gv.el (buffer-local-variable): Make obsolete (bug#26624). * lisp/emacs-lisp/gv.el (make-obsolete-generalized-variable): Move to allow usage.
* | Make many seldom-used generalized variables obsoleteLars Ingebrigtsen2022-08-211-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vast majority of these are unused in-tree, and many of them perform actions that aren't obvious when reading the code. * lisp/server.el (server-ensure-safe-dir): Prefer with-file-modes over letf-ing default-file-modes. (server-start): Ditto. * lisp/winner.el (winner-set-conf): Don't use generalized variable window-height. * lisp/emacs-lisp/gv.el: Make most little-used generalized variables obsolete. * lisp/org/oc-basic.el (org-cite-basic--set-keymap): Adjust buffer-substring generalized variable usage.
* | Make it possible to mark generalized variables as obsoleteLars Ingebrigtsen2022-08-213-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/variables.texi (Adding Generalized Variables): Document it. * lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Alter the interface so that it can also be used by generalized variable warnings. (byte-compile-function-warn): Adjust caller. (byte-compile-check-variable): Adjust caller. * lisp/emacs-lisp/gv.el (gv-get): Warn about obsolete generalized variables (bug#49730). (make-obsolete-generalized-variable): New function.
* | Mention delete-line in shortdocLars Ingebrigtsen2022-08-211-0/+2
| | | | | | | | * lisp/emacs-lisp/shortdoc.el (buffer): Mention delete-line.
* | Update function properties and optimisationsMattias Engdegård2022-08-211-7/+13
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-opt--bool-value-form): Recognise boolean identity in aset, put, function-put and puthash. * lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp): Mark more functins as non-nil-returning, including the new pos-bol and pos-eol. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Mark pos-bol and pos-eol as side-effect-free.
* | * lisp/emacs-lisp/shortdoc.el (buffer): Add missing functionsMattias Engdegård2022-08-211-0/+5
| | | | | | | | | | Add preceding-char and char-before because following-char and char-after were already there.
* | Rename newly-added eol/bol functions to pos-eol/pos-bolLars Ingebrigtsen2022-08-211-4/+4
| | | | | | | | | | | | | | * lisp/emacs-lisp/shortdoc.el (buffer): * doc/lispref/positions.texi (Text Lines): Adjust. * src/editfns.c (Fpos_bol): Rename from Fpos. (Fpos_eol): Rename from Feol.
* | Move `while` syntax check from optimiser to macroexpandMattias Engdegård2022-08-192-3/+5
| | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-while): Move check... * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): ...here.
* | Display new keybinding in obsolete command warningStefan Kangas2022-08-191-1/+3
| | | | | | | | | | | | * lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): * lisp/simple.el (command-execute): When warning about an obsolete command, display the keybinding for the new command.
* | ; Delete not-useful comments referring to Emacs 19.Stefan Kangas2022-08-193-3/+1
| |
* | Add new functions eol and bolLars Ingebrigtsen2022-08-191-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/positions.texi (Text Lines): Document them * lisp/emacs-lisp/shortdoc.el: Mention them, and also the buffer/line predicates. * src/editfns.c (bol): New function. (Fbol): New defun. (Fline_beginning_position): Use `bol'. (eol): New function. (Feol): New defun. (Fline_end_position): Use `eol'.
* | * Rename `comp--typeof-builtin-types'Andrea Corallo2022-08-181-5/+5
| | | | | | | | | | * lisp/emacs-lisp/comp-cstr.el (comp--typeof-builtin-types): Rename. (comp-normalize-valset, comp-common-supertype-2): Update.
* | * lisp/emacs-lisp/comp-cstr.el (comp--all-builtin-types): RemoveAndrea Corallo2022-08-181-4/+0
| |
* | Merge from origin/emacs-28Stefan Kangas2022-08-181-0/+4
|\| | | | | | | | | | | | | ef1e68f11d * lisp/image-mode.el (image-mode-as-hex): Fix toggle instr... dc0fce3a7d ; lisp/image-mode.el: Fix typo. 254ba1d3e5 * lisp/image-mode.el: Improve commentary. ac43ac1af9 cl-reduce doc string improvement
| * cl-reduce doc string improvementColin Woodbury2022-08-181-0/+4
| | | | | | | | | | * lisp/emacs-lisp/cl-seq.el (cl-reduce): Explain what happens when using :from-end (bug#57273).
* | Fix string-to-syntax signature in comp-known-type-specifiersMattias Engdegård2022-08-181-1/+1
| | | | | | | | | | * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): `string-to-syntax` can return nil.
* | * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Fix some typeAndrea Corallo2022-08-181-10/+10
| |
* | More non-nil-returning functions in source optimisationMattias Engdegård2022-08-181-5/+24
| | | | | | | | | | | | | | | | | | This change was partially generated and mechanically cross-validated with function type information from comp-known-type-specifiers in comp.el. * lisp/emacs-lisp/byte-opt.el (byte-compile-trueconstp): Extend list of functions and fix a typo (logxor).
* | Make GEN message from loaddefs-generate nicerLars Ingebrigtsen2022-08-181-1/+2
| | | | | | | | | | | | * lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Shorten the informational GEN file relative to the stated directory (bug#57265). This makes the message nicer for ELPA packages.
* | Improve cryptic syntax switch message in re-builderStefan Kangas2022-08-181-2/+2
| | | | | | | | | | | | | | * lisp/emacs-lisp/re-builder.el (reb-restart-font-lock): Move message from here... * lisp/emacs-lisp/re-builder.el (reb-change-syntax): ...to here. Change it to be less cryptic.