summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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.
* | Make checkdoc--next-docstring use the doc-string-elt propertyMauro Aranda2021-03-081-24/+9
| | | | | | | | | | | | | | | | | | | | | | This follows from a fix for Bug#46918 and a discussion to use doc-string-elt: https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00232.html * lisp/emacs-lisp/checkdoc.el (checkdoc--next-docstring): Check for a non-nil doc-string-elt property, instead of hard-coding the supported symbols. Use that property to position point at the doc-string.
* | Normalize version specifiers for make-obsolete and friendsStefan Kangas2021-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | * lisp/auth-source.el (auth-source-forget-user-or-password) (auth-source-user-or-password, auth-source-hide-passwords): * lisp/calendar/icalendar.el (icalendar--datetime-to-noneuropean-date): * lisp/cedet/semantic/db-el.el (semanticdb-elisp-sym-function-arglist): * lisp/emacs-lisp/debug.el (debugger-insert-backtrace): * lisp/obsolete/nnir.el (nnir-swish-e-index-file): * lisp/obsolete/starttls.el (starttls-any-program-available): Normalize version specifiers for make-obsolete and friends.
* | * lisp/emacs-lisp/bytecomp.el: Warn about unprefixed vars in `boundp`Stefan Monnier2021-03-071-4/+12
| | | | | | | | | | | | | | (byte-compile--check-prefixed-var): New fun, extracted from `byte-compile--declare-var`. (byte-compile--declare-var): Use it. (byte-compile-maybe-guarded): Use it as well.
* | * lisp/emacs-lisp/bindat.el (bindat-struct): Fix Edebug defStefan Monnier2021-03-061-2/+2
| |
* | Various map.el improvementsBasil L. Contovounesios2021-03-062-147/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/seq.el (seq-do-indexed): Return nil as per doc. * lisp/emacs-lisp/map.el: Require Emacs >= 26 due to dependence on 5-arg alist-get. Bump package to version 3.0. Fix other headers. (Bug#46754) (map--plist-p): Detect list starting with nil as plist, not alist. (map-elt, map-filter, map-apply, map--make-pcase-bindings) (map--make-pcase-patterns): Simplify. (map-let, map-put, map-nested-elt, mapp): Update docstring for plist support. (map-delete): Fix OBOE on arrays. Split into cl-defmethods. (map-values, map-values-apply): Specialize for arrays. (map-pairs, map-keys-apply, map-put!): Improve docstring. (map-length): Clarify docstring w.r.t. duplicate keys. Split into cl-defmethods. Optimize default implementation. (map-copy): Use copy-alist on alists. Split into cl-defmethods. (map-contains-key): Add plist support. Clarify docstring w.r.t. optional argument. Simplify default implementation. (map-some, map-every-p, map-merge, map-merge-with, map--into-hash): Don't use map-apply for side effects. (map-into): Preserve plist ordering. Improve docstrings. (map-insert): Add hash-table and array support. (map-inplace): Remove unused error symbol. (map-do): Return nil as per doc. * etc/NEWS: Announce new user-visible behavior. * test/lisp/emacs-lisp/map-tests.el: Prefer should-not over (should (not ...)) in general. (with-maps-do): Fix docstring. (with-empty-maps-do): New macro. (test-map-elt-default, test-mapp, test-map-keys, test-map-values) (test-map-pairs, test-map-length, test-map-copy, test-map-apply) (test-map-do, test-map-keys-apply, test-map-values-apply) (test-map-filter, test-map-remove, test-map-empty-p) (test-map-contains-key, test-map-some, test-map-every-p): Use it. (test-map-plist-p, test-map-put!-new-keys, test-map-insert-empty) (test-map-insert, test-map-delete-empty, test-map-copy-alist) (test-map-contains-key-testfn, test-map-into-hash-test) (test-map-into-empty, test-map-merge, test-map-merge-empty): New tests. (test-map-elt): Test array key that is within bounds but not fixnum. (test-map-put!): Use map--plist-p. Remove redundant tests. (test-map-put-alist-new-key): Don't modify list literal. (test-map-put-testfn-alist, test-map-put-return-value): Silence obsoletion warnings. (test-map-delete): Check for OBOE on arrays. (test-map-delete-return-value): Remove test made redundant by test-map-delete. (test-map-nested-elt, test-map-into): Test plists too.
* | ; Fix typo.Stefan Kangas2021-03-061-1/+1
| |
* | Bindat: new macro-expansion based data layout languageStefan Monnier2021-03-051-151/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thorough redesign of the Bindat system, which makes it possible to define new Bindat type forms, define recursive types, control the values returned when unpacking, freely mix arbitrary computations with type definitions, as well as support for arbitrary sized integers. This also reverts the recent addition of the `bindat-spec` macro and the support for 64bit integers in the old Bindat language since that is now considered obsolete anyway. * doc/lispref/processes.texi (Bindat Types): Rename from `Bindat Spec` and rewrite for the new sublanguage. (Bindat Functions): Adjust to the new terminology. (Bindat Computed Types): New node. * lisp/emacs-lisp/bindat.el (bindat--type): New type. (bindat--unpack-u64, bindat--unpack-u64r): Delete functions. (bindat--unpack-item, bindat--pack-item, bindat--fixed-length-alist): Revert addition of support for 64bit integers. (bindat--unpack-group, bindat--length-group, bindat--pack-group): Handle the new `bindat--type` values. (bindat-spec): Revert addition of this macro. (bindat--unpack-uint, bindat--unpack-uintr, bindat--pack-uint) (bindat--pack-uintr): New functions. (bindat-type, bindat-defmacro, bindat--pcase): New macros. (bindat-type): New Edebug elem. (bindat--type): New generic function. (bindat--primitives): New constant. (bindat--macroenv, bindat--op): New vars. (bindat--make-docstring, bindat--fun, bindat--makefun, bindat--toplevel): New functions. * test/lisp/emacs-lisp/bindat-tests.el: Use `bindat-type`. (ip): New Bindat type. (header-bindat-spec, data-bindat-spec, packet-bindat-spec): Adjust to new `bindat-type` macro. (bindat-test-unpack): Simplify now that the order of fields is preserved. (bindat-test--int-websocket-type, bindat-test--LEB128): New consts. (bindat-test--pack-val, bindat-test--sint, bindat-test--recursive): New tests.
* | Make lambda-lifting work againMattias Engdegård2021-03-051-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/cconv.el (cconv--analyze-use): Fix typo. * test/lisp/emacs-lisp/cconv-tests.el (cconv-convert-lambda-lifted): Add test case.
* | * lisp/emacs-lisp/bindat.el: Minor refactoringStefan Monnier2021-03-051-69/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (bindat--unpack-str, bindat--unpack-strz, bindat--unpack-bits): New functions, extracted from `bindat--unpack-item`. (bindat--unpack-item): Use them. (bindat--align): New function. (bindat--unpack-group, bindat--length-group, bindat--pack-group): Use it. (bindat-get-field): Allow integers to index both lists (as returned by `repeat`) and vectors (as returned by `vec`). (bindat--pack-str, bindat--pack-bits): New functions, extracted from `bindat--pack-item`. (bindat--pack-item): Use them. * test/lisp/emacs-lisp/bindat-tests.el (struct-bindat): Place the fields in the order in which they appear in the structs.
* | Improve the documentation of :extra in cl-defmethodLars Ingebrigtsen2021-03-051-3/+7
| | | | | | | | | | | | | | * doc/lispref/functions.texi (Generic Functions): Improve documentation of :extra (bug#46917). * lisp/emacs-lisp/cl-generic.el (cl-defmethod): Ditto.
* | Fix qualifiers order for loadhist-unload-element in elp.elMauro Aranda2021-03-051-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/elp.el (loadhist-unload-element): The :extra qualifier is expected to come before the other qualifiers, so do that (bug#46917).
* | Actually fill the correct paragraph in `lisp-fill-paragraph'Lars Ingebrigtsen2021-03-051-1/+4
| | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Fix previous change here by actually filling the correct paragraph (bug#28937).
* | Don't ignore lexically-bound variables in a defvar (bug#46912)Pip Cet2021-03-051-3/+6
| | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Walk the value form of a defvar.
* | * lisp/emacs-lisp/cl-generic.el: Make `doc-string` prop work with qualifiersStefan Monnier2021-03-041-1/+11
| | | | | | | | | | (cl--defmethod-doc-pos): New function. (cl-defmethod): Use it.
* | Add a command in package mode for opening home pages directlyLars Ingebrigtsen2021-03-041-0/+19
| | | | | | | | | | | | * doc/emacs/package.texi (Package Menu): Document it. * lisp/emacs-lisp/package.el (package-browse-url): New command and keystroke (bug#46927).
* | Make checkdoc work with qualified methodsMauro Aranda2021-03-041-1/+20
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc--next-docstring): Handle cl-defmethod in a case of its own. Check for the presence of qualifiers, and skip them accordingly until the docstring. * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-cl-defmethod-qualified-ok) (checkdoc-cl-defmethod-with-extra-qualifier-ok) (checkdoc-cl-defmethod-with-extra-and-nil-args-ok): Add tests for the fix.
* | Fix pcase dontcare pattern in cl--sm-macroexpandBasil L. Contovounesios2021-03-041-1/+1
| | | | | | | | | | | | | | | | For discussion, see the following thread: https://lists.gnu.org/r/emacs-devel/2021-03/msg00119.html * lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand): Fix recently uncovered use of old name for pcase--dontcare.
* | * lisp/emacs-lisp/pcase.el (pcase-defmacro): Fix `pcase-tests-macro`Stefan Monnier2021-03-032-8/+13
| | | | | | | | * lisp/emacs-lisp/radix-tree.el (radix-tree-leaf): Simplify accordingly.
* | * lisp/emacs-lisp/pcase.el (pcase--u1): Fix typoStefan Monnier2021-03-021-1/+1
| |
* | * lisp/emacs-lisp/trace.el (trace-values): Work outside of traced functionStefan Monnier2021-03-021-2/+2
| |
* | Compile closures that modify their bound vars correctly (Bug#46834)Pip Cet2021-03-021-23/+23
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--reify-function): Don't move let bindings into the lambda. Don't reverse list of bindings. (byte-compile): Evaluate the return value if it was previously reified. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-reify-function): Add tests.
* | * lisp/emacs-lisp/pcase.el: Bind all the vars in `or` patternsStefan Monnier2021-03-011-74/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the handling of `or` patterns where not all sub-patterns bind the same set of variables. This used to be "unsupported" and behaved in somewhat unpredictable ways. (pcase--expand): Rewrite. (pcase-codegen): Delete. * doc/lispref/control.texi (pcase Macro): Adjust accordingly. Also remove the warning about "at least two" sub patterns. These work fine, AFAICT, and if not we should fix it. * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-or-vars): New test.
* | Make easymenu downcase the menu symbol for greater backwards compatLars Ingebrigtsen2021-03-011-1/+5
| | | | | | | | | | | | | | | | | | * lisp/cmuscheme.el (map): Revert previous fix. * lisp/woman.el (woman-dired-define-keys): Ditto. * lisp/emacs-lisp/easymenu.el (easy-menu-do-define): Downcase the menu name for greater backwards compatibility.
* | * lisp/emacs-lisp/pcase.el: Fix bug#46786Stefan Monnier2021-03-011-24/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert commit a218c9861573b5ec4979ff2662f5c0343397e3ff, but in order to avoid the spurious warnings that this commit tried to squash, keep track of the vars used during the match so as to add corresponding annotations to explicitly silence the spurious warnings. To do this, we change the VARS used in `pcase-u` (and throughout the pcase code): they used to hold elements of the form (NAME . VAL) and now they hold elements of the form (NAME VAL . USED). (pcase--expand): Bind all vars instead of only those found via fgrep. (pcase-codegen): Silence "unused var" warnings for those vars that have already been referenced during the match itself. (pcase--funcall, pcase--eval): Record the vars that are used. (pcase--u1): Record the vars that are used via non-linear patterns. * lisp/textmodes/mhtml-mode.el (mhtml-forward): * lisp/vc/diff-mode.el (diff-goto-source): Silence newly discovered warnings. * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-bug46786): New test.
* | * lisp/emacs-lisp/pcase.el (pcase--split-pred): Re-fix bug#14773Stefan Monnier2021-03-011-1/+1
| | | | | | | | Adjust to calling convention of `macroexp--fgrep`.
* | Fix misuses of `byte-compile-macro-environment`Stefan Monnier2021-03-013-27/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These seem to be left overs from Emacs<24 when `macroexpand-all` was implemented in the CL library and hence the macros's evaluation environment could come from different places depending on the circumstance (either `byte-compile-macro-environment`, or `cl-macro-environment`, or ...). `byte-compile-macro-environment` contains definitions which expand to code that is only understood by the rest of the byte-compiler, so using it for code which isn't being byte-compiled leads to errors such as references to non-existing function `internal--with-suppressed-warnings`. * lisp/emacs-lisp/cl-extra.el (cl-prettyexpand): Remove left-over binding from when `macroexpand-all` was implemented in the CL library. * lisp/emacs-lisp/ert.el (ert--expand-should-1): * lisp/emacs-lisp/cl-macs.el (cl--compile-time-too): Properly preserve the macroexpand-all-environment. (cl--macroexp-fboundp): Pay attention to `cl-macrolet` macros as well.
* | Convert various menus to easymenuStefan Kangas2021-03-011-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-mode-map): Move menu from here... (lisp-mode-menu): ...to here, and convert to easymenu. * lisp/progmodes/elisp-mode.el (lisp-interaction-mode-map): Move menu definition from here... (lisp-interaction-mode-menu): ...to here, and convert to easymenu. * lisp/replace.el (occur-menu-map): Convert to easymenu.
* | Declare more string predicates as pureMattias Engdegård2021-02-281-1/+2
| | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (pure-fns): Treat string>, string-greaterp, string-empty-p, string-blank-p, string-prefix-p and string-suffix-p as pure functions in the compiler.
* | Fix pcase 'rx' pattern match-data bugMattias Engdegård2021-02-281-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pcase 'rx' pattern would in some cases allow the match data to be clobbered before it is read. For example: (pcase "PQR" ((and (rx (let a nonl)) (rx ?z)) (list 'one a)) ((rx (let b ?Q)) (list 'two b))) The above returned (two "P") instead of the correct (two "Q"). This occurred because the calls to string-match and match-string were presented as separate patterns to pcase, which would interleave them with other patterns. As a remedy, combine string matching and match-data extraction into a single pcase pattern. This introduces a slight inefficiency for two or more submatches as they are grouped into a list structure which then has to be destructured. Found by Stefan Monnier. See discussion at https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg02010.html * lisp/emacs-lisp/rx.el (rx--reduce-right): New helper. (rx [pcase macro]): Combine string-match and match-string calls into a single pcase pattern. * test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test cases.
* | * lisp/emacs-lisp/macroexp.el: Rewrite the code warning about '(lambda ...)Stefan Monnier2021-02-271-27/+34
| | | | | | | | | | | | (macroexp--expand-all): Use `pcase--dontcare` so pcase generates slightly better code. Don't hardcode which functions takes function arguments; rely on a new `funarg-positions` symbol property instead.
* | * lisp/emacs-lisp/bytecomp.el: Fix minor regression introduced by pdumpStefan Monnier2021-02-271-2/+3
| | | | | | | | | | | | | | | | After `rm **/*.elc; make` we'd sometimes get loads and loads of unnecessary "Reloading ...". (byte-compile-refresh-preloaded): Don't reload files that are more recent than `temacs` but older than the `.pdmp` file.
* | * lisp/emacs-lisp/cconv.el: Fix uncaught brain farts in last changeStefan Monnier2021-02-271-2/+2
| | | | | | | | (cconv--convert-funcbody, cconv-convert): Use `macroexp--warn-wrap` properly.
* | Convert emacs-lisp-mode menu to easy-menu-defineStefan Kangas2021-02-271-4/+0
| | | | | | | | | | | | | | * lisp/loadup.el: Preload easymenu. * lisp/progmodes/elisp-mode.el (emacs-lisp-mode-map): Convert menu to use easy-menu-define (bug#24774).
* | * lisp/emacs-lisp/cconv.el: Improve line-nb info of unused var warningsStefan Monnier2021-02-2611-137/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of warning about unused vars during the analysis phase of closure conversion, do it in the actual closure conversion by annotating the code with "unused" warnings, so that the warnings get emitted later by the bytecomp phase, like all other warnings, at which point the line-number info is a bit less imprecise. Take advantage of this change to wrap the expressions of unused let-bound vars inside (ignore ...) so the byte-compiler can better optimize them away. Finally, promote `macroexp--warn-and-return` to "official" status by removing its "--" marker. (cconv-captured+mutated, cconv-lambda-candidates): Remove vars. (cconv-var-classification): New var to replace them. (cconv-warnings-only): Delete function. (cconv--warn-unused-msg, cconv--var-classification): New functions. (cconv--convert-funcbody): Add warnings for unused args. (cconv-convert): Add warnings for unused vars in `let` and `condition-case`. (cconv--analyze-use): Don't emit an "unused var" warning any more, but instead remember the fact in `cconv-var-classification`. * lisp/emacs-lisp/bytecomp.el (byte-compile-force-lexical-warnings): Remove variable. (byte-compile-preprocess): Remove corresponding case. * lisp/emacs-lisp/pcase.el (pcase--if): Don't throw away `test` effects. (\`): * lisp/emacs-lisp/cl-macs.el (cl--do-arglist): Use `car-safe` instead of `car`, so it can more easily be removed by the optimizer if the result is not used. * lisp/emacs-lisp/macroexp.el (macroexp--warn-wrap): New function. (macroexp-warn-and-return): Rename from `macroexp--warn-and-return`.
* | Fix syntax highlighting of easy-menu-define docstringsStefan Kangas2021-02-261-1/+1
| | | | | | | | | | * lisp/emacs-lisp/easymenu.el (easy-menu-define): Add doc-string declaration for correct syntax highlighting.
* | Remove redundant requires of easymenuStefan Kangas2021-02-262-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/allout.el: * lisp/emacs-lisp/edebug.el: * lisp/emacs-lisp/ert.el: * lisp/erc/erc-menu.el: * lisp/help-mode.el: * lisp/net/dictionary.el: * lisp/nxml/rng-nxml.el: * lisp/progmodes/ebrowse.el: * lisp/progmodes/meta-mode.el: * lisp/progmodes/prolog.el: * lisp/progmodes/ps-mode.el: * lisp/progmodes/vera-mode.el: * lisp/wid-browse.el: Remove redundant require of easymenu. We only use the autoloaded macro 'easy-menu-define' here.
* | Function-quote completion property of declare formBasil L. Contovounesios2021-02-262-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For discussion, see the following thread: https://lists.gnu.org/r/emacs-devel/2021-02/msg01666.html * lisp/emacs-lisp/byte-run.el (byte-run--set-completion): Quote with 'function' for syntactical consistency with other declare form properties. This allows writing (declare (completion foo)) instead of (declare (completion 'foo)). * lisp/emacs-lisp/easymenu.el (easy-menu-do-define): * lisp/gnus/gnus-sum.el (gnus-summary-make-menu-bar): Prefer function-put over put for function symbols. * lisp/subr.el (ignore, undefined): Remove #'-quoting from declare form; it is no longer needed.
* | Fix pcase rx pattern bugsMattias Engdegård2021-02-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two unrelated bugs: A missing type check caused an error in rx patterns for non-string match targets, and rx patterns did not work at all in pcase-let or pcase-let*. Second bug reported by Basil Contovounesios and Ag Ibragimov; fixes proposed by Stefan Monnier. Discussion and explanation in thread at https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg01924.html * lisp/emacs-lisp/rx.el (rx): Add (pred stringp) to avoid type errors, and replace the `pred` clause for the actual match with something that works with pcase-let(*) without being optimised away. * test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test cases.
* | New variable 'use-short-answers' to use 'y-or-n-p' instead of 'yes-or-no-p'Juri Linkov2021-02-251-2/+4
| | | | | | | | | | | | | | | | | | | | * lisp/cus-start.el: Add use-short-answers. * lisp/emacs-lisp/map-ynp.el (read-answer): Handle use-short-answers. (read-answer-short): Add use-short-answers to docstring. * src/fns.c (Fyes_or_no_p): Call y-or-n-p if use_short_answers is true. (syms_of_fns): Add DEFVAR_BOOL use-short-answers (bug#46594).
* | Remove last remaining external uses of `edebug-form-spec`Stefan Monnier2021-02-241-1/+1
| | | | | | | | | | | | | | * lisp/emacs-lisp/gv.el (gv-place): Use `def-edebug-elem-spec`. * lisp/obsolete/erc-compat.el (erc-define-minor-mode): Remove redundant `edebug-form-spec`.
* | * lisp/emacs-lisp/macroexp.el (macroexp-file-name): Work in `eval-buffer`Stefan Monnier2021-02-242-2/+6
| | | | | | | | | | | | | | Rely on `current-load-list` instead of `load-file-name`. * lisp/emacs-lisp/bytecomp.el (byte-compile-close-variables): Change the var we override accordingly.
* | * lisp/emacs-lisp/macroexp.el (macroexp-file-name): New function.Stefan Monnier2021-02-247-34/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Yes, finally: a function that tells you the name of the file where the code is located. Finding this name is non-trivial in practice, as evidenced by the "4 shift/reduce conflicts" warning when compiling CEDET's python.el, because its `wisent-source` got it wrong in that case, thinking the grammar came from `python.el` instead of `python-wy.el`. While at it, also made `macroexp-compiling-p` public, since it's useful at various places. (macroexp-compiling-p): Rename from `macroexp--compiling-p`. * lisp/emacs-lisp/bytecomp.el (byte-compile-close-variables): Bind `load-file-name` to nil so we can distinguish a load that calls the byte compiler from a byte compilation which causes a load. * lisp/cedet/semantic/wisent/python.el (wisent-python--expected-conflicts): Remove; it was just a workaround. * lisp/subr.el (do-after-load-evaluation): Avoid `byte-compile--` vars. * lisp/cedet/semantic/fw.el (semantic-alias-obsolete): Use `macroexp-compiling-p` and `macroexp-file-name`. * lisp/cedet/semantic/wisent/comp.el (wisent-source): Use `macroexp-file-name` (wisent-total-conflicts): Tighten regexp. * lisp/emacs-lisp/cl-lib.el (cl--compiling-file): Delete function and variable. Use `macroexp-compiling-p` instead. * lisp/progmodes/flymake.el (flymake-log): * lisp/emacs-lisp/package.el (package-get-version): * lisp/emacs-lisp/ert-x.el (ert-resource-directory): Use `macroexp-file-name`.
* | Use named faces in shortdocProtesilaos Stavrou2021-02-241-2/+7
| | | | | | | | | | | | | | * shortdoc.el (shortdoc-heading): Define new face for headings. (shortdoc-display-group): Apply new heading face. (shortdoc--display-function): Use existing face for section text. * etc/NEWS: Document new face (bug#46748).
* | Small fixesJuri Linkov2021-02-231-1/+1
| | | | | | | | | | | | * lisp/emacs-lisp/seq.el (seq-contains): Move the ‘declare’ form after the docstring. * lisp/misc.el (copy-from-above-command): Fix whitespace regexp.
* | Improve easymenu.el Commentary sectionStefan Kangas2021-02-231-0/+3
| | | | | | | | * lisp/emacs-lisp/easymenu.el: Improve Commentary section.
* | Prefer `declare` over a `put` of `list-indent-function`.Stefan Monnier2021-02-222-23/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While at it, I enabled lexical-binding in the affected files. * lisp/cedet/semantic/sb.el: Enable lexical-binding. (semantic-sb-with-tag-buffer): Use `declare`. * lisp/cedet/semantic/bovine/el.el: Enable lexical-binding. (semantic-elisp-setup-form-parser): Use `declare`. * lisp/emacs-lisp/ert.el: * lisp/emacs-lisp/ert-x.el: Remove redundant `put`. * lisp/emulation/cua-rect.el: Enable lexical-binding. (cua--rectangle-operation, cua--rectangle-aux-replace): Use `declare`. * lisp/mh-e/mh-acros.el: Enable lexical-binding. (mh-do-in-gnu-emacs, mh-do-in-xemacs, mh-funcall-if-exists, defun-mh) (defmacro-mh, with-mh-folder-updating, mh-in-show-buffer) (mh-do-at-event-location, mh-iterate-on-messages-in-region) (mh-iterate-on-range): Use `declare`. * lisp/mh-e/mh-compat.el: Enable lexical-binding. (mh-flet): Use `declare`. * lisp/mh-e/mh-e.el: Enable lexical-binding. (defgroup-mh, defcustom-mh, defface-mh): Use `declare`. * lisp/net/sieve.el: Enable lexical-binding. Remove redundant :group args. (sieve-activate, sieve-remove, sieve-edit-script): Remove unused arg from the interactive spec. (sieve-deactivate-all): Remove unused var `name`. (sieve-change-region): Use `declare`. * lisp/obsolete/fast-lock.el: Enable lexical-binding. Remove redundant :group args. Remove XEmacs compat code. (save-buffer-state): Remove macro. (fast-lock-add-properties): Use `with-silent-modifications` instead. * lisp/obsolete/lazy-lock.el: Enable lexical-binding. Remove redundant :group args. (do-while): Use `declare`. (save-buffer-state): Remove macro. (lazy-lock-fontify-rest-after-change, lazy-lock-defer-line-after-change) (lazy-lock-defer-rest-after-change, lazy-lock-after-fontify-buffer) (lazy-lock-after-unfontify-buffer, lazy-lock-fontify-region): Use `with-silent-modifications` instead. * lisp/obsolete/pgg.el: Enable lexical-binding. Remove XEmacs compat code. (pgg-save-coding-system, pgg-as-lbt, pgg-process-when-success): Use `declare`. (pgg-add-passphrase-to-cache): Remove unused var `new-timer`. (pgg-decrypt-region): Remove unused var `buf`. * lisp/org/org-agenda.el (org-let, org-let2): Move from org-macs and use `declare`. * lisp/org/org-macs.el (org-let, org-let2): Move these functions that are inherently harmful to your karma to the only package that uses them. (org-scroll): Use `pcase` to avoid `eval` and use more readable syntax for those integers standing for events. * lisp/progmodes/antlr-mode.el: Enable lexical-binding. (save-buffer-state-x): Use `declare` and `with-silent-modifications`. * lisp/international/mule-util.el (with-coding-priority): * lisp/cedet/ede/proj-comp.el (proj-comp-insert-variable-once): * lisp/org/org-element.el (org-element-map): * test/lisp/emacs-lisp/bytecomp-tests.el (test-byte-comp-compile-and-load): * test/lisp/emacs-lisp/generator-tests.el (cps-testcase): Use `declare`.
* | cl-extra: Fix docstring retrievalJulian Scheid2021-02-221-2/+2
| | | | | | | | | | * lisp/emacs-lisp/cl-extra.el (cl--describe-class-slots): Fix docstring retrieval (bug#46662).