summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* Deduplicate non-fixnum numeric constants in byte-compilationMattias Engdegård2019-12-271-1/+1
| | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-get-constant): Use eql for looking up constants instead of eq, allowing for bignum and flonum deduplication (bug#38708).
* Optimise 'while' bodies for effectMattias Engdegård2019-12-261-0/+7
| | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Treat all expressions in the body of 'while' as for-effect, since their values are discarded. This also finds some errors.
* Don't bind XEmacs-only variable in edebugLars Ingebrigtsen2019-12-251-3/+1
| | | | | * lisp/emacs-lisp/edebug.el (edebug-safe-prin1-to-string): Remove binding of XEmacs-only variable print-readably.
* Merge from origin/emacs-27Glenn Morris2019-12-252-6/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | ca6a53d3bc Don't default to showing X-Faces externally in Gnus dbf4b5b2d0 Fix manual typo in Special Read Syntax a9fe6dfa90 Fix problem with emacs -nw / eww / svg 0de63092c8 Clarify base64 requirements and say what {en,de}code_codin... 6184aa003f ; * etc/NEWS: Fix boring oddities. 51ea32dd12 * src/emacs-module.h.in: Add reference to manual. 75d0cef20d Trivial docstring fixes ee12c421b6 imagemagick-types needs to initialize ImageMagick # Conflicts: # etc/NEWS
| * Trivial docstring fixesJuanma Barranquero2019-12-242-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ChangeLog.3: * lisp/emacs-lisp/cl-macs.el (cl-flet): * lisp/filesets.el (filesets-menu-ensure-use-cached): * lisp/progmodes/compile.el (compilation-context-lines): * lisp/progmodes/prolog.el (prolog-paren-indent): * lisp/progmodes/sql.el (sql-password-search-wallet-function): Fix typos in docstrings. * lisp/cedet/semantic/analyze.el (semantic-analyze-push-error): Doc fix. * lisp/emacs-lisp/map.el (map-put, map-info): Refill docstring. (map-contains-key): Fix typo. (map-every-p): Doc fix.
* | Don't use `let*' with just one bindingJuanma Barranquero2019-12-241-1/+1
|/ | | | | | * lisp/registry.el (registry-reindex): * lisp/emacs-lisp/generator.el (cps--add-state): Use `let', not `let*'.
* More precise 'regexp-opt' documentationMattias Engdegård2019-12-181-5/+5
| | | | | | | | * lisp/emacs-lisp/regexp-opt.el (regexp-opt): * doc/lispref/searching.texi (Regexp Functions): Be more specific about how the KEEP-ORDER argument actually works. If nil, the regexp guarantees a longest match; this is the behaviour that many callers implicitly rely on.
* Allow characters and single-char strings in rx charsetsMattias Engdegård2019-12-131-6/+20
| | | | | | | | | | | | | | | | The `not' and `intersection' forms, and `or' inside these forms, now accept characters and single-character strings as arguments. Previously, they had to be wrapped in `any' forms. This does not add expressive power but is a convenience and is easily understood. * doc/lispref/searching.texi (Rx Constructs): Amend the documentation. * etc/NEWS: Announce the change. * lisp/emacs-lisp/rx.el (rx--charset-p, rx--translate-not) (rx--charset-intervals, rx): Accept characters and 1-char strings in more places. * test/lisp/emacs-lisp/rx-tests.el (rx-not, rx-charset-or) (rx-def-in-charset-or, rx-intersection): Test the change.
* Add prefix to help.el uni-confusable* varsNoam Postavsky2019-12-131-1/+1
| | | | | | | | | * lisp/help.el (help-uni-confusables, help-uni-confusables-regexp): Rename from uni-confusable and uni-confusables-regexp, respectively. (help-uni-confusable-suggestions): Use ngettext. Use new variable name. * lisp/emacs-lisp/lisp-mode.el (lisp--match-confusable-symbol-character): Use new variable name.
* * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): Use 'user-error'.Juri Linkov2019-12-131-1/+1
|
* Use `or' instead of `union' for charset union in rxMattias Engdegård2019-12-121-15/+26
| | | | | | | | | | | | | | Design change suggested by Stefan Monnier. * doc/lispref/searching.texi (Rx Constructs): * etc/NEWS: Document. * lisp/emacs-lisp/rx.el (rx--translate-or): Detect charset arguments. (rx--charset-p): New. (rx--translate-not, rx--charset-intervals, rx--translate-union): Change from `union' to `or'. (rx--translate-form, rx--builtin-forms, rx): Remove `union'. * test/lisp/emacs-lisp/rx-tests.el (rx-union, rx-def-in-union) (rx-intersection): Rename tests and change `union' to `or' and `|'.
* * lisp/emacs-lisp/debug.el (debug-on-entry): Allow undefined functionsStefan Monnier2019-12-111-1/+1
| | | | | | Allow placing debug-on-entry on a function not-yet-defined, which is convenient when the problem you're investigating happens while the relevant files are loaded.
* Add `union' and `intersection' to rx (bug#37849)Mattias Engdegård2019-12-101-95/+214
| | | | | | | | | | | | | | | | | | | | | | These character set operations, together with `not' for set complement, improve the compositionality of rx, and reduce duplication in complicated cases. Named character classes are not permitted in set operations. * lisp/emacs-lisp/rx.el (rx--translate-any): Split into multiple functions. (rx--foldl, rx--parse-any, rx--generate-alt, rx--intervals-to-alt) (rx--complement-intervals, rx--intersect-intervals) (rx--union-intervals, rx--charset-intervals, rx--charset-union) (rx--charset-all, rx--charset-intersection, rx--translate-union) (rx--translate-intersection): New. (rx--translate-not, rx--translate-form, rx--builtin-forms, rx): Add `union' and `intersection'. * test/lisp/emacs-lisp/rx-tests.el (rx-union ,rx-def-in-union) (rx-intersection, rx-def-in-intersection): New tests. * doc/lispref/searching.texi (Rx Constructs): * etc/NEWS: Document `union' and `intersection'.
* Spelling fixesPaul Eggert2019-12-092-2/+2
|
* * lisp/emacs-lisp/map-ynp.el (read-answer): Use [remap self-insert-command]Juri Linkov2019-12-101-1/+1
| | | | | | This reverts the last change that replaced [remap self-insert-command] with [t]. The user should have freedom of using any command in the minibuffer. (bug#32738)
* * lisp/emacs-lisp/map-ynp.el (read-answer): Allow more SHORT-ANSWER types.Juri Linkov2019-12-091-5/+18
| | | | | | | Treat SHORT-ANSWER as a character is characterp returns non-nil. Otherwise, use key-description to print it. Use catch-all [t] in keymap instead of [remap self-insert-command]. (bug#32738)
* Don't use the return value of 'push'Mattias Engdegård2019-12-041-1/+1
| | | | | | | Although 'push' returns the modified list, it isn't actually documented to do so, so don't rely on it. * lisp/emacs-lisp/rx.el (rx--translate-any): Add progn.
* Avoid duplicated character classes in rxMattias Engdegård2019-12-031-1/+3
| | | | | | | | For example, (any digit digit) should produce "[[:digit:]]", not "[[:digit:][:digit:]]". * lisp/emacs-lisp/rx.el (rx--translate-any): Deduplicate character classes. * test/lisp/emacs-lisp/rx-tests.el (rx-any): Add test case.
* New functions window-state-buffers and tab-bar-get-buffer-tab (bug#38354)Juri Linkov2019-12-031-0/+1
| | | | | | | | | | * lisp/window.el (window-state-buffers): New function. * lisp/tab-bar.el (tab-bar-get-buffer-tab): New function. * lisp/emacs-lisp/seq.el (seq-some): Add autoload cookie. * lisp/desktop.el (desktop-buffers-not-to-save-function): New variable. (desktop-save-buffer-p): Use it.
* Use run-with-idle-timer instead of debounce for responsive image scaling.Juri Linkov2019-11-301-44/+0
| | | | | | | | | | | | | | | * lisp/emacs-lisp/timer.el (debounce, debounce-reduce): Revert macro addition. https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg01133.html * lisp/image.el (image-increase-size, image-decrease-size): Use run-with-idle-timer. (image--change-size): Rename back from image--change-size-function. * lisp/image-mode.el (image-mode--setup-mode): Remove hooks window-size-change-functions and window-selection-change-functions (bug#32672) (image-fit-to-window): Rename from image--window-change-function. (image--window-state-change): Rename from image--window-change. Use run-with-idle-timer.
* Improve errors & warnings due to fancy quoted vars (Bug#32939)Noam Postavsky2019-11-283-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | Add some hints to the message for byte compiler free & unused variable warnings, and 'void-variable' errors where the variable has confusable quote characters in it. * lisp/help.el (uni-confusables), uni-confusables-regexp): New constants. (help-command-error-confusable-suggestions): New function, added to `command-error-function'. (help-uni-confusable-suggestions): New function. * lisp/emacs-lisp/bytecomp.el (byte-compile-variable-ref): * lisp/emacs-lisp/cconv.el (cconv--analyze-use): Use it. * lisp/emacs-lisp/lisp-mode.el (lisp--match-confusable-symbol-character): New function. (lisp-fdefs): Use it to fontify confusable characters with font-lock-warning-face when they occur in symbol names. * doc/lispref/modes.texi (Faces for Font Lock): * doc/lispref/objects.texi (Basic Char Syntax): Recommend backslash escaping of confusable characters, and mention new fontification. * etc/NEWS: Announce the new fontification behavior. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-fontify-confusables): New test.
* Use new macro debounce-reduce to make mouse scaling of images more responsiveJuri Linkov2019-11-241-0/+44
| | | | | | | | | | * lisp/emacs-lisp/timer.el (debounce, debounce-reduce): New macros. * lisp/image.el (image-increase-size, image-decrease-size): Use funcall to call image--change-size-function. (image--change-size-function): Move code from defun of image--change-size to defvar that has the value of lambda returned from debounce-reduce. (Bug#38187)
* Fix edebug instrumentation removing from advised functionsMichael Heerdegen2019-11-231-6/+22
| | | | | * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): Handle advised functions correctly.
* Refix conditional step clauses in cl-loopdickmao2019-11-221-59/+37
| | | | | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl--loop-bindings, cl--loop-symbol-macs, cl-loop): Add cl--loop-conditions, remove cl--loop-guard-cond. (cl--push-clause-loop-body): Apply clause to both cl--loop-conditions and cl--loop-body (cl--parse-loop-clause): Use cl--push-clause-loop-body. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-and-assignment): Use docstring. (cl-macs-loop-for-as-arith): Removed expected failure. (cl-macs-loop-conditional-step-clauses): Add some tests (bug#29799).
* Fix uses of inhibit-message in package.elEli Zaretskii2019-11-221-5/+1
| | | | | | | | * lisp/emacs-lisp/package.el (package-generate-autoloads) (package--compile, package--save-selected-packages): Don't use 'inhibit-message' to bind 'noninteractive' and 'save-silently', since 'inhibit-message' already disables all messages. (Bug#38264)
* * lisp/emacs-lisp/smie.el (smie-next-sexp): Fix bug#38255Stefan Monnier2019-11-211-1/+5
| | | | | | Handle the case where the token is not in `smie-grammar`, either because the caller is making an error, or because it's a paren-like token that's not handled in the grammar but directly via the syntax tables.
* Make pp-buffer into a commandLars Ingebrigtsen2019-11-211-0/+1
| | | | * lisp/emacs-lisp/pp.el (pp-buffer): Make into a command (bug#38306).
* Make with-suppressed-warnings work for macros, tooLars Ingebrigtsen2019-11-201-1/+1
| | | | | | * lisp/emacs-lisp/macroexp.el (macroexp-macroexpand): Pass the macro/alias symbol on to byte-compile-warning-enabled-p so that with-suppressed-warnings works for macros, too.
* Fix cl-prettyexpand in the non-FULL caseLars Ingebrigtsen2019-11-181-9/+7
| | | | | | | | * lisp/emacs-lisp/cl-extra.el (cl-prettyexpand): This function has apparently not worked for at least a couple of decades (bug#38206) unless supplied with a FULL parameter. Make the FULL parameter obsolete and make the function always work as it did with a non-nil FULL.
* Make edebug-remove-instrumentation remove macro instrumentationLars Ingebrigtsen2019-11-151-2/+3
| | | | | | * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): Macros can also have edebug instrumentation, so remove that as well (bug#38195).
* Allow using edebug-remove-instrumentation more fine-grainedLars Ingebrigtsen2019-11-141-17/+31
| | | | | | * lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation): Prompt the user for what functions to remove instrumentation from a la cancel-edebug-on-entry (bug#38195).
* * lisp/emacs-lisp/easymenu.el (easy-menu-make-symbol): Fix last changeStefan Monnier2019-11-121-1/+1
|
* Fix some quoting glitches in doc stringsPaul Eggert2019-11-111-3/+3
|
* Document Lisp floats a bit betterPaul Eggert2019-11-101-9/+7
| | | | | | | | | | | | | * doc/lispref/numbers.texi (Float Basics): * doc/misc/cl.texi (Implementation Parameters): * lisp/emacs-lisp/cl-lib.el (cl-most-positive-float) (cl-least-positive-float) (cl-least-positive-normalized-float, cl-float-epsilon) (cl-float-negative-epsilon): Document IEEE floating point better. Don’t suggest that Emacs might use some floating-point format other than IEEE format, as Emacs currently assumes IEEE in several places and there seems little point in removing those assumptions.
* * lisp/autorevert.el: Use 'minibuffer-message' to not obscure the prompt.Juri Linkov2019-11-101-1/+1
| | | | | | | | | | | * lisp/autorevert.el (auto-revert-handler): Use 'minibuffer-message' instead of 'message'. Call it from the original window's buffer that in case of the minibuffer should be current, so minibuffer-message could add a message to it. (Bug#34614) * lisp/emacs-lisp/ert-x.el (ert--make-message-advice): Add nil to the list of values to not use for format-message, because minibuffer-message calls 'message' with nil argument, and tests fail.
* Add CHARS arg to read-char-from-minibuffer compatible with read-char-choice.Juri Linkov2019-11-101-3/+3
| | | | | | | | | | | | | | | * lisp/simple.el (read-char-history): Rename from read-char-from-minibuffer-history. (Bug#38076) (read-char-from-minibuffer-insert-char): Rename from read-char-from-minibuffer-self-insert. (read-char-from-minibuffer-map-hash): New defconst. (read-char-from-minibuffer-insert-other): New command. (read-char-from-minibuffer): Add optional args CHARS and HISTORY. (zap-to-char): Use 'read-char-history as HISTORY arg of read-char-from-minibuffer. * lisp/emacs-lisp/map-ynp.el (read-answer): Use sit-for instead of sleep-for. Replace short answer history yes-or-no-p-history with read-char-history.
* * lisp/emacs-lisp/easymenu.el: Don't quote lambdasStefan Monnier2019-11-071-6/+6
| | | | | (easy-menu-do-define, easy-menu-make-symbol): Replace `(lambda ..) with a closure.
* Clean up major mode check in package-menu-modeStefan Kangas2019-11-071-8/+20
| | | | | | | | | | | | | | * lisp/emacs-lisp/package.el (package--ensure-package-menu-mode): Extract function to warn about incorrect major mode... (package-menu-toggle-hiding, package-menu-refresh) (package-menu-execute): ...from here. (package-menu--mark-upgrades-1): And here, but move call... (package-menu-mark-upgrades): ...here instead. (package-menu-hide-package, package-menu-mark-delete) (package-menu-mark-install, package-menu-mark-unmark) (package-menu-quick-help, package-menu-get-status) (package-menu-filter-by-keyword, package-menu-filter-by-name) (package-menu-clear-filter): Add call to new function. (Bug#37891)
* Fix problem with my last commit in package.elStefan Kangas2019-11-061-3/+3
| | | | | | * lisp/emacs-lisp/package.el (package-menu--refresh-archives): Rename from duplicated name package-menu--refresh. (Bug#38084) (package-menu-mode, list-packages): Use new name.
* Avoid changing value of defcustom package-enable-at-startupStefan Kangas2019-11-061-6/+9
| | | | | | | | | | | | | | * lisp/emacs-lisp/package.el (package--activated): New variable to avoid changing value of defcustom 'package-enable-at-startup'. (package-initialize): Don't set 'package-enable-at-startup'. (package-initialize, package-activate-all): Set 'package--activated' instead of 'package-enable-at-startup'. (package--initialized): Add doc string. * lisp/startup.el (command-line): Check if 'package--activated' is non-nil before activating packages. * doc/lispref/package.texi (Packaging Basics): Update docs.
* Make 'g' refresh package data in package menuStefan Kangas2019-11-061-6/+11
| | | | | | | | | | | * lisp/emacs-lisp/package.el (package-menu--refresh): Rename from 'package-menu-refresh', make internal and non-interactive. (package-menu-mode-map, package-menu-mode-menu, package-menu-mode) (list-packages): Use the above. (Bug#35504) (package-menu-refresh): Redefine as obsolete fuction alias for 'revert-buffer'. * doc/emacs/package.texi (Package Menu): Document it. * etc/NEWS: Announce it.
* Declare unused macro package--push obsoleteStefan Kangas2019-11-051-0/+1
| | | | * lisp/emacs-lisp/package.el (package--push): Declare obsolete.
* * lisp/tab-bar.el: Filter out non-persistent tab parameters from frameset.Juri Linkov2019-11-031-0/+1
| | | | | | | | | | * lisp/tab-bar.el (frameset-filter-tabs): New function added to 'frameset-filter-alist' for frame parameter 'tabs'. (tab-bar--tab): Remove ws-bl/ws-bbl that are not needed because frameset doesn't save frame buffer-list to desktop anyway. (tab-bar-select-tab): Remove ws-bl/ws-bbl related code. * lisp/emacs-lisp/seq.el (seq-reduce): Add autoload cookie.
* Don't refuse to install packages without a "footer line"Stefan Kangas2019-11-021-3/+6
| | | | | | * lisp/emacs-lisp/package.el (package-buffer-info): Don't signal an error when the "footer line" is missing. Warn only. (Bug#26490) * etc/NEWS: Announce it.
* Really enable setting a breakpoint without instrumenting firstLars Ingebrigtsen2019-11-011-1/+3
| | | | | * lisp/emacs-lisp/edebug.el (edebug-set-breakpoint): Really enable setting a breakpoint without instrumenting first (bug#23469).
* Revert "Move description of value to syntax-ppss function."Lars Ingebrigtsen2019-10-301-20/+0
| | | | | | This reverts commit 305dbc7e2be05748039aacb1a3d697f6f64bed4c. Both of the functions in question are used a lot in the sources, so move it back to the more basic function.
* Add a new ppss structure for syntax-ppss dataLars Ingebrigtsen2019-10-301-0/+34
| | | | | * lisp/emacs-lisp/syntax.el (ppss): Add a new structure to provide accessors to the syntax-ppss data.
* Move description of value to syntax-ppss function.Lars Ingebrigtsen2019-10-301-0/+20
| | | | | | | | | * lisp/emacs-lisp/syntax.el (syntax-ppss): Move the description of the return value from... * src/syntax.c (Fparse_partial_sexp): ... here because `syntax-ppss' is what's called over the place, and jumping through an indirection to get to the value description is inconvenient.
* * lisp/tab-bar.el: Store point position and frame buffer-lists in tab.Juri Linkov2019-10-301-0/+2
| | | | | | | | | | | | | | | | | * lisp/tab-bar.el (tab-bar--tab): Store additionally point-marker, frame parameters buffer-list and buried-buffer-list, both for wc and ws. Use seq-filter. (tab-bar-select-tab): Restore point-marker after restoring window-configuration. Also restore frame parameters buffer-list and buried-buffer-list both for window-configuration and window-state. (tab-bar-history-limit, tab-bar-history--minibuffer-depth): New variables. (tab-bar-history-current): Rename from tab-bar-history--pre-change. (tab-bar-history--pre-change): Set tab-bar-history-current. (tab-bar--history-change): Use seq-take for tab-bar-history-limit. (tab-bar-history-back, tab-bar-history-forward): Restore point-marker. (tab-bar-list-noselect): Use seq-remove. * lisp/emacs-lisp/seq.el (seq-take, seq-filter): Add autoload cookie.
* * lisp/emacs-lisp/seq.el: Don't require cl-lib.Stefan Monnier2019-10-272-22/+23
| | | | | (seq-subseq): Move cl-subseq's code here instyead of calling it. * lisp/emacs-lisp/cl-extra.el (cl-subseq): Use seq-subseq.