aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Move EIEIO's C3 linearization code to `subr.el`scratch/derived-mode-add-parents-2Stefan Monnier2023-11-095-85/+61
| | | | | | | | | | | | | | | | | | | | | The code was used to linearize the EIEIO class hierarchy, since it results in saner results than things like BFS or DFS. By moving it to `subr.el` we get to benefit from that same advantage both in `cl--class-allparents` and in `derived-mode-all-parents`. * lisp/subr.el (merge-ordered-lists): New function. (derived-mode-all-parents): Use it to improve parent ordering. * lisp/emacs-lisp/eieio-core.el (eieio--c3-candidate) (eieio--c3-merge-lists): Delete functions, replaced by `merge-ordered-lists`. (eieio--class-precedence-c3): Use `merge-ordered-lists`. * lisp/emacs-lisp/cl-preloaded.el (cl--class-allparents): Use `merge-ordered-lists` to improve parent ordering. * lisp/emacs-lisp/cl-macs.el (cl--struct-all-parents): Delete function. (cl--pcase-mutually-exclusive-p): Use `cl--class-allparents` instead.
* Use `derived-mode-add-parents` in remaining uses of `derived-mode-parent`Stefan Monnier2023-11-098-148/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now multiple inheritance wasn't really used, but some ad-hoc code went a bit beyond the normal uses of the mode hierarchy. Use the new multiple inheritance code to replace that ad-hoc code, thereby eliminating basically all remaining direct uses of the `derived-mode-parent` property. CEDET had its own notion of mode hierrchy using `derived-mode-parent` as well as its own `mode-local-parent` property set via `define-child-mode`. `derived-mode-add-parents` lets us reimplement `define-child-mode` such that CEDET can now use the normal API functions. * lisp/locate.el (locate-mode): Use `derived-mode-add-parents`. * lisp/cedet/mode-local.el (get-mode-local-parent): Declare obsolete. (mode-local-equivalent-mode-p, mode-local-use-bindings-p): Make them obsolete aliases. (mode-local--set-parent): Rewrite to use `derived-mode-add-parents`. Declare as obsolete. (mode-local-map-mode-buffers): Use `derived-mode-p`. (mode-local-symbol, mode-local--activate-bindings) (mode-local--deactivate-bindings, mode-local-describe-bindings-2): Use `derived-mode-all-parents`. * lisp/cedet/srecode/table.el (srecode-get-mode-table): * lisp/cedet/srecode/find.el (srecode-table, srecode-load-tables-for-mode) (srecode-all-template-hash): Use `derived-mode-all-parents`. * lisp/cedet/srecode/map.el (srecode-map-entries-for-mode): * lisp/cedet/semantic/db.el (semanticdb-equivalent-mode): Use `provided-mode-derived-p` now that it obeys `define-child-mode`.
* subr.el: Add multiple inheritance to `derived-mode-p`Stefan Monnier2023-11-091-15/+36
| | | | | | | | Add the ability for a major mode to declare "extra parents" in addition to the one from which it inherits. * lisp/subr.el (derived-mode-add-parents): New function. (derived-mode-all-parents): Adjust accordingly.
* Use new `derived-mode-all/set-parents` functions.Stefan Monnier2023-11-088-50/+47
| | | | | | | | | | | | | | | Try and avoid using the `derived-mode-parent` property directly and use the new API functions instead. * lisp/emacs-lisp/derived.el (define-derived-mode): Use `derived-mode-set-parent`. * lisp/loadhist.el (unload--set-major-mode): * lisp/info-look.el (info-lookup-select-mode): * lisp/ibuf-ext.el (ibuffer-list-buffer-modes): * lisp/files.el (dir-locals--get-sort-score): * lisp/emacs-lisp/cl-generic.el (cl--generic-derived-specializers): Use `derived-mode-all-parents`.
* (derived-mode-all-parents): Speed up with a cacheStefan Monnier2023-11-081-9/+31
| | | | | | | | | | | | | | | Most uses of the mode hierarchy don't really need to construct the list, they just need to iterate over it. With single inheritance we could do it just by jumping up from a mode to its parent, but to support the upcoming multiple inheritance we'd need a more complex and costly iterator. Luckily, the inheritance graph is mostly static so we can cache the list of all parents, making `derived-mode-all-parents` cheap enough to be the basis of iteration and keeping the API very simple. * lisp/subr.el (derived-mode-all-parents): Cache the result. (derived-mode--flush): New function. (derived-mode-set-parent): Use it.
* subr.el: Provide a functional API around `derived-mode-parent`Stefan Monnier2023-11-081-10/+21
| | | | | | | | | | The `derived-mode-parent` property should be an implementation detail, so we can change it more easily. To that end, add functions to set and query it. * lisp/subr.el (derived-mode-all-parents): New function. (provided-mode-derived-p): Use it. (derived-mode-set-parent): New function.
* Guarantee files are auto-saved when Emacs is terminated by AndroidPo Lu2023-11-093-0/+35
| | | | | | | | | | | * java/org/gnu/emacs/EmacsNative.java (shutDownEmacs): * java/org/gnu/emacs/EmacsService.java (onDestroy): New function. When invoked, call shut_down_emacs and await its completion. * src/android.c (android_shut_down_emacs, shutDownEmacs): New functions.
* With `native-compile', compile lambdas in a defun or lambda tooAlan Mackenzie2023-11-083-68/+45
| | | | | | | | | | | | | | | | | | | This fixes bug#64646. Also refactor two functions to reduce code duplication. * lisp/emacs-lisp/comp.el (comp-spill-lap-function/symbol) (comp-spill-lap-function/list): Add all functions found by the byte compiler (including lambdas) to the native compiler's context, thus making them be native compiled. Refactor to use comp-intern-func-in-ctxt. Make comp-spill-lap-function/list also compile closures. * test/src/comp-resources/comp-test-funcs.el (comp-tests-lambda-return-f2): New function * test/src/comp-tests.el (comp-test-lambda-return2) (comp-tests-free-fun-f2): New functions to test that internal lambdas get native compiled.
* Simplify 'project-remember-projects-under'Philip Kaludercic2023-11-081-27/+20
| | | | | | * lisp/progmodes/project.el (project-remember-projects-under): Instead of traversing the directories manually, re-use `directory-files-recursively' to reduce complexity. (Bug#66649)
* * lisp/minibuffer.el (minibuffer-choose-completion-or-exit): New command.Juri Linkov2023-11-081-2/+12
| | | | | (minibuffer-visible-completions-map): Bind it to "RET". https://lists.gnu.org/archive/html/emacs-devel/2023-11/msg00246.html
* Don't leave point amid text conversion edits if auto-fill transpiresPo Lu2023-11-081-3/+7
| | | | | | | * lisp/simple.el (analyze-text-conversion): Save point in old-point after auto-fill completes, so that point-moved is not set if point remains intact subsequent to the execution of both hooks.
* Eglot: Demote errors to warnings in eglot-ensureJoão Távora2023-11-072-11/+33
| | | | | | | | | Github-reference: https://github.com/joaotavora/eglot/discussions/1318 * doc/misc/eglot.texi (Quick Start): Reword. (Starting Eglot): Reword. * lisp/progmodes/eglot.el (eglot-ensure): Demote errors to warnings.
* ; * lisp/minibuffer.el (completion-lazy-hilit-fn): Fix last change.Eli Zaretskii2023-11-071-3/+3
|
* ; Minor documentation fixesEli Zaretskii2023-11-072-30/+29
| | | | | | | * etc/NEWS: * lisp/minibuffer.el (completion-lazy-hilit) (completion-lazy-hilit-fn, completion-lazy-hilit): Fix recently added documentation.
* * lisp/simple.el (next-line-completion): Improve (bug#59486).Juri Linkov2023-11-061-12/+16
| | | | | Handle the case when lines with completion candidates are interspersed with lines that contain group headings.
* Allow completion frontends to fontify candidates just-in-timeJoão Távora2023-11-063-121/+223
| | | | | | | | | | | | | | | | | | | | | | | bug#48841, bug#47711 The variable may be bound by the frontend to a non-nil around completion-producing calls like completion-all-completions. See completion-lazy-hilit docstring for more info. * lisp/icomplete.el (icomplete-minibuffer-setup): Set completion-lazy-hilit. (icomplete--render-vertical): Call completion-lazy-hilit. (icomplete-completions): Call completion-lazy-hilit. * lisp/minibuffer.el (completion-lazy-hilit): New variable. (completion-lazy-hilit): New function. (completion-lazy-hilit-fn): New variable. (completion-pcm--regexp) (completion--flex-score-last-md): New helper variables. (completion--flex-score-1): New helper. (completion-pcm--hilit-commonality): Use completion-lazy-hilit. (completion--flex-adjust-metadata): Rework sorting code. * etc/NEWS: Mention completion-lazy-hilit
* ; * lisp/emacs-lisp/cl-macs.el: Axe useless `gethash` inline declMattias Engdegård2023-11-061-1/+1
|
* Silence warning when requiring ruby-ts-modeStefan Kangas2023-11-061-2/+2
| | | | | * lisp/progmodes/ruby-ts-mode.el: Silence warning when requiring file without a treesitter grammar.
* * lisp/vc/vc-git.el (vc-git-revision-table): Reverse the table (bug#64656).Juri Linkov2023-11-061-1/+1
|
* Emulate secondary selections on AndroidPo Lu2023-11-062-19/+51
| | | | | | | | | | | | | * doc/lispref/frames.texi (Other Selections): Revise documentation to match. * lisp/term/android-win.el (android-secondary-selection): New variable. (android-primary-selection, android-get-clipboard-1) (android-get-primary, gui-backend-get-selection) (gui-backend-selection-exists-p, gui-backend-selection-owner-p) (gui-backend-set-selection): Update doc strings and code as is proper.
* * lisp/emacs-lisp/cl-extra.el (cl-remprop): Update names to match docstringJeremy Bryant2023-11-051-7/+6
|
* New option to use arrows in the minibuffer to select completions (bug#59486)Juri Linkov2023-11-052-10/+90
| | | | | | | | | | | | | | | * lisp/minibuffer.el (minibuffer-visible-completions): New defcustom. (minibuffer-visible-completions-bind): New function. (minibuffer-visible-completions-map): New defvar-keymap. (minibuffer-mode): Set buffer-local minibuffer-completion-auto-choose to nil for minibuffer-visible-completions. (completing-read-default, completion-in-region-mode): Use minibuffer-visible-completions to compose keymap with minibuffer-visible-completions-map. (minibuffer-next-completion): Add new arg VERTICAL, and use next-line-completion. (minibuffer-next-line-completion) (minibuffer-previous-line-completion): New commands.
* Declare calc-eval-error in calc.elStefan Kangas2023-11-051-0/+2
| | | | * lisp/calc/calc.el (calc-eval-error): Declare. (Bug#58801)
* Further improve test coverage of time-stamp-pattern parsingStephen Gildea2023-11-041-11/+21
| | | | | | | * test/lisp/time-stamp-tests.el (time-stamp-custom-pattern): Use test strings that are easier to mis-parse, for a more exacting test. * (fz-make+zone, fz-make-zone): Declare pure.
* Implement more Android text editing controlsPo Lu2023-11-053-1/+55
| | | | | | | | | | | | | | | * lisp/term/android-win.el (android-deactivate-mark-command): New command. (select-all, start-selecting-text, stop-selecting-text): Arrange for commands manipulating the region to be executed when these keys are registered. * src/android.c (android_get_keysym_name): Return the keysym name of each of the new keysyms introduced. * src/androidterm.c (performContextMenuAction): Save special keysyms into key events for the selectAll, startSelectingText and stopSelectingText actions.
* Add project-any-command and project-prefix-or-any-commandDmitry Gutov2023-11-052-2/+56
| | | | | | | | | | * lisp/progmodes/project.el (project-any-command): New command. (project-prefix-map): Bind it to 'o'. (project-switch-commands): Add entry for it here too. (project-prefix-or-any-command): New command (bug#63648). (project-switch-commands): Update the custom type to mention 'project-prefix-or-any-command' as well. * etc/NEWS: Document the change.
* Align date stamps to whole days in ERCF. Jason Park2023-11-045-31/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/erc/erc-stamp.el (erc-stamp--current-time): Ditch overriding precedence of the `erc--ts' property in `:around' method because the variable `erc-stamp--current-time' fills that role well enough. (erc-stamp--current-datestamp-left): Remove unused variable. (erc-stamp--insert-date-stamp-as-phony-message): Assume `erc-timestamp-last-inserted-left' has already been assigned the updated rendered stamp for the current time. (erc-stamp--lr-date-on-pre-modify): Use the variable `erc-stamp--current-time' instead of the `erc-ts' property to convey an overriding time value for `erc-add-timestamp'. Set `erc-timestamp-last-inserted-left' instead of fiddling with another temporary variable to hack around these ill-fitting interfaces. Use day-aligned time value for the `erc-ts' property assigned to date stamps. (erc-stamp--date-mode): New internal minor mode. (erc-insert-timestamp-left-and-right): Defer to `erc-stamp--date-mode' for setting up date-stamp specific hooks. (erc-stamp--time-as-day): New function to "round" a date stamp to start of local day. (erc-stamp--setup): Defer to `erc-stamp--date-mode' for date-stamp specific teardown. (Bug#60936) * test/lisp/erc/erc-fill-tests.el (erc-fill-tests--current-time-value): Change default value to nil. (erc-stamp--current-time): New method for test cases. (erc-fill-tests--insert-privmsg): Use realistic value for `unparsed' slot. (erc-fill-tests--wrap-populate): Bind `erc-fill-tests--current-time-value' to 0. Don't mock the function `erc-stamp--current-time' because doing so inhibits normal polymorphic dispatch, which test cases rely on for delivering correct timestamp values in varied contexts. ; * test/lisp/erc/resources/fill/snapshots/merge-01-start.eld: Update. ; * test/lisp/erc/resources/fill/snapshots/merge-02-right.eld: Update. ; * test/lisp/erc/resources/fill/snapshots/merge-wrap-01.eld: Update.
* Decouple disparate escape-hatch concerns in erc-stampF. Jason Park2023-11-041-15/+27
| | | | | | | | | | | | | | * lisp/erc/erc-stamp.el (erc-stamp--allow-unmanaged): Improve doc string. (erc-stamp--permanent-cursor-sensor-functions): New variable to take over the formerly provided `cursor-sensor-functions' aspect of the flag `erc-stamp--allow-unmanaged'. (erc-add-timestamp): Use `erc-stamp--permanent-cursor-sensor-functions' instead of `erc-stamp--allow-unmanaged' in guard condition. (erc-munge-invisibility-spec): Use dedicated compatibility flag `erc-stamp--permanent-cursor-sensor-functions' and forgo unnecessary setup when it's non-nil. (Bug#60936)
* Preserve user markers when inserting ERC date stampsF. Jason Park2023-11-043-1/+72
| | | | | | | | | | | | | | | * lisp/erc/erc-stamp.el (erc-stamp--insert-date-stamp-as-phony-message): Ensure existing user markers aren't displaced by date-stamp insertion. * lisp/erc/erc.el (erc--insert-line-function): New function-valued variable for overriding `insert'. (erc-insert-line): Call `erc--insert-line-function', when non-nil, to insert line specially. * test/lisp/erc/erc-scenarios-stamp.el (erc-scenarios-stamp--on-insert-modify): New assertion helper function. (erc-scenarios-stamp--date-mode/left-and-right): New test. (Bug#60936)
* Don't over-truncate erc-timestamp-format-leftF. Jason Park2023-11-041-14/+27
| | | | | | | | | | | | | | * lisp/erc/erc-stamp.el (erc-timestamp-format-left): Fix typo in doc string and mention that changing the value mid-session requires cycling the minor mode. (erc-echo-timestamp-format): Add Custom :tag for choices. (erc-stamp--date-format-end): Revise doc string. (erc-stamp--format-date-stamp): Fix bug involving erroneous truncation parameter for `substring' when `erc-timestamp-format-left' doesn't end in a newline. Thanks to Emanuel Berg for catching this. (erc-stamp-prepend-date-stamps-p) Revise doc string. (erc-insert-timestamp-left-and-right): Add comment regarding compatibility concession. (Bug#60936)
* Really fix off-by-one in erc--get-inserted-msg-boundsF. Jason Park2023-11-044-5/+57
| | | | | | | | | | * lisp/erc/erc.el (erc--get-inserted-msg-bounds): Account for `previous-single-property-change' returning a position adjacent to that with an actual changed value. The prior attempt at addressing this was insufficient. * test/lisp/erc/erc-tests.el (erc--get-inserted-msg-bounds): New test. ; * test/lisp/erc/resources/base/local-modules/second.eld: Timeout. ; * test/lisp/erc/resources/base/local-modules/third.eld: Timeout.
* ; Fix last change in the FAQEli Zaretskii2023-11-041-2/+2
| | | | | * doc/misc/efaq.texi (Start Emacs maximized, Common requests): Fix last change.
* Make FAQ on starting Emacs maximized portableStefan Kangas2023-11-041-32/+9
| | | | | | | | | * doc/misc/efaq.texi (Start Emacs Maximized): Rename node from "Fullscreen mode on MS-Windows". Make advice portable to other platforms, and remove MS-Windows specific hacks. Ref: https://lists.gnu.org/r/emacs-devel/2023-10/msg00733.html Co-authored-by: David Hedlund <public@beloved.name>
* ; Improve commentary in 'files-tests-save-buffer-read-only-file'.Eli Zaretskii2023-11-041-0/+3
|
* Add tests for saving to write-protected filesJens Schmidt2023-11-041-0/+148
| | | | | | * test/lisp/files-tests.el (files-tests--with-yes-or-no-p): Add macro. (files-tests-save-buffer-read-only-file): Add test for writing to write-protected files with `save-buffer'. (Bug#66546)
* ; Update eww-suggest-uris :version.Visuwesh2023-11-041-1/+1
| | | | | * lisp/net/eww.el (eww-suggest-uris): Bump it to 30.1 since it was changed. (Bug#66926)
* Fix bytecomp-tests--dest-mountpoint test failureMattias Engdegård2023-11-041-1/+2
| | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--dest-mountpoint): Add lexical cookie. Bug reported and fix suggested by Jens Schmidt (https://lists.gnu.org/archive/html/emacs-devel/2023-10/msg00719.html)
* ; Merge from origin/emacs-29Eli Zaretskii2023-11-040-0/+0
|\ | | | | | | | | | | The following commit was skipped: 33fae4b02d6 Suggest alternative reason for ERT test duplication error
| * Suggest alternative reason for ERT test duplication errorMattias Engdegård2023-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-set-test): Amend error message; maybe the redefinition was caused by a file loaded twice. (Bug#66782) Suggested by Xiyue Deng. (cherry picked from commit 425d23fbeaede81ab4f50b4073949cc1c8a3fbd0)
* | Merge from origin/emacs-29Eli Zaretskii2023-11-043-1/+19
|\ \ | |/ | | | | | | | | | | 196def4fa64 Fix description of 'Package-Requires' library header c1778432790 ; * doc/misc/tramp.texi (FUSE setup): Fix typo. a64336cbb9c * lisp/emacs-lisp/cl-lib.el (cl--defalias): Improve&fix d... da8b85b577d Add two docstrings in cl-lib.el
| * Fix description of 'Package-Requires' library headerEli Zaretskii2023-11-041-0/+15
| | | | | | | | | | * doc/lispref/tips.texi (Library Headers): Update the description of the 'Package-Requires' header. (Bug#66677)
| * ; * doc/misc/tramp.texi (FUSE setup): Fix typo.Michael Albinus2023-10-311-1/+1
| |
| * * lisp/emacs-lisp/cl-lib.el (cl--defalias): Improve&fix docstringStefan Monnier2023-10-301-2/+1
| |
| * Add two docstrings in cl-lib.elJeremy Bryant2023-10-301-0/+4
| | | | | | | | | | * lisp/emacs-lisp/cl-lib.el (cl--set-buffer-substring) (cl--defalias): Add docstrings. (Bug#66828)
* | ; Merge from origin/emacs-29Eli Zaretskii2023-11-040-0/+0
|\ \ | |/ | | | | | | | | | | | | | | The following commits were skipped: 41939127457 Fix Tramp (don't merge) c22eeba8277 ; Fix typo 4f57af7fccd * doc/misc/tramp.texi (Traces and Profiles): Fix indentat... ccaf801baad * doc/misc/tramp.texi (Traces and Profiles): Fix indentat...
| * Fix Tramp (don't merge)Michael Albinus2023-10-271-3/+3
| | | | | | | | * lisp/net/tramp.el (tramp-read-id-output): Identifiers can contain "-".
| * ; Fix typoMichael Albinus2023-10-261-1/+1
| |
| * * doc/misc/tramp.texi (Traces and Profiles): Fix indentation. (don't merge)Michael Albinus2023-10-261-14/+14
| |
| * * doc/misc/tramp.texi (Traces and Profiles): Fix indentation. (Don't merge)Michael Albinus2023-10-251-13/+16
| |
* | Merge from origin/emacs-29Eli Zaretskii2023-11-045-13/+13
|\ \ | |/ | | | | | | | | | | | | d5e5ea4e36b Fix guessing commands for zstandard archives in Dired 90db29aff86 Fix eglot.texi (JSONRPC objects in Elisp) example 5ef48ad6a37 ; Fix one author's name. c4e9a6159a3 * doc/man/emacsclient.1: Fix --tramp option. 6dca3a8eab2 Improve `nsm-protocol-check--3des-cipher` docstring