summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
...
* | Make the name column in 'list-buffers' have a dynamic widthLars Ingebrigtsen2020-08-081-0/+1
| | | | | | | | | | | | | | | | | | * lisp/buff-menu.el (Buffer-menu--dynamic-name-width): New function (bug#30692). (Buffer-menu-name-width): Default to using it. (list-buffers--refresh): Call it. * lisp/emacs-lisp/seq.el (seq-max): Add autoload cookie.
* | Clean up and improve compilation of arithmetic (bug#42597)Mattias Engdegård2020-08-072-60/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-associative-math) (byte-optimize-min-max): Transform 3-arg min/max call into two 2-arg calls, which is faster. * lisp/emacs-lisp/bytecomp.el (byte-compile-associative): Rename to... (byte-compile-variadic-numeric): ...this function and simplify, fixing incorrect comments. The 3-arg strength reduction is now always done in the optimisers and is no longer needed here. (byte-compile-min-max): New function. (byte-compile-minus): Simplify, remove incorrect comment, and use byte-compile-variadic-numeric. (byte-compile-quo): Simplify and fix comment.
* | Fix byte-compilation of (+ -0.0) (bug#42597)Mattias Engdegård2020-08-071-3/+3
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-associative): Translate numerical identity expressions, such as (+ x) and (* x), into (* x 1) since the previous translation (+ x 0) gets it wrong for x = -0.0. * test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data): Add test cases.
* | Tweak the autoloads scrape output slightlyLars Ingebrigtsen2020-08-061-2/+2
| | | | | | | | | | | | * lisp/emacs-lisp/autoload.el (batch-update-autoloads--summary): Output " ..." at the end of the non-concluding lines to signify that the output continues.
* | Make the loaddefs scraping compilation output look more regularLars Ingebrigtsen2020-08-061-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/Makefile.in ($(lisp)/loaddefs.el): Don't output the directories here. * lisp/emacs-lisp/autoload.el (batch-update-autoloads--summary): New function. (batch-update-autoloads): Use it to output the directories we're scraping. This changes the compilation output from: Directories for loaddefs: . ./calc ./calendar ./cedet ./cedet/ede ./cedet/semantic ./cedet/semantic/analyze ./cedet/semantic/bovine ./cedet/semantic/decorate ./cedet/semantic/symref ./cedet/semantic/wisent ./cedet/srecode ./emacs-lisp ./emulation ./erc ./eshell ./gnus ./image ./international ./language ./leim ./leim/ja-dic ./leim/quail ./mail ./mh-e ./net ./nxml ./org ./play ./progmodes ./textmodes ./url ./vc (but all on one long line) To: SCRAPE . ./calc ./calendar ./cedet ./cedet/ede ./cedet/semantic SCRAPE ./cedet/semantic/analyze ./cedet/semantic/bovine SCRAPE ./cedet/semantic/decorate ./cedet/semantic/symref SCRAPE ./cedet/semantic/wisent ./cedet/srecode ./emacs-lisp ./emulation SCRAPE ./erc ./eshell ./gnus ./image ./international ./language ./leim SCRAPE ./leim/ja-dic ./leim/quail ./mail ./mh-e ./net ./nxml ./org ./play SCRAPE ./progmodes ./textmodes ./url ./vc Compilation output with very long lines can be mistaken for errors when they scroll by fast in the compilation output. Making it look more like normal informational output avoids this confusion.
* | Make 'byte-compile-info*' functions more logicalLars Ingebrigtsen2020-08-061-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-run.el (byte-compile-info): New function that's more flexible that replaces 'byte-compile-info-string' and 'byte-compile-info-message'. (byte-compile-info-string): Make obsolete. (byte-compile-info-message): Ditto. * lisp/international/ja-dic-cnv.el (skkdic-convert-okuri-ari) (skkdic-convert-postfix, skkdic-convert-prefix) (skkdic-collect-okuri-nasi, skkdic-set-okuri-nasi): * lisp/finder.el (finder-compile-keywords): * lisp/cus-dep.el (custom-make-dependencies): Adjust callers to use the new function.
* | Avoid duplicate Edebug symbols when backtracking (Bug#42701)Philipp Stephani2020-08-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When Edebug backtracks, it nevertheless generates definitions for the non-matching branches, see Bug#41988 and Bug#42701. This should be fixed eventually (probably by deferring the definition until a branch is known to match), but for now add a band-aid to avoid these duplicate symbols, at least for anonymous forms. * lisp/emacs-lisp/edebug.el (edebug-make-enter-wrapper): Regenerate anonymous names. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-duplicate-symbol-backtrack): New regression test.
* | Improve Edebug symbols for inlined secondary methods (Bug#42671)Philipp Stephani2020-08-021-1/+1
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Include qualifiers in Edebug symbol name. * test/lisp/emacs-lisp/cl-generic-tests.el (cl-defgeneric/edebug/method): Adapt unit test.
* | Add a workaround for Bug#42672Philipp Stephani2020-08-021-1/+10
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Work around Bug#42672 by uniquifying inline method names. * test/lisp/emacs-lisp/cl-generic-tests.el (cl-defgeneric/edebug/method): New regression test.
* | Avoid duplicate Edebug symbols when using ‘cl-flet’ (Bug#41989)Philipp Stephani2020-08-022-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-match-:unique): Add a new ‘:unique’ specifier to generate unique names. * lisp/emacs-lisp/cl-macs.el (cl-flet): Use it. This requires inlining the ‘cl-defun’ specification. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-cl-flet): New unit test. * doc/lispref/edebug.texi (Specification List): Document new ‘:unique’ construct.
* | Don’t generate duplicate symbols for secondary CL methods (Bug#42671)Philipp Stephani2020-08-022-3/+14
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/edebug.el (edebug-match-cl-generic-method-qualifier): Add matcher for ‘cl-defmethod’ qualifier. * lisp/emacs-lisp/cl-generic.el (cl-defmethod): Use it. * test/lisp/emacs-lisp/edebug-tests.el (edebug-cl-defmethod-qualifier): New unit test.
* | ; Maintainer header updatesGlenn Morris2020-07-311-0/+1
| |
* | * lisp/emacs-lisp/byte-opt.el: Minor simplificationsStefan Monnier2020-07-311-77/+45
| | | | | | | | | | | | | | | | | | (byte-optimize-form-code-walker): Use `byte-optimize-form` after inlining, so optimizations are also applied to the top level call. Simplify the code for `pure` functions using `byte-optimize-constant-args`. (byte-optimize-all-constp): Remove, not used any more. (byte-optimize-1+, byte-optimize-1-): Remove, they are redundant with the `pure` annotation.
* | Declare some ancient compat aliases obsolete (Bug#41328)Stefan Kangas2020-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/comint.el (comint-read-noecho): * lisp/emacs-lisp/edebug.el (edebug-all-defuns): * lisp/man.el (manual-entry): * lisp/vc/log-edit.el (vc-log-mode-map, vc-log-entry-mode): Declare ancient backwards-compatibility aliases and functions obsolete. The oldest in this list was added in 1992, and the most recent in 2004. * lisp/net/telnet.el (telnet-initial-filter): Don't use `comint-read-noecho'.
* | Simplify and streamline optimizer clausesMattias Engdegård2020-07-281-14/+9
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Remove clause for 'with-output-to-temp-buffer', since it is a macro and will have been expanded before reaching this point. Move clauses for 'lambda' and 'closure' to avoid splitting a cond jump table.
* | Make newer ElDoc versions are compatible with Emacs < 28João Távora2020-07-271-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: bug#42563 For some time, Eldoc has has some Elisp-specific code that shouldn't live there, but in elisp-mode.el. This can be fixed in Emacs master, but since ElDoc is distributed in GNU Elpa and is meant to work with Emacs 26 and 27, this means that that elisp-specific code must still be distributed with eldoc.el and kept up to date. * lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Ensure implementation is compatible with Emacs < 28. (Version): Bump to 1.8
* | Bring back ElDoc's eldoc-display-message-p, but obsolete itJoão Távora2020-07-271-1/+7
| | | | | | | | | | | | | | | | | | Like others, this is an implementation detail that third parties could be relying on. Better not remove it outright just now, since its implementation is very simple anyway. * lisp/emacs-lisp/eldoc.el (Version): Bump to 1.7.0 (eldoc-display-message-p): Bring back, but obsolete.
* | Optimise 3-arg +, - and *Mattias Engdegård2020-07-251-0/+10
| | | | | | | | | | | | | | | | | | | | Turn (+ a b c) into (+ (+ a b) c), and do the same for - and *. The 2-arg operations have their own bytecode which results in a 1.5× speed-up. Furthermore, the transform enables other optimisations; for example, (+ a 1 b) -> (+ (1+ a) b). * lisp/emacs-lisp/byte-opt.el (byte-optimize-plus, byte-optimize-minus) (byte-optimize-multiply): Transform (OP a b c) into (OP (OP a b) c).
* | Don't needlessly request docs from ElDoc functionsJoão Távora2020-07-231-19/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: bug#42421 Do this conservatively for now: if the ElDoc helper buffer (as returned by eldoc--doc-buffer) is visible and showing documentation for the very same "situation" (as computed by the the new eldoc--request-state helper), don't request that documentation from sources again. Before this change, not only was that request inefficient but if the user invoked scroll-other-window to see more of the helper buffer, that would eventually cause it to be reformatted and unexpectedly recentered. Later on, when a customizable list of documentation "sinks" is offered to the user, say, something like eldoc-display-functions, this process must be consolidated. In those circumstances, as soon as one of those sinks signals that it doesn't have up-to-date documentation for the state computed by eldoc--request-state, documentation will have to be requested anew from eldoc-documentation-functions via eldoc--invoke-strategy. * lisp/emacs-lisp/eldoc.el (eldoc--request-docs-p): Rework from eglot-display-message-p. (eldoc--last-request-state): New variable. (eldoc--request-state): New helper. (eldoc--handle-docs): Memorize state of request in doc buffer. (eldoc-print-current-symbol-info): Pass a token to eldoc--request-docs-p. (Version): Bump to 1.6.0
* | Fix ElDoc bugs around eldoc-echo-area-use-multiline-p.João Távora2020-07-191-9/+13
| | | | | | | | | | | | | | | | | | | | If the value is 'truncate-sym-name-if-fit andthe single docstring doesn't fit in the echo area even when the symbol name is elided, that step shouldn't be attempted. Also if the value is nil, really ensure that only the first line is shown. * lisp/emacs-lisp/eldoc.el (eldoc--handle-docs): Rework 'truncate-sym-name-if-fit case of eldoc-echo-area-use-multiline-p.
* | ; Reword bits of ElDoc internal documentationJoão Távora2020-07-191-66/+66
| | | | | | | | | | * lisp/emacs-lisp/eldoc.el (eldoc--invoke-strategy): Rewrite docstring. (eldoc--invoke-strategy): Fix formatting and rewrite comments
* | Fix NOT-CURRENT behaviour in text-property-search-backwardLars Ingebrigtsen2020-07-171-5/+13
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/text-property-search.el (text-property-search-backward): Fix inconsistent behaviour of S-TAB in eww (and other callers that use the NOT-CURRENT behaviour) when there are adjacent elements (bug#39239).
* | ;Fix eldoc regression bug#42365Tassilo Horn2020-07-151-2/+3
| |
* | Consistently stylize eldoc as ElDoc in more proseBasil L. Contovounesios2020-07-141-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | This fixes new occurrences of "Eldoc" since emacs-27. * doc/lispref/modes.texi (Major Mode Conventions): * etc/NEWS: * lisp/descr-text.el (describe-char-eldoc): * lisp/emacs-lisp/eldoc.el (eldoc-echo-area-use-multiline-p) (eldoc-prefer-doc-buffer, eldoc--documentation-strategy-defcustom): Consistently capitalize eldoc as ElDoc rather than Eldoc in documentation and commentary.
* | Fix a typo in eldoc.elJames N. V. Cash2020-07-121-1/+1
| | | | | | | | | | | | | | * lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions): Fix a typo. (Bug#42310) Copyright-paperwork-exempt: yes
* | Sort out ElDoc backward compatibility of eldoc-documentation-functionJoão Távora2020-07-121-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As explained previously, we can't simply make eldoc-documentation-function an variable alias for eldoc-documentation-strategy, because ElDoc is pre-loaded in Emacs < 28, where it holds at least one buffer-local binding. So if eldoc.el is loaded in those versions, we do the variable alias binding in reverse. We do this using a macro eldoc--documentation-strategy-defcustom to at load time in which direction to make the variable alias. * lisp/emacs-lisp/eldoc.el (eldoc--documentation-strategy-defcustom): Helper macro. (eldoc-documentation-strategy, eldoc-documentation-function): Use it. (Version): Bump to 1.5.0
* | Fix placement of Eldoc docs during eval-expression (bug#42309)João Távora2020-07-101-36/+40
| | | | | | | | * lisp/emacs-lisp/eldoc.el (eldoc--handle-docs): Rework.
* | Revert "Fix Eldoc problem when loading on Emacs 26.3"João Távora2020-07-101-4/+1
| | | | | | | | | | | | This reverts commit 9ade7ea7b77ec40c16deb4dff139ce7127a703e2. * lisp/emacs-lisp/eldoc.el (Version): Bump to 1.4.0
* | Fix byte compilation warning in EldocJoão Távora2020-07-101-1/+1
| | | | | | | | | | * lisp/emacs-lisp/eldoc.el (eldoc-documentation-function): Pass nil as second argument.
* | Fix Eldoc problem when loading on Emacs 26.3João Távora2020-07-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When defining the obsolete variable alias for old eldoc-documentation-function (which now points to the newer eldoc-documentation-strategy), one gets the error "don't know how to make a localized vareiable an alias". I'm not sure, but I suspect this is because Eldoc is preloaded in Emacs 26.3 and the eldoc-documentation-function variable is already set locally by some Elisp buffer. Uninterning the symbol shortly before defining the alias seems to fix it. * lisp/emacs-lisp/eldoc.el (eldoc-documentation-function): Unintern on load. (Version): Bump to 1.3.0
* | Unbreak M-x eldocJoão Távora2020-07-091-13/+16
| | | | | | | | | | | | | | | | | | The command should always invoke Eldoc when called interactively, instead of going through the usual checks, which are performed to avoid interference with other commands. * lisp/emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): Rework. (Version): Bump to 1.2.0
* | Prevent infloop in Eldoc message truncation algorithmJoão Távora2020-07-091-1/+1
| | | | | | | | | | | | | | | | | | The truncation algorithm still has a long way to go for very narrow frame sizes. It should become a generic mechanism that would allows one to truncate a string so that fits in N possibly truncated screen lines of a full-width window. * lisp/emacs-lisp/eldoc.el (eldoc-handle-docs): Tweak
* | Improve Eldoc docstringsJoão Távora2020-07-081-31/+87
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/eldoc.el (eldoc-documentation-strategy): Improve docstring. (eldoc--make-callback): Improve docstring. (eldoc--invoke-strategy): New helper function. (eldoc-print-current-symbol-info): Call eldoc--invoke-strategy. (eldoc-documentation-functions): Improve docstring.
* | Change version scheme of two Eldoc obsolete specsJoão Távora2020-07-081-2/+2
| | | | | | | | | | * lisp/emacs-lisp/eldoc.el (eldoc-documentation-function) (eldoc-message): Obsolete spec uses eldoc-1.1.0.
* | Adjust Eldoc documentation after Eli's reviewJoão Távora2020-07-081-95/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * etc/NEWS (Eldoc): Adjust paragraphs. * lisp/emacs-lisp/eldoc.el (eldoc-prefer-doc-buffer): Adjust docstring. (eldoc--enthusiasm-curbing-timer, eldoc-documentation-strategy) (eldoc-documentation-functions): Adjust docstring. (eldoc--handle-docs): Adjust comments. (eldoc--documentation-compose-1): New helper. (eldoc-documentation-compose) (eldoc-documentation-compose-eagerly): Use it. (eldoc-print-current-symbol-info): Adjust comments.
* | Make more parts of Emacs use new Eldoc capabilitiesJoão Távora2020-07-081-34/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Elisp-mode was doing a lot of work that can now be delegated to Eldoc. Flymake uses the new Eldoc functionality, too, installing a global documentation function that may report on diagnostics under point. CEDET's grammar.el was left as the only user of an Eldoc-internal function. That function was moved to grammar.el. That file is still, somewhat reprehensibly, using an internal function of elisp-mode.el, but this was left unchanged. In other situations, eldoc-documentation-functions is used or recommended. The only other places where the obsolete eldoc-documentation-function is still used is in libraries which are presumably meant to remain compatible with previous Emacs versions. * lisp/progmodes/elisp-mode.el (elisp-eldoc-funcall) (elisp-eldoc-var-docstring): New functions. (emacs-lisp-mode): Put two elements in eldoc-documentation-functions. * lisp/emacs-lisp/eldoc.el (eldoc--eval-expression-setup): Setup new Elisp eldoc-documentation-functions. * lisp/progmodes/flymake.el (flymake-mode): Use flymake-eldoc-function. (flymake-eldoc-function): New function. (Package-Requires): Require eldoc 1.1.0 * lisp/descr-text.el (describe-char-eldoc): Recommend eldoc-documentation-functions. * lisp/progmodes/cfengine.el (cfengine3-documentation-function): Recommend eldoc-documentation-functions * lisp/progmodes/octave.el (inferior-octave-mode): Use eldoc-documentation-functions. * lisp/cedet/semantic/grammar.el (semantic--docstring-format-sym-doc): New function. (semantic-grammar-eldoc-get-macro-docstring): Adjust.
* | * lisp/emacs-lisp/eldoc.el (Version): Bump to 1.1.0João Távora2020-07-081-1/+1
| |
* | New M-x eldoc for on-demand and interactive documentation requestsJoão Távora2020-07-081-0/+3
| | | | | | | | | | | | | | | | | | The function eldoc is just an alias for eldoc-print-current-symbol-info, which is made interactive. * lisp/emacs-lisp/eldoc.el (eldoc-print-current-symbol-info): Now an interactive function. (eldoc): Alias to eldoc-print-current-symbol-info.
* | Better handle asynchronous Eldoc sourcesJoão Távora2020-07-081-86/+316
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a backward compatible redesign of significant parts of the eldoc.el library. Previously, Eldoc clients (major/minor modes setting its documentation gathering variables) needed to directly call eldoc-message, an internal function, to display the docstring to the user. When more asynchronous sources are involved, this is hard to do or even breaks down. Now, an Eldoc backend may return any non-nil, non-string value and call a callback afterwards. This restores power to Eldoc over how (and crucially also when) to display the docstrings to the user. Among other things, this fixes so called "doc blinking", or the very short-lived display of a lower priority Eldoc message. This would happen if a particular producer of documentation finishes shortly before a higher priority one, like in the LSP engine Eglot as reported by Andrii Kolomoiets <andreyk.mad@gmail.com> and Dmitry Gutov <dgutov@yandex.ru>. Gathering docstrings is now delegated to the variable eldoc-documentation-strategy, which is the new name for the now-obsolete eldoc-documentation-function, and still accepts the so-called "old protocol". Examples of the new strategies enabled are codified in functions such as eldoc-documentation-enthusiast, eldoc-documentation-compose-eagerly, along with the existing eldoc-documentation-compose and eldoc-documentation-default. The work of displaying and formatting docstrings is shifted almost fully to Eldoc itself and is delegated to the internal function eldoc--handle-docs. Among other improvements, it handles most of eldoc-echo-area-use-multiline-p and outputs documentation to a temporary *eldoc* buffer. The manual and NEWS are updated to mention the new Eldoc features. * lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions): Overhaul docstring. (eldoc-documentation-compose, eldoc-documentation-default): Handle non-nil, non-string values of elements of eldoc-documentation-functions. Use eldoc--handle-multiline. (eldoc-print-current-symbol-info): Honour non-nil, non-string values returned by eldoc-documentation-callback. (eldoc--make-callback): Now also a function. (eldoc-documentation-default, eldoc-documentation-compose): Tweak docstring. (eldoc-documentation-enthusiast, eldoc-documentation-compose-eagerly): New functions. (eldoc-echo-area-use-multiline-p): Add new semantics. (eldoc--handle-docs): Handle some of eldoc-echo-area-use-multiline-p. (eldoc-doc-buffer): New command. (eldoc-prefer-doc-buffer): New defcustom. (eldoc--enthusiasm-curbing-timer): New variable. (eldoc-documentation-strategy): Rename from eldoc-documentation-function. (eldoc--supported-p): Use eldoc-documentation-strategy (eldoc-highlight-function-argument) (eldoc-argument-case, global-eldoc-mode) (turn-on-eldoc-mode): Mention eldoc-documentation-strategy. (eldoc-message-function): Mention eldoc--message. (eldoc-message): Made obsolete. (eldoc--message): New helper. * lisp/hexl.el (hexl-print-current-point-info): Adjust to new eldoc-documentation-functions protocol. * lisp/progmodes/cfengine.el (cfengine3-documentation-function): Adjust to new eldoc-documentation-functions protocol. * lisp/progmodes/elisp-mode.el (elisp-eldoc-documentation-function): Adjust to new eldoc-documentation-functions protocol. * lisp/progmodes/octave.el (octave-eldoc-function): Adjust to new eldoc-documentation-functions protocol. * lisp/progmodes/python.el (python-eldoc-function): Adjust to new eldoc-documentation-functions protocol. (eldoc-print-current-symbol-info): Rework with cl-labels. * doc/emacs/programs.texi (Lisp Doc): Mention eldoc-documentation-strategy. * doc/lispref/modes.texi (Major Mode Conventions): Mention eldoc-documentation-functions. * etc/NEWS: Mention eldoc-documentation-strategy.
* | Optimise assoc and rassoc with symbol key to assq and rassqMattias Engdegård2020-07-071-0/+11
| | | | | | | | | | | | | | This is the same transformation made for member to memq. * lisp/emacs-lisp/byte-opt.el (byte-optimize-assoc): New function. (assoc, rassoc): Set the byte-optimizer property.
* | * lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add `keyword`Stefan Monnier2020-07-061-10/+16
| |
* | Simplify byte-code optimisation of pure functionsMattias Engdegård2020-07-061-43/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most pure functions need no explicit optimisation; we can do away with almost all uses of byte-optimize-predicate (now renamed to byte-optimize-constant-args, since it is not just for predicates). Also remove some superfluous arity warnings. * lisp/emacs-lisp/byte-opt.el (byte-optimize-identity, byte-optimize-memq) (byte-optimize-nth, byte-optimize-nthcdr): Remove arity warnings and simplify. * lisp/emacs-lisp/byte-opt.el (<, >, <=, >=, not, null, consp, listp) (symbolp, stringp, string<, string-lessp, proper-list-p, logand) (logior, logxor, lognot, car, cdr, car-safe, cdr-safe): Remove superfluous byte-optimizer property. (byte-optimize-predicate): Rename to byte-optimize-constant-args. All uses changed.
* | Mark more functions pure (bug#42147)Mattias Engdegård2020-07-061-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | Extend the list of 'pure' functions to many predicates and numerical functions that we are reasonably confident will give portable results. Also include various list and array accessors, because our use of purity in the byte compiler isn't affected by the mutability of arguments. * lisp/emacs-lisp/byte-opt.el: Update example in comment. (pure-fns): Add many functions. (byte-optimize-form-code-walker) Don't signal errors during evaluation of calls to pure functions with constant arguments at compile time, since such calls are not necessarily reachable.
* | Relax portable number check in byte compiler (bug#42147)Mattias Engdegård2020-07-051-30/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With bignums, the set of representable integers is no longer platform-dependent, and since we use nothing but IEEE754 64-bit floats, all numbers are now portable. Take advantage of this fact to simplify constant-folding in the byte compiler, allowing it to be applied more widely. * lisp/emacs-lisp/byte-opt.el (byte-opt--portable-max) (byte-opt--portable-min, byte-opt--portable-numberp): Remove. (byte-opt--arith-reduce, byte-optimize-minus, byte-optimize-1+) (byte-optimize-1-): Simplify: any number will do, and if N is a number, then so are -N, N+1 and N-1.
* | Fix byte-compilation warning in project.elEli Zaretskii2020-06-261-0/+1
| | | | | | | | | | * lisp/emacs-lisp/seq.el (seq-every-p): Autoload it. This fixes byte-compilation warning in project.el.
* | Revert last change in benchmark.elBasil L. Contovounesios2020-06-211-1/+1
| | | | | | | | | | | | | | | | For discussion, see the following thread: https://lists.gnu.org/archive/html/emacs-devel/2020-06/msg00791.html * lisp/emacs-lisp/benchmark.el (benchmark-run-compiled): Revert to giving byte-compile a form rather than a closure.
* | Evaluate some unnecessarily quoted lambdasBasil L. Contovounesios2020-06-212-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/cedet/semantic/complete.el (semantic-displayer-tooltip-max-tags): * lisp/emacs-lisp/benchmark.el (benchmark-run-compiled): * lisp/emacs-lisp/package.el (package--default-summary) (package-menu-filter-by-version): * lisp/eshell/em-pred.el (eshell-pred-file-time): * lisp/progmodes/verilog-mode.el (verilog-auto-lineup) (verilog-auto-reset-widths, verilog-auto-arg-format) (verilog-auto-inst-vector, verilog-auto-inst-template-numbers): * lisp/textmodes/bibtex.el (bibtex-dialect): * test/lisp/autoinsert-tests.el (autoinsert-tests-define-auto-insert-before) (autoinsert-tests-define-auto-insert-after): Remove some unnecessary quoting around anonymous functions.
* | Various battery.el improvements (bug#41808)Basil L. Contovounesios2020-06-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/battery.el: Mention BSD support in Commentary. Don't load preloaded lisp/emacs-lisp/timer.el. (battery--files): New function. (battery--find-linux-sysfs-batteries): Use it and make fewer syscalls. (battery-status-function): Perform GNU/Linux checks in increasing order of obsolescence: sysfs, ACPI, and then APM. Simplify Darwin check. Add :version tag now that battery-upower is the default. (battery-echo-area-format, battery-mode-line-format): Mention %s. (battery-load-low, battery-load-critical): New faces. (battery-update): Display battery-mode-line-format even if percentage is N/A. Apply faces battery-load-low or battery-load-critical according to the percentage, but append them so they don't override user customizations. Update all mode lines since we are in global-mode-string. (battery-linux-proc-apm-regexp): Mark as obsolete, replacing with... (battery--linux-proc-apm): ...this new rx definition. (battery-linux-proc-apm): Use it. Fix indentation. Simplify. (battery--acpi-rate, battery--acpi-capacity): New rx definitions. (battery-linux-proc-acpi): Use them. Fix pathological whitespace regexps. Simplify. (battery-linux-sysfs): Fix docstring and indentation. Reduce number of file searches. Simplify. (battery-bsd-apm): Fix docstring. Simplify. (battery-pmset): Fix docstring. Simplify ID regexp. * lisp/emacs-lisp/rx.el (rx-define): Indent as a defun. * test/lisp/battery-tests.el (battery-linux-proc-apm-regexp): Test new battery--linux-proc-apm rx definition. (battery-acpi-rate-regexp, battery-acpi-capacity-regexp): New tests.
* | Band-aid for edebugging generator bodies (Bug#40434).Philipp Stephani2020-06-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Edebug doesn't support them well. Rather than trying to fix Edebug, disable instrumentation for now to prevent annoying bugs. * lisp/emacs-lisp/generator.el (iter-defun, iter-lambda, iter-make) (iter-do): Don't attempt to instrument bodies that are mangled by the CPS transformer. * test/lisp/emacs-lisp/generator-tests.el (generator-tests-edebug): New regression test.
* | Ensure that getters and setters can be edebugged at the same time.Philipp Stephani2020-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It's necessary to add a name suffix to setters defined with 'gv-define-setter' so that Edebug can distinguish between the getter and the setter (Bug#41853). * lisp/emacs-lisp/gv.el (gv-define-setter): Add a name suffix to setter definitions. * test/lisp/emacs-lisp/gv-tests.el (gv-setter-edebug): New regression test.