From f76ac74db30cb324d5fed923ca86022b53f70bb8 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Wed, 31 Jul 2024 17:03:41 +0200 Subject: [PATCH] update magit Signed-off-by: Andreas Gerler --- elpa/compat-29.1.4.5.signed | 1 - elpa/compat-30.0.0.0.signed | 1 + .../NEWS.org | 24 + .../compat-25.el | 23 +- .../compat-26.el | 0 .../compat-27.el | 0 .../compat-28.el | 5 +- .../compat-29.el | 0 elpa/compat-30.0.0.0/compat-30.el | 355 ++++++++++++++ .../compat-autoloads.el | 0 .../compat-macs.el | 0 .../compat-pkg.el | 2 +- .../compat.el | 8 +- .../compat.info | 382 ++++++++++++--- elpa/{compat-29.1.4.5 => compat-30.0.0.0}/dir | 0 .../AUTHORS.md | 8 +- .../LICENSE | 0 .../dir | 0 .../git-rebase.el | 1 + .../magit-apply.el | 19 +- .../magit-autoloads.el | 34 +- .../magit-autorevert.el | 7 +- .../magit-base.el | 72 +-- .../magit-bisect.el | 4 +- .../magit-blame.el | 1 + .../magit-bookmark.el | 10 +- .../magit-branch.el | 20 +- .../magit-bundle.el | 0 .../magit-clone.el | 0 .../magit-commit.el | 0 .../magit-core.el | 9 - .../magit-diff.el | 213 ++++---- .../magit-ediff.el | 0 .../magit-extras.el | 14 + .../magit-fetch.el | 3 +- .../magit-files.el | 11 +- .../magit-git.el | 77 +-- .../magit-gitignore.el | 0 .../magit-log.el | 47 +- .../magit-margin.el | 0 .../magit-merge.el | 2 +- .../magit-mode.el | 57 ++- .../magit-notes.el | 0 .../magit-patch.el | 0 .../magit-pkg.el | 16 +- .../magit-process.el | 56 +-- .../magit-pull.el | 3 +- .../magit-push.el | 12 +- .../magit-reflog.el | 7 +- .../magit-refs.el | 13 +- .../magit-remote.el | 4 +- .../magit-repos.el | 2 + .../magit-reset.el | 0 .../magit-sequence.el | 0 .../magit-sparse-checkout.el | 0 .../magit-stash.el | 19 +- .../magit-status.el | 167 +++---- .../magit-submodule.el | 44 +- .../magit-subtree.el | 0 .../magit-tag.el | 0 .../magit-transient.el | 0 .../magit-wip.el | 0 .../magit-worktree.el | 18 +- .../magit.el | 10 +- .../magit.info | 297 ++++++------ .../magit-section-autoloads.el | 28 -- .../dir | 0 .../magit-section-autoloads.el | 67 +++ .../magit-section-pkg.el | 8 +- .../magit-section.el | 95 ++-- .../magit-section.info | 22 +- .../dir | 0 .../gpl.info | 2 +- .../transient-autoloads.el | 2 +- .../transient-pkg.el | 6 +- .../transient.el | 456 +++++++++++------- .../transient.info | 156 ++++-- 77 files changed, 1903 insertions(+), 1017 deletions(-) delete mode 100644 elpa/compat-29.1.4.5.signed create mode 100644 elpa/compat-30.0.0.0.signed rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/NEWS.org (92%) rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/compat-25.el (95%) rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/compat-26.el (100%) rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/compat-27.el (100%) rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/compat-28.el (99%) rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/compat-29.el (100%) create mode 100644 elpa/compat-30.0.0.0/compat-30.el rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/compat-autoloads.el (100%) rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/compat-macs.el (100%) rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/compat-pkg.el (59%) rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/compat.el (96%) rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/compat.info (89%) rename elpa/{compat-29.1.4.5 => compat-30.0.0.0}/dir (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/AUTHORS.md (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/LICENSE (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/dir (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/git-rebase.el (99%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-apply.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-autoloads.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-autorevert.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-base.el (95%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-bisect.el (99%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-blame.el (99%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-bookmark.el (92%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-branch.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-bundle.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-clone.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-commit.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-core.el (92%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-diff.el (96%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-ediff.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-extras.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-fetch.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-files.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-git.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-gitignore.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-log.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-margin.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-merge.el (99%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-mode.el (97%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-notes.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-patch.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-pkg.el (54%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-process.el (97%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-pull.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-push.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-reflog.el (97%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-refs.el (99%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-remote.el (99%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-repos.el (99%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-reset.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-sequence.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-sparse-checkout.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-stash.el (98%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-status.el (86%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-submodule.el (96%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-subtree.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-tag.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-transient.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-wip.el (100%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit-worktree.el (94%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit.el (99%) rename elpa/{magit-20240522.204 => magit-20240730.1741}/magit.info (99%) delete mode 100644 elpa/magit-section-20240508.2349/magit-section-autoloads.el rename elpa/{magit-section-20240508.2349 => magit-section-20240730.1741}/dir (100%) create mode 100644 elpa/magit-section-20240730.1741/magit-section-autoloads.el rename elpa/{magit-section-20240508.2349 => magit-section-20240730.1741}/magit-section-pkg.el (62%) rename elpa/{magit-section-20240508.2349 => magit-section-20240730.1741}/magit-section.el (97%) rename elpa/{magit-section-20240508.2349 => magit-section-20240730.1741}/magit-section.info (94%) rename elpa/{transient-20240421.1737 => transient-20240729.1524}/dir (100%) rename elpa/{transient-20240421.1737 => transient-20240729.1524}/gpl.info (99%) rename elpa/{transient-20240421.1737 => transient-20240729.1524}/transient-autoloads.el (97%) rename elpa/{transient-20240421.1737 => transient-20240729.1524}/transient-pkg.el (71%) rename elpa/{transient-20240421.1737 => transient-20240729.1524}/transient.el (93%) rename elpa/{transient-20240421.1737 => transient-20240729.1524}/transient.info (97%) diff --git a/elpa/compat-29.1.4.5.signed b/elpa/compat-29.1.4.5.signed deleted file mode 100644 index e82e0d32..00000000 --- a/elpa/compat-29.1.4.5.signed +++ /dev/null @@ -1 +0,0 @@ -Good signature from 645357D2883A0966 GNU ELPA Signing Agent (2023) (trust undefined) created at 2024-03-31T11:15:02+0200 using EDDSA \ No newline at end of file diff --git a/elpa/compat-30.0.0.0.signed b/elpa/compat-30.0.0.0.signed new file mode 100644 index 00000000..465f6348 --- /dev/null +++ b/elpa/compat-30.0.0.0.signed @@ -0,0 +1 @@ +Good signature from 645357D2883A0966 GNU ELPA Signing Agent (2023) (trust undefined) created at 2024-07-08T23:05:02+0200 using EDDSA \ No newline at end of file diff --git a/elpa/compat-29.1.4.5/NEWS.org b/elpa/compat-30.0.0.0/NEWS.org similarity index 92% rename from elpa/compat-29.1.4.5/NEWS.org rename to elpa/compat-30.0.0.0/NEWS.org index c466a003..acc06d05 100644 --- a/elpa/compat-29.1.4.5/NEWS.org +++ b/elpa/compat-30.0.0.0/NEWS.org @@ -2,6 +2,30 @@ #+link: compat-gh https://github.com/emacs-compat/compat/issues/ #+options: toc:nil num:nil author:nil +* Release of "Compat" Version 30.0.0.0 + +- compat-28: Mark =subr-native-elisp-p= as obsolete (renamed in Emacs 30). +- compat-30: New function =char-to-name=. +- compat-30: New function =obarray-clear=. +- compat-30: New function =interpreted-function-p=. +- compat-30: New function =primitive-function-p=. +- compat-30: New function =closurep=. +- compat-30: Add extended function =sort= with keyword arguments. +- compat-30: New function =value<=. +- compat-30: Add extended =copy-tree= with support for copying records with + non-nil optional second argument. +- compat-30: New macro =static-if=. +- compat-30: New alias =drop=. +- compat-30: New function =merge-ordered-lists=. +- compat-30: New variables =completion-lazy-hilit= and =completion-lazy-hilit-fn= + and new function =completion-lazy-hilit=. +- compat-30: New function =require-with-check=. +- compat-30: New functions =find-buffer= and =get-truename-buffer=. +- compat-30: Add extended =completion-metadata-get= with support for + =completion-category-overrides= and =completion-extra-properties=. + +(Release <2024-07-08 Mon>) + * Release of "Compat" Version 29.1.4.5 - Minor optimization of ~plist-get~ and ~plist-put~. diff --git a/elpa/compat-29.1.4.5/compat-25.el b/elpa/compat-30.0.0.0/compat-25.el similarity index 95% rename from elpa/compat-29.1.4.5/compat-25.el rename to elpa/compat-30.0.0.0/compat-25.el index 182f5a35..9a0b13d6 100644 --- a/elpa/compat-29.1.4.5/compat-25.el +++ b/elpa/compat-30.0.0.0/compat-25.el @@ -40,23 +40,6 @@ usage: (bool-vector &rest OBJECTS)" i (1+ i))) vec)) -;;;; Defined in fns.c - -(compat-defun sort (seq predicate) ;; - "Handle vector SEQ." - :extended t - (cond - ((listp seq) - (sort seq predicate)) - ((vectorp seq) - (let* ((list (sort (append seq nil) predicate)) - (p list) (i 0)) - (while p - (aset seq i (car p)) - (setq i (1+ i) p (cdr p))) - (apply #'vector list))) - (t (signal 'wrong-type-argument (list 'list-or-vector-p seq))))) - ;;;; Defined in editfns.c (compat-defalias format-message format) ;; @@ -267,5 +250,11 @@ itself or not." form)))))))) (t form))) +;;;; Defined in minibuffer.el + +(compat-defun completion--category-override (category tag) ;; + "Return completion category override for CATEGORY and TAG." + (assq tag (cdr (assq category completion-category-overrides)))) + (provide 'compat-25) ;;; compat-25.el ends here diff --git a/elpa/compat-29.1.4.5/compat-26.el b/elpa/compat-30.0.0.0/compat-26.el similarity index 100% rename from elpa/compat-29.1.4.5/compat-26.el rename to elpa/compat-30.0.0.0/compat-26.el diff --git a/elpa/compat-29.1.4.5/compat-27.el b/elpa/compat-30.0.0.0/compat-27.el similarity index 100% rename from elpa/compat-29.1.4.5/compat-27.el rename to elpa/compat-30.0.0.0/compat-27.el diff --git a/elpa/compat-29.1.4.5/compat-28.el b/elpa/compat-30.0.0.0/compat-28.el similarity index 99% rename from elpa/compat-29.1.4.5/compat-28.el rename to elpa/compat-30.0.0.0/compat-28.el index b5730b11..12e7b480 100644 --- a/elpa/compat-29.1.4.5/compat-28.el +++ b/elpa/compat-30.0.0.0/compat-28.el @@ -396,7 +396,8 @@ not a list, return a one-element list containing OBJECT." ;;;; Defined in data.c -(compat-defalias subr-native-elisp-p ignore) ;; +;; Renamed in Emacs 30 to `native-comp-function-p'. +(compat-defalias subr-native-elisp-p ignore :obsolete t) ;; ;;;; Defined in subr-x.el @@ -835,7 +836,7 @@ function will never return nil." ;;;; Defined in button.el ;; Obsolete Alias since 29 -(compat-defalias button-buttonize buttonize :obsolete t) ;; +(compat-defalias button-buttonize buttonize :obsolete t) ;; ;;;; Defined in wid-edit.el diff --git a/elpa/compat-29.1.4.5/compat-29.el b/elpa/compat-30.0.0.0/compat-29.el similarity index 100% rename from elpa/compat-29.1.4.5/compat-29.el rename to elpa/compat-30.0.0.0/compat-29.el diff --git a/elpa/compat-30.0.0.0/compat-30.el b/elpa/compat-30.0.0.0/compat-30.el new file mode 100644 index 00000000..c41c4a01 --- /dev/null +++ b/elpa/compat-30.0.0.0/compat-30.el @@ -0,0 +1,355 @@ +;;; compat-30.el --- Functionality added in Emacs 30 -*- lexical-binding: t; -*- + +;; Copyright (C) 2023-2024 Free Software Foundation, Inc. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; Functionality added in Emacs 30, needed by older Emacs versions. + +;;; Code: + +(eval-when-compile (load "compat-macs.el" nil t t)) +(compat-require compat-29 "29.1") + +;; TODO Update to 30.1 as soon as the Emacs emacs-30 branch version bumped +(compat-version "30.0.50") + +;;;; Defined in lread.c + +(compat-defun obarray-clear (ob) ;; + "Remove all symbols from obarray OB." + (fillarray ob 0)) + +;;;; Defined in buffer.c + +(compat-defun find-buffer (variable value) ;; + "Return the buffer with buffer-local VARIABLE equal to VALUE. +If there is no such live buffer, return nil." + (cl-loop for buffer the buffers + if (equal (buffer-local-value variable buffer) value) + return buffer)) + +(compat-defun get-truename-buffer (filename) ;; + "Return the buffer with `file-truename' equal to FILENAME (a string). +If there is no such live buffer, return nil. +See also `find-buffer-visiting'." + (find-buffer 'buffer-file-truename filename)) + +;;;; Defined in files.el + +(compat-defun require-with-check (feature &optional filename noerror) ;; + "If FEATURE is not already loaded, load it from FILENAME. +This is like `require' except if FEATURE is already a member of the list +`features’, then we check if this was provided by a different file than the +one that we would load now (presumably because `load-path' has been +changed since the file was loaded). +If it's the case, we either signal an error (the default), or forcibly reload +the new file (if NOERROR is equal to `reload'), or otherwise emit a warning." + (let ((lh load-history) + (res (require feature filename (if (eq noerror 'reload) nil noerror)))) + ;; If the `feature' was not yet provided, `require' just loaded the right + ;; file, so we're done. + (when (eq lh load-history) + ;; If `require' did nothing, we need to make sure that was warranted. + (let ((fn (locate-file (or filename (symbol-name feature)) + load-path (get-load-suffixes)))) + (cond + ((assoc fn load-history) nil) ;We loaded the right file. + ((eq noerror 'reload) (load fn nil 'nomessage)) + (t (funcall (if noerror #'warn #'error) + "Feature provided by other file: %S" feature))))) + res)) + +;;;; Defined in minibuffer.el + +(compat-defun completion--metadata-get-1 (metadata prop) ;; + "Helper function. +See for `completion-metadata-get' for METADATA and PROP arguments." + (or (alist-get prop metadata) + (plist-get completion-extra-properties + (or (get prop 'completion-extra-properties--keyword) + (put prop 'completion-extra-properties--keyword + (intern (concat ":" (symbol-name prop)))))))) + +(compat-defun completion-metadata-get (metadata prop) ;; + "Get property PROP from completion METADATA. +If the metadata specifies a completion category, the variables +`completion-category-overrides' and +`completion-category-defaults' take precedence for +category-specific overrides. If the completion metadata does not +specify the property, the `completion-extra-properties' plist is +consulted. Note that the keys of the +`completion-extra-properties' plist are keyword symbols, not +plain symbols." + :extended t + (if-let ((cat (and (not (eq prop 'category)) + (completion--metadata-get-1 metadata 'category))) + (over (completion--category-override cat prop))) + (cdr over) + (completion--metadata-get-1 metadata prop))) + +(compat-defvar completion-lazy-hilit nil ;; + "If non-nil, request lazy highlighting of completion candidates. + +Lisp programs (a.k.a. \"front ends\") that present completion +candidates may opt to bind this variable to a non-nil value when +calling functions (such as `completion-all-completions') which +produce completion candidates. This tells the underlying +completion styles that they do not need to fontify (i.e., +propertize with the `face' property) completion candidates in a +way that highlights the matching parts. Then it is the front end +which presents the candidates that becomes responsible for this +fontification. The front end does that by calling the function +`completion-lazy-hilit' on each completion candidate that is to be +displayed to the user. + +Note that only some completion styles take advantage of this +variable for optimization purposes. Other styles will ignore the +hint and fontify eagerly as usual. It is still safe for a +front end to call `completion-lazy-hilit' in these situations. + +To author a completion style that takes advantage of this variable, +see `completion-lazy-hilit-fn' and `completion-pcm--hilit-commonality'.") + +(compat-defvar completion-lazy-hilit-fn nil ;; + "Fontification function set by lazy-highlighting completions styles. +When a given style wants to enable support for `completion-lazy-hilit' +\(which see), that style should set this variable to a function of one +argument. It will be called with each completion candidate, a string, to +be displayed to the user, and should destructively propertize these +strings with the `face' property.") + +(compat-defun completion-lazy-hilit (str) ;; + "Return a copy of completion candidate STR that is `face'-propertized. +See documentation of the variable `completion-lazy-hilit' for more +details." + (if (and completion-lazy-hilit completion-lazy-hilit-fn) + (funcall completion-lazy-hilit-fn (copy-sequence str)) + str)) + +;;;; Defined in subr.el + +(compat-defmacro static-if (condition then-form &rest else-forms) ;; + "A conditional compilation macro. +Evaluate CONDITION at macro-expansion time. If it is non-nil, +expand the macro to THEN-FORM. Otherwise expand it to ELSE-FORMS +enclosed in a `progn' form. ELSE-FORMS may be empty." + (declare (indent 2) (debug (sexp sexp &rest sexp))) + (if (eval condition lexical-binding) + then-form + (cons 'progn else-forms))) + +(compat-defun closurep (object) ;; + "Return t if OBJECT is a function of type closure." + (declare (side-effect-free error-free)) + (eq (car-safe object) 'closure)) + +(compat-defalias interpreted-function-p closurep) ;; + +(compat-defun primitive-function-p (object) ;; + "Return t if OBJECT is a built-in primitive function. +This excludes special forms, since they are not functions." + (declare (side-effect-free error-free)) + (and (subrp object) + (not (or (with-no-warnings (subr-native-elisp-p object)) + (special-form-p object))))) + +(compat-defalias drop nthcdr) ;; + +(compat-defun merge-ordered-lists (lists &optional error-function) ;; + "Merge LISTS in a consistent order. +LISTS is a list of lists of elements. +Merge them into a single list containing the same elements (removing +duplicates), obeying their relative positions in each list. +The order of the (sub)lists determines the final order in those cases where +the order within the sublists does not impose a unique choice. +Equality of elements is tested with `eql'. + +If a consistent order does not exist, call ERROR-FUNCTION with +a remaining list of lists that we do not know how to merge. +It should return the candidate to use to continue the merge, which +has to be the head of one of the lists. +By default we choose the head of the first list." + (let ((result '())) + (setq lists (remq nil lists)) + (while (cdr (setq lists (delq nil lists))) + (let* ((next nil) + (tail lists)) + (while tail + (let ((candidate (caar tail)) + (other-lists lists)) + (while other-lists + (if (not (memql candidate (cdr (car other-lists)))) + (setq other-lists (cdr other-lists)) + (setq candidate nil) + (setq other-lists nil))) + (if (not candidate) + (setq tail (cdr tail)) + (setq next candidate) + (setq tail nil)))) + (unless next + (setq next (funcall (or error-function #'caar) lists)) + (unless (funcall + (eval-when-compile (if (fboundp 'compat--assoc) 'compat--assoc 'assoc)) + next lists #'eql) + (error "Invalid candidate returned by error-function: %S" next))) + (push next result) + (setq lists + (mapcar (lambda (l) (if (eql (car l) next) (cdr l) l)) + lists)))) + (if (null result) (car lists) + (append (nreverse result) (car lists))))) + +(compat-defun copy-tree (tree &optional vectors-and-records) ;; + "Handle copying records when optional arg is non-nil." + :extended t + (declare (side-effect-free error-free)) + (if (fboundp 'recordp) + (if (consp tree) + (let (result) + (while (consp tree) + (let ((newcar (car tree))) + (if (or (consp (car tree)) + (and vectors-and-records + (or (vectorp (car tree)) (recordp (car tree))))) + (setq newcar (compat--copy-tree (car tree) vectors-and-records))) + (push newcar result)) + (setq tree (cdr tree))) + (nconc (nreverse result) + (if (and vectors-and-records (or (vectorp tree) (recordp tree))) + (compat--copy-tree tree vectors-and-records) + tree))) + (if (and vectors-and-records (or (vectorp tree) (recordp tree))) + (let ((i (length (setq tree (copy-sequence tree))))) + (while (>= (setq i (1- i)) 0) + (aset tree i (compat--copy-tree (aref tree i) vectors-and-records))) + tree) + tree)) + (copy-tree tree vectors-and-records))) + +;;;; Defined in fns.c + +(compat-defun value< (a b) ;; + "Return non-nil if A precedes B in standard value order. +A and B must have the same basic type. +Numbers are compared with <. +Strings and symbols are compared with string-lessp. +Lists, vectors, bool-vectors and records are compared lexicographically. +Markers are compared lexicographically by buffer and position. +Buffers and processes are compared by name. +Other types are considered unordered and the return value will be ‘nil’." + (cond + ((or (and (numberp a) (numberp b)) + (and (markerp a) (markerp b))) + (< a b)) + ((or (and (stringp a) (stringp b)) + (and (symbolp a) (symbolp b))) + (string< a b)) + ((and (listp a) (listp b)) + (while (and (consp a) (consp b) (equal (car a) (car b))) + (setq a (cdr a) b (cdr b))) + (cond + ((not b) nil) + ((not a) t) + ((and (consp a) (consp b)) (value< (car a) (car b))) + (t (value< a b)))) + ((and (vectorp a) (vectorp b)) + (let* ((na (length a)) + (nb (length b)) + (n (min na nb)) + (i 0)) + (while (and (< i n) (equal (aref a i) (aref b i))) + (cl-incf i)) + (if (< i n) (value< (aref a i) (aref b i)) (< n nb)))) + ((and (bufferp a) (bufferp b)) + ;; `buffer-name' is nil for killed buffers. + (setq a (buffer-name a) + b (buffer-name b)) + (cond + ((and a b) (string< a b)) + (b t))) + ((and (processp a) (processp b)) + (string< (process-name a) (process-name b))) + ;; TODO Add support for more types here. + ;; Other values of equal type are considered unordered (return value nil). + ((eq (type-of a) (type-of b)) nil) + ;; Different types. + (t (error "value< type mismatch: %S %S" a b)))) + +(compat-defun sort (seq &optional lessp &rest rest) ;; + "Sort function with support for keyword arguments. +The following arguments are defined: + +:key FUNC -- FUNC is a function that takes a single element from SEQ and + returns the key value to be used in comparison. If absent or nil, + `identity' is used. + +:lessp FUNC -- FUNC is a function that takes two arguments and returns + non-nil if the first element should come before the second. + If absent or nil, `value<' is used. + +:reverse BOOL -- if BOOL is non-nil, the sorting order implied by FUNC is + reversed. This does not affect stability: equal elements still retain + their order in the input sequence. + +:in-place BOOL -- if BOOL is non-nil, SEQ is sorted in-place and returned. + Otherwise, a sorted copy of SEQ is returned and SEQ remains unmodified; + this is the default. + +For compatibility, the calling convention (sort SEQ LESSP) can also be used; +in this case, sorting is always done in-place." + :extended t + (let ((in-place t) (reverse nil) (orig-seq seq)) + (when (or (not lessp) rest) + (setq + rest (if lessp (cons lessp rest) rest) + in-place (plist-get rest :in-place) + reverse (plist-get rest :reverse) + lessp (let ((key (plist-get rest :key)) + (< (or (plist-get rest :lessp) #'value<))) + (if key + (lambda (a b) (funcall < (funcall key a) (funcall key b))) + <)) + seq (if (or (and (eval-when-compile (< emacs-major-version 25)) (vectorp orig-seq)) + in-place) + seq + (copy-sequence seq)))) + ;; Emacs 24 does not support vectors. Convert to list. + (when (and (eval-when-compile (< emacs-major-version 25)) (vectorp orig-seq)) + (setq seq (append seq nil))) + (setq seq (if reverse + (nreverse (sort (nreverse seq) lessp)) + (sort seq lessp))) + ;; Emacs 24: Convert back to vector. + (if (and (eval-when-compile (< emacs-major-version 25)) (vectorp orig-seq)) + (if in-place + (cl-loop for i from 0 for x in seq + do (aset orig-seq i x) + finally return orig-seq) + (apply #'vector seq)) + seq))) + +;;;; Defined in mule-cmds.el + +(compat-defun char-to-name (char) ;; + "Return the Unicode name for CHAR, if it has one, else nil. +Return nil if CHAR is not a character." + (and (characterp char) + (or (get-char-code-property char 'name) + (get-char-code-property char 'old-name)))) + +(provide 'compat-30) +;;; compat-30.el ends here diff --git a/elpa/compat-29.1.4.5/compat-autoloads.el b/elpa/compat-30.0.0.0/compat-autoloads.el similarity index 100% rename from elpa/compat-29.1.4.5/compat-autoloads.el rename to elpa/compat-30.0.0.0/compat-autoloads.el diff --git a/elpa/compat-29.1.4.5/compat-macs.el b/elpa/compat-30.0.0.0/compat-macs.el similarity index 100% rename from elpa/compat-29.1.4.5/compat-macs.el rename to elpa/compat-30.0.0.0/compat-macs.el diff --git a/elpa/compat-29.1.4.5/compat-pkg.el b/elpa/compat-30.0.0.0/compat-pkg.el similarity index 59% rename from elpa/compat-29.1.4.5/compat-pkg.el rename to elpa/compat-30.0.0.0/compat-pkg.el index 6b172644..4754b354 100644 --- a/elpa/compat-29.1.4.5/compat-pkg.el +++ b/elpa/compat-30.0.0.0/compat-pkg.el @@ -1,2 +1,2 @@ ;; Generated package description from compat.el -*- no-byte-compile: t -*- -(define-package "compat" "29.1.4.5" "Emacs Lisp Compatibility Library" '((emacs "24.4") (seq "2.23")) :commit "8d4e8a366681def88751f5e9975738ecd3180deb" :authors '(("Philip Kaludercic" . "philipk@posteo.net") ("Daniel Mendler" . "mail@daniel-mendler.de")) :maintainer '("Compat Development" . "~pkal/compat-devel@lists.sr.ht") :keywords '("lisp" "maint") :url "https://github.com/emacs-compat/compat") +(define-package "compat" "30.0.0.0" "Emacs Lisp Compatibility Library" '((emacs "24.4") (seq "2.23")) :commit "09dce8a193c5a70277512263782b82fa1cba84c0" :authors '(("Philip Kaludercic" . "philipk@posteo.net") ("Daniel Mendler" . "mail@daniel-mendler.de")) :maintainer '("Compat Development" . "~pkal/compat-devel@lists.sr.ht") :keywords '("lisp" "maint") :url "https://github.com/emacs-compat/compat") diff --git a/elpa/compat-29.1.4.5/compat.el b/elpa/compat-30.0.0.0/compat.el similarity index 96% rename from elpa/compat-29.1.4.5/compat.el rename to elpa/compat-30.0.0.0/compat.el index b2eb9fef..e43e6695 100644 --- a/elpa/compat-29.1.4.5/compat.el +++ b/elpa/compat-30.0.0.0/compat.el @@ -4,7 +4,7 @@ ;; Author: Philip Kaludercic , Daniel Mendler ;; Maintainer: Compat Development <~pkal/compat-devel@lists.sr.ht> -;; Version: 29.1.4.5 +;; Version: 30.0.0.0 ;; URL: https://github.com/emacs-compat/compat ;; Package-Requires: ((emacs "24.4") (seq "2.23")) ;; Keywords: lisp, maint @@ -50,9 +50,9 @@ ;; time and runtime, but only if needed. (eval-when-compile (defmacro compat--maybe-require () - (when (version< emacs-version "29.1") - (require 'compat-29) - '(require 'compat-29)))) + (when (version< emacs-version "30.0.50") + (require 'compat-30) + '(require 'compat-30)))) (compat--maybe-require) ;;;; Macros for extended compatibility function calls diff --git a/elpa/compat-29.1.4.5/compat.info b/elpa/compat-30.0.0.0/compat.info similarity index 89% rename from elpa/compat-29.1.4.5/compat.info rename to elpa/compat-30.0.0.0/compat.info index 04d96edd..83a8be50 100644 --- a/elpa/compat-29.1.4.5/compat.info +++ b/elpa/compat-30.0.0.0/compat.info @@ -1,4 +1,4 @@ -This is docXccUUB.info, produced by makeinfo version 6.8 from +This is doc23GpG6.info, produced by makeinfo version 6.8 from compat.texi. Copyright © 2022-2024 Free Software Foundation, Inc. @@ -20,14 +20,14 @@ START-INFO-DIR-ENTRY END-INFO-DIR-ENTRY  -File: docXccUUB.info, Node: Top, Next: Introduction, Up: (dir) +File: doc23GpG6.info, Node: Top, Next: Introduction, Up: (dir) "Compat" Manual *************** This manual documents the usage of the "Compat" Emacs lisp library, the forward-compatibility library for Emacs Lisp, corresponding to version -29.1.4.5. +30.0.0.0. Copyright © 2022-2024 Free Software Foundation, Inc. @@ -68,7 +68,7 @@ Support  -File: docXccUUB.info, Node: Introduction, Next: Support, Prev: Top, Up: Top +File: doc23GpG6.info, Node: Introduction, Next: Support, Prev: Top, Up: Top 1 Introduction ************** @@ -80,7 +80,7 @@ File: docXccUUB.info, Node: Introduction, Next: Support, Prev: Top, Up: Top * Limitations::  -File: docXccUUB.info, Node: Overview, Next: Usage, Up: Introduction +File: doc23GpG6.info, Node: Overview, Next: Usage, Up: Introduction 1.1 Overview ============ @@ -95,7 +95,7 @@ audience are package developers that are interested in using newer developments, without having to break compatibility.  -File: docXccUUB.info, Node: Usage, Next: Limitations, Prev: Overview, Up: Introduction +File: doc23GpG6.info, Node: Usage, Next: Limitations, Prev: Overview, Up: Introduction 1.2 Usage ========= @@ -105,7 +105,7 @@ as a dependency in the header. The version of the Compat library mirrors the version of Emacs releases. The current version of Compat corresponds to the current Emacs release. - ;; Package-Requires: ((emacs "24.4") (compat "29.1.4.5")) + ;; Package-Requires: ((emacs "24.4") (compat "30.0.0.0")) There is no need to depend on ‘emacs 24.4’ specifically. One can choose any newer version, if features not provided by Compat necessitate @@ -184,7 +184,7 @@ provide a development mailing list <~pkal/compat-devel@lists.sr.ht>).  -File: docXccUUB.info, Node: Limitations, Prev: Usage, Up: Introduction +File: doc23GpG6.info, Node: Limitations, Prev: Usage, Up: Introduction 1.3 Limitations =============== @@ -276,7 +276,7 @@ belong here, a *note report: Development. would be much appreciated. on the level of Compat.  -File: docXccUUB.info, Node: Support, Next: Development, Prev: Introduction, Up: Top +File: doc23GpG6.info, Node: Support, Next: Development, Prev: Introduction, Up: Top 2 Support ********* @@ -293,7 +293,7 @@ manage to provide for each Emacs version. * Emacs 29.1:: Compatibility support for Emacs 29.1  -File: docXccUUB.info, Node: Emacs 25.1, Next: Emacs 26.1, Up: Support +File: doc23GpG6.info, Node: Emacs 25.1, Next: Emacs 26.1, Up: Support 2.1 Emacs 25.1 ============== @@ -475,28 +475,7 @@ functions are made available by Compat on Emacs versions older than *Note (elisp)Bool-Vectors::. -2.1.2 Extended Definitions --------------------------- - -These functions must be called explicitly via ‘compat-call’, since their -calling convention or behavior was extended in Emacs 25.1: - - -- Function: compat-call sort sequence predicate - This function sorts SEQUENCE stably. Note that this function - doesn’t work for all sequences; it may be used only for lists and - vectors. If SEQUENCE is a list, it is modified destructively. - This functions returns the sorted SEQUENCE and compares elements - using PREDICATE. A stable sort is one in which elements with equal - sort keys maintain their relative order before and after the sort. - Stability is important when successive sorts are used to order - elements according to different criteria. - - *Note (elisp)Sequence Functions::. - - The compatibility version adds support for vectors to be sorted, - not just lists. - -2.1.3 Missing Definitions +2.1.2 Missing Definitions ------------------------- Compat does not provide support for the following Lisp features @@ -524,7 +503,7 @@ implemented in 25.1: • The ‘thunk’ library.  -File: docXccUUB.info, Node: Emacs 26.1, Next: Emacs 27.1, Prev: Emacs 25.1, Up: Support +File: doc23GpG6.info, Node: Emacs 26.1, Next: Emacs 27.1, Prev: Emacs 25.1, Up: Support 2.2 Emacs 26.1 ============== @@ -935,7 +914,7 @@ implemented in 26.1: • The ‘svg’ library (published separately as a :core package).  -File: docXccUUB.info, Node: Emacs 27.1, Next: Emacs 28.1, Prev: Emacs 26.1, Up: Support +File: doc23GpG6.info, Node: Emacs 27.1, Next: Emacs 28.1, Prev: Emacs 26.1, Up: Support 2.3 Emacs 27.1 ============== @@ -1404,7 +1383,7 @@ implemented in 27.1: • The ‘image-converter’ library.  -File: docXccUUB.info, Node: Emacs 28.1, Next: Emacs 29.1, Prev: Emacs 27.1, Up: Support +File: doc23GpG6.info, Node: Emacs 28.1, Next: Emacs 29.1, Prev: Emacs 27.1, Up: Support 2.4 Emacs 28.1 ============== @@ -1774,11 +1753,6 @@ available by Compat. native compilation is not available, this function behaves identically to ‘subrp’. - -- Function: subr-native-elisp-p object - Return ‘t’ if OBJECT if the object is native compiled lisp. If - native compilation is not available, this function always returns - ‘nil’. - -- Function: native-comp-available-p This function returns non-‘nil’ if the running Emacs process has the native-compilation support compiled into it. On systems that @@ -1865,7 +1839,7 @@ implemented in 28.1: • The ‘multisession’ library.  -File: docXccUUB.info, Node: Emacs 29.1, Prev: Emacs 28.1, Up: Support +File: doc23GpG6.info, Node: Emacs 29.1, Next: Emacs 30.1, Prev: Emacs 28.1, Up: Support 2.5 Emacs 29.1 ============== @@ -2699,7 +2673,284 @@ implemented in 29.1: • Support for symbols with position information.  -File: docXccUUB.info, Node: Development, Next: Function Index, Prev: Support, Up: Top +File: doc23GpG6.info, Node: Emacs 30.1, Prev: Emacs 29.1, Up: Support + +2.6 Emacs 30.1 +============== + +2.6.1 Added Definitions +----------------------- + +The following functions and macros are implemented in Emacs 30.1. These +functions are made available by Compat on Emacs versions older than +30.1. Note that due to upstream changes, it might happen that there +will be the need for changes, so use these functions with care. + + -- Function: char-to-name char + This function returns the Unicode name of CHAR. It returns ‘nil’ + if CHAR is not a character or has no Unicode name. + + -- Function: obarray-clear obarray + This function removes all symbols from OBARRAY. + + -- Function: closurep object + This function returns ‘t’ if OBJECT is a closure, which is a + particular kind of function object. Currently closures are used + for all byte-code functions and all interpreted functions. + + -- Function: interpreted-function-p object + This function returns ‘t’ if OBJECT is an interpreted function. + + -- Function: primitive-function-p object + Return ‘t’ if OBJECT is a built-in primitive function. This + excludes special forms, since they are not functions. + + -- Function: value< a b + This function returns non-‘nil’ if A comes before B in the standard + sorting order; this means that it returns ‘nil’ when B comes before + A, or if they are equal or unordered. + + The arguments A and B must have the same type. Specifically: + + • Numbers are compared using ‘<’. + • Strings are compared using ‘string<’ and symbols are compared + by comparing their names as strings. + • Conses, lists, vectors and records are compared + lexicographically. This means that the two sequences are + compared element-wise from left to right until they differ, + and the result is then that of ‘value<’ on the first pair of + differing elements. If one sequence runs out of elements + before the other, the shorter sequence comes before the + longer. + • Markers are compared first by buffer, then by position. + • Buffers and processes are compared by comparing their names as + strings. Dead buffers (whose name is ‘nil’) will compare + before any live buffer. + • Other types are considered unordered and the return value will + be ‘nil’. + + Examples: + (value< -4 3.5) ⇒ t + (value< "dog" "cat") ⇒ nil + (value< 'yip 'yip) ⇒ nil + (value< '(3 2) '(3 2 0)) ⇒ t + (value< [3 2 "a"] [3 2 "b"]) ⇒ t + + Note that ‘nil’ is treated as either a symbol or an empty list, + depending on what it is compared against: + + (value< nil '(0)) ⇒ t + (value< 'nib nil) ⇒ t + + There is no limit to the length of sequences (lists, vectors and so + on) that can be compared, but ‘value<’ may fail with an error if + used to compare circular or deeply nested data structures. + + -- Function: drop n list + This function is an alias for ‘nthcdr’. It returns the Nth CDR of + LIST. In other words, it skips past the first N links of LIST and + returns what follows. + + -- Function: get-truename-buffer filename + Return the buffer with ‘file-truename’ equal to FILENAME (a + string). If there is no such live buffer, return nil. See also + ‘find-buffer-visiting’. + + -- Function: find-buffer variable value + Return the buffer with buffer-local VARIABLE equal to VALUE. If + there is no such live buffer, return nil. + + -- Function: require-with-check feature &optional filename noerror + This function works like ‘require’, except if FEATURE is already + loaded (i.e. is already a member of the list in ‘features’, see + below). If FEATURE is already loaded, this function checks if + FEATURE was provided by a file different from FILENAME, and if so, + it by default signals an error. If the value of the optional + argument NOERROR is ‘reload’, the function doesn’t signal an error, + but instead forcibly reloads FILENAME; if NOERROR is some other + non-‘nil’ value, the function emits a warning about FEATURE being + already provided by another file. + + -- Function: merge-ordered-lists lists &optional error-function + Merge LISTS in a consistent order. LISTS is a list of lists of + elements. Merge them into a single list containing the same + elements (removing duplicates), obeying their relative positions in + each list. The order of the (sub)lists determines the final order + in those cases where the order within the sublists does not impose + a unique choice. Equality of elements is tested with ‘eql’. + + If a consistent order does not exist, call ERROR-FUNCTION with a + remaining list of lists that we do not know how to merge. It + should return the candidate to use to continue the merge, which has + to be the head of one of the lists. By default we choose the head + of the first list. + + -- Variable: completion-lazy-hilit + If non-nil, request lazy highlighting of completion candidates. + + Lisp programs (a.k.a. "front ends") that present completion + candidates may opt to bind this variable to a non-nil value when + calling functions (such as ‘completion-all-completions’) which + produce completion candidates. This tells the underlying + completion styles that they do not need to fontify (i.e., + propertize with the ‘face’ property) completion candidates in a way + that highlights the matching parts. Then it is the front end which + presents the candidates that becomes responsible for this + fontification. The front end does that by calling the function + ‘completion-lazy-hilit’ on each completion candidate that is to be + displayed to the user. + + Note that only some completion styles take advantage of this + variable for optimization purposes. Other styles will ignore the + hint and fontify eagerly as usual. It is still safe for a front + end to call ‘completion-lazy-hilit’ in these situations. + + To author a completion style that takes advantage of this variable, + see ‘completion-lazy-hilit-fn’ and + ‘completion-pcm--hilit-commonality’. + + -- Variable: completion-lazy-hilit-fn + Fontification function set by lazy-highlighting completions styles. + When a given style wants to enable support for + ‘completion-lazy-hilit’ (which see), that style should set this + variable to a function of one argument. It will be called with + each completion candidate, a string, to be displayed to the user, + and should destructively propertize these strings with the ‘face’ + property. + + -- Function: completion-lazy-hilit str + Return a copy of completion candidate STR that is face-propertized. + See documentation of the variable ‘completion-lazy-hilit’ for more + details. + + -- Macro: static-if condition then-form else-forms... + Test CONDITION at macro-expansion time. If its value is non-‘nil’, + expand the macro to THEN-FORM, otherwise expand it to ELSE-FORMS + enclosed in a ‘progn’. ELSE-FORMS may be empty. + + Here is an example of its use from CC Mode, which prevents a + ‘defadvice’ form being compiled in newer versions of Emacs: + (static-if (boundp 'comment-line-break-function) + (progn) + (defvar c-inside-line-break-advice nil) + (defadvice indent-new-comment-line (around c-line-break-advice + activate preactivate) + "Call `c-indent-new-comment-line' if in CC Mode." + (if (or c-inside-line-break-advice + (not c-buffer-is-cc-mode)) + ad-do-it + (let ((c-inside-line-break-advice t)) + (c-indent-new-comment-line (ad-get-arg 0)))))) + +2.6.2 Extended Definitions +-------------------------- + +These functions must be called explicitly via ‘compat-call’, since their +calling convention or behavior was extended in Emacs 30.1: + + -- Function: compat-call sort sequence &rest keyword-args + This function sorts SEQUENCE, which must be a list or vector, and + returns a sorted sequence of the same type. The sort is stable, + which means that elements with equal sort keys maintain their + relative order. It takes the following optional keyword arguments: + + ‘:key KEYFUNC’ + Use KEYFUNC, a function that takes a single element from + SEQUENCE and returns its key value, to generate the keys used + in comparison. If this argument is absent or if KEYFUNC is + ‘nil’ then ‘identity’ is assumed; that is, the elements + themselves are used as sorting keys. + + ‘:lessp PREDICATE’ + Use PREDICATE to order the keys. PREDICATE is a function that + takes two sort keys as arguments and returns non-‘nil’ if the + first should come before the second. If this argument is + absent or PREDICATE is ‘nil’, then ‘value<’ is used, which is + applicable to many different Lisp types and generally sorts in + ascending order. + + For consistency, any predicate must obey the following rules: + • It must be “antisymmetric”: it cannot both order A before + B and B before A. + • It must be “transitive”: if it orders A before B and B + before C, then it must also order A before C. + + ‘:reverse FLAG’ + If FLAG is non-‘nil’, the sorting order is reversed. With the + default ‘:lessp’ predicate this means sorting in descending + order. + + ‘:in-place FLAG’ + If FLAG is non-‘nil’, then SEQUENCE is sorted in-place + (destructively) and returned. If ‘nil’, or if this argument + is not given, a sorted copy of the input is returned and + SEQUENCE itself remains unmodified. In-place sorting is + slightly faster, but the original sequence is lost. + + If the default behaviour is not suitable for your needs, it is + usually easier and faster to supply a new ‘:key’ function than a + different ‘:lessp’ predicate. For example, consider sorting these + strings: + + (setq numbers '("one" "two" "three" "four" "five" "six")) + (sort numbers) + ⇒ ("five" "four" "one" "six" "three" "two") + + You can sort the strings by length instead by supplying a different + key function: + + (sort numbers :key #'length) + ⇒ ("one" "two" "six" "four" "five" "three") + + Note how strings of the same length keep their original order, + thanks to the sorting stability. Now suppose you want to sort by + length, but use the string contents to break ties. The easiest way + is to specify a key function that transforms an element to a value + that is sorted this way. Since ‘value<’ orders compound objects + (conses, lists, vectors and records) lexicographically, you could + do: + + (sort numbers :key (lambda (x) (cons (length x) x))) + ⇒ ("one" "six" "two" "five" "four" "three") + + because ‘(3 . "six")’ is ordered before ‘(3 . "two")’ and so on. + + For compatibility with previous versions of Emacs, the ‘sort’ + function can also be called using the fixed two-argument form: + + (sort SEQUENCE PREDICATE) + + where PREDICATE is the ‘:lessp’ argument. When using this form, + sorting is always done in-place. + + -- Function: compat-call completion-metadata-get metadata prop + Get property PROP from completion METADATA. If the metadata + specifies a completion category, the variables + ‘completion-category-overrides’ and ‘completion-category-defaults’ + take precedence for category-specific overrides. If the completion + metadata does not specify the property, the + ‘completion-extra-properties’ plist is consulted. Note that the + keys of the ‘completion-extra-properties’ plist are keyword + symbols, not plain symbols. + + -- Function: compat-call copy-tree tree &optional vectors-and-records + This function returns a copy of the tree TREE. If TREE is a cons + cell, this makes a new cons cell with the same CAR and CDR, then + recursively copies the CAR and CDR in the same way. + + Normally, when TREE is anything other than a cons cell, ‘copy-tree’ + simply returns TREE. However, if VECTORS-AND-RECORDS is non-‘nil’, + it copies vectors and records too (and operates recursively on + their elements). The TREE argument must not contain cycles. + +2.6.3 Missing Definitions +------------------------- + +Compat does not provide support for the following Lisp features +implemented in 30.1: + + +File: doc23GpG6.info, Node: Development, Next: Function Index, Prev: Support, Up: Top 3 Development ************* @@ -2736,7 +2987,7 @@ version has been reasonably stabilized, e.g., around the time when the Emacs version branch is created in the Emacs repository on Savannah.  -File: docXccUUB.info, Node: Function Index, Next: Variable Index, Prev: Development, Up: Top +File: doc23GpG6.info, Node: Function Index, Next: Variable Index, Prev: Development, Up: Top Appendix A Function Index ************************* @@ -2759,17 +3010,21 @@ Appendix A Function Index * buffer-match-p: Emacs 29.1. (line 258) * buttonize: Emacs 29.1. (line 156) * buttonize-region: Emacs 29.1. (line 165) +* char-to-name: Emacs 30.1. (line 14) * char-uppercase-p: Emacs 29.1. (line 127) * cl-constantly: Emacs 29.1. (line 635) * cl-once-only: Emacs 29.1. (line 658) * cl-with-gensyms: Emacs 29.1. (line 639) +* closurep: Emacs 30.1. (line 21) * color-dark-p: Emacs 28.1. (line 322) * color-values-from-color-spec: Emacs 28.1. (line 328) * compat-call: Usage. (line 50) * compat-call alist-get: Emacs 26.1. (line 344) * compat-call assoc: Emacs 26.1. (line 316) * compat-call assoc-delete-all: Emacs 27.1. (line 417) -* compat-call count-windows: Emacs 28.1. (line 412) +* compat-call completion-metadata-get: Emacs 30.1. (line 251) +* compat-call copy-tree: Emacs 30.1. (line 261) +* compat-call count-windows: Emacs 28.1. (line 407) * compat-call define-key: Emacs 29.1. (line 755) * compat-call executable-find: Emacs 27.1. (line 429) * compat-call file-size-human-readable: Emacs 27.1. (line 397) @@ -2783,14 +3038,15 @@ Appendix A Function Index * compat-call regexp-opt: Emacs 27.1. (line 385) * compat-call set-transient-map: Emacs 29.1. (line 710) * compat-call setq-local: Emacs 27.1. (line 370) -* compat-call sort: Emacs 25.1. (line 189) +* compat-call sort: Emacs 30.1. (line 176) * compat-call string-lines: Emacs 29.1. (line 746) * compat-call string-trim: Emacs 26.1. (line 375) * compat-call string-trim-left: Emacs 26.1. (line 359) * compat-call string-trim-right: Emacs 26.1. (line 367) -* compat-call string-width: Emacs 28.1. (line 395) +* compat-call string-width: Emacs 28.1. (line 390) * compat-function: Usage. (line 58) * compiled-function-p: Emacs 29.1. (line 226) +* completion-lazy-hilit: Emacs 30.1. (line 146) * count-sentences: Emacs 29.1. (line 25) * cXXXr: Emacs 26.1. (line 66) * cXXXXr: Emacs 26.1. (line 67) @@ -2815,6 +3071,7 @@ Appendix A Function Index * directory-name-p: Emacs 25.1. (line 56) * dlet: Emacs 28.1. (line 143) * dolist-with-progress-reporter: Emacs 27.1. (line 119) +* drop: Emacs 30.1. (line 74) * ensure-list: Emacs 28.1. (line 158) * ert-with-temp-directory: Emacs 29.1. (line 623) * ert-with-temp-file: Emacs 29.1. (line 617) @@ -2843,6 +3100,7 @@ Appendix A Function Index * file-name-unquote: Emacs 26.1. (line 90) * file-name-with-extension: Emacs 28.1. (line 225) * file-size-human-readable-iec: Emacs 27.1. (line 251) +* find-buffer: Emacs 30.1. (line 84) * fixnump: Emacs 27.1. (line 60) * flatten-tree: Emacs 27.1. (line 132) * format-message: Emacs 25.1. (line 44) @@ -2853,12 +3111,14 @@ Appendix A Function Index * gensym: Emacs 26.1. (line 70) * get-display-property: Emacs 29.1. (line 173) * get-scratch-buffer-create: Emacs 29.1. (line 38) +* get-truename-buffer: Emacs 30.1. (line 79) * hash-table-empty: Emacs 25.1. (line 119) * if-let: Emacs 25.1. (line 96) * if-let*: Emacs 26.1. (line 149) * ignore-errors: Emacs 27.1. (line 106) * image-property: Emacs 26.1. (line 198) * insert-into-buffer: Emacs 28.1. (line 92) +* interpreted-function-p: Emacs 30.1. (line 26) * key-parse: Emacs 29.1. (line 419) * key-valid-p: Emacs 29.1. (line 387) * keymap-global-lookup: Emacs 29.1. (line 514) @@ -2888,14 +3148,17 @@ Appendix A Function Index * mapcan: Emacs 26.1. (line 53) * mark-thing-at-mouse: Emacs 28.1. (line 298) * match-buffers: Emacs 29.1. (line 292) +* merge-ordered-lists: Emacs 30.1. (line 99) * minibuffer-history-value: Emacs 27.1. (line 32) * named-let: Emacs 28.1. (line 207) -* native-comp-available-p: Emacs 28.1. (line 376) +* native-comp-available-p: Emacs 28.1. (line 371) * ntake: Emacs 29.1. (line 213) +* obarray-clear: Emacs 30.1. (line 18) * package-get-version: Emacs 27.1. (line 205) * plistp: Emacs 29.1. (line 65) * pos-bol: Emacs 29.1. (line 119) * pos-eol: Emacs 29.1. (line 123) +* primitive-function-p: Emacs 30.1. (line 29) * process-lines-handling-status: Emacs 28.1. (line 20) * process-lines-ignore-status: Emacs 28.1. (line 16) * proper-list-p: Emacs 27.1. (line 76) @@ -2908,8 +3171,10 @@ Appendix A Function Index * region-noncontiguous-p: Emacs 25.1. (line 34) * replace-regexp-in-string: Emacs 28.1. (line 117) * replace-string-in-region: Emacs 28.1. (line 102) +* require-with-check: Emacs 30.1. (line 88) * ring-resize: Emacs 27.1. (line 28) * save-mark-and-excursion: Emacs 25.1. (line 39) +* static-if: Emacs 30.1. (line 151) * string-chop-newline: Emacs 28.1. (line 202) * string-clean-whitespace: Emacs 28.1. (line 171) * string-distance: Emacs 27.1. (line 86) @@ -2922,7 +3187,6 @@ Appendix A Function Index * string-replace: Emacs 28.1. (line 77) * string-search: Emacs 28.1. (line 34) * string-split: Emacs 29.1. (line 252) -* subr-native-elisp-p: Emacs 28.1. (line 371) * subr-primitive-p: Emacs 28.1. (line 364) * substitute-quotes: Emacs 29.1. (line 34) * take: Emacs 29.1. (line 199) @@ -2937,6 +3201,7 @@ Appendix A Function Index * use-region-beginning: Emacs 29.1. (line 47) * use-region-end: Emacs 29.1. (line 44) * use-region-noncontiguous-p: Emacs 29.1. (line 41) +* value<: Emacs 30.1. (line 33) * when-let: Emacs 25.1. (line 114) * when-let*: Emacs 26.1. (line 153) * while-let: Emacs 29.1. (line 606) @@ -2950,12 +3215,12 @@ Appendix A Function Index * with-minibuffer-selected-window: Emacs 27.1. (line 38) * with-restriction: Emacs 29.1. (line 73) * with-suppressed-warnings: Emacs 27.1. (line 65) -* with-window-non-dedicated: Emacs 28.1. (line 384) +* with-window-non-dedicated: Emacs 28.1. (line 379) * without-restriction: Emacs 29.1. (line 107) * xor: Emacs 27.1. (line 142)  -File: docXccUUB.info, Node: Variable Index, Prev: Function Index, Up: Top +File: doc23GpG6.info, Node: Variable Index, Prev: Function Index, Up: Top Appendix B Variable Index ************************* @@ -2963,6 +3228,8 @@ Appendix B Variable Index [index] * Menu: +* completion-lazy-hilit: Emacs 30.1. (line 113) +* completion-lazy-hilit-fn: Emacs 30.1. (line 137) * exec-path: Emacs 27.1. (line 228) * gensym-counter: Emacs 26.1. (line 77) * lisp-directory: Emacs 29.1. (line 17) @@ -2981,13 +3248,14 @@ Node: Usage2947 Node: Limitations7326 Node: Support12192 Node: Emacs 25.112777 -Node: Emacs 26.122179 -Node: Emacs 27.139473 -Node: Emacs 28.159870 -Node: Emacs 29.179951 -Node: Development117330 -Node: Function Index119064 -Node: Variable Index134496 +Node: Emacs 26.121265 +Node: Emacs 27.138559 +Node: Emacs 28.158956 +Node: Emacs 29.178835 +Node: Emacs 30.1116233 +Node: Development129248 +Node: Function Index130982 +Node: Variable Index147436  End Tag Table diff --git a/elpa/compat-29.1.4.5/dir b/elpa/compat-30.0.0.0/dir similarity index 100% rename from elpa/compat-29.1.4.5/dir rename to elpa/compat-30.0.0.0/dir diff --git a/elpa/magit-20240522.204/AUTHORS.md b/elpa/magit-20240730.1741/AUTHORS.md similarity index 98% rename from elpa/magit-20240522.204/AUTHORS.md rename to elpa/magit-20240730.1741/AUTHORS.md index ed39a9c9..31c3b18b 100644 --- a/elpa/magit-20240522.204/AUTHORS.md +++ b/elpa/magit-20240730.1741/AUTHORS.md @@ -31,6 +31,7 @@ All Contributors - Aaron Madlon-Kay - Abdo Roig-Maranges - Adam Benanti +- Adam Jones - Adam Kruszewski - Adam Porter - Adam Spiers @@ -56,6 +57,7 @@ All Contributors - Andrew Kirkpatrick - Andrew Psaltis - Andrew Schwartzmeyer +- Andrew Zipperer - Andrey Smirnov - Andriy Kmit' - Andy Sawyer @@ -281,12 +283,13 @@ All Contributors - Nikolay Martynov - Noam Postavsky - N. Troy de Freitas -- Ola x Nilsson +- Ola Nilsson - Ole Arndt - Oleh Krehel - Orivej Desh - Óscar Fuentes - Pancho Horrillo +- Park Zhou - Paul Pogonyshev - Paul Stadig - Pavel Holejsovsky @@ -305,6 +308,7 @@ All Contributors - Phil Sainty - Pierre Neidhardt - Pieter Praet +- Pieter van Oostrum - Prathamesh Sonpatki - Pritam Baral - rabio @@ -322,6 +326,7 @@ All Contributors - Robin Green - Roey Darwish Dror - Roger Crew +- Roland Marchand - Romain Francoise - Ron Parker - Roy Crihfield @@ -354,6 +359,7 @@ All Contributors - Steven Thomas - Steven Vancoillie - Steve Purcell +- StrawberryTea - Suhail Shergill - Sylvain Rousseau - Syohei Yoshida diff --git a/elpa/magit-20240522.204/LICENSE b/elpa/magit-20240730.1741/LICENSE similarity index 100% rename from elpa/magit-20240522.204/LICENSE rename to elpa/magit-20240730.1741/LICENSE diff --git a/elpa/magit-20240522.204/dir b/elpa/magit-20240730.1741/dir similarity index 100% rename from elpa/magit-20240522.204/dir rename to elpa/magit-20240730.1741/dir diff --git a/elpa/magit-20240522.204/git-rebase.el b/elpa/magit-20240730.1741/git-rebase.el similarity index 99% rename from elpa/magit-20240522.204/git-rebase.el rename to elpa/magit-20240730.1741/git-rebase.el index 92a4b433..6f4af506 100644 --- a/elpa/magit-20240522.204/git-rebase.el +++ b/elpa/magit-20240730.1741/git-rebase.el @@ -705,6 +705,7 @@ Rebase files are generated when you run \"git rebase -i\" or run `magit-interactive-rebase'. They describe how Git should perform the rebase. See the documentation for git-rebase (e.g., by running \"man git-rebase\" at the command line) for details." + :interactive nil :group 'git-rebase (setq comment-start (or (magit-get "core.commentChar") "#")) (setq git-rebase-comment-re (concat "^" (regexp-quote comment-start))) diff --git a/elpa/magit-20240522.204/magit-apply.el b/elpa/magit-20240730.1741/magit-apply.el similarity index 98% rename from elpa/magit-20240522.204/magit-apply.el rename to elpa/magit-20240730.1741/magit-apply.el index bdac5e13..7ad55e14 100644 --- a/elpa/magit-20240522.204/magit-apply.el +++ b/elpa/magit-20240730.1741/magit-apply.el @@ -187,10 +187,8 @@ adjusted as \"@@ -10,6 +10,7 @@\" and \"@@ -18,6 +19,7 @@\"." (magit-apply-patch file args (concat (oref file header) - (mapconcat #'identity - (magit-apply--adjust-hunk-new-starts - (mapcar #'magit-apply--section-content hunks)) - ""))))) + (string-join (magit-apply--adjust-hunk-new-starts + (mapcar #'magit-apply--section-content hunks))))))) (defun magit-apply-hunk (hunk &rest args) (let ((file (oref hunk parent))) @@ -550,9 +548,10 @@ of a side, then keep that side without prompting." (funcall apply section "--reverse" "--index")))) (defun magit-discard-hunks (sections) - (magit-confirm 'discard (format "Discard %s hunks from %s" - (length sections) - (magit-section-parent-value (car sections)))) + (magit-confirm 'discard + (list "Discard %d hunks from %s" + (length sections) + (magit-section-parent-value (car sections)))) (magit-discard-apply-n sections #'magit-apply-hunks)) (defun magit-discard-apply-n (sections apply) @@ -740,9 +739,9 @@ so causes the change to be applied to the index as well." (defun magit-reverse-hunks (sections args) (magit-confirm 'reverse - (format "Reverse %s hunks from %s" - (length sections) - (magit-section-parent-value (car sections)))) + (list "Reverse %d hunks from %s" + (length sections) + (magit-section-parent-value (car sections)))) (magit-reverse-apply sections #'magit-apply-hunks args)) (defun magit-reverse-file (section args) diff --git a/elpa/magit-20240522.204/magit-autoloads.el b/elpa/magit-20240730.1741/magit-autoloads.el similarity index 98% rename from elpa/magit-20240522.204/magit-autoloads.el rename to elpa/magit-20240730.1741/magit-autoloads.el index 133be212..fa8c5fb1 100644 --- a/elpa/magit-20240522.204/magit-autoloads.el +++ b/elpa/magit-20240730.1741/magit-autoloads.el @@ -194,16 +194,23 @@ See `auto-revert-mode' for more information on Auto-Revert mode. (autoload 'magit-emacs-Q-command "magit-base" "\ Show a shell command that runs an uncustomized Emacs with only Magit loaded. See info node `(magit)Debugging Tools' for more information." t) -(autoload 'Info-follow-nearest-node--magit-gitman "magit-base" "\ - - -(fn FN &optional FORK)") -(advice-add 'Info-follow-nearest-node :around #'Info-follow-nearest-node--magit-gitman) -(advice-add 'org-man-export :around #'org-man-export--magit-gitman) -(autoload 'org-man-export--magit-gitman "magit-base" "\ - - -(fn FN LINK DESCRIPTION FORMAT)") +(define-advice Info-follow-nearest-node (:around (fn &optional fork) gitman) (let ((node (Info-get-token (point) "\\*note[ + ]+" "\\*note[ + ]+\\([^:]*\\):\\(:\\|[ + ]*(\\)?"))) (if (and node (string-match "^(gitman)\\(.+\\)" node)) (pcase magit-view-git-manual-method ('info (funcall fn fork)) ('man (require 'man) (man (match-string 1 node))) ('woman (require 'woman) (woman (match-string 1 node))) (_ (user-error "Invalid value for `magit-view-git-manual-method'"))) (funcall fn fork)))) +(define-advice org-man-export (:around (fn link description format) gitman) (if (and (eq format 'texinfo) (string-prefix-p "git" link)) (string-replace "%s" link " +@ifinfo +@ref{%s,,,gitman,}. +@end ifinfo +@ifhtml +@html +the %s(1) manpage. +@end html +@end ifhtml +@iftex +the %s(1) manpage. +@end iftex +") (funcall fn link description format))) (register-definition-prefixes "magit-base" '("magit-")) @@ -998,6 +1005,9 @@ Switch to a Magit buffer belonging to the current Git repository. Abort current operation. Depending on the context, this will abort a merge, a rebase, a patch application, a cherry-pick, a revert, or a bisect." t) +(autoload 'magit-back-to-indentation "magit-extras" "\ +Move point to the first non-whitespace character on this line. +In Magit diffs, also skip over - and + at the beginning of the line." t) (register-definition-prefixes "magit-extras" '("magit-")) @@ -1067,7 +1077,7 @@ the same location in the respective file in the working tree." t) Checkout FILE from REV. (fn REV FILE)" t) -(register-definition-prefixes "magit-files" '("magit-")) +(register-definition-prefixes "magit-files" '("lsp" "magit-")) ;;; Generated autoloads from magit-git.el @@ -2222,7 +2232,7 @@ Checkout BRANCH in a new worktree at PATH. (autoload 'magit-worktree-branch "magit-worktree" "\ Create a new BRANCH and check it out in a new worktree at PATH. -(fn PATH BRANCH START-POINT &optional FORCE)" t) +(fn PATH BRANCH START-POINT)" t) (autoload 'magit-worktree-move "magit-worktree" "\ Move WORKTREE to PATH. diff --git a/elpa/magit-20240522.204/magit-autorevert.el b/elpa/magit-20240730.1741/magit-autorevert.el similarity index 98% rename from elpa/magit-20240522.204/magit-autorevert.el rename to elpa/magit-20240730.1741/magit-autorevert.el index e6a98d45..ebac571e 100644 --- a/elpa/magit-20240522.204/magit-autorevert.el +++ b/elpa/magit-20240730.1741/magit-autorevert.el @@ -152,7 +152,7 @@ and code surrounding the definition of this function." (magit-auto-revert-mode 1) (magit-message "Turning on magit-auto-revert-mode...done%s" - (let ((elapsed (float-time (time-subtract nil start)))) + (let ((elapsed (float-time (time-since start)))) (if (> elapsed 0.2) (format " (%.3fs, %s buffers checked)" elapsed (length (buffer-list))) @@ -244,7 +244,7 @@ defaults to nil) for any BUFFER." ;; ^ `tramp-handle-file-in-directory-p' lacks this optimization. (file-in-directory-p dir top)))))) -(defun auto-revert-buffers--buffer-list-filter (fn) +(define-advice auto-revert-buffers (:around (fn) buffer-list-filter) (cl-incf magit-auto-revert-counter) (if (or global-auto-revert-mode (not auto-revert-buffer-list) @@ -257,9 +257,6 @@ defaults to nil) for any BUFFER." (unless auto-revert-timer (auto-revert-set-timer)))) -(advice-add 'auto-revert-buffers :around - #'auto-revert-buffers--buffer-list-filter) - ;;; _ (provide 'magit-autorevert) ;;; magit-autorevert.el ends here diff --git a/elpa/magit-20240522.204/magit-base.el b/elpa/magit-20240730.1741/magit-base.el similarity index 95% rename from elpa/magit-20240522.204/magit-base.el rename to elpa/magit-20240730.1741/magit-base.el index 2d6f7a01..af809b28 100644 --- a/elpa/magit-20240522.204/magit-base.el +++ b/elpa/magit-20240730.1741/magit-base.el @@ -772,7 +772,7 @@ This is similar to `read-string', but (let ((parts (nconc (list ,@(mapcar #'cadr clauses)) ,(and verbose '(list "[C-g] to abort"))))) (concat ,prompt - (mapconcat #'identity (butlast parts) ", ") + (string-join (butlast parts) ", ") ", or " (car (last parts)) " ")) ',(mapcar #'car clauses)) ,@(--map `(,(car it) ,@(cddr it)) clauses)) @@ -794,6 +794,16 @@ ACTION is a member of option `magit-slow-confirm'." (cl-defun magit-confirm ( action &optional prompt prompt-n noabort (items nil sitems) prompt-suffix) (declare (indent defun)) + (when (and prompt (listp prompt)) + (setq prompt + (apply #'format (car prompt) + (mapcar (lambda (a) (if (stringp a) (string-replace "%" "%%" a) a)) + (cdr prompt))))) + (when (and prompt-n (listp prompt-n)) + (setq prompt-n + (apply #'format (car prompt-n) + (mapcar (lambda (a) (if (stringp a) (string-replace "%" "%%" a) a)) + (cdr prompt-n))))) (setq prompt-n (format (concat (or prompt-n prompt) "? ") (length items))) (setq prompt (format (concat (or prompt (magit-confirm-make-prompt action)) "? ") @@ -816,7 +826,7 @@ ACTION is a member of option `magit-slow-confirm'." ((length= items 1) (and (magit-y-or-n-p prompt action) items)) ((length> items 1) - (and (magit-y-or-n-p (concat (mapconcat #'identity items "\n") + (and (magit-y-or-n-p (concat (string-join items "\n") "\n\n" prompt-n) action) items))) @@ -861,16 +871,12 @@ See info node `(magit)Debugging Tools' for more information." (delete-dups (cl-mapcan (lambda (lib) - (let ((path (locate-library lib))) - (cond - (path - (list (file-name-directory path))) - ((not (equal lib "libgit")) - (error "Cannot find mandatory dependency %s" lib))))) + (if-let ((path (locate-library lib))) + (list (file-name-directory path)) + (error "Cannot find mandatory dependency %s" lib))) '(;; Like `LOAD_PATH' in `default.mk'. "compat" "dash" - "libgit" "transient" "with-editor" ;; Obviously `magit' itself is needed too. @@ -1121,7 +1127,7 @@ the value in the symbol's `saved-value' property if any, or ;;; Kludges for Info Manuals ;;;###autoload -(defun Info-follow-nearest-node--magit-gitman (fn &optional fork) +(define-advice Info-follow-nearest-node (:around (fn &optional fork) gitman) (let ((node (Info-get-token (point) "\\*note[ \n\t]+" "\\*note[ \n\t]+\\([^:]*\\):\\(:\\|[ \n\t]*(\\)?"))) @@ -1132,19 +1138,12 @@ the value in the symbol's `saved-value' property if any, or (man (match-string 1 node))) ('woman (require 'woman) (woman (match-string 1 node))) - (_ - (user-error "Invalid value for `magit-view-git-manual-method'"))) + (_ (user-error "Invalid value for `magit-view-git-manual-method'"))) (funcall fn fork)))) -;;;###autoload -(advice-add 'Info-follow-nearest-node :around - #'Info-follow-nearest-node--magit-gitman) - ;; When making changes here, then also adjust the copy in docs/Makefile. ;;;###autoload -(advice-add 'org-man-export :around #'org-man-export--magit-gitman) -;;;###autoload -(defun org-man-export--magit-gitman (fn link description format) +(define-advice org-man-export (:around (fn link description format) gitman) (if (and (eq format 'texinfo) (string-prefix-p "git" link)) (string-replace "%s" link " @@ -1164,19 +1163,29 @@ the %s(1) manpage. ;;; Kludges for Package Managers -(defun magit--straight-chase-links (filename) +(defun magit--chase-links (filename) "Chase links in FILENAME until a name that is not a link. -This is the same as `file-chase-links', except that it also -handles fake symlinks that are created by the package manager -straight.el on Windows. +This is the same as `file-chase-links', except that it also handles +fake symlinks that are created by some source based package managers +\(Elpaca and Straight) on Windows. See ." - (when (and (bound-and-true-p straight-symlink-emulation-mode) - (fboundp 'straight-chase-emulated-symlink)) - (when-let ((target (straight-chase-emulated-symlink filename))) - (unless (eq target 'broken) - (setq filename target)))) + (when-let* + ((manager (cond ((bound-and-true-p straight-symlink-mode) 'straight) + ((bound-and-true-p elpaca-no-symlink-mode) 'elpaca))) + (build (pcase manager + ('straight (bound-and-true-p straight-build-dir)) + ('elpaca (bound-and-true-p elpaca-builds-directory)))) + ((string-prefix-p build filename)) + (repo (pcase manager + ('straight + (and (bound-and-true-p straight-base-dir) + (expand-file-name "repos/magit/lisp/" straight-base-dir))) + ('elpaca + (and (bound-and-true-p elpaca-repos-directory) + (expand-file-name "magit/lisp/" elpaca-repos-directory)))))) + (setq filename (expand-file-name (file-name-nondirectory filename) repo))) (file-chase-links filename)) ;;; Kludges for older Emacs versions @@ -1198,10 +1207,9 @@ Magit." default-directory))) (list (tramp-get-method-parameter vec 'tramp-remote-shell) - (mapconcat #'identity - (tramp-get-method-parameter - vec 'tramp-remote-shell-args) - " ")))))) + (string-join (tramp-get-method-parameter + vec 'tramp-remote-shell-args) + " ")))))) ,@body) ,@body))) diff --git a/elpa/magit-20240522.204/magit-bisect.el b/elpa/magit-20240730.1741/magit-bisect.el similarity index 99% rename from elpa/magit-20240522.204/magit-bisect.el rename to elpa/magit-20240730.1741/magit-bisect.el index 805b68b3..47095de0 100644 --- a/elpa/magit-20240522.204/magit-bisect.el +++ b/elpa/magit-20240730.1741/magit-bisect.el @@ -274,7 +274,7 @@ bisect run'." "While bisecting, insert section visualizing the bisect state." (when (magit-bisect-in-progress-p) (magit-insert-section (bisect-view) - (magit-insert-heading "Bisect Rest:") + (magit-insert-heading t "Bisect Rest") (magit-git-wash (apply-partially #'magit-log-wash-log 'bisect-vis) "bisect" "visualize" "git" "log" "--format=%h%x00%D%x00%s" "--decorate=full" @@ -286,7 +286,7 @@ bisect run'." "While bisecting, insert section logging bisect progress." (when (magit-bisect-in-progress-p) (magit-insert-section (bisect-log) - (magit-insert-heading "Bisect Log:") + (magit-insert-heading t "Bisect Log") (magit-git-wash #'magit-wash-bisect-log "bisect" "log") (insert ?\n)))) diff --git a/elpa/magit-20240522.204/magit-blame.el b/elpa/magit-20240730.1741/magit-blame.el similarity index 99% rename from elpa/magit-20240522.204/magit-blame.el rename to elpa/magit-20240730.1741/magit-blame.el index 084e1e19..bdcccb5d 100644 --- a/elpa/magit-20240522.204/magit-blame.el +++ b/elpa/magit-20240730.1741/magit-blame.el @@ -453,6 +453,7 @@ modes is toggled, then this mode also gets toggled automatically. (let ((status (process-status process))) (when (memq status '(exit signal)) (kill-buffer (process-buffer process)) + (kill-buffer (process-get process 'stderr-buf)) (if (and (eq status 'exit) (zerop (process-exit-status process))) (unless quiet diff --git a/elpa/magit-20240522.204/magit-bookmark.el b/elpa/magit-20240730.1741/magit-bookmark.el similarity index 92% rename from elpa/magit-20240522.204/magit-bookmark.el rename to elpa/magit-20240730.1741/magit-bookmark.el index 19819122..666acf1e 100644 --- a/elpa/magit-20240522.204/magit-bookmark.el +++ b/elpa/magit-20240730.1741/magit-bookmark.el @@ -65,7 +65,7 @@ ('undefined (delq nil (list magit-buffer-typearg magit-buffer-range-hashed)))) (if magit-buffer-diff-files - (concat " -- " (mapconcat #'identity magit-buffer-diff-files " ")) + (concat " -- " (string-join magit-buffer-diff-files " ")) ""))) ;;;; Revision @@ -79,7 +79,7 @@ (format "magit-revision(%s %s)" (magit-rev-abbrev magit-buffer-revision) (if magit-buffer-diff-files - (mapconcat #'identity magit-buffer-diff-files " ") + (string-join magit-buffer-diff-files " ") (magit-rev-format "%s" magit-buffer-revision)))) ;;;; Stash @@ -93,7 +93,7 @@ (format "magit-stash(%s %s)" (magit-rev-abbrev magit-buffer-revision) (if magit-buffer-diff-files - (mapconcat #'identity magit-buffer-diff-files " ") + (string-join magit-buffer-diff-files " ") (magit-rev-format "%s" magit-buffer-revision)))) (cl-defmethod magit-bookmark--get-child-value @@ -112,9 +112,9 @@ (cl-defmethod magit-bookmark-name (&context (major-mode magit-log-mode)) (format "magit-log(%s%s)" - (mapconcat #'identity magit-buffer-revisions " ") + (string-join magit-buffer-revisions " ") (if magit-buffer-log-files - (concat " -- " (mapconcat #'identity magit-buffer-log-files " ")) + (concat " -- " (string-join magit-buffer-log-files " ")) ""))) ;;;; Cherry diff --git a/elpa/magit-20240522.204/magit-branch.el b/elpa/magit-20240730.1741/magit-branch.el similarity index 98% rename from elpa/magit-20240522.204/magit-branch.el rename to elpa/magit-20240730.1741/magit-branch.el index 2ffb80e0..d6962659 100644 --- a/elpa/magit-20240522.204/magit-branch.el +++ b/elpa/magit-20240730.1741/magit-branch.el @@ -434,9 +434,7 @@ when using `magit-branch-and-checkout'." (if magit-completing-read--silent-default (format "%s (starting at `%s')" prompt choice) "Name for new branch") - (let ((def (mapconcat #'identity - (cdr (split-string choice "/")) - "/"))) + (let ((def (string-join (cdr (split-string choice "/")) "/"))) (and (member choice (magit-list-remote-branch-names)) (not (member def (magit-list-local-branch-names))) def))) @@ -635,12 +633,12 @@ prompt is confusing." (offset (1+ (length remote)))) (cond ((magit-confirm 'delete-branch-on-remote - (format "Deleting local %s. Also delete on %s" - (magit-ref-fullname (car branches)) - remote) - (format "Deleting %d local refs. Also delete on %s" - (length refs) - remote) + (list "Deleting local %s. Also delete on %s" + (magit-ref-fullname (car branches)) + remote) + (list "Deleting %d local refs. Also delete on %s" + (length refs) + remote) 'noabort refs) ;; The ref may actually point at another rev on the remote, ;; but this is better than nothing. @@ -726,8 +724,8 @@ prompt is confusing." (when (member refspec refspecs) (if (and (length= refspecs 1) (magit-confirm 'delete-pr-remote - (format "Also delete remote %s (%s)" remote - "no pull-request branch remains") + (list "Also delete remote %s (%s)" remote + "no pull-request branch remains") nil t)) (magit-call-git "remote" "rm" remote) (magit-call-git "config" "--unset-all" variable diff --git a/elpa/magit-20240522.204/magit-bundle.el b/elpa/magit-20240730.1741/magit-bundle.el similarity index 100% rename from elpa/magit-20240522.204/magit-bundle.el rename to elpa/magit-20240730.1741/magit-bundle.el diff --git a/elpa/magit-20240522.204/magit-clone.el b/elpa/magit-20240730.1741/magit-clone.el similarity index 100% rename from elpa/magit-20240522.204/magit-clone.el rename to elpa/magit-20240730.1741/magit-clone.el diff --git a/elpa/magit-20240522.204/magit-commit.el b/elpa/magit-20240730.1741/magit-commit.el similarity index 100% rename from elpa/magit-20240522.204/magit-commit.el rename to elpa/magit-20240730.1741/magit-commit.el diff --git a/elpa/magit-20240522.204/magit-core.el b/elpa/magit-20240730.1741/magit-core.el similarity index 92% rename from elpa/magit-20240522.204/magit-core.el rename to elpa/magit-20240730.1741/magit-core.el index ff154866..57b08f48 100644 --- a/elpa/magit-20240522.204/magit-core.el +++ b/elpa/magit-20240730.1741/magit-core.el @@ -37,15 +37,6 @@ (require 'magit-transient) (require 'magit-autorevert) -(when (and (not magit-inhibit-libgit) - (magit--libgit-available-p)) - (condition-case err - (require 'magit-libgit) - (error - (setq magit-inhibit-libgit 'error) - (message "Error while loading `magit-libgit': %S" err) - (message "That is not fatal. The `libegit2' module just won't be used.")))) - ;;; Options (defgroup magit nil diff --git a/elpa/magit-20240522.204/magit-diff.el b/elpa/magit-20240730.1741/magit-diff.el similarity index 96% rename from elpa/magit-20240522.204/magit-diff.el rename to elpa/magit-20240730.1741/magit-diff.el index e36a38b2..5ad87868 100644 --- a/elpa/magit-20240522.204/magit-diff.el +++ b/elpa/magit-20240730.1741/magit-diff.el @@ -80,6 +80,7 @@ (&optional whoami file-name)) (declare-function magit-diff-edit-hunk-commit "magit-extras" (file)) (declare-function magit-smerge-keep-current "magit-apply" ()) +(declare-function magit-smerge-keep-all "magit-apply" ()) (declare-function magit-smerge-keep-upper "magit-apply" ()) (declare-function magit-smerge-keep-base "magit-apply" ()) (declare-function magit-smerge-keep-lower "magit-apply" ()) @@ -1539,9 +1540,9 @@ The visited version depends on what changes the diff is about. 1. If the diff shows uncommitted changes (i.e., stage or unstaged changes), then visit the file in the working tree (i.e., the - same \"real\" file that `find-file' would visit. In all other - cases visit a \"blob\" (i.e., the version of a file as stored - in some commit). + same \"real\" file that `find-file' would visit). In all + other cases visit a \"blob\" (i.e., the version of a file as + stored in some commit). 2. If point is on a removed line, then visit the blob for the first parent of the commit that removed that line, i.e., the @@ -1673,6 +1674,7 @@ the Magit-Status buffer for DIRECTORY." (magit-diff-visit--range-from spec) (magit-diff-visit--range-to spec))) (buf (if (or goto-worktree + (equal magit-buffer-typearg "--no-index") (and (not (stringp rev)) (or magit-diff-visit-avoid-head-blob (not goto-from)))) @@ -1705,9 +1707,10 @@ the Magit-Status buffer for DIRECTORY." (magit-current-section) nil) (oref file-section source)) (oref file-section value)))) - (if expand - (expand-file-name file (magit-toplevel)) - file) + (cond ((equal magit-buffer-typearg "--no-index") + (concat "/" file)) + (expand (expand-file-name file (magit-toplevel))) + (file)) (when assert (user-error "No file at point")))) @@ -1958,8 +1961,9 @@ Staging and applying changes is documented in info node \\[magit-reverse] to reverse it. \\{magit-diff-mode-map}" + :interactive nil :group 'magit-diff - (hack-dir-local-variables-non-file-buffer) + (magit-hack-dir-local-variables) (setq magit--imenu-item-types 'file)) (put 'magit-diff-mode 'magit-diff-default-arguments @@ -2002,8 +2006,7 @@ Staging and applying changes is documented in info node (0) (1 (concat " in file " (car magit-buffer-diff-files))) (_ (concat " in files " - (mapconcat #'identity magit-buffer-diff-files - ", "))))))) + (string-join magit-buffer-diff-files ", "))))))) (setq magit-buffer-range-hashed (and magit-buffer-range (magit-hash-range magit-buffer-range))) (magit-insert-section (diffbuf) @@ -2075,6 +2078,7 @@ keymap is the parent of their keymaps." (defvar-keymap magit-hunk-section-smerge-map :doc "Keymap bound to `smerge-command-prefix' in `magit-hunk-section-map'." "RET" #'magit-smerge-keep-current + "a" #'magit-smerge-keep-all "u" #'magit-smerge-keep-upper "b" #'magit-smerge-keep-base "l" #'magit-smerge-keep-lower) @@ -2396,7 +2400,7 @@ section or a child thereof." (or file orig))) (format "--- %s\n" (or orig "/dev/null")) (format "+++ %s\n" (or file "/dev/null"))))) - (setq header (mapconcat #'identity header "")) + (setq header (string-join header)) (magit-diff-insert-file-section file orig status modes rename header binary nil))))) @@ -2525,7 +2529,7 @@ section or a child thereof." (defun magit-diff-expansion-threshold (section) "Keep new diff sections collapsed if washing takes too long." (and (magit-file-section-p section) - (> (float-time (time-subtract (current-time) magit-refresh-start-time)) + (> (float-time (time-since magit-refresh-start-time)) magit-diff-expansion-threshold) 'hide)) @@ -2554,8 +2558,9 @@ Staging and applying changes is documented in info node \\[magit-reverse] to reverse it. \\{magit-revision-mode-map}" + :interactive nil :group 'magit-revision - (hack-dir-local-variables-non-file-buffer)) + (magit-hack-dir-local-variables)) (put 'magit-revision-mode 'magit-diff-default-arguments '("--stat" "--no-ext-diff")) @@ -2578,7 +2583,7 @@ Staging and applying changes is documented in info node (0) (1 (concat " limited to file " (car magit-buffer-diff-files))) (_ (concat " limited to files " - (mapconcat #'identity magit-buffer-diff-files ", ")))))) + (string-join magit-buffer-diff-files ", ")))))) (magit-insert-section (commitbuf) (magit-run-section-hook 'magit-revision-sections-hook))) @@ -2656,99 +2661,49 @@ or a ref which is not a branch, then it inserts nothing." (magit-insert-section ( commit-message nil nil :heading-highlight-face 'magit-diff-revision-summary-highlight) - (let ((beg (point)) - (rev magit-buffer-revision)) - (insert (with-temp-buffer - (magit-rev-insert-format "%B" rev) - (magit-revision--wash-message))) - (if (= (point) (+ beg 2)) - (progn (delete-char -2) - (insert "(no message)\n")) - (goto-char beg) - (save-excursion - (while (search-forward "\r\n" nil t) ; Remove trailing CRs. - (delete-region (match-beginning 0) (1+ (match-beginning 0))))) - (when magit-revision-fill-summary-line - (let ((fill-column (min magit-revision-fill-summary-line - (window-width (get-buffer-window nil t))))) - (fill-region (point) (line-end-position)))) - (when magit-revision-use-hash-sections + (if-let* ((rev magit-buffer-revision) + (msg (with-temp-buffer + (save-excursion (magit-rev-insert-format "%B" rev)) + (magit-revision--wash-message)))) + (progn + (save-excursion (insert msg)) + (magit-revision--wash-message-hashes) (save-excursion - ;; Start after beg to prevent a (commit text) section from - ;; starting at the same point as the (commit-message) - ;; section. - (goto-char (1+ beg)) - (while (not (eobp)) - (re-search-forward "\\_<" nil 'move) - (let ((beg (point))) - (re-search-forward "\\_>" nil t) - (when (> (point) beg) - (let ((text (buffer-substring-no-properties beg (point)))) - (when (pcase magit-revision-use-hash-sections - ('quickest ; false negatives and positives - (and (>= (length text) 7) - (string-match-p "[0-9]" text) - (string-match-p "[a-z]" text))) - ('quicker ; false negatives (number-less hashes) - (and (>= (length text) 7) - (string-match-p "[0-9]" text) - (magit-commit-p text))) - ('quick ; false negatives (short hashes) - (and (>= (length text) 7) - (magit-commit-p text))) - ('slow - (magit-commit-p text))) - (put-text-property beg (point) - 'font-lock-face 'magit-hash) - (let ((end (point))) - (goto-char beg) - (magit-insert-section (commit text) - (goto-char end)))))))))) - (save-excursion - (forward-line) - (magit--add-face-text-property - beg (point) 'magit-diff-revision-summary) - (magit-insert-heading)) - (when magit-diff-highlight-keywords - (save-excursion - (while (re-search-forward "\\[[^[]*\\]" nil t) - (let ((beg (match-beginning 0)) - (end (match-end 0))) - (put-text-property - beg end 'font-lock-face - (if-let ((face (get-text-property beg 'font-lock-face))) - (list face 'magit-keyword) - 'magit-keyword)))))) - (goto-char (point-max)))))) + (magit--add-face-text-property (point) + (progn (forward-line) (point)) + 'magit-diff-revision-summary) + (magit-insert-heading)) + (goto-char (point-max))) + (insert "(no message)\n")))) (defun magit-insert-revision-notes () "Insert commit notes into a revision buffer." - (let* ((var "core.notesRef") - (def (or (magit-get var) "refs/notes/commits"))) + (let ((default (or (magit-get "core.notesRef") "refs/notes/commits"))) (dolist (ref (magit-list-active-notes-refs)) - (magit-insert-section - ( notes ref (not (equal ref def)) - :heading-highlight-face 'magit-diff-hunk-heading-highlight) - (let ((beg (point)) - (rev magit-buffer-revision)) - (insert (with-temp-buffer - (magit-git-insert "-c" (concat "core.notesRef=" ref) - "notes" "show" rev) - (magit-revision--wash-message))) - (if (= (point) beg) - (magit-cancel-section) - (goto-char beg) + (when-let* ((rev magit-buffer-revision) + (msg (with-temp-buffer + (save-excursion + (magit-git-insert "-c" (concat "core.notesRef=" ref) + "notes" "show" rev)) + (magit-revision--wash-message)))) + (magit-insert-section + ( notes ref (not (equal ref default)) + :heading-highlight-face 'magit-diff-hunk-heading-highlight) + (save-excursion (insert msg)) + (magit-revision--wash-message-hashes) + (save-excursion (end-of-line) (insert (format " (%s)" (propertize (if (string-prefix-p "refs/notes/" ref) (substring ref 11) ref) - 'font-lock-face 'magit-refname))) - (forward-char) - (magit--add-face-text-property beg (point) 'magit-diff-hunk-heading) - (magit-insert-heading) - (goto-char (point-max)) - (insert ?\n))))))) + 'font-lock-face 'magit-refname)))) + (magit--add-face-text-property (point) + (progn (forward-line) (point)) + 'magit-diff-revision-summary) + (magit-insert-heading) + (goto-char (point-max)) + (insert ?\n)))))) (defun magit-revision--wash-message () (let ((major-mode 'git-commit-mode)) @@ -2757,7 +2712,56 @@ or a ref which is not a branch, then it inserts nothing." (unless (memq git-commit-major-mode '(nil text-mode)) (funcall git-commit-major-mode) (font-lock-ensure)) - (buffer-string)) + (when (> (point-max) (point-min)) + (save-excursion + (while (search-forward "\r\n" nil t) ; Remove trailing CRs. + (delete-region (match-beginning 0) (1+ (match-beginning 0))))) + (when magit-revision-fill-summary-line + (let ((fill-column (min magit-revision-fill-summary-line + (window-width (get-buffer-window nil t))))) + (fill-region (point) (line-end-position)))) + (when magit-diff-highlight-keywords + (save-excursion + (while (re-search-forward "\\[[^[]*\\]" nil t) + (put-text-property (match-beginning 0) + (match-end 0) + 'font-lock-face 'magit-keyword)))) + (run-hook-wrapped 'magit-wash-message-hook + (lambda (fn) (save-excursion (funcall fn)))) + (buffer-string))) + +(defun magit-revision--wash-message-hashes () + (when magit-revision-use-hash-sections + (save-excursion + ;; Start after beg to prevent a (commit text) section from + ;; starting at the same point as the (commit-message) + ;; section. + (while (not (eobp)) + (re-search-forward "\\_<" nil 'move) + (let ((beg (point))) + (re-search-forward "\\_>" nil t) + (when (> (point) beg) + (let ((text (buffer-substring-no-properties beg (point)))) + (when (pcase magit-revision-use-hash-sections + ('quickest ; false negatives and positives + (and (>= (length text) 7) + (string-match-p "[0-9]" text) + (string-match-p "[a-z]" text))) + ('quicker ; false negatives (number-less hashes) + (and (>= (length text) 7) + (string-match-p "[0-9]" text) + (magit-commit-p text))) + ('quick ; false negatives (short hashes) + (and (>= (length text) 7) + (magit-commit-p text))) + ('slow + (magit-commit-p text))) + (put-text-property beg (point) + 'font-lock-face 'magit-hash) + (let ((end (point))) + (goto-char beg) + (magit-insert-section (commit text) + (goto-char end))))))))))) (defun magit-insert-revision-headers () "Insert headers about the commit into a revision buffer." @@ -2901,8 +2905,9 @@ Refer to user option `magit-revision-insert-related-refs-display-alist'." (define-derived-mode magit-merge-preview-mode magit-diff-mode "Magit Merge" "Mode for previewing a merge." + :interactive nil :group 'magit-diff - (hack-dir-local-variables-non-file-buffer)) + (magit-hack-dir-local-variables)) (put 'magit-merge-preview-mode 'magit-diff-default-arguments '("--no-ext-diff")) @@ -2990,12 +2995,13 @@ It the SECTION has a different type, then do nothing." "<2>" (magit-menu-item "Stage all" #'magit-stage) "<1>" (magit-menu-item "Visit diff" #'magit-diff-unstaged)) -(magit-define-section-jumper magit-jump-to-unstaged "Unstaged changes" unstaged) +(magit-define-section-jumper magit-jump-to-unstaged + "Unstaged changes" unstaged nil magit-insert-unstaged-changes) (defun magit-insert-unstaged-changes () "Insert section showing unstaged changes." (magit-insert-section (unstaged) - (magit-insert-heading "Unstaged changes:") + (magit-insert-heading t "Unstaged changes") (magit--insert-diff nil "diff" magit-buffer-diff-args "--no-prefix" "--" magit-buffer-diff-files))) @@ -3011,14 +3017,15 @@ It the SECTION has a different type, then do nothing." "<2>" (magit-menu-item "Unstage all" #'magit-unstage) "<1>" (magit-menu-item "Visit diff" #'magit-diff-staged)) -(magit-define-section-jumper magit-jump-to-staged "Staged changes" staged) +(magit-define-section-jumper magit-jump-to-staged + "Staged changes" staged nil magit-insert-staged-changes) (defun magit-insert-staged-changes () "Insert section showing staged changes." ;; Avoid listing all files as deleted when visiting a bare repo. (unless (magit-bare-repo-p) (magit-insert-section (staged) - (magit-insert-heading "Staged changes:") + (magit-insert-heading t "Staged changes") (magit--insert-diff nil "diff" "--cached" magit-buffer-diff-args "--no-prefix" "--" magit-buffer-diff-files)))) @@ -3557,7 +3564,7 @@ last (visual) lines of the region." (forward-line))) (let ((buffer-list-update-hook nil)) ; #3759 (with-temp-buffer - (insert (mapconcat #'identity (reverse patch) "")) + (insert (string-join (reverse patch))) (diff-fixup-modifs (point-min) (point-max)) (setq patch (buffer-string)))) patch)) diff --git a/elpa/magit-20240522.204/magit-ediff.el b/elpa/magit-20240730.1741/magit-ediff.el similarity index 100% rename from elpa/magit-20240522.204/magit-ediff.el rename to elpa/magit-20240730.1741/magit-ediff.el diff --git a/elpa/magit-20240522.204/magit-extras.el b/elpa/magit-20240730.1741/magit-extras.el similarity index 98% rename from elpa/magit-20240522.204/magit-extras.el rename to elpa/magit-20240730.1741/magit-extras.el index e208f4a2..77350b99 100644 --- a/elpa/magit-20240522.204/magit-extras.el +++ b/elpa/magit-20240730.1741/magit-extras.el @@ -905,6 +905,20 @@ patch application, a cherry-pick, a revert, or a bisect." ((magit-sequencer-in-progress-p) (magit-sequencer-abort)) ((magit-bisect-in-progress-p) (magit-bisect-reset)))) +;;;###autoload +(defun magit-back-to-indentation () + "Move point to the first non-whitespace character on this line. +In Magit diffs, also skip over - and + at the beginning of the line." + (interactive "^") + (beginning-of-line 1) + (when (and (magit-section-match 'hunk) + (looking-at (if (oref (magit-current-section) combined) + "^ ?[-+]+" + "^[-+]"))) + (goto-char (match-end 0))) + (skip-syntax-forward " " (line-end-position)) + (backward-prefix-chars)) + ;;; _ (provide 'magit-extras) ;;; magit-extras.el ends here diff --git a/elpa/magit-20240522.204/magit-fetch.el b/elpa/magit-20240730.1741/magit-fetch.el similarity index 98% rename from elpa/magit-20240522.204/magit-fetch.el rename to elpa/magit-20240730.1741/magit-fetch.el index d19910f5..003d1e8a 100644 --- a/elpa/magit-20240522.204/magit-fetch.el +++ b/elpa/magit-20240730.1741/magit-fetch.el @@ -37,7 +37,8 @@ ["Arguments" ("-p" "Prune deleted branches" ("-p" "--prune")) ("-t" "Fetch all tags" ("-t" "--tags")) - (7 "-u" "Fetch full history" "--unshallow")] + ("-u" "Fetch full history" "--unshallow" :level 7) + ("-F" "Force" ("-f" "--force"))] ["Fetch from" ("p" magit-fetch-from-pushremote) ("u" magit-fetch-from-upstream) diff --git a/elpa/magit-20240522.204/magit-files.el b/elpa/magit-20240730.1741/magit-files.el similarity index 98% rename from elpa/magit-20240522.204/magit-files.el rename to elpa/magit-20240730.1741/magit-files.el index e13491a2..09947a01 100644 --- a/elpa/magit-20240522.204/magit-files.el +++ b/elpa/magit-20240730.1741/magit-files.el @@ -184,14 +184,12 @@ then only after asking. A non-nil value for REVERT is ignored if REV is (set-buffer-modified-p nil) (goto-char (point-min)))) -(defun magit--lsp--disable-when-visiting-blob (fn &rest args) +(define-advice lsp (:around (fn &rest args) magit-find-file) "Do nothing when visiting blob using `magit-find-file' and similar. See also https://github.com/doomemacs/doomemacs/pull/6309." (unless magit-buffer-revision (apply fn args))) -(advice-add 'lsp :around #'magit--lsp--disable-when-visiting-blob) - ;;; Find Index (defvar magit-find-index-hook nil) @@ -491,7 +489,7 @@ Git, then fallback to using `delete-file'." (interactive (let ((rev (magit-read-branch-or-commit "Checkout from revision" magit-buffer-revision))) - (list rev (magit-read-file-from-rev rev "Checkout file")))) + (list rev (magit-read-file-from-rev rev "Checkout file" nil t)))) (magit-with-toplevel (magit-run-git "checkout" rev "--" file))) @@ -499,8 +497,11 @@ Git, then fallback to using `delete-file'." (defvar magit-read-file-hist nil) -(defun magit-read-file-from-rev (rev prompt &optional default) +(defun magit-read-file-from-rev (rev prompt &optional default include-dirs) (let ((files (magit-revision-files rev))) + (when include-dirs + (setq files (sort (nconc files (magit-revision-directories rev)) + #'string<))) (magit-completing-read prompt files nil t nil 'magit-read-file-hist (car (member (or default (magit-current-file)) files))))) diff --git a/elpa/magit-20240522.204/magit-git.el b/elpa/magit-20240730.1741/magit-git.el similarity index 98% rename from elpa/magit-20240522.204/magit-git.el rename to elpa/magit-20240730.1741/magit-git.el index a4163135..58004304 100644 --- a/elpa/magit-20240522.204/magit-git.el +++ b/elpa/magit-20240730.1741/magit-git.el @@ -65,41 +65,6 @@ (cl-pushnew 'orig-rev eieio--known-slot-names) (cl-pushnew 'number eieio--known-slot-names)) -;;; Git implementations - -(defvar magit-inhibit-libgit t - "Whether to inhibit the use of libgit. -Use of libgit is inhibited by default because support for libgit -in magit is only a stub for now. There is no benefit in using -it.") - -(defvar magit--libgit-available-p 'unknown - "Whether libgit is available. -Use the function by the same name instead of this variable.") - -(defun magit--libgit-available-p () - (if (eq magit--libgit-available-p 'unknown) - (setq magit--libgit-available-p - (and module-file-suffix - (let ((libgit (locate-library "libgit"))) - (and libgit - (or (locate-library "libegit2") - (let ((load-path - (cons (expand-file-name - (convert-standard-filename "build") - (file-name-directory libgit)) - load-path))) - (locate-library "libegit2"))))))) - magit--libgit-available-p)) - -(defun magit-gitimpl () - "Return the Git implementation used in this repository." - (if (and (not magit-inhibit-libgit) - (not (file-remote-p default-directory)) - (magit--libgit-available-p)) - 'libgit - 'git)) - ;;; Options ;; For now this is shared between `magit-process' and `magit-git'. @@ -772,7 +737,7 @@ See info node `(magit)Debugging Tools' for more information." (arg (and (or (null (car keys)) (string-prefix-p "--" (car keys))) (pop keys))) - (key (mapconcat #'identity keys "."))) + (key (string-join keys "."))) (if (and magit--refresh-cache (not arg)) (magit-config-get-from-cached-list key) (magit-git-items "config" arg "-z" "--get-all" key)))) @@ -783,7 +748,7 @@ Also see `magit-git-config-p'." (let ((arg (and (or (null (car keys)) (string-prefix-p "--" (car keys))) (pop keys))) - (key (mapconcat #'identity keys "."))) + (key (string-join keys "."))) (equal (if magit--refresh-cache (car (last (magit-config-get-from-cached-list key))) (magit-git-str "config" arg "--bool" key)) @@ -794,7 +759,7 @@ Also see `magit-git-config-p'." (let ((arg (and (or (null (car keys)) (string-prefix-p "--" (car keys))) (pop keys))) - (key (mapconcat #'identity keys "."))) + (key (string-join keys "."))) (if value (magit-git-success "config" arg key value) (magit-git-success "config" arg "--unset" key)) @@ -808,7 +773,7 @@ Also see `magit-git-config-p'." (let ((arg (and (or (null (car keys)) (string-prefix-p "--" (car keys))) (pop keys))) - (var (mapconcat #'identity keys "."))) + (var (string-join keys "."))) (when (magit-get var) (magit-call-git "config" arg "--unset-all" var)) (dolist (v values) @@ -972,7 +937,8 @@ returning the truename." (define-error 'magit-outside-git-repo "Not inside Git repository") (define-error 'magit-corrupt-git-config "Corrupt Git configuration") (define-error 'magit-git-executable-not-found - "Git executable cannot be found (see https://magit.vc/goto/e6a78ed2)") + (concat "Git executable cannot be found " + "(see https://magit.vc/goto/e6a78ed2)")) (defun magit--assert-usable-git () (if (not (compat-call executable-find (magit-git-executable) t)) @@ -1088,10 +1054,16 @@ tracked file." (defun magit-tracked-files () (magit-list-files "--cached")) -(defun magit-untracked-files (&optional all files) - (magit-list-files "--other" - (and (not all) "--exclude-standard") - "--" files)) +(defun magit-untracked-files (&optional all files compact) + (if compact + (--mapcat (and (eq (aref it 0) ??) + (list (substring it 3))) + (magit-git-items "status" "-z" "--porcelain" + (magit-ignore-submodules-p t) + "--" files)) + (magit-list-files "--other" + (and (not all) "--exclude-standard") + "--" files))) (defun magit-modified-files (&optional nomodules files) (magit-git-items "diff-index" "-z" "--name-only" @@ -2425,15 +2397,14 @@ and this option only controls what face is used.") 0 (length target) 'magit-branch-upstream nil target) (setq upstream target) (setq combined (delete target combined)))))) - (mapconcat #'identity - (flatten-tree `(,state - ,head - ,upstream - ,@(nreverse tags) - ,@(nreverse combined) - ,@(nreverse remotes) - ,@other)) - " "))))) + (string-join (flatten-tree `(,state + ,head + ,upstream + ,@(nreverse tags) + ,@(nreverse combined) + ,@(nreverse remotes) + ,@other)) + " "))))) (defun magit-object-type (object) (magit-git-string "cat-file" "-t" object)) diff --git a/elpa/magit-20240522.204/magit-gitignore.el b/elpa/magit-20240730.1741/magit-gitignore.el similarity index 100% rename from elpa/magit-20240522.204/magit-gitignore.el rename to elpa/magit-20240730.1741/magit-gitignore.el diff --git a/elpa/magit-20240522.204/magit-log.el b/elpa/magit-20240730.1741/magit-log.el similarity index 98% rename from elpa/magit-20240522.204/magit-log.el rename to elpa/magit-20240730.1741/magit-log.el index c71c51dd..c50eb4d0 100644 --- a/elpa/magit-20240522.204/magit-log.el +++ b/elpa/magit-20240730.1741/magit-log.el @@ -38,7 +38,7 @@ (declare-function magit-insert-upstream-branch-header "magit-status" (&optional branch pull keyword)) (declare-function magit-read-file-from-rev "magit-files" - (rev prompt &optional default)) + (rev prompt &optional default include-dirs)) (declare-function magit-rebase--get-state-lines "magit-sequence" (file)) (declare-function magit-show-commit "magit-diff" @@ -763,6 +763,7 @@ restrict the log to the lines that the region touches." (cons current-prefix-arg (and (region-active-p) (magit-file-relative-name) + (not (derived-mode-p 'dired-mode)) (save-restriction (widen) (list (line-number-at-pos (region-beginning)) @@ -782,9 +783,7 @@ restrict the log to the lines that the region touches." (let ((args (car (magit-log-arguments)))) (when (and follow (not (member "--follow" args))) (push "--follow" args)) - (when (and (file-regular-p - (expand-file-name file (magit-toplevel))) - beg end) + (when (and beg end) (setq args (cons (format "-L%s,%s:%s" beg end file) (cl-delete "-L" args :test #'string-prefix-p))) @@ -1061,8 +1060,9 @@ Type \\[magit-cherry-pick] to apply the commit at point. Type \\[magit-reset] to reset `HEAD' to the commit at point. \\{magit-log-mode-map}" + :interactive nil :group 'magit-log - (hack-dir-local-variables-non-file-buffer) + (magit-hack-dir-local-variables) (setq magit--imenu-item-types 'commit)) (put 'magit-log-mode 'magit-log-default-arguments @@ -1157,11 +1157,11 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (defun magit-log-header-line-sentence (revs args files) "Return string containing all arguments." (concat "Commits in " - (mapconcat #'identity revs " ") + (string-join revs " ") (and (member "--reverse" args) " in reverse") (and files (concat " touching " - (mapconcat #'identity files " "))) + (string-join files " "))) (--some (and (string-prefix-p "-L" it) (concat " " it)) args))) @@ -1691,7 +1691,7 @@ to visit the commit at point. Type \\[magit-log-select-pick] to select the commit at point. Type \\[magit-log-select-quit] to abort without selecting a commit." :group 'magit-log - (hack-dir-local-variables-non-file-buffer)) + (magit-hack-dir-local-variables)) (put 'magit-log-select-mode 'magit-log-default-arguments '("--graph" "-n256" "--decorate")) @@ -1790,8 +1790,9 @@ to visit the commit at point. Type \\[magit-cherry-pick] to apply the commit at point. \\{magit-cherry-mode-map}" + :interactive nil :group 'magit-log - (hack-dir-local-variables-non-file-buffer) + (magit-hack-dir-local-variables) (setq magit--imenu-group-types 'cherries)) (defun magit-cherry-setup-buffer (head upstream) @@ -1833,7 +1834,7 @@ Type \\[magit-cherry-pick] to apply the commit at point. (defun magit-insert-cherry-commits () "Insert commit sections into a `magit-cherry-mode' buffer." (magit-insert-section (cherries) - (magit-insert-heading "Cherry commits:") + (magit-insert-heading t "Cherry commits") (magit-git-wash (apply-partially #'magit-log-wash-log 'cherry) "cherry" "-v" "--abbrev" magit-buffer-upstream @@ -1860,7 +1861,8 @@ in the pushremote case." (if (equal value "..@{upstream}") value "..@{push}"))) (magit-define-section-jumper magit-jump-to-unpulled-from-upstream - "Unpulled from @{upstream}" unpulled "..@{upstream}") + "Unpulled from @{upstream}" unpulled "..@{upstream}" + magit-insert-unpulled-from-upstream) (defun magit-insert-unpulled-from-upstream () "Insert commits that haven't been pulled from the upstream yet." @@ -1874,7 +1876,8 @@ in the pushremote case." (magit-log-insert-child-count)))) (magit-define-section-jumper magit-jump-to-unpulled-from-pushremote - "Unpulled from " unpulled "..@{push}") + "Unpulled from " unpulled "..@{push}" + magit-insert-unpulled-from-pushremote) (defun magit-insert-unpulled-from-pushremote () "Insert commits that haven't been pulled from the push-remote yet." @@ -1899,7 +1902,18 @@ in the pushremote case." (if (equal value "@{upstream}..") value "@{push}.."))) (magit-define-section-jumper magit-jump-to-unpushed-to-upstream - "Unpushed to @{upstream}" unpushed "@{upstream}..") + "Unpushed to @{upstream}" unpushed "@{upstream}.." nil + :if (lambda () + (or (memq 'magit-insert-unpushed-to-upstream-or-recent + magit-status-sections-hook) + (memq 'magit-insert-unpushed-to-upstream + magit-status-sections-hook))) + :description (lambda () + (let ((upstream (magit-get-upstream-branch))) + (if (or (not upstream) + (magit-rev-ancestor-p "HEAD" upstream)) + "Recent commits" + "Unmerged into upstream")))) (defun magit-insert-unpushed-to-upstream-or-recent () "Insert section showing unpushed or other recent commits. @@ -1941,7 +1955,8 @@ Show the last `magit-log-section-commit-count' commits." magit-buffer-log-args)))))) (magit-define-section-jumper magit-jump-to-unpushed-to-pushremote - "Unpushed to " unpushed "@{push}..") + "Unpushed to " unpushed "@{push}.." + magit-insert-unpushed-to-pushremote) (defun magit-insert-unpushed-to-pushremote () "Insert commits that haven't been pushed to the push-remote yet." @@ -1987,7 +2002,7 @@ not shared with any local commit) with \"+\", and all others with \"-\"." (when (magit-git-success "rev-parse" "@{upstream}") (magit-insert-section (unpulled "..@{upstream}") - (magit-insert-heading "Unpulled commits:") + (magit-insert-heading t "Unpulled commits") (magit-git-wash (apply-partially #'magit-log-wash-log 'cherry) "cherry" "-v" (magit-abbrev-arg) (magit-get-current-branch) "@{upstream}")))) @@ -2000,7 +2015,7 @@ a patch-id not shared with any upstream commit) with \"+\", and all others with \"-\"." (when (magit-git-success "rev-parse" "@{upstream}") (magit-insert-section (unpushed "@{upstream}..") - (magit-insert-heading "Unpushed commits:") + (magit-insert-heading t "Unpushed commits") (magit-git-wash (apply-partially #'magit-log-wash-log 'cherry) "cherry" "-v" (magit-abbrev-arg) "@{upstream}")))) diff --git a/elpa/magit-20240522.204/magit-margin.el b/elpa/magit-20240730.1741/magit-margin.el similarity index 100% rename from elpa/magit-20240522.204/magit-margin.el rename to elpa/magit-20240730.1741/magit-margin.el diff --git a/elpa/magit-20240522.204/magit-merge.el b/elpa/magit-20240730.1741/magit-merge.el similarity index 99% rename from elpa/magit-20240522.204/magit-merge.el rename to elpa/magit-20240730.1741/magit-merge.el index d6b0198c..3f41cc43 100644 --- a/elpa/magit-20240522.204/magit-merge.el +++ b/elpa/magit-20240730.1741/magit-merge.el @@ -302,7 +302,7 @@ If no merge is in progress, do nothing." (range (magit--merge-range (car heads)))) (magit-insert-section (unmerged range) (magit-insert-heading - (format "Merging %s:" (mapconcat #'identity heads ", "))) + (format "Merging %s:" (string-join heads ", "))) (magit--insert-log nil range (let ((args magit-buffer-log-args)) diff --git a/elpa/magit-20240522.204/magit-mode.el b/elpa/magit-20240730.1741/magit-mode.el similarity index 97% rename from elpa/magit-20240522.204/magit-mode.el rename to elpa/magit-20240730.1741/magit-mode.el index 2548bb7b..62881d2b 100644 --- a/elpa/magit-20240522.204/magit-mode.el +++ b/elpa/magit-20240730.1741/magit-mode.el @@ -31,6 +31,7 @@ (require 'magit-base) (require 'magit-git) +(require 'benchmark) (require 'browse-url) (require 'format-spec) (require 'help-mode) @@ -412,10 +413,11 @@ recommended value." "C-c C-w" 'magit-copy-thing "C-w" 'magit-copy-section-value "M-w" 'magit-copy-buffer-revision - " " 'magit-previous-line - " " 'magit-next-line - " " 'evil-previous-visual-line - " " 'evil-next-visual-line) + " " 'magit-back-to-indentation + " " 'magit-previous-line + " " 'magit-next-line + " " 'evil-previous-visual-line + " " 'evil-next-visual-line) (defun magit-delete-thing () "This is a placeholder command, which signals an error if called. @@ -551,8 +553,9 @@ to the kill ring." "Parent major mode from which Magit major modes inherit. Magit is documented in info node `(magit)'." + :interactive nil :group 'magit - (hack-dir-local-variables-non-file-buffer) + (magit-hack-dir-local-variables) (face-remap-add-relative 'header-line 'magit-header-line) (setq mode-line-process (magit-repository-local-get 'mode-line-process)) (setq-local revert-buffer-function #'magit-refresh-buffer) @@ -561,6 +564,13 @@ Magit is documented in info node `(magit)'." (setq-local imenu-default-goto-function #'magit--imenu-goto-function) (setq-local isearch-filter-predicate #'magit-section--open-temporarily)) +(defun magit-hack-dir-local-variables () + "Like `hack-dir-local-variables-non-file-buffer' but ignore some variables." + (let ((ignored-local-variables + `(show-trailing-whitespace + ,@ignored-local-variables))) + (hack-dir-local-variables-non-file-buffer))) + ;;; Local Variables (defvar-local magit-buffer-arguments nil) @@ -613,7 +623,7 @@ The buffer's major-mode should derive from `magit-section-mode'." bindings)))) (defun magit-setup-buffer-internal ( mode locked bindings - &optional buffer-or-name) + &optional buffer-or-name directory) (let* ((value (and locked (with-temp-buffer (pcase-dolist (`(,var ,val) bindings) @@ -629,6 +639,8 @@ The buffer's major-mode should derive from `magit-section-mode'." (setq buffer (magit-generate-new-buffer mode value))) (with-current-buffer buffer (setq magit-previous-section section) + (when directory + (setq default-directory directory)) (funcall mode) (magit-xref-setup #'magit-setup-buffer-internal bindings) (pcase-dolist (`(,var ,val) bindings) @@ -1008,7 +1020,7 @@ Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'." (let* ((c (caar magit--refresh-cache)) (a (+ c (cdar magit--refresh-cache)))) (message "Refreshing magit...done (%.3fs, cached %s/%s (%.0f%%))" - (float-time (time-subtract (current-time) start)) + (float-time (time-since start)) c a (* (/ c (* a 1.0)) 100))))) (run-hooks 'magit-unwind-refresh-hook)))) @@ -1075,8 +1087,7 @@ Run hooks `magit-pre-refresh-hook' and `magit-post-refresh-hook'." (set-buffer-modified-p nil)) (when magit-refresh-verbose (message "Refreshing buffer `%s'...done (%.3fs)" (buffer-name) - (float-time (time-subtract (current-time) - magit-refresh-start-time))))))) + (float-time (time-since magit-refresh-start-time))))))) (defun magit-profile-refresh-buffer () "Profile refreshing the current Magit buffer." @@ -1412,9 +1423,9 @@ repositories." "Zap caches for the current repository. Remove the repository's entry from `magit-repository-local-cache', -remove the host's entry from `magit--host-git-version-cache', set -`magit-section-visibility-cache' to nil for all Magit buffers of -the repository and set `magit--libgit-available-p' to `unknown'. +remove the host's entry from `magit--host-git-version-cache', and +set `magit-section-visibility-cache' to nil for all Magit buffers +of the repository. With a prefix argument or if optional ALL is non-nil, discard the mentioned caches completely." @@ -1438,8 +1449,7 @@ mentioned caches completely." :key #'car :test #'equal))) (dolist (buffer (magit-mode-get-buffers)) (with-current-buffer buffer - (setq magit-section-visibility-cache nil))))) - (setq magit--libgit-available-p 'unknown)) + (setq magit-section-visibility-cache nil)))))) ;;; Utilities @@ -1453,14 +1463,17 @@ The additional output can be found in the *Messages* buffer." (if magit-refresh-verbose "Enabled" "Disabled"))) (defun magit-run-hook-with-benchmark (hook) - (when hook - (if magit-refresh-verbose - (let ((start (current-time))) - (message "Running %s..." hook) - (run-hooks hook) - (message "Running %s...done (%.3fs)" hook - (float-time (time-subtract (current-time) start)))) - (run-hooks hook)))) + (cond + ((not hook)) + (magit-refresh-verbose + (message "Running %s..." hook) + (message "Running %s...done (%.3fs)" hook + (benchmark-elapse + (run-hook-wrapped + hook + (lambda (fn) + (message " %-50s %f" fn (benchmark-elapse (funcall fn)))))))) + ((run-hooks hook)))) ;;; _ (provide 'magit-mode) diff --git a/elpa/magit-20240522.204/magit-notes.el b/elpa/magit-20240730.1741/magit-notes.el similarity index 100% rename from elpa/magit-20240522.204/magit-notes.el rename to elpa/magit-20240730.1741/magit-notes.el diff --git a/elpa/magit-20240522.204/magit-patch.el b/elpa/magit-20240730.1741/magit-patch.el similarity index 100% rename from elpa/magit-20240522.204/magit-patch.el rename to elpa/magit-20240730.1741/magit-patch.el diff --git a/elpa/magit-20240522.204/magit-pkg.el b/elpa/magit-20240730.1741/magit-pkg.el similarity index 54% rename from elpa/magit-20240522.204/magit-pkg.el rename to elpa/magit-20240730.1741/magit-pkg.el index 2c4e6990..8cb83dac 100644 --- a/elpa/magit-20240522.204/magit-pkg.el +++ b/elpa/magit-20240730.1741/magit-pkg.el @@ -1,13 +1,13 @@ -(define-package "magit" "20240522.204" "A Git porcelain inside Emacs." +(define-package "magit" "20240730.1741" "A Git porcelain inside Emacs." '((emacs "26.1") - (compat "29.1.4.5") - (dash "20240405") - (git-commit "20240429") - (magit-section "20240429") + (compat "30.0.0.0") + (dash "20240510") + (git-commit "20240623") + (magit-section "20240710") (seq "2.24") - (transient "20240421") - (with-editor "20240415")) - :commit "f9268a959828d0c6ab26171dd2fb1ffc55e5ae70" :authors + (transient "20240629") + (with-editor "20240702")) + :commit "d9ff4e8b3a8203454bfcbedfbac378a80cd6c8fe" :authors '(("Marius Vollmer" . "marius.vollmer@gmail.com") ("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev")) :maintainer diff --git a/elpa/magit-20240522.204/magit-process.el b/elpa/magit-20240730.1741/magit-process.el similarity index 97% rename from elpa/magit-20240522.204/magit-process.el rename to elpa/magit-20240730.1741/magit-process.el index 9f74469d..ae2bf1fb 100644 --- a/elpa/magit-20240522.204/magit-process.el +++ b/elpa/magit-20240730.1741/magit-process.el @@ -309,8 +309,9 @@ Used when `magit-process-display-mode-line-error' is non-nil." (define-derived-mode magit-process-mode magit-mode "Magit Process" "Mode for looking at Git process output." + :interactive nil :group 'magit-process - (hack-dir-local-variables-non-file-buffer) + (magit-hack-dir-local-variables) (setq magit--imenu-item-types 'process)) (defun magit-process-buffer (&optional nodisplay) @@ -389,11 +390,11 @@ as well as the current repository's status buffer are refreshed. Process output goes into a new section in the buffer returned by `magit-process-buffer'." (let ((magit--refresh-cache (list (cons 0 0)))) - (magit-call-git args) - (when (member (car args) '("init" "clone")) - ;; Creating a new repository invalidates the cache. - (setq magit--refresh-cache nil)) - (magit-refresh))) + (prog1 (magit-call-git args) + (when (member (car args) '("init" "clone")) + ;; Creating a new repository invalidates the cache. + (setq magit--refresh-cache nil)) + (magit-refresh)))) (defvar magit-pre-call-git-hook nil) @@ -516,7 +517,7 @@ and still alive), as well as the respective Magit status buffer. See `magit-start-process' for more information." (message "Running %s %s" (magit-git-executable) - (let ((m (mapconcat #'identity (flatten-tree args) " "))) + (let ((m (string-join (flatten-tree args) " "))) (remove-list-of-text-properties 0 (length m) '(face) m) m)) (magit-start-git nil args)) @@ -651,18 +652,21 @@ Magit status buffer." (defun magit-parse-git-async (&rest args) (setq args (magit-process-git-arguments args)) (let ((command-buf (current-buffer)) - (process-buf (generate-new-buffer " *temp*")) + (stdout-buf (generate-new-buffer " *git-stdout*")) + (stderr-buf (generate-new-buffer " *git-stderr*")) (toplevel (magit-toplevel))) - (with-current-buffer process-buf + (with-current-buffer stdout-buf (setq default-directory toplevel) (let ((process - (let ((process-connection-type nil) - (process-environment (magit-process-environment)) - (default-process-coding-system - (magit--process-coding-system))) - (apply #'start-file-process "git" process-buf - (magit-git-executable) args)))) + (let ((process-environment (magit-process-environment))) + (make-process :name "git" + :buffer stdout-buf + :stderr stderr-buf + :command (cons (magit-git-executable) args) + :coding (magit--process-coding-system) + :file-handler t)))) (process-put process 'command-buf command-buf) + (process-put process 'stderr-buf stderr-buf) (process-put process 'parsed (point)) (setq magit-this-process process) process)))) @@ -717,7 +721,7 @@ Magit status buffer." " " (propertize (magit--ellipsis) 'font-lock-face 'magit-section-heading - 'help-echo (mapconcat #'identity (seq-take args global) " ")) + 'help-echo (string-join (seq-take args global) " ")) " " (propertize (mapconcat #'shell-quote-argument (seq-drop args global) " ") 'font-lock-face 'magit-section-heading)))) @@ -1015,8 +1019,9 @@ as argument." (add-hook 'magit-credential-hook #'magit-maybe-start-credential-cache-daemon) -(defun tramp-sh-handle-start-file-process--magit-tramp-process-environment - (fn name buffer program &rest args) +(define-advice tramp-sh-handle-start-file-process + (:around (fn name buffer program &rest args) + magit-tramp-process-environment) (if magit-tramp-process-environment (apply fn name buffer (car magit-tramp-process-environment) @@ -1024,23 +1029,18 @@ as argument." (cons program args))) (apply fn name buffer program args))) -(advice-add 'tramp-sh-handle-start-file-process :around - #'tramp-sh-handle-start-file-process--magit-tramp-process-environment) - -(defun tramp-sh-handle-process-file--magit-tramp-process-environment - (fn program &optional infile destination display &rest args) +(define-advice tramp-sh-handle-process-file + (:around (fn program &optional infile destination display &rest args) + magit-tramp-process-environment) (if magit-tramp-process-environment (apply fn "env" infile destination display (append magit-tramp-process-environment (cons program args))) (apply fn program infile destination display args))) -(advice-add 'tramp-sh-handle-process-file :around - #'tramp-sh-handle-process-file--magit-tramp-process-environment) - (defvar-keymap magit-mode-line-process-map :doc "Keymap for `mode-line-process'." - " " ''magit-process-buffer) + " " 'magit-process-buffer) (defun magit-process-set-mode-line (program args) "Display the git command (sans arguments) in the mode line." @@ -1288,7 +1288,7 @@ Limited by `magit-process-error-tooltip-max-lines'." (let ((inhibit-message t)) (when heading (setq lines (cons heading lines))) - (message (mapconcat #'identity lines "\n")))))) + (message (string-join lines "\n")))))) ;;; _ (provide 'magit-process) diff --git a/elpa/magit-20240522.204/magit-pull.el b/elpa/magit-20240730.1741/magit-pull.el similarity index 98% rename from elpa/magit-20240522.204/magit-pull.el rename to elpa/magit-20240730.1741/magit-pull.el index ae50cde5..d218c72c 100644 --- a/elpa/magit-20240522.204/magit-pull.el +++ b/elpa/magit-20240730.1741/magit-pull.el @@ -47,7 +47,8 @@ (lambda () (if magit-pull-or-fetch "Pull arguments" "Arguments")) ("-f" "Fast-forward only" "--ff-only") ("-r" "Rebase local commits" ("-r" "--rebase")) - ("-A" "Autostash" "--autostash" :level 7)] + ("-A" "Autostash" "--autostash" :level 7) + ("-F" "Force" ("-f" "--force"))] [:description (lambda () (if-let ((branch (magit-get-current-branch))) diff --git a/elpa/magit-20240522.204/magit-push.el b/elpa/magit-20240730.1741/magit-push.el similarity index 98% rename from elpa/magit-20240522.204/magit-push.el rename to elpa/magit-20240730.1741/magit-push.el index ddeeec94..8e89d736 100644 --- a/elpa/magit-20240522.204/magit-push.el +++ b/elpa/magit-20240730.1741/magit-push.el @@ -87,10 +87,8 @@ argument the push-remote can be changed before pushed to it." (magit--select-push-remote "push there"))) (when changed (magit-confirm 'set-and-push - (string-replace - "%" "%%" - (format "Really use \"%s\" as push-remote and push \"%s\" there" - remote branch)))) + (list "Really use \"%s\" as push-remote and push \"%s\" there" + remote branch))) (run-hooks 'magit-credential-hook) (magit-run-git-async "push" "-v" args remote (format "refs/heads/%s:refs/heads/%s" @@ -150,10 +148,8 @@ the upstream." ;; is what the user wants to happen. (setq merge (concat "refs/heads/" merge))) (magit-confirm 'set-and-push - (string-replace - "%" "%%" - (format "Really use \"%s\" as upstream and push \"%s\" there" - upstream branch)))) + (list "Really use \"%s\" as upstream and push \"%s\" there" + upstream branch))) (cl-pushnew "--set-upstream" args :test #'equal)) (run-hooks 'magit-credential-hook) (magit-run-git-async "push" "-v" args remote (concat branch ":" merge)))) diff --git a/elpa/magit-20240522.204/magit-reflog.el b/elpa/magit-20240730.1741/magit-reflog.el similarity index 97% rename from elpa/magit-20240522.204/magit-reflog.el rename to elpa/magit-20240730.1741/magit-reflog.el index bb5cddbe..cb6c2274 100644 --- a/elpa/magit-20240522.204/magit-reflog.el +++ b/elpa/magit-20240730.1741/magit-reflog.el @@ -150,8 +150,9 @@ Type \\[magit-cherry-pick] to apply the commit at point. Type \\[magit-reset] to reset `HEAD' to the commit at point. \\{magit-reflog-mode-map}" + :interactive nil :group 'magit-log - (hack-dir-local-variables-non-file-buffer) + (magit-hack-dir-local-variables) (setq magit--imenu-item-types 'commit)) (defun magit-reflog-setup-buffer (ref) @@ -196,9 +197,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. command)) (text (if (string= command "commit") label - (mapconcat #'identity - (delq nil (list command option type)) - " ")))) + (string-join (delq nil (list command option type)) " ")))) (format "%-16s " (magit--propertize-face text (or (cdr (assoc label magit-reflog-labels)) diff --git a/elpa/magit-20240522.204/magit-refs.el b/elpa/magit-20240730.1741/magit-refs.el similarity index 99% rename from elpa/magit-20240522.204/magit-refs.el rename to elpa/magit-20240730.1741/magit-refs.el index ee6b1e9a..7e2d9a31 100644 --- a/elpa/magit-20240522.204/magit-refs.el +++ b/elpa/magit-20240730.1741/magit-refs.el @@ -294,8 +294,9 @@ Type \\[magit-cherry-pick] to apply the commit at point. Type \\[magit-reset] to reset `HEAD' to the commit at point. \\{magit-refs-mode-map}" + :interactive nil :group 'magit-refs - (hack-dir-local-variables-non-file-buffer) + (magit-hack-dir-local-variables) (setq magit--imenu-group-types '(local remote tags))) (defun magit-refs-setup-buffer (ref args) @@ -309,7 +310,7 @@ Type \\[magit-reset] to reset `HEAD' to the commit at point. (setq magit-refs-show-commit-count nil)) (magit-set-header-line-format (format "%s %s" magit-buffer-upstream - (mapconcat #'identity magit-buffer-arguments " "))) + (string-join magit-buffer-arguments " "))) (magit-insert-section (branchbuf) (magit-run-section-hook 'magit-refs-sections-hook)) (add-hook 'kill-buffer-hook #'magit-preserve-section-visibility-cache)) @@ -527,7 +528,7 @@ line is inserted at all." (magit-insert-section (branchdesc branch t) (magit-insert-heading branch ": " (car desc)) (when (cdr desc) - (insert (mapconcat #'identity (cdr desc) "\n")) + (insert (string-join (cdr desc) "\n")) (insert "\n\n"))))) (defun magit-insert-tags () @@ -535,7 +536,7 @@ line is inserted at all." (when-let ((tags (magit-git-lines "tag" "--list" "-n" magit-buffer-arguments))) (let ((_head (magit-rev-parse "HEAD"))) (magit-insert-section (tags) - (magit-insert-heading "Tags:") + (magit-insert-heading (length tags) "Tags") (dolist (tag tags) (string-match "^\\([^ \t]+\\)[ \t]+\\([^ \t\n].*\\)?" tag) (let ((tag (match-string 1 tag)) @@ -616,7 +617,7 @@ line is inserted at all." (defun magit-insert-local-branches () "Insert sections showing all local branches." (magit-insert-section (local nil) - (magit-insert-heading "Branches:") + (magit-insert-heading t "Branches") (dolist (line (magit-refs--format-local-branches)) (pcase-let ((`(,branch . ,strings) line)) (magit-insert-section @@ -639,7 +640,7 @@ line is inserted at all." %(upstream:short)%00%(upstream)%00%(upstream:track)%00" (if magit-refs-show-push-remote "\ %(push:remotename)%00%(push)%00%(push:track)%00%(subject)" - "%00%00%00%(subject)")) + "%00%00%00%(subject)")) "refs/heads" magit-buffer-arguments)))) (unless (magit-get-current-branch) diff --git a/elpa/magit-20240522.204/magit-remote.el b/elpa/magit-20240730.1741/magit-remote.el similarity index 99% rename from elpa/magit-20240522.204/magit-remote.el rename to elpa/magit-20240730.1741/magit-remote.el index 3cc22b88..2cf913cf 100644 --- a/elpa/magit-20240522.204/magit-remote.el +++ b/elpa/magit-20240730.1741/magit-remote.el @@ -206,8 +206,8 @@ the now stale refspecs. Other stale branches are not removed." (if (if (length= stale 1) (pcase-let ((`(,refspec . ,refs) (car stale))) (magit-confirm 'prune-stale-refspecs - (format "Prune stale refspec %s and branch %%s" refspec) - (format "Prune stale refspec %s and %%d branches" refspec) + (list "Prune stale refspec %s and branch %%s" refspec) + (list "Prune stale refspec %s and %%d branches" refspec) nil refs)) (magit-confirm 'prune-stale-refspecs nil (format "Prune %%d stale refspecs and %d branches" diff --git a/elpa/magit-20240522.204/magit-repos.el b/elpa/magit-20240730.1741/magit-repos.el similarity index 99% rename from elpa/magit-20240522.204/magit-repos.el rename to elpa/magit-20240730.1741/magit-repos.el index 769f29aa..aed56e3c 100644 --- a/elpa/magit-20240522.204/magit-repos.el +++ b/elpa/magit-20240730.1741/magit-repos.el @@ -265,6 +265,8 @@ If it contains \"%s\" then the directory is substituted for that." (define-derived-mode magit-repolist-mode tabulated-list-mode "Repos" "Major mode for browsing a list of Git repositories." + :interactive nil + :group 'magit-repolist (setq-local x-stretch-cursor nil) (setq tabulated-list-padding 0) (add-hook 'tabulated-list-revert-hook #'magit-repolist-refresh nil t) diff --git a/elpa/magit-20240522.204/magit-reset.el b/elpa/magit-20240730.1741/magit-reset.el similarity index 100% rename from elpa/magit-20240522.204/magit-reset.el rename to elpa/magit-20240730.1741/magit-reset.el diff --git a/elpa/magit-20240522.204/magit-sequence.el b/elpa/magit-20240730.1741/magit-sequence.el similarity index 100% rename from elpa/magit-20240522.204/magit-sequence.el rename to elpa/magit-20240730.1741/magit-sequence.el diff --git a/elpa/magit-20240522.204/magit-sparse-checkout.el b/elpa/magit-20240730.1741/magit-sparse-checkout.el similarity index 100% rename from elpa/magit-20240522.204/magit-sparse-checkout.el rename to elpa/magit-20240730.1741/magit-sparse-checkout.el diff --git a/elpa/magit-20240522.204/magit-stash.el b/elpa/magit-20240730.1741/magit-stash.el similarity index 98% rename from elpa/magit-20240522.204/magit-stash.el rename to elpa/magit-20240730.1741/magit-stash.el index 65f21892..e09bb789 100644 --- a/elpa/magit-20240522.204/magit-stash.el +++ b/elpa/magit-20240730.1741/magit-stash.el @@ -348,7 +348,7 @@ When the region is active offer to drop all contained stashes." (defun magit-stash-clear (ref) "Remove all stashes saved in REF's reflog by deleting REF." (interactive (let ((ref (or (magit-section-value-if 'stashes) "refs/stash"))) - (magit-confirm t (format "Drop all stashes in %s" ref)) + (magit-confirm t (list "Drop all stashes in %s" ref)) (list ref))) (magit-run-git "update-ref" "-d" ref)) @@ -467,7 +467,7 @@ Then apply STASH, dropping it if it applies cleanly." "<1>" (magit-menu-item "Visit %v" #'magit-stash-show)) (magit-define-section-jumper magit-jump-to-stashes - "Stashes" stashes "refs/stash") + "Stashes" stashes "refs/stash" magit-insert-stashes) (cl-defun magit-insert-stashes (&optional (ref "refs/stash") (heading "Stashes:")) @@ -511,8 +511,9 @@ instead of \"Stashes:\"." (define-derived-mode magit-stashes-mode magit-reflog-mode "Magit Stashes" "Mode for looking at lists of stashes." + :interactive nil :group 'magit-log - (hack-dir-local-variables-non-file-buffer)) + (magit-hack-dir-local-variables)) (defun magit-stashes-setup-buffer () (magit-setup-buffer #'magit-stashes-mode nil @@ -520,9 +521,10 @@ instead of \"Stashes:\"." (defun magit-stashes-refresh-buffer () (magit-insert-section (stashesbuf) - (magit-insert-heading (if (equal magit-buffer-refname "refs/stash") - "Stashes:" - (format "Stashes [%s]:" magit-buffer-refname))) + (magit-insert-heading t + (if (equal magit-buffer-refname "refs/stash") + "Stashes" + (format "Stashes [%s]" magit-buffer-refname))) (magit-git-wash (apply-partially #'magit-log-wash-log 'stash) "reflog" "--format=%gd%x00%aN%x00%at%x00%gs" magit-buffer-refname))) @@ -571,8 +573,9 @@ If there is no stash buffer in the same frame, then do nothing." (define-derived-mode magit-stash-mode magit-diff-mode "Magit Stash" "Mode for looking at individual stashes." + :interactive nil :group 'magit-diff - (hack-dir-local-variables-non-file-buffer) + (magit-hack-dir-local-variables) (setq magit--imenu-group-types '(commit))) (defun magit-stash-setup-buffer (stash args files) @@ -608,7 +611,7 @@ If there is no stash buffer in the same frame, then do nothing." This shows the notes for stash@{N} but not for the other commits that make up the stash." (magit-insert-section (note) - (magit-insert-heading "Notes") + (magit-insert-heading t "Notes") (magit-git-insert "notes" "show" magit-buffer-revision) (magit-cancel-section 'if-empty) (insert "\n"))) diff --git a/elpa/magit-20240522.204/magit-status.el b/elpa/magit-20240730.1741/magit-status.el similarity index 86% rename from elpa/magit-20240522.204/magit-status.el rename to elpa/magit-20240730.1741/magit-status.el index b2de4d91..6b7b475f 100644 --- a/elpa/magit-20240522.204/magit-status.el +++ b/elpa/magit-20240730.1741/magit-status.el @@ -342,38 +342,22 @@ init file: (global-set-key (kbd \"C-x g\") \\='magit-status-quick)." (transient-define-prefix magit-status-jump () "In a Magit-Status buffer, jump to a section." - ["Jump to" - [("z " "Stashes" magit-jump-to-stashes - :if (lambda () (memq 'magit-insert-stashes magit-status-sections-hook))) - ("t " "Tracked" magit-jump-to-tracked - :if (lambda () (memq 'magit-insert-tracked-files magit-status-sections-hook))) - ("n " "Untracked" magit-jump-to-untracked - :if (lambda () (memq 'magit-insert-untracked-files magit-status-sections-hook))) - ("u " "Unstaged" magit-jump-to-unstaged - :if (lambda () (memq 'magit-insert-unstaged-changes magit-status-sections-hook))) - ("s " "Staged" magit-jump-to-staged - :if (lambda () (memq 'magit-insert-staged-changes magit-status-sections-hook)))] - [("fu" "Unpulled from upstream" magit-jump-to-unpulled-from-upstream - :if (lambda () (memq 'magit-insert-unpulled-from-upstream magit-status-sections-hook))) - ("fp" "Unpulled from pushremote" magit-jump-to-unpulled-from-pushremote - :if (lambda () (memq 'magit-insert-unpulled-from-pushremote magit-status-sections-hook))) - ("pu" magit-jump-to-unpushed-to-upstream - :if (lambda () - (or (memq 'magit-insert-unpushed-to-upstream-or-recent magit-status-sections-hook) - (memq 'magit-insert-unpushed-to-upstream magit-status-sections-hook))) - :description (lambda () - (let ((upstream (magit-get-upstream-branch))) - (if (or (not upstream) - (magit-rev-ancestor-p "HEAD" upstream)) - "Recent commits" - "Unmerged into upstream")))) - ("pp" "Unpushed to pushremote" magit-jump-to-unpushed-to-pushremote - :if (lambda () (memq 'magit-insert-unpushed-to-pushremote magit-status-sections-hook))) - ("a " "Assumed unstaged" magit-jump-to-assume-unchanged - :if (lambda () (memq 'magit-insert-assume-unchanged-files magit-status-sections-hook))) - ("w " "Skip worktree" magit-jump-to-skip-worktree - :if (lambda () (memq 'magit-insert-skip-worktree-files magit-status-sections-hook)))] - [("i" "Using Imenu" imenu)]]) + [["Jump to" + ("z " magit-jump-to-stashes) + ("t " magit-jump-to-tracked) + ("n " magit-jump-to-untracked) + ("i " magit-jump-to-ignored) + ("u " magit-jump-to-unstaged) + ("s " magit-jump-to-staged)] + ["" + ("fu" magit-jump-to-unpulled-from-upstream) + ("fp" magit-jump-to-unpulled-from-pushremote) + ("pu" magit-jump-to-unpushed-to-upstream) + ("pp" magit-jump-to-unpushed-to-pushremote) + ("a " magit-jump-to-assume-unchanged) + ("w " magit-jump-to-skip-worktree)] + ["Jump using" + ("j" "Imenu" imenu)]]) (define-derived-mode magit-status-mode magit-mode "Magit" "Mode for looking at Git status. @@ -401,8 +385,9 @@ Staging and applying changes is documented in info node Type \\[magit-commit] to create a commit. \\{magit-status-mode-map}" + :interactive nil :group 'magit-status - (hack-dir-local-variables-non-file-buffer) + (magit-hack-dir-local-variables) (when magit-status-initial-section (add-hook 'magit-post-create-buffer-hook #'magit-status-goto-initial-section nil t)) @@ -530,7 +515,7 @@ the status buffer causes this section to disappear again." (when magit-buffer-diff-files (insert " -- "))) (when magit-buffer-diff-files - (insert (mapconcat #'identity magit-buffer-diff-files " "))) + (insert (string-join magit-buffer-diff-files " "))) (insert ?\n)))) ;;;; Reference Headers @@ -705,7 +690,20 @@ remote in alphabetic order." "<1>" (magit-menu-item "Stage files" #'magit-stage)) (magit-define-section-jumper magit-jump-to-untracked - "Untracked files" untracked) + "Untracked files" untracked nil magit-insert-untracked-files) + +(magit-define-section-jumper magit-jump-to-tracked + "Tracked files" tracked nil magit-insert-tracked-files) + +(magit-define-section-jumper magit-jump-to-ignored + "Ignored files" ignored nil magit-insert-ignored-files) + +(magit-define-section-jumper magit-jump-to-skip-worktree + "Skip-worktree files" skip-worktree nil magit-insert-skip-worktree-files) + +(magit-define-section-jumper magit-jump-to-assume-unchanged + "Assume-unchanged files" assume-unchanged nil + magit-insert-assume-unchanged-files) (defun magit-insert-untracked-files () "Maybe insert a list or tree of untracked files. @@ -718,30 +716,14 @@ be expanded using \"TAB\". If the first element of `magit-buffer-diff-files' is a directory, then limit the list to files below that. The value value of that variable can be set using \"D -- DIRECTORY RET g\"." - (let* ((show (or (magit-get "status.showUntrackedFiles") "normal")) - (base (car magit-buffer-diff-files)) - (base (and base (file-directory-p base) base))) + (let ((show (or (magit-get "status.showUntrackedFiles") "normal"))) (unless (equal show "no") - (if (equal show "all") - (when-let ((files (magit-untracked-files nil base))) - (magit-insert-section (untracked) - (magit-insert-heading "Untracked files:") - (magit-insert-files files base) - (insert ?\n))) - (when-let ((files - (--mapcat (and (eq (aref it 0) ??) - (list (substring it 3))) - (magit-git-items "status" "-z" "--porcelain" - (magit-ignore-submodules-p t) - "--" base)))) - (magit-insert-section (untracked) - (magit-insert-heading "Untracked files:") - (dolist (file files) - (magit-insert-section (file file) - (insert (propertize file 'font-lock-face 'magit-filename) ?\n))) - (insert ?\n))))))) - -(magit-define-section-jumper magit-jump-to-tracked "Tracked files" tracked) + (let* ((all (equal show "all")) + (base (car magit-buffer-diff-files)) + (base (and base (file-directory-p base) base))) + (magit-insert-files 'untracked + (lambda () (magit-untracked-files nil base (not all))) + (not all)))))) (defun magit-insert-tracked-files () "Insert a tree of tracked files. @@ -749,13 +731,7 @@ value of that variable can be set using \"D -- DIRECTORY RET g\"." If the first element of `magit-buffer-diff-files' is a directory, then limit the list to files below that. The value value of that variable can be set using \"D -- DIRECTORY RET g\"." - (when-let ((files (magit-list-files))) - (let* ((base (car magit-buffer-diff-files)) - (base (and base (file-directory-p base) base))) - (magit-insert-section (tracked nil t) - (magit-insert-heading "Tracked files:") - (magit-insert-files files base) - (insert ?\n))))) + (magit-insert-files 'tracked #'magit-list-files)) (defun magit-insert-ignored-files () "Insert a tree of ignored files. @@ -763,16 +739,7 @@ value of that variable can be set using \"D -- DIRECTORY RET g\"." If the first element of `magit-buffer-diff-files' is a directory, then limit the list to files below that. The value of that variable can be set using \"D -- DIRECTORY RET g\"." - (when-let ((files (magit-ignored-files))) - (let* ((base (car magit-buffer-diff-files)) - (base (and base (file-directory-p base) base))) - (magit-insert-section (tracked nil t) - (magit-insert-heading "Ignored files:") - (magit-insert-files files base) - (insert ?\n))))) - -(magit-define-section-jumper magit-jump-to-skip-worktree - "Skip-worktree files" skip-worktree) + (magit-insert-files 'ignored #'magit-ignored-files)) (defun magit-insert-skip-worktree-files () "Insert a tree of skip-worktree files. @@ -780,16 +747,7 @@ of that variable can be set using \"D -- DIRECTORY RET g\"." If the first element of `magit-buffer-diff-files' is a directory, then limit the list to files below that. The value of that variable can be set using \"D -- DIRECTORY RET g\"." - (when-let ((files (magit-skip-worktree-files))) - (let* ((base (car magit-buffer-diff-files)) - (base (and base (file-directory-p base) base))) - (magit-insert-section (skip-worktree nil t) - (magit-insert-heading "Skip-worktree files:") - (magit-insert-files files base) - (insert ?\n))))) - -(magit-define-section-jumper magit-jump-to-assume-unchanged - "Assume-unchanged files" assume-unchanged) + (magit-insert-files 'skip-worktree #'magit-skip-worktree-files)) (defun magit-insert-assume-unchanged-files () "Insert a tree of files that are assumed to be unchanged. @@ -797,25 +755,46 @@ of that variable can be set using \"D -- DIRECTORY RET g\"." If the first element of `magit-buffer-diff-files' is a directory, then limit the list to files below that. The value of that variable can be set using \"D -- DIRECTORY RET g\"." - (when-let ((files (magit-assume-unchanged-files))) + (magit-insert-files 'assume-unchanged #'magit-assume-unchanged-files)) + +(defvar magit-file-section-indent nil + "Indentation used for simple `file' sections. +If non-nil, this must be a string or character, and is used as +indentation of `file' sections inserted by `magit-insert-*-files'. +`file' sections that are part of diffs are not affected. This is mainly +intended as a workaround for https://github.com/magit/magit/issues/5176, +in which case ?\N{ZERO WIDTH SPACE} is a good value.") + +(defun magit-insert-files (type fn &optional nogroup) + (when-let ((files (funcall fn))) (let* ((base (car magit-buffer-diff-files)) - (base (and base (file-directory-p base) base))) - (magit-insert-section (assume-unchanged nil t) - (magit-insert-heading "Assume-unchanged files:") - (magit-insert-files files base) + (base (and base (file-directory-p base) base)) + (title (symbol-name type))) + (magit-insert-section ((eval type) nil t) + (magit-insert-heading (length files) + (format "%c%s files" + (capitalize (aref title 0)) + (substring title 1))) + (magit-insert-files-1 files base nogroup) (insert ?\n))))) -(defun magit-insert-files (files directory) - (while (and files (string-prefix-p (or directory "") (car files))) +(defun magit-insert-files-1 (files directory &optional nogroup) + (while (and files (or nogroup + (not directory) + (string-prefix-p directory (car files)))) (let ((dir (file-name-directory (car files)))) - (if (equal dir directory) + (if (or nogroup (equal dir directory)) (let ((file (pop files))) (magit-insert-section (file file) + (when magit-file-section-indent + (insert magit-file-section-indent)) (insert (propertize file 'font-lock-face 'magit-filename) ?\n))) (magit-insert-section (file dir t) + (when magit-file-section-indent + (insert magit-file-section-indent)) (insert (propertize dir 'file 'magit-filename) ?\n) (magit-insert-heading) - (setq files (magit-insert-files files dir)))))) + (setq files (magit-insert-files-1 files dir)))))) files) ;;; _ diff --git a/elpa/magit-20240522.204/magit-submodule.el b/elpa/magit-20240730.1741/magit-submodule.el similarity index 96% rename from elpa/magit-20240522.204/magit-submodule.el rename to elpa/magit-20240730.1741/magit-submodule.el index a6b77047..2c2e946f 100644 --- a/elpa/magit-20240522.204/magit-submodule.el +++ b/elpa/magit-20240730.1741/magit-submodule.el @@ -408,7 +408,7 @@ to recover from making a mistake here, but don't count on it." (if (cdr modified) (message "Omitting %s modules with uncommitted changes: %s" (length modified) - (mapconcat #'identity modified ", ")) + (string-join modified ", ")) (message "Omitting module %s, it has uncommitted changes" (car modified))) (setq modules (cl-set-difference modules modified :test #'equal)))) @@ -599,25 +599,26 @@ These sections can be expanded to show the respective commits." (propertize (match-string 2 heading) 'font-lock-face 'magit-branch-remote) ":") - (magit-with-toplevel - (dolist (module modules) - (when (magit-module-worktree-p module) - (let ((default-directory - (expand-file-name (file-name-as-directory module)))) - (when (file-accessible-directory-p default-directory) - (magit-insert-section - ( module module t - :range range) - (magit-insert-heading - (propertize module - 'font-lock-face 'magit-diff-file-heading) - ":") - (let ((pos (point))) - (magit-git-wash - (apply-partially #'magit-log-wash-log 'module) - "-c" "push.default=current" "log" "--oneline" range) - (when (> (point) pos) - (delete-char -1))))))))) + (dolist (module modules) + (when-let* ((default-directory (expand-file-name module)) + ((file-exists-p (expand-file-name ".git"))) + (lines (magit-git-lines "-c" "push.default=current" + "log" "--oneline" range)) + (count (length lines)) + ((> count 0))) + (magit-insert-section + ( module module t + :range range) + (magit-insert-heading count + (propertize module 'font-lock-face 'magit-diff-file-heading)) + (dolist (line lines) + (string-match magit-log-module-re line) + (let ((rev (match-string 1 line)) + (msg (match-string 2 line))) + (magit-insert-section (module-commit rev t) + (insert (propertize rev 'font-lock-face 'magit-hash) " " + (funcall magit-log-format-message-function rev msg) + "\n"))))))) (magit-cancel-section 'if-empty) (insert ?\n))))) @@ -635,7 +636,8 @@ These sections can be expanded to show the respective commits." (define-derived-mode magit-submodule-list-mode tabulated-list-mode "Modules" "Major mode for browsing a list of Git submodules." - :group 'magit-repolist-mode + :interactive nil + :group 'magit-repolist (setq-local x-stretch-cursor nil) (setq tabulated-list-padding 0) (add-hook 'tabulated-list-revert-hook #'magit-submodule-list-refresh nil t) diff --git a/elpa/magit-20240522.204/magit-subtree.el b/elpa/magit-20240730.1741/magit-subtree.el similarity index 100% rename from elpa/magit-20240522.204/magit-subtree.el rename to elpa/magit-20240730.1741/magit-subtree.el diff --git a/elpa/magit-20240522.204/magit-tag.el b/elpa/magit-20240730.1741/magit-tag.el similarity index 100% rename from elpa/magit-20240522.204/magit-tag.el rename to elpa/magit-20240730.1741/magit-tag.el diff --git a/elpa/magit-20240522.204/magit-transient.el b/elpa/magit-20240730.1741/magit-transient.el similarity index 100% rename from elpa/magit-20240522.204/magit-transient.el rename to elpa/magit-20240730.1741/magit-transient.el diff --git a/elpa/magit-20240522.204/magit-wip.el b/elpa/magit-20240730.1741/magit-wip.el similarity index 100% rename from elpa/magit-20240522.204/magit-wip.el rename to elpa/magit-20240730.1741/magit-wip.el diff --git a/elpa/magit-20240522.204/magit-worktree.el b/elpa/magit-20240730.1741/magit-worktree.el similarity index 94% rename from elpa/magit-20240522.204/magit-worktree.el rename to elpa/magit-20240730.1741/magit-worktree.el index 63c49bd4..a9bc05ba 100644 --- a/elpa/magit-20240522.204/magit-worktree.el +++ b/elpa/magit-20240730.1741/magit-worktree.el @@ -61,20 +61,20 @@ Used by `magit-worktree-checkout' and `magit-worktree-branch'." (list (funcall magit-worktree-read-directory-name-function (format "Checkout %s in new worktree: " branch)) branch))) - (magit-run-git "worktree" "add" (magit--expand-worktree path) branch) - (magit-diff-visit-directory path)) + (when (zerop (magit-run-git "worktree" "add" + (magit--expand-worktree path) branch)) + (magit-diff-visit-directory path))) ;;;###autoload -(defun magit-worktree-branch (path branch start-point &optional force) +(defun magit-worktree-branch (path branch start-point) "Create a new BRANCH and check it out in a new worktree at PATH." (interactive `(,(funcall magit-worktree-read-directory-name-function "Create worktree: ") - ,@(magit-branch-read-args "Create and checkout branch") - ,current-prefix-arg)) - (magit-run-git "worktree" "add" (if force "-B" "-b") - branch (magit--expand-worktree path) start-point) - (magit-diff-visit-directory path)) + ,@(magit-branch-read-args "Create and checkout branch"))) + (when (zerop (magit-run-git "worktree" "add" "-b" branch + (magit--expand-worktree path) start-point)) + (magit-diff-visit-directory path))) ;;;###autoload (defun magit-worktree-move (worktree path) @@ -160,7 +160,7 @@ If there is only one worktree, then insert nothing." (let ((worktrees (magit-list-worktrees))) (when (length> worktrees 1) (magit-insert-section (worktrees) - (magit-insert-heading "Worktrees:") + (magit-insert-heading t "Worktrees") (let* ((cols (mapcar (lambda (config) diff --git a/elpa/magit-20240522.204/magit.el b/elpa/magit-20240730.1741/magit.el similarity index 99% rename from elpa/magit-20240522.204/magit.el rename to elpa/magit-20240730.1741/magit.el index f7775994..969e5eb5 100644 --- a/elpa/magit-20240522.204/magit.el +++ b/elpa/magit-20240730.1741/magit.el @@ -20,13 +20,13 @@ ;; Package-Version: 3.3.0.50-git ;; Package-Requires: ( ;; (emacs "26.1") -;; (compat "29.1.4.5") +;; (compat "30.0.0.0") ;; (dash "2.19.1") ;; (git-commit "3.3.0") ;; (magit-section "3.3.0") ;; (seq "2.24") -;; (transient "0.6.0") -;; (with-editor "3.3.2")) +;; (transient "0.7.2") +;; (with-editor "3.3.4")) ;; SPDX-License-Identifier: GPL-3.0-or-later @@ -598,7 +598,7 @@ the output in the kill ring. '("magit.el" "magit.el.gz"))) (let ((load-suffixes (reverse load-suffixes))) ; prefer .el than .elc (setq toplib (locate-library "magit")))) - (setq toplib (and toplib (magit--straight-chase-links toplib))) + (setq toplib (and toplib (magit--chase-links toplib))) (push toplib debug) (when toplib (let* ((topdir (file-name-directory toplib)) @@ -606,7 +606,7 @@ the output in the kill ring. ".git" (file-name-directory (directory-file-name topdir)))) (static (locate-library "magit-version.el" nil (list topdir))) - (static (and static (magit--straight-chase-links static)))) + (static (and static (magit--chase-links static)))) (or (progn (push 'repo debug) (when (and (file-exists-p gitdir) diff --git a/elpa/magit-20240522.204/magit.info b/elpa/magit-20240730.1741/magit.info similarity index 99% rename from elpa/magit-20240522.204/magit.info rename to elpa/magit-20240730.1741/magit.info index 94de5fe9..12f0e372 100644 --- a/elpa/magit-20240522.204/magit.info +++ b/elpa/magit-20240730.1741/magit.info @@ -1,4 +1,4 @@ -This is magit.info, produced by makeinfo version 6.7 from magit.texi. +This is magit.info, produced by makeinfo version 6.8 from magit.texi. Copyright (C) 2015-2024 Jonas Bernoulli @@ -3047,9 +3047,7 @@ repository’s log buffer, depending on the value of Buffer Variables::). For information about the various arguments, see *note -(gitman)git-log::. - - The switch ‘++order=VALUE’ is converted to one of +(gitman)git-log::. The switch ‘++order=VALUE’ is converted to one of ‘--author-date-order’, ‘--date-order’, or ‘--topo-order’ before being passed to ‘git log’. @@ -5831,10 +5829,9 @@ e.g.: git config --global remote.autoSetupMerge always - For more information about these variables you should also see - - *note (gitman)git-config::. Also see *note (gitman)git-branch::. , -*note (gitman)git-checkout::. and *note Pushing::. + For more information about these variables you should also see *note +(gitman)git-config::. Also see *note (gitman)git-branch::. , *note +(gitman)git-checkout::. and *note Pushing::. -- User Option: magit-prefer-remote-upstream This option controls whether commands that read a branch from the @@ -8379,7 +8376,7 @@ Log Performance When showing logs, Magit limits the number of commits initially shown in the hope that this avoids unnecessary work. When ‘--graph’ is used, then this unfortunately does not have the desired effect for large -histories. Junio, Git’s maintainer, said on the git mailing list +histories. Junio, Git’s maintainer, said on the Git mailing list (): "‘--graph’ wants to compute the whole history and the max-count only affects the output phase after ‘--graph’ does its computation". @@ -9556,8 +9553,8 @@ File: magit.info, Node: Point is wrong in the COMMIT_EDITMSG buffer, Next: The A.2.7 Point is wrong in the ‘COMMIT_EDITMSG’ buffer --------------------------------------------------- -Neither Magit nor ‘git-commit‘ fiddle with point in the buffer used to -write commit messages, so something else must be doing it. +Neither Magit nor ‘git-commit.el’ fiddle with point in the buffer used +to write commit messages, so something else must be doing it. You have probably globally enabled a mode which restores point in file-visiting buffers. It might be a bit surprising, but when you write @@ -10142,28 +10139,28 @@ Appendix C Keystroke Index * k <2>: Editing Rebase Sequences. (line 56) * k <3>: Stashing. (line 118) -* l: Logging. (line 30) +* l: Logging. (line 28) * L: Refreshing Logs. (line 12) * L <1>: Log Buffer. (line 7) * L <2>: Log Margin. (line 52) * l <1>: Editing Rebase Sequences. (line 94) -* l a: Logging. (line 61) -* l b: Logging. (line 58) +* l a: Logging. (line 59) +* l b: Logging. (line 56) * L d: Log Margin. (line 66) * L g: Refreshing Logs. (line 17) -* l h: Logging. (line 40) +* l h: Logging. (line 38) * l H: Reflog. (line 18) -* l l: Logging. (line 35) -* l L: Logging. (line 55) +* l l: Logging. (line 33) +* l L: Logging. (line 53) * L L: Refreshing Logs. (line 34) * L L <1>: Log Margin. (line 60) * L l: Log Margin. (line 63) -* l o: Logging. (line 49) +* l o: Logging. (line 47) * l O: Reflog. (line 15) * l r: Reflog. (line 12) * L s: Refreshing Logs. (line 21) -* l u: Logging. (line 43) +* l u: Logging. (line 41) * L w: Refreshing Logs. (line 27) * m: Repository List. (line 105) * m <1>: Merging. (line 10) @@ -10827,23 +10824,23 @@ Appendix D Function and Command Index * magit-list-repositories: Repository List. (line 6) * magit-list-submodules: Listing Submodules. (line 13) * magit-list-submodules <1>: Submodule Transient. (line 48) -* magit-log: Logging. (line 30) +* magit-log: Logging. (line 28) * magit-log <1>: Commands for Buffers Visiting Files. (line 52) * magit-log <2>: Commands for Buffers Visiting Files. (line 109) -* magit-log-all: Logging. (line 61) -* magit-log-all-branches: Logging. (line 58) -* magit-log-branches: Logging. (line 55) +* magit-log-all: Logging. (line 59) +* magit-log-all-branches: Logging. (line 56) +* magit-log-branches: Logging. (line 53) * magit-log-buffer-file: Commands for Buffers Visiting Files. (line 52) * magit-log-buffer-file <1>: Commands for Buffers Visiting Files. (line 119) * magit-log-bury-buffer: Log Buffer. (line 14) -* magit-log-current: Logging. (line 35) +* magit-log-current: Logging. (line 33) * magit-log-double-commit-limit: Log Buffer. (line 64) * magit-log-half-commit-limit: Log Buffer. (line 67) -* magit-log-head: Logging. (line 40) +* magit-log-head: Logging. (line 38) * magit-log-maybe-show-more-commits: Section Movement. (line 58) * magit-log-maybe-update-blob-buffer: Section Movement. (line 72) * magit-log-maybe-update-revision-buffer: Section Movement. (line 65) @@ -10853,11 +10850,11 @@ Appendix D Function and Command Index (line 132) * magit-log-move-to-parent: Log Buffer. (line 26) * magit-log-move-to-revision: Log Buffer. (line 31) -* magit-log-other: Logging. (line 49) +* magit-log-other: Logging. (line 47) * magit-log-refresh: Refreshing Logs. (line 12) * magit-log-refresh <1>: Refreshing Logs. (line 17) * magit-log-refresh <2>: Log Buffer. (line 7) -* magit-log-related: Logging. (line 43) +* magit-log-related: Logging. (line 41) * magit-log-save-default-arguments: Refreshing Logs. (line 27) * magit-log-select-pick: Select from Log. (line 21) * magit-log-select-quit: Select from Log. (line 26) @@ -11331,7 +11328,7 @@ Appendix E Variable Index * magit-post-display-buffer-hook: Switching Buffers. (line 85) * magit-pre-display-buffer-hook: Switching Buffers. (line 76) * magit-prefer-remote-upstream: Branch Git Variables. - (line 109) + (line 108) * magit-prefix-use-buffer-arguments: Transient Arguments and Buffer Variables. (line 65) * magit-process-extreme-logging: Viewing Git Output. (line 56) @@ -11464,128 +11461,128 @@ Node: Status Module Sections118053 Node: Status Options120550 Node: Repository List121913 Node: Logging126691 -Node: Refreshing Logs129533 -Node: Log Buffer130954 -Node: Log Margin135777 -Node: Select from Log138930 -Node: Reflog141140 -Node: Cherries142777 -Node: Diffing144615 -Node: Refreshing Diffs147649 -Node: Commands Available in Diffs151338 -Node: Diff Options153851 -Node: Revision Buffer159314 -Node: Ediffing162634 -Node: References Buffer168684 -Node: References Sections179278 -Node: Bisecting180135 -Node: Visiting Files and Blobs182446 -Node: General-Purpose Visit Commands182974 -Node: Visiting Files and Blobs from a Diff183927 -Node: Blaming187371 -Node: Manipulating194359 -Node: Creating Repository194701 -Node: Cloning Repository195238 -Node: Staging and Unstaging201679 -Node: Staging from File-Visiting Buffers205660 -Node: Applying206766 -Node: Committing208839 -Node: Initiating a Commit209422 -Node: Editing Commit Messages214612 -Node: Using the Revision Stack217385 -Node: Commit Pseudo Headers220430 -Node: Commit Mode and Hooks221725 -Node: Commit Message Conventions224583 -Node: Branching226570 -Node: The Two Remotes226796 -Node: Branch Commands229449 -Node: Branch Git Variables242299 -Node: Auxiliary Branch Commands247673 -Node: Merging248789 -Node: Resolving Conflicts252945 -Node: Rebasing258319 -Node: Editing Rebase Sequences263108 -Node: Information About In-Progress Rebase267324 -Ref: Information About In-Progress Rebase-Footnote-1276437 -Node: Cherry Picking277033 -Node: Reverting281367 -Node: Resetting282786 -Node: Stashing284612 -Node: Transferring290993 -Node: Remotes291215 -Node: Remote Commands291367 -Node: Remote Git Variables295406 -Node: Fetching296677 -Node: Pulling299160 -Node: Pushing300186 -Node: Plain Patches304477 -Node: Maildir Patches305948 -Node: Miscellaneous307427 -Node: Tagging307773 -Node: Notes309666 -Node: Submodules312001 -Node: Listing Submodules312219 -Node: Submodule Transient314367 -Node: Subtree316812 -Node: Worktree318743 -Node: Sparse checkouts319819 -Node: Bundle322595 -Node: Common Commands322970 -Node: Wip Modes325598 -Node: Wip Graph330489 -Node: Legacy Wip Modes332802 -Node: Commands for Buffers Visiting Files335689 -Node: Minor Mode for Buffers Visiting Blobs343916 -Node: Customizing344714 -Node: Per-Repository Configuration346310 -Node: Essential Settings348564 -Node: Safety348910 -Node: Performance350671 -Ref: Log Performance353634 -Ref: Diff Performance354939 -Ref: Refs Buffer Performance356280 -Ref: Committing Performance356855 -Node: Microsoft Windows Performance357837 -Node: MacOS Performance359028 -Ref: MacOS Performance-Footnote-1360051 -Node: Global Bindings360133 -Node: Plumbing362361 -Node: Calling Git363190 -Node: Getting a Value from Git364715 -Node: Calling Git for Effect368443 -Node: Section Plumbing374337 -Node: Creating Sections374565 -Node: Section Selection378461 -Node: Matching Sections380257 -Node: Refreshing Buffers386178 -Node: Conventions389322 -Node: Theming Faces389514 -Node: FAQ397619 -Node: FAQ - How to ...?398057 -Node: How to pronounce Magit?398414 -Node: How to show git's output?399217 -Node: How to install the gitman info manual?400003 -Node: How to show diffs for gpg-encrypted files?400973 -Node: How does branching and pushing work?401569 -Node: Should I disable VC?401902 -Node: FAQ - Issues and Errors402505 -Node: Magit is slow403450 -Node: I changed several thousand files at once and now Magit is unusable403743 -Node: I am having problems committing404469 -Node: I am using MS Windows and cannot push with Magit404950 -Node: I am using macOS and SOMETHING works in shell but not in Magit405568 -Node: Expanding a file to show the diff causes it to disappear406402 -Node: Point is wrong in the COMMIT_EDITMSG buffer406990 -Node: The mode-line information isn't always up-to-date408035 -Node: A branch and tag sharing the same name breaks SOMETHING409098 -Node: My Git hooks work on the command-line but not inside Magit409985 -Node: git-commit-mode isn't used when committing from the command-line410831 -Node: Point ends up inside invisible text when jumping to a file-visiting buffer413102 -Node: I am no longer able to save popup defaults413951 -Node: Debugging Tools414932 -Node: Keystroke Index418106 -Node: Function and Command Index459720 -Node: Variable Index517921 +Node: Refreshing Logs129530 +Node: Log Buffer130951 +Node: Log Margin135774 +Node: Select from Log138927 +Node: Reflog141137 +Node: Cherries142774 +Node: Diffing144612 +Node: Refreshing Diffs147646 +Node: Commands Available in Diffs151335 +Node: Diff Options153848 +Node: Revision Buffer159311 +Node: Ediffing162631 +Node: References Buffer168681 +Node: References Sections179275 +Node: Bisecting180132 +Node: Visiting Files and Blobs182443 +Node: General-Purpose Visit Commands182971 +Node: Visiting Files and Blobs from a Diff183924 +Node: Blaming187368 +Node: Manipulating194356 +Node: Creating Repository194698 +Node: Cloning Repository195235 +Node: Staging and Unstaging201676 +Node: Staging from File-Visiting Buffers205657 +Node: Applying206763 +Node: Committing208836 +Node: Initiating a Commit209419 +Node: Editing Commit Messages214609 +Node: Using the Revision Stack217382 +Node: Commit Pseudo Headers220427 +Node: Commit Mode and Hooks221722 +Node: Commit Message Conventions224580 +Node: Branching226567 +Node: The Two Remotes226793 +Node: Branch Commands229446 +Node: Branch Git Variables242296 +Node: Auxiliary Branch Commands247666 +Node: Merging248782 +Node: Resolving Conflicts252938 +Node: Rebasing258312 +Node: Editing Rebase Sequences263101 +Node: Information About In-Progress Rebase267317 +Ref: Information About In-Progress Rebase-Footnote-1276430 +Node: Cherry Picking277026 +Node: Reverting281360 +Node: Resetting282779 +Node: Stashing284605 +Node: Transferring290986 +Node: Remotes291208 +Node: Remote Commands291360 +Node: Remote Git Variables295399 +Node: Fetching296670 +Node: Pulling299153 +Node: Pushing300179 +Node: Plain Patches304470 +Node: Maildir Patches305941 +Node: Miscellaneous307420 +Node: Tagging307766 +Node: Notes309659 +Node: Submodules311994 +Node: Listing Submodules312212 +Node: Submodule Transient314360 +Node: Subtree316805 +Node: Worktree318736 +Node: Sparse checkouts319812 +Node: Bundle322588 +Node: Common Commands322963 +Node: Wip Modes325591 +Node: Wip Graph330482 +Node: Legacy Wip Modes332795 +Node: Commands for Buffers Visiting Files335682 +Node: Minor Mode for Buffers Visiting Blobs343909 +Node: Customizing344707 +Node: Per-Repository Configuration346303 +Node: Essential Settings348557 +Node: Safety348903 +Node: Performance350664 +Ref: Log Performance353627 +Ref: Diff Performance354932 +Ref: Refs Buffer Performance356273 +Ref: Committing Performance356848 +Node: Microsoft Windows Performance357830 +Node: MacOS Performance359021 +Ref: MacOS Performance-Footnote-1360044 +Node: Global Bindings360126 +Node: Plumbing362354 +Node: Calling Git363183 +Node: Getting a Value from Git364708 +Node: Calling Git for Effect368436 +Node: Section Plumbing374330 +Node: Creating Sections374558 +Node: Section Selection378454 +Node: Matching Sections380250 +Node: Refreshing Buffers386171 +Node: Conventions389315 +Node: Theming Faces389507 +Node: FAQ397612 +Node: FAQ - How to ...?398050 +Node: How to pronounce Magit?398407 +Node: How to show git's output?399210 +Node: How to install the gitman info manual?399996 +Node: How to show diffs for gpg-encrypted files?400966 +Node: How does branching and pushing work?401562 +Node: Should I disable VC?401895 +Node: FAQ - Issues and Errors402498 +Node: Magit is slow403443 +Node: I changed several thousand files at once and now Magit is unusable403736 +Node: I am having problems committing404462 +Node: I am using MS Windows and cannot push with Magit404943 +Node: I am using macOS and SOMETHING works in shell but not in Magit405561 +Node: Expanding a file to show the diff causes it to disappear406395 +Node: Point is wrong in the COMMIT_EDITMSG buffer406983 +Node: The mode-line information isn't always up-to-date408031 +Node: A branch and tag sharing the same name breaks SOMETHING409094 +Node: My Git hooks work on the command-line but not inside Magit409981 +Node: git-commit-mode isn't used when committing from the command-line410827 +Node: Point ends up inside invisible text when jumping to a file-visiting buffer413098 +Node: I am no longer able to save popup defaults413947 +Node: Debugging Tools414928 +Node: Keystroke Index418102 +Node: Function and Command Index459716 +Node: Variable Index517917  End Tag Table diff --git a/elpa/magit-section-20240508.2349/magit-section-autoloads.el b/elpa/magit-section-20240508.2349/magit-section-autoloads.el deleted file mode 100644 index e186f246..00000000 --- a/elpa/magit-section-20240508.2349/magit-section-autoloads.el +++ /dev/null @@ -1,28 +0,0 @@ -;;; magit-section-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- -;; Generated by the `loaddefs-generate' function. - -;; This file is part of GNU Emacs. - -;;; Code: - -(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) - - - -;;; Generated autoloads from magit-section.el - -(register-definition-prefixes "magit-section" '("isearch-clean-overlays@magit-mode" "magit-")) - -;;; End of scraped data - -(provide 'magit-section-autoloads) - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; no-native-compile: t -;; coding: utf-8-emacs-unix -;; End: - -;;; magit-section-autoloads.el ends here diff --git a/elpa/magit-section-20240508.2349/dir b/elpa/magit-section-20240730.1741/dir similarity index 100% rename from elpa/magit-section-20240508.2349/dir rename to elpa/magit-section-20240730.1741/dir diff --git a/elpa/magit-section-20240730.1741/magit-section-autoloads.el b/elpa/magit-section-20240730.1741/magit-section-autoloads.el new file mode 100644 index 00000000..aa1f445f --- /dev/null +++ b/elpa/magit-section-20240730.1741/magit-section-autoloads.el @@ -0,0 +1,67 @@ +;;; magit-section-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- +;; Generated by the `loaddefs-generate' function. + +;; This file is part of GNU Emacs. + +;;; Code: + +(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) + + + +;;; Generated autoloads from magit-section.el + +(autoload 'magit-add-section-hook "magit-section" "\ +Add to the value of section hook HOOK the function FUNCTION. + +Add FUNCTION at the beginning of the hook list unless optional +APPEND is non-nil, in which case FUNCTION is added at the end. +If FUNCTION already is a member, then move it to the new location. + +If optional AT is non-nil and a member of the hook list, then +add FUNCTION next to that instead. Add before or after AT, or +replace AT with FUNCTION depending on APPEND. If APPEND is the +symbol `replace', then replace AT with FUNCTION. For any other +non-nil value place FUNCTION right after AT. If nil, then place +FUNCTION right before AT. If FUNCTION already is a member of the +list but AT is not, then leave FUNCTION where ever it already is. + +If optional LOCAL is non-nil, then modify the hook's buffer-local +value rather than its global value. This makes the hook local by +copying the default value. That copy is then modified. + +HOOK should be a symbol. If HOOK is void, it is first set to nil. +HOOK's value must not be a single hook function. FUNCTION should +be a function that takes no arguments and inserts one or multiple +sections at point, moving point forward. FUNCTION may choose not +to insert its section(s), when doing so would not make sense. It +should not be abused for other side-effects. To remove FUNCTION +again use `remove-hook'. + +(fn HOOK FUNCTION &optional AT APPEND LOCAL)") +(autoload 'magit--handle-bookmark "magit-section" "\ +Open a bookmark created by `magit--make-bookmark'. + +Call the generic function `magit-bookmark-get-buffer-create' to get +the appropriate buffer without displaying it. + +Then call the `magit-*-setup-buffer' function of the the major-mode +with the variables' values as arguments, which were recorded by +`magit--make-bookmark'. + +(fn BOOKMARK)") +(register-definition-prefixes "magit-section" '("context-menu-region" "isearch-clean-overlays" "magit-")) + +;;; End of scraped data + +(provide 'magit-section-autoloads) + +;; Local Variables: +;; version-control: never +;; no-byte-compile: t +;; no-update-autoloads: t +;; no-native-compile: t +;; coding: utf-8-emacs-unix +;; End: + +;;; magit-section-autoloads.el ends here diff --git a/elpa/magit-section-20240508.2349/magit-section-pkg.el b/elpa/magit-section-20240730.1741/magit-section-pkg.el similarity index 62% rename from elpa/magit-section-20240508.2349/magit-section-pkg.el rename to elpa/magit-section-20240730.1741/magit-section-pkg.el index 42c24eed..8c62b0b0 100644 --- a/elpa/magit-section-20240508.2349/magit-section-pkg.el +++ b/elpa/magit-section-20240730.1741/magit-section-pkg.el @@ -1,8 +1,8 @@ -(define-package "magit-section" "20240508.2349" "Sections for read-only buffers." +(define-package "magit-section" "20240730.1741" "Sections for read-only buffers." '((emacs "26.1") - (compat "29.1.4.5") - (dash "20240405")) - :commit "855d924969eb6231d62ab446f727c9f7ad5c4913" :authors + (compat "30.0.0.0") + (dash "20240510")) + :commit "d9ff4e8b3a8203454bfcbedfbac378a80cd6c8fe" :authors '(("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev")) :maintainer '("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev") diff --git a/elpa/magit-section-20240508.2349/magit-section.el b/elpa/magit-section-20240730.1741/magit-section.el similarity index 97% rename from elpa/magit-section-20240508.2349/magit-section.el rename to elpa/magit-section-20240730.1741/magit-section.el index 5e020c70..e12deef8 100644 --- a/elpa/magit-section-20240508.2349/magit-section.el +++ b/elpa/magit-section-20240730.1741/magit-section.el @@ -11,7 +11,7 @@ ;; Package-Version: 3.3.0.50-git ;; Package-Requires: ( ;; (emacs "26.1") -;; (compat "29.1.4.5") +;; (compat "30.0.0.0") ;; (dash "2.19.1") ;; (seq "2.24")) @@ -447,6 +447,7 @@ if any." "Parent major mode from which major modes with Magit-like sections inherit. Magit-Section is documented in info node `(magit-section)'." + :interactive nil :group 'magit-section (buffer-disable-undo) (setq truncate-lines t) @@ -459,7 +460,6 @@ Magit-Section is documented in info node `(magit-section)'." (setq show-trailing-whitespace nil) (setq-local symbol-overlay-inhibit-map t) (setq list-buffers-directory (abbreviate-file-name default-directory)) - ;; (hack-dir-local-variables-non-file-buffer) (make-local-variable 'text-property-default-nonsticky) (push (cons 'keymap t) text-property-default-nonsticky) (add-hook 'pre-command-hook #'magit-section-pre-command-hook nil t) @@ -596,9 +596,8 @@ instead of in the one whose root `magit-root-section' is." (defun magit-section-lineage (section &optional raw) "Return the lineage of SECTION. -If optional RAW is non-nil, return a list of section object -beginning with SECTION, otherwise return a list of section -types." +If optional RAW is non-nil, return a list of section objects, beginning +with SECTION, otherwise return a list of section types." (cons (if raw section (oref section type)) (and-let* ((parent (oref section parent))) (magit-section-lineage parent raw)))) @@ -774,12 +773,11 @@ Slight trimmed down." (magit--menu-bar-keymap keymap)))) menu) -(advice-add 'context-menu-region :around - (lambda (fn menu click) - "Disable in `magit-section-mode' buffers." - (if (derived-mode-p 'magit-section-mode) - menu - (funcall fn menu click)))) +(define-advice context-menu-region (:around (fn menu click) magit-section-mode) + "Disable in `magit-section-mode' buffers." + (if (derived-mode-p 'magit-section-mode) + menu + (funcall fn menu click))) ;;; Commands ;;;; Movement @@ -882,14 +880,24 @@ If there is no previous sibling section, then move to the parent." (unless (pos-visible-in-window-p (oref section end)) (set-window-start (selected-window) (oref section start)))) -(defmacro magit-define-section-jumper (name heading type &optional value) +(defmacro magit-define-section-jumper + (name heading type &optional value inserter &rest properties) "Define an interactive function to go some section. Together TYPE and VALUE identify the section. HEADING is the displayed heading of the section." (declare (indent defun)) - `(defun ,name (&optional expand) + `(transient-define-suffix ,name (&optional expand) ,(format "Jump to the section \"%s\". With a prefix argument also expand it." heading) + ,@properties + ,@(and (not (plist-member properties :description)) + (list :description heading)) + ,@(and inserter + `(:if (lambda () (memq ',inserter + (bound-and-true-p magit-status-sections-hook))))) + :inapt-if-not (lambda () (magit-get-section + (cons (cons ',type ,value) + (magit-section-ident magit-root-section)))) (interactive "P") (if-let ((section (magit-get-section (cons (cons ',type ,value) @@ -1527,16 +1535,31 @@ its body cannot be collapsed. If a section does have a heading, then its height must be exactly one line, including a trailing newline character. This isn't enforced, you are responsible for getting it right. The only exception is that this function does -insert a newline character if necessary." +insert a newline character if necessary + +If provided, optional CHILD-COUNT must evaluate to an integer or +boolean. If t, then the count is determined once the children have been +inserted, using `magit-insert-child-count' (which see). For historic +reasons, if the heading ends with \":\", the count is substituted for +that, at this time as well. If `magit-section-show-child-count' is nil, +no counts are inserted + +\n(fn [CHILD-COUNT] &rest STRINGS)" (declare (indent defun)) (when args - (let ((heading (apply #'concat args))) + (let ((count (and (or (integerp (car args)) + (booleanp (car args))) + (pop args))) + (heading (apply #'concat args))) (insert (if (or (text-property-not-all 0 (length heading) 'font-lock-face nil heading) (text-property-not-all 0 (length heading) 'face nil heading)) heading - (propertize heading 'font-lock-face 'magit-section-heading))))) + (propertize heading 'font-lock-face 'magit-section-heading))) + (when (and count magit-section-show-child-count) + (insert (propertize (format " (%s)" count) + 'font-lock-face 'magit-section-child-count))))) (unless (bolp) (insert ?\n)) (when (fboundp 'magit-maybe-make-margin-overlay) @@ -1624,16 +1647,25 @@ with \" (N)\", where N is the number of child sections. This function is called by `magit-insert-section' after that has evaluated its BODY. Admittedly that's a bit of a hack." (let (content count) - (when (and magit-section-show-child-count - (setq content (oref section content)) - (setq count (length (oref section children))) - (> count 0) - (eq (char-before (1- content)) ?:)) + (cond + ((not (and magit-section-show-child-count + (setq content (oref section content)) + (setq count (length (oref section children))) + (> count 0)))) + ((eq (char-before (- content 1)) ?:) (save-excursion (goto-char (- content 2)) (insert (magit--propertize-face (format " (%s)" count) 'magit-section-child-count)) - (delete-char 1))))) + (delete-char 1))) + ((and (eq (char-before (- content 4)) ?\s) + (eq (char-before (- content 3)) ?\() + (eq (char-before (- content 2)) ?t ) + (eq (char-before (- content 1)) ?\))) + (save-excursion + (goto-char (- content 3)) + (delete-char 1) + (insert (format "%s" count))))))) ;;; Highlight @@ -1762,10 +1794,10 @@ invisible." (kill-local-variable 'redisplay-unhighlight-region-function) (when magit-show-long-lines-warning (setq magit-show-long-lines-warning nil) - (display-warning 'magit "\ + (display-warning 'magit (format "\ Emacs has enabled redisplay shortcuts in this buffer because there are lines whose length go beyond -`long-line-treshold' \(%s characters). As a result, section +`long-line-threshold' \(%s characters). As a result, section highlighting and the special appearance of the region has been disabled. Some existing highlighting might remain in effect. @@ -1775,7 +1807,7 @@ and recreate the buffer. This message won't be shown for this session again. To disable it for all future sessions, set `magit-show-long-lines-warning' -to nil." :warning))) +to nil." (bound-and-true-p long-line-threshold)) :warning))) (cl-defgeneric magit-section-get-relative-position (section)) @@ -1981,7 +2013,7 @@ When `magit-section-preserve-visibility' is nil, do nothing." (or (eq search-invisible t) (not (isearch-range-invisible beg end)))) -(defun isearch-clean-overlays@magit-mode (fn) +(define-advice isearch-clean-overlays (:around (fn) magit-mode) (if (derived-mode-p 'magit-mode) (let ((pos (point))) (dolist (section magit-section--opened-sections) @@ -1990,9 +2022,6 @@ When `magit-section-preserve-visibility' is nil, do nothing." (setq magit-section--opened-sections nil)) (funcall fn))) -(advice-add 'isearch-clean-overlays :around - #'isearch-clean-overlays@magit-mode) - ;;; Utilities (cl-defun magit-section-selected-p (section &optional (selection nil sselection)) @@ -2121,6 +2150,7 @@ If optional SECTION is nil, use the current section." FUNCTION has to move point forward or return nil." (while (and (not (eobp)) (funcall function)))) +;;;###autoload (defun magit-add-section-hook (hook function &optional at append local) "Add to the value of section hook HOOK the function FUNCTION. @@ -2368,6 +2398,7 @@ and the buffer-local values of the variables referenced in its bookmark) (user-error "Bookmarking is not implemented for %s buffers" major-mode))) +;;;###autoload (defun magit--handle-bookmark (bookmark) "Open a bookmark created by `magit--make-bookmark'. @@ -2377,6 +2408,7 @@ the appropriate buffer without displaying it. Then call the `magit-*-setup-buffer' function of the the major-mode with the variables' values as arguments, which were recorded by `magit--make-bookmark'." + (require (quote magit-bookmark) nil t) (let ((buffer (magit-bookmark-get-buffer-create bookmark (bookmark-prop-get bookmark 'mode)))) @@ -2411,7 +2443,7 @@ with the variables' values as arguments, which were recorded by ;;; Bitmaps -(when (fboundp 'define-fringe-bitmap) +(when (fboundp 'define-fringe-bitmap) ;for Emacs 26 (define-fringe-bitmap 'magit-fringe-bitmap+ [#b00000000 #b00011000 @@ -2421,6 +2453,7 @@ with the variables' values as arguments, which were recorded by #b00011000 #b00011000 #b00000000]) + (define-fringe-bitmap 'magit-fringe-bitmap- [#b00000000 #b00000000 @@ -2440,6 +2473,7 @@ with the variables' values as arguments, which were recorded by #b00110000 #b01100000 #b00000000]) + (define-fringe-bitmap 'magit-fringe-bitmapv [#b00000000 #b10000010 @@ -2459,6 +2493,7 @@ with the variables' values as arguments, which were recorded by #b00111000 #b01110000 #b11100000]) + (define-fringe-bitmap 'magit-fringe-bitmap-boldv [#b10000001 #b11000011 diff --git a/elpa/magit-section-20240508.2349/magit-section.info b/elpa/magit-section-20240730.1741/magit-section.info similarity index 94% rename from elpa/magit-section-20240508.2349/magit-section.info rename to elpa/magit-section-20240730.1741/magit-section.info index 9106cc76..f35a1394 100644 --- a/elpa/magit-section-20240508.2349/magit-section.info +++ b/elpa/magit-section-20240730.1741/magit-section.info @@ -1,4 +1,4 @@ -This is magit-section.info, produced by makeinfo version 6.7 from +This is magit-section.info, produced by makeinfo version 6.8 from magit-section.texi. Copyright (C) 2015-2024 Jonas Bernoulli @@ -121,7 +121,7 @@ File: magit-section.info, Node: Creating Sections, Next: Core Functions, Prev section by washing Git’s output and Git didn’t actually output anything this time around. - -- Function: magit-insert-heading &rest args + -- Function: magit-insert-heading [child-count] &rest args Insert the heading for the section currently being inserted. This function should only be used inside ‘magit-insert-section’. @@ -149,6 +149,13 @@ File: magit-section.info, Node: Creating Sections, Next: Core Functions, Prev right. The only exception is that this function does insert a newline character if necessary. + If provided, optional CHILD-COUNT must evaluate to an integer or + boolean. If t, then the count is determined once the children have + been inserted, using ‘magit-insert-child-count’ (which see). For + historic reasons, if the heading ends with ":", the count is + substituted for that, at this time as well. If + ‘magit-section-show-child-count’ is nil, no counts are inserted + -- Macro: magit-insert-section-body &rest body Use BODY to insert the section body, once the section is expanded. If the section is expanded when it is created, then this is like @@ -200,9 +207,10 @@ Function magit-section-at &optional position then search in that section tree instead of in the one whose root ‘magit-root-section’ is. - -- Function: magit-section-lineage section - Return the lineage of SECTION. The return value has the form - ‘(TYPE...)’. + -- Function: magit-section-lineage section &optional raw + Return the lineage of SECTION. If optional RAW is non-nil, return + a list of section objects, beginning with SECTION, otherwise return + a list of section types. -- Function: magit-section-content-p section Return non-nil if SECTION has content or an unused washer function. @@ -298,8 +306,8 @@ Tag Table: Node: Top808 Node: Introduction2116 Node: Creating Sections2886 -Node: Core Functions7394 -Node: Matching Functions10446 +Node: Core Functions7819 +Node: Matching Functions10971  End Tag Table diff --git a/elpa/transient-20240421.1737/dir b/elpa/transient-20240729.1524/dir similarity index 100% rename from elpa/transient-20240421.1737/dir rename to elpa/transient-20240729.1524/dir diff --git a/elpa/transient-20240421.1737/gpl.info b/elpa/transient-20240729.1524/gpl.info similarity index 99% rename from elpa/transient-20240421.1737/gpl.info rename to elpa/transient-20240729.1524/gpl.info index 094dde78..3a659dea 100644 --- a/elpa/transient-20240421.1737/gpl.info +++ b/elpa/transient-20240729.1524/gpl.info @@ -1,4 +1,4 @@ -This is gpl.info, produced by makeinfo version 6.7 from gpl.texi. +This is gpl.info, produced by makeinfo version 6.8 from gpl.texi. Version 3, 29 June 2007 diff --git a/elpa/transient-20240421.1737/transient-autoloads.el b/elpa/transient-20240729.1524/transient-autoloads.el similarity index 97% rename from elpa/transient-20240421.1737/transient-autoloads.el rename to elpa/transient-20240729.1524/transient-autoloads.el index 93700ed1..df3d3674 100644 --- a/elpa/transient-20240421.1737/transient-autoloads.el +++ b/elpa/transient-20240729.1524/transient-autoloads.el @@ -61,7 +61,7 @@ See info node `(transient)Modifying Existing Transients'. (fn PREFIX LOC)") (function-put 'transient-remove-suffix 'lisp-indent-function 'defun) -(register-definition-prefixes "transient" '("static-if" "transient")) +(register-definition-prefixes "transient" '("find-function-advised-original" "transient")) ;;; End of scraped data diff --git a/elpa/transient-20240421.1737/transient-pkg.el b/elpa/transient-20240729.1524/transient-pkg.el similarity index 71% rename from elpa/transient-20240421.1737/transient-pkg.el rename to elpa/transient-20240729.1524/transient-pkg.el index 5aac0067..178fb458 100644 --- a/elpa/transient-20240421.1737/transient-pkg.el +++ b/elpa/transient-20240729.1524/transient-pkg.el @@ -1,8 +1,8 @@ -(define-package "transient" "20240421.1737" "Transient commands" +(define-package "transient" "20240729.1524" "Transient commands" '((emacs "26.1") - (compat "29.1.4.4") + (compat "30.0.0.0") (seq "2.24")) - :commit "2dd0102ec3df901d421fc338e5c768467cc54ecf" :authors + :commit "6543000d5a509096f0f98eb4b814d7f6f2114ce3" :authors '(("Jonas Bernoulli" . "emacs.transient@jonas.bernoulli.dev")) :maintainers '(("Jonas Bernoulli" . "emacs.transient@jonas.bernoulli.dev")) diff --git a/elpa/transient-20240421.1737/transient.el b/elpa/transient-20240729.1524/transient.el similarity index 93% rename from elpa/transient-20240421.1737/transient.el rename to elpa/transient-20240729.1524/transient.el index a58eb2e8..9630be66 100644 --- a/elpa/transient-20240421.1737/transient.el +++ b/elpa/transient-20240729.1524/transient.el @@ -6,8 +6,8 @@ ;; Homepage: https://github.com/magit/transient ;; Keywords: extensions -;; Package-Version: 0.6.0 -;; Package-Requires: ((emacs "26.1") (compat "29.1.4.4") (seq "2.24")) +;; Package-Version: 0.7.3 +;; Package-Requires: ((emacs "26.1") (compat "30.0.0.0") (seq "2.24")) ;; SPDX-License-Identifier: GPL-3.0-or-later @@ -41,7 +41,7 @@ (require 'format-spec) (eval-and-compile - (when (and (featurep' seq) + (when (and (featurep 'seq) (not (fboundp 'seq-keep))) (unload-feature 'seq 'force))) (require 'seq) @@ -85,17 +85,6 @@ similar defect.") :emergency)) (defvar Man-notify-method) (defvar pp-default-function) ; since Emacs 29.1 -(defmacro static-if (condition then-form &rest else-forms) - "A conditional compilation macro. -Evaluate CONDITION at macro-expansion time. If it is non-nil, -expand the macro to THEN-FORM. Otherwise expand it to ELSE-FORMS -enclosed in a `progn' form. ELSE-FORMS may be empty." - (declare (indent 2) - (debug (sexp sexp &rest sexp))) - (if (eval condition lexical-binding) - then-form - (cons 'progn else-forms))) - (defmacro transient--with-emergency-exit (id &rest body) (declare (indent defun)) (unless (keywordp id) @@ -724,24 +713,12 @@ the prototype is stored in the clone's `prototype' slot.") (if-not-derived :initarg :if-not-derived :initform nil - :documentation "Enable if major-mode does not derive from value.")) - "Abstract superclass for group and suffix classes. - -It is undefined what happens if more than one `if*' predicate -slot is non-nil." - :abstract t) - -(defclass transient-suffix (transient-child) - ((definition :allocation :class :initform nil) - (key :initarg :key) - (command :initarg :command) - (transient :initarg :transient) - (format :initarg :format :initform " %k %d") - (description :initarg :description :initform nil) - (face :initarg :face :initform nil) - (show-help :initarg :show-help :initform nil) - (inapt-face :initarg :inapt-face :initform 'transient-inapt-suffix) - (inapt :initform nil) + :documentation "Enable if major-mode does not derive from value.") + (inapt + :initform nil) + (inapt-face + :initarg :inapt-face + :initform 'transient-inapt-suffix) (inapt-if :initarg :inapt-if :initform nil @@ -774,6 +751,21 @@ slot is non-nil." :initarg :inapt-if-not-derived :initform nil :documentation "Inapt if major-mode does not derive from value.")) + "Abstract superclass for group and suffix classes. + +It is undefined what happens if more than one `if*' predicate +slot is non-nil." + :abstract t) + +(defclass transient-suffix (transient-child) + ((definition :allocation :class :initform nil) + (key :initarg :key) + (command :initarg :command) + (transient :initarg :transient) + (format :initarg :format :initform " %k %d") + (description :initarg :description :initform nil) + (face :initarg :face :initform nil) + (show-help :initarg :show-help :initform nil)) "Superclass for suffix command.") (defclass transient-information (transient-suffix) @@ -835,6 +827,11 @@ Technically a suffix object with no associated command.") All remaining arguments are treated as files. They become the value of this argument.") +(defclass transient-value-preset (transient-suffix) + ((transient :initform t) + (set :initarg := :initform nil)) + "Class used by the `transient-preset' suffix command.") + ;;;; Group (defclass transient-group (transient-child) @@ -916,8 +913,9 @@ to the setup function: [&optional ("interactive" interactive) def-body])) (indent defun) (doc-string 3)) - (pcase-let ((`(,class ,slots ,suffixes ,docstr ,body ,interactive-only) - (transient--expand-define-args args arglist))) + (pcase-let + ((`(,class ,slots ,suffixes ,docstr ,body ,interactive-only) + (transient--expand-define-args args arglist 'transient-define-prefix))) `(progn (defalias ',name ,(if body @@ -956,8 +954,9 @@ ARGLIST. The infix arguments are usually accessed by using [&optional ("interactive" interactive) def-body])) (indent defun) (doc-string 3)) - (pcase-let ((`(,class ,slots ,_ ,docstr ,body ,interactive-only) - (transient--expand-define-args args arglist))) + (pcase-let + ((`(,class ,slots ,_ ,docstr ,body ,interactive-only) + (transient--expand-define-args args arglist 'transient-define-suffix))) `(progn (defalias ',name ,(if (and (not body) class (oref-default class definition)) @@ -968,6 +967,18 @@ ARGLIST. The infix arguments are usually accessed by using (put ',name 'transient--suffix (,(or class 'transient-suffix) :command ',name ,@slots))))) +(defmacro transient-augment-suffix (name &rest args) + "Augment existing command NAME with a new transient suffix object. +Similar to `transient-define-suffix' but define a suffix object only. +\n\(fn NAME [KEYWORD VALUE]...)" + (declare (debug (&define name [&rest keywordp sexp])) + (indent defun)) + (pcase-let + ((`(,class ,slots) + (transient--expand-define-args args nil 'transient-augment-suffix t))) + `(put ',name 'transient--suffix + (,(or class 'transient-suffix) :command ',name ,@slots)))) + (defmacro transient-define-infix (name arglist &rest args) "Define NAME as a transient infix command. @@ -1005,8 +1016,9 @@ keyword. [&rest keywordp sexp])) (indent defun) (doc-string 3)) - (pcase-let ((`(,class ,slots ,_ ,docstr ,_ ,interactive-only) - (transient--expand-define-args args arglist t))) + (pcase-let + ((`(,class ,slots ,_ ,docstr ,_ ,interactive-only) + (transient--expand-define-args args arglist 'transient-define-infix t))) `(progn (defalias ',name #'transient--default-infix-command) (put ',name 'interactive-only ,interactive-only) @@ -1049,7 +1061,8 @@ falling back to that of the same aliased command." (put 'transient--default-infix-command 'completion-predicate #'transient--suffix-only) -(defun transient--find-function-advised-original (fn func) +(define-advice find-function-advised-original + (:around (fn func) transient-default-infix) "Return nil instead of `transient--default-infix-command'. When using `find-function' to jump to the definition of a transient infix command/argument, then we want to actually jump to that, not to @@ -1057,11 +1070,12 @@ the definition of `transient--default-infix-command', which all infix commands are aliases for." (let ((val (funcall fn func))) (and val (not (eq val 'transient--default-infix-command)) val))) -(advice-add 'find-function-advised-original :around - #'transient--find-function-advised-original) -(eval-and-compile - (defun transient--expand-define-args (args &optional arglist nobody) +(eval-and-compile ;transient--expand-define-args + (defun transient--expand-define-args (args &optional arglist form nobody) + ;; ARGLIST and FORM are only optional for backward compatibility. + ;; This is necessary because "emoji.el" from Emacs 29 calls this + ;; function directly, with just one argument. (unless (listp arglist) (error "Mandatory ARGLIST is missing")) (let (class keys suffixes docstr declare (interactive-only t)) @@ -1089,9 +1103,9 @@ commands are aliases for." (cond ((not args)) (nobody - (error "transient-define-infix: No function body allowed")) + (error "%s: No function body allowed" form)) ((not (eq (car-safe (nth (if declare 1 0) args)) 'interactive)) - (error "transient-define-*: Interactive form missing"))) + (error "%s: Interactive form missing" form))) (list (if (eq (car-safe class) 'quote) (cadr class) class) @@ -1272,7 +1286,7 @@ symbol property.") (when (and (boundp 'read-extended-command-predicate) ; since Emacs 28.1 (not read-extended-command-predicate)) (setq read-extended-command-predicate - 'transient-command-completion-not-suffix-only-p)) + #'transient-command-completion-not-suffix-only-p)) (defun transient-parse-suffix (prefix suffix) "Parse SUFFIX, to be added to PREFIX. @@ -1281,7 +1295,7 @@ SUFFIX is a suffix command or a group specification (of the same forms as expected by `transient-define-prefix'). Intended for use in a group's `:setup-children' function." (cl-assert (and prefix (symbolp prefix))) - (eval (car (transient--parse-child prefix suffix)))) + (eval (car (transient--parse-child prefix suffix)) t)) (defun transient-parse-suffixes (prefix suffixes) "Parse SUFFIXES, to be added to PREFIX. @@ -1301,7 +1315,7 @@ Intended for use in a group's `:setup-children' function." (string suffix))) (mem (transient--layout-member loc prefix)) (elt (car mem))) - (setq suf (eval suf)) + (setq suf (eval suf t)) (cond ((not mem) (message "Cannot insert %S into %s; %s not found" @@ -1533,6 +1547,9 @@ That buffer is current and empty when this hook runs.") (defvar transient--buffer-name " *transient*" "Name of the transient buffer.") +(defvar transient--buffer nil + "The transient menu buffer.") + (defvar transient--window nil "The window used to display the transient popup buffer.") @@ -1574,6 +1591,31 @@ This is bound while the suffixes are drawn in the transient buffer.") ;;; Identities +(defun transient-active-prefix (&optional prefixes) + "Return the active transient object. + +Return nil if there is no active transient, if the transient buffer +isn't shown, and while the active transient is suspended (e.g., while +the minibuffer is in use). + +Unlike `transient-current-prefix', which is only ever non-nil in code +that is run directly by a command that is invoked while a transient +is current, this function is also suitable for use in asynchronous +code, such as timers and callbacks (this function's main use-case). + +If optional PREFIXES is non-nil, it must be a list of prefix command +symbols, in which case the active transient object is only returned +if it matches one of the PREFIXES." + (and transient--showp + transient--prefix + (or (not prefixes) + (memq (oref transient--prefix command) prefixes)) + (or (memq 'transient--pre-command pre-command-hook) + (and (memq t pre-command-hook) + (memq 'transient--pre-command + (default-value 'pre-command-hook)))) + transient--prefix)) + (defun transient-prefix-object () "Return the current prefix as an object. @@ -1763,7 +1805,8 @@ to `transient-predicate-map'. Also see `transient-base-map'." "Hide common commands" "Show common permanently"))) (list "C-x l" "Show/hide suffixes" #'transient-set-level) - (list "C-x a" #'transient-toggle-level-limit)))))))) + (list "C-x a" #'transient-toggle-level-limit))))) + t))) (defvar-keymap transient-popup-navigation-map :doc "One of the keymaps used when popup navigation is enabled. @@ -2002,7 +2045,7 @@ transient. In that case NAME is mandatory, LAYOUT and EDIT must be nil and PARAMS may be (but usually is not) used to set, e.g., the \"scope\" of the transient (see `transient-define-prefix'). -This function is also called internally in which case LAYOUT and +This function is also called internally, in which case LAYOUT and EDIT may be non-nil." (transient--debug 'setup) (transient--with-emergency-exit :setup @@ -2070,7 +2113,7 @@ value. Otherwise return CHILDREN as is." (defun transient--init-suffixes (name) (let ((levels (alist-get name transient-levels))) - (cl-mapcan (lambda (c) (transient--init-child levels c)) + (cl-mapcan (lambda (c) (transient--init-child levels c nil)) (append (get name 'transient--layout) (and (not transient--editp) (get 'transient-common-commands @@ -2088,24 +2131,29 @@ value. Otherwise return CHILDREN as is." (list def))))) (cl-mapcan #'s layout))) -(defun transient--init-child (levels spec) +(defun transient--init-child (levels spec parent) (cl-etypecase spec - (vector (transient--init-group levels spec)) - (list (transient--init-suffix levels spec)) + (vector (transient--init-group levels spec parent)) + (list (transient--init-suffix levels spec parent)) (string (list spec)))) -(defun transient--init-group (levels spec) +(defun transient--init-group (levels spec parent) (pcase-let ((`(,level ,class ,args ,children) (append spec nil))) (and-let* (((transient--use-level-p level)) (obj (apply class :level level args)) ((transient--use-suffix-p obj)) - (suffixes (cl-mapcan (lambda (c) (transient--init-child levels c)) - (transient-setup-children obj children)))) + ((prog1 t + (when (or (and parent (oref parent inapt)) + (transient--inapt-suffix-p obj)) + (oset obj inapt t)))) + (suffixes (cl-mapcan + (lambda (c) (transient--init-child levels c obj)) + (transient-setup-children obj children)))) (progn ; work around debbugs#31840 (oset obj suffixes suffixes) (list obj))))) -(defun transient--init-suffix (levels spec) +(defun transient--init-suffix (levels spec parent) (pcase-let* ((`(,level ,class ,args) spec) (cmd (plist-get args :command)) (key (transient--kbd (plist-get args :key))) @@ -2138,7 +2186,8 @@ value. Otherwise return CHILDREN as is." (unless (cl-typep obj 'transient-information) (transient--init-suffix-key obj)) (when (transient--use-suffix-p obj) - (if (transient--inapt-suffix-p obj) + (if (or (and parent (oref parent inapt)) + (transient--inapt-suffix-p obj)) (oset obj inapt t) (transient-init-scope obj) (transient-init-value obj)) @@ -2251,6 +2300,12 @@ value. Otherwise return CHILDREN as is." (transient--pop-keymap 'transient--predicate-map) (transient--pop-keymap 'transient--transient-map) (transient--pop-keymap 'transient--redisplay-map) + (if (eq transient--refreshp 'updated-value) + ;; Preserve the prefix value this once, because the + ;; invoked suffix indicates that it has updated that. + (setq transient--refreshp (oref transient--prefix refresh-suffixes)) + ;; Otherwise update the prefix value from suffix values. + (oset transient--prefix value (transient-get-value))) (transient--init-objects) (transient--init-keymaps) (transient--push-keymap 'transient--transient-map) @@ -2327,8 +2382,9 @@ value. Otherwise return CHILDREN as is." 'other) (with-demoted-errors "Error while exiting transient: %S" (delete-window transient--window))) - (when-let ((buffer (get-buffer transient--buffer-name))) - (kill-buffer buffer)) + (when (buffer-live-p transient--buffer) + (kill-buffer transient--buffer)) + (setq transient--buffer nil) (when remain-in-minibuffer-window (select-window remain-in-minibuffer-window))))) @@ -2499,7 +2555,7 @@ value. Otherwise return CHILDREN as is." ;; We cannot use `current-prefix-arg' because it is set ;; too late (in `command-execute'), and if it were set ;; earlier, then we likely still would not be able to - ;; rely on it and `prefix-command-preserve-state-hook' + ;; rely on it, and `prefix-command-preserve-state-hook' ;; would have to be used to record that a universal ;; argument is in effect. (not prefix-arg))) @@ -2511,7 +2567,10 @@ value. Otherwise return CHILDREN as is." (transient--pop-keymap 'transient--redisplay-map) (setq transient--redisplay-map new) (transient--push-keymap 'transient--redisplay-map)) - (transient--redisplay))))))) + (transient--redisplay))))) + (setq transient-current-prefix nil) + (setq transient-current-command nil) + (setq transient-current-suffixes nil))) (defun transient--post-exit (&optional command) (transient--debug 'post-exit) @@ -2534,9 +2593,6 @@ value. Otherwise return CHILDREN as is." (remove-hook 'pre-command-hook #'transient--pre-command) (remove-hook 'post-command-hook #'transient--post-command) (advice-remove 'recursive-edit #'transient--recursive-edit)) - (setq transient-current-prefix nil) - (setq transient-current-command nil) - (setq transient-current-suffixes nil) (let ((resume (and transient--stack (not (memq transient--exitp '(replace suspend)))))) (unless (or resume (eq transient--exitp 'replace)) @@ -2577,8 +2633,7 @@ value. Otherwise return CHILDREN as is." mouse-set-region)) (equal (key-description (this-command-keys-vector)) "")) - (and (eq (current-buffer) - (get-buffer transient--buffer-name))))) + (and (eq (current-buffer) transient--buffer)))) (transient--show)) (when (and (numberp transient-show-popup) (not (zerop transient-show-popup)) @@ -2606,10 +2661,12 @@ value. Otherwise return CHILDREN as is." (if (symbolp arg) (message "-- %-22s (cmd: %s, event: %S, exit: %s%s)" arg - (or (and (symbolp this-command) this-command) - (if (byte-code-function-p this-command) - "#[...]" - this-command)) + (cond ((and (symbolp this-command) this-command)) + ((fboundp 'help-fns-function-name) + (help-fns-function-name this-command)) + ((byte-code-function-p this-command) + "#[...]") + (this-command)) (key-description (this-command-keys-vector)) transient--exitp (cond ((keywordp (car args)) @@ -3014,7 +3071,7 @@ transient is active." (interactive) (transient-set-value (transient-prefix-object))) -(defalias 'transient-set-and-exit 'transient-set +(defalias 'transient-set-and-exit #'transient-set "Set active transient's value for this Emacs session and exit.") (defun transient-save () @@ -3022,7 +3079,7 @@ transient is active." (interactive) (transient-save-value (transient-prefix-object))) -(defalias 'transient-save-and-exit 'transient-save +(defalias 'transient-save-and-exit #'transient-save "Save active transient's value for this and future Emacs sessions and exit.") (defun transient-reset () @@ -3055,6 +3112,12 @@ transient is active." (oset obj value (nth pos hst)) (mapc #'transient-init-value transient--suffixes)))) +(transient-define-suffix transient-preset () + "Put this preset into action." + :class transient-value-preset + (interactive) + (transient-prefix-set (oref (transient-suffix-object) set))) + ;;;; Auxiliary (defun transient-toggle-common () @@ -3232,7 +3295,7 @@ it\", in which case it is pointless to preserve history.)" (reader (oref obj reader)) (choices (if (functionp choices) (funcall choices) choices)) (prompt (transient-prompt obj)) - (value (if multi-value (mapconcat #'identity value ",") value)) + (value (if multi-value (string-join value ",") value)) (history-key (or (oref obj history-key) (oref obj command))) (transient--history (alist-get history-key transient-history)) @@ -3379,10 +3442,10 @@ prompt." ;;;; Set (cl-defgeneric transient-infix-set (obj value) - "Set the value of infix object OBJ to value.") + "Set the value of infix object OBJ to VALUE.") (cl-defmethod transient-infix-set ((obj transient-infix) value) - "Set the value of infix object OBJ to value." + "Set the value of infix object OBJ to VALUE." (oset obj value value)) (cl-defmethod transient-infix-set :after ((obj transient-argument) value) @@ -3412,8 +3475,16 @@ prompt." (member arg incomp))))) (transient-infix-set obj nil))))) +(defun transient-prefix-set (value) + "Set the value of the active transient prefix to VALUE. +Intended for use by transient suffix commands." + (oset transient--prefix value value) + (setq transient--refreshp 'updated-value)) + (cl-defgeneric transient-set-value (obj) - "Set the value of the transient prefix OBJ.") + "Persist the value of the transient prefix OBJ. +Only intended for use by `transient-set'. +Also see `transient-prefix-set'.") (cl-defmethod transient-set-value ((obj transient-prefix)) (oset (oref obj prototype) value (transient-get-value)) @@ -3469,7 +3540,7 @@ the set, saved or default value for PREFIX." (and (or (not (slot-exists-p obj 'unsavable)) (not (oref obj unsavable))) (transient--get-wrapped-value obj))) - transient-current-suffixes))) + (or transient--suffixes transient-current-suffixes)))) (defun transient--get-wrapped-value (obj) (and-let* ((value (transient-infix-value obj))) @@ -3614,9 +3685,9 @@ have a history of their own.") (transient--timer-cancel) (setq transient--showp t) (let ((transient--shadowed-buffer (current-buffer)) - (buf (get-buffer-create transient--buffer-name)) (focus nil)) - (with-current-buffer buf + (setq transient--buffer (get-buffer-create transient--buffer-name)) + (with-current-buffer transient--buffer (when transient-enable-popup-navigation (setq focus (or (button-get (point) 'command) (and (not (bobp)) @@ -3649,7 +3720,8 @@ have a history of their own.") (insert line))) (unless (window-live-p transient--window) (setq transient--window - (display-buffer buf transient-display-buffer-action))) + (display-buffer transient--buffer + transient-display-buffer-action))) (when (window-live-p transient--window) (with-selected-window transient--window (goto-char (point-min)) @@ -3680,7 +3752,7 @@ have a history of their own.") (propertize "\n" 'face face 'line-height t)))) (defmacro transient-with-shadowed-buffer (&rest body) - "While in the transient buffer, temporarly make the shadowed buffer current." + "While in the transient buffer, temporarily make the shadowed buffer current." (declare (indent 0) (debug t)) `(with-current-buffer (or transient--shadowed-buffer (current-buffer)) ,@body)) @@ -3692,9 +3764,8 @@ have a history of their own.") (transient-with-shadowed-buffer (funcall hide)))) (list group)))) - transient--layout)) - group) - (while (setq group (pop groups)) + transient--layout))) + (while-let ((group (pop groups))) (transient--insert-group group) (when groups (insert ?\n))))) @@ -3721,78 +3792,47 @@ have a history of their own.") (insert " ")) (insert ?\n)) -(cl-defmethod transient--insert-group ((group transient-column)) +(cl-defmethod transient--insert-group ((group transient-column) + &optional skip-empty) (transient--maybe-pad-keys group) (dolist (suffix (oref group suffixes)) (let ((str (transient-with-shadowed-buffer (transient-format suffix)))) - (insert str) - (unless (string-match-p ".\n\\'" str) - (insert ?\n))))) + (unless (and (not skip-empty) (equal str "")) + (insert str) + (unless (string-match-p ".\n\\'" str) + (insert ?\n)))))) (cl-defmethod transient--insert-group ((group transient-columns)) - (let* ((columns - (mapcar - (lambda (column) - (transient--maybe-pad-keys column group) - (transient-with-shadowed-buffer - (let* ((transient--pending-group column) - (rows (mapcar #'transient-format (oref column suffixes)))) - (when-let ((desc (transient-format-description column))) - (push desc rows)) - (flatten-tree rows)))) - (oref group suffixes))) - (vp (or (oref transient--prefix variable-pitch) - transient-align-variable-pitch)) - (rs (apply #'max (mapcar #'length columns))) - (cs (length columns)) - (cw (mapcar (let ((widths (oref transient--prefix column-widths))) - (lambda (col) - (apply - #'max - (if-let ((min (pop widths))) - (if vp (* min (transient--pixel-width " ")) min) - 0) - (mapcar (if vp #'transient--pixel-width #'length) - col)))) - columns)) - (cc (transient--seq-reductions-from - (apply-partially #'+ (* 3 (if vp (transient--pixel-width " ") 1))) - cw 0))) - (if transient-force-single-column - (dotimes (c cs) - (dotimes (r rs) - (when-let ((cell (nth r (nth c columns)))) - (unless (equal cell "") - (insert cell ?\n)))) - (unless (= c (1- cs)) - (insert ?\n))) - (dotimes (r rs) - (dotimes (c cs) - (if vp - (progn - (when-let ((cell (nth r (nth c columns)))) - (insert cell)) - (if (= c (1- cs)) - (insert ?\n) - (insert (propertize " " 'display - `(space :align-to (,(nth (1+ c) cc))))))) - (when (> c 0) - (insert (make-string (max 1 (- (nth c cc) (current-column))) - ?\s))) - (when-let ((cell (nth r (nth c columns)))) - (insert cell)) - (when (= c (1- cs)) - (insert ?\n)))))))) + (if transient-force-single-column + (dolist (group (oref group suffixes)) + (transient--insert-group group t)) + (let* ((columns + (mapcar + (lambda (column) + (transient--maybe-pad-keys column group) + (transient-with-shadowed-buffer + `(,@(and-let* ((desc (transient-format-description column))) + (list desc)) + ,@(let ((transient--pending-group column)) + (mapcar #'transient-format (oref column suffixes)))))) + (oref group suffixes))) + (stops (transient--column-stops columns))) + (dolist (row (apply #'transient--mapn #'list columns)) + (let ((stops stops)) + (dolist (cell row) + (let ((stop (pop stops))) + (when cell + (transient--align-to stop) + (insert cell))))) + (insert ?\n))))) (cl-defmethod transient--insert-group ((group transient-subgroups)) - (let* ((subgroups (oref group suffixes)) - (n (length subgroups))) - (dotimes (s n) - (let ((subgroup (nth s subgroups))) - (transient--maybe-pad-keys subgroup group) - (transient--insert-group subgroup) - (when (< s (1- n)) - (insert ?\n)))))) + (let ((subgroups (oref group suffixes))) + (while-let ((subgroup (pop subgroups))) + (transient--maybe-pad-keys subgroup group) + (transient--insert-group subgroup) + (when subgroups + (insert ?\n))))) (cl-defgeneric transient-format (obj) "Format and return OBJ for display. @@ -3924,28 +3964,40 @@ as a button." (cl-defgeneric transient-format-description (obj) "Format OBJ's `description' for display and return the result.") -(cl-defmethod transient-format-description ((obj transient-child)) +(cl-defmethod transient-format-description ((obj transient-suffix)) "The `description' slot may be a function, in which case that is called inside the correct buffer (see `transient--insert-group') and its value is returned to the caller." - (and-let* ((desc (oref obj description)) - (desc (if (functionp desc) - (if (= (car (transient--func-arity desc)) 1) - (funcall desc obj) - (funcall desc)) - desc))) - (if-let* ((face (transient--get-face obj 'face))) - (transient--add-face desc face t) - desc))) + (transient--get-description obj)) + +(cl-defmethod transient-format-description ((obj transient-value-preset)) + (pcase-let* (((eieio description key set) obj) + ((eieio value) transient--prefix) + (active (seq-set-equal-p set value))) + (format + "%s %s" + (propertize (or description (format "Preset %s" key)) + 'face (and active 'transient-argument)) + (format (propertize "(%s)" 'face 'transient-delimiter) + (mapconcat (lambda (arg) + (propertize + arg 'face (cond (active 'transient-argument) + ((member arg value) + '((:weight demibold) + transient-inactive-argument)) + ('transient-inactive-argument)))) + set " "))))) (cl-defmethod transient-format-description ((obj transient-group)) "Format the description by calling the next method. If the result doesn't use the `face' property at all, then apply the face `transient-heading' to the complete string." - (and-let* ((desc (cl-call-next-method obj))) - (if (text-property-not-all 0 (length desc) 'face nil desc) - desc - (propertize desc 'face 'transient-heading)))) + (and-let* ((desc (transient--get-description obj))) + (cond ((oref obj inapt) + (propertize desc 'face 'transient-inapt-suffix)) + ((text-property-not-all 0 (length desc) 'face nil desc) + desc) + ((propertize desc 'face 'transient-heading))))) (cl-defmethod transient-format-description :around ((obj transient-suffix)) "Format the description by calling the next method. If the result @@ -3955,8 +4007,11 @@ If the OBJ's `key' is currently unreachable, then apply the face (let ((desc (or (cl-call-next-method obj) (and (slot-boundp transient--prefix 'suffix-description) (funcall (oref transient--prefix suffix-description) - obj)) - (propertize "(BUG: no description)" 'face 'error)))) + obj))))) + (if desc + (when-let ((face (transient--get-face obj 'face))) + (setq desc (transient--add-face desc face t))) + (setq desc (propertize "(BUG: no description)" 'face 'error))) (when (if transient--all-levels-p (> (oref obj level) transient--default-prefix-level) (and transient-highlight-higher-levels @@ -4018,14 +4073,16 @@ If the OBJ's `key' is currently unreachable, then apply the face choices (propertize "|" 'face 'transient-delimiter)))))) -(defun transient--add-face (string face &optional append beg end) - (let ((str (copy-sequence string))) - (add-face-text-property (or beg 0) (or end (length str)) face append str) - str)) +(cl-defmethod transient--get-description ((obj transient-child)) + (and-let* ((desc (oref obj description))) + (if (functionp desc) + (if (= (car (transient--func-arity desc)) 1) + (funcall desc obj) + (funcall desc)) + desc))) -(defun transient--get-face (obj slot) - (and-let* (((slot-exists-p obj slot)) - ((slot-boundp obj slot)) +(cl-defmethod transient--get-face ((obj transient-suffix) slot) + (and-let* (((slot-boundp obj slot)) (face (slot-value obj slot))) (if (and (not (facep face)) (functionp face)) @@ -4035,6 +4092,11 @@ If the OBJ's `key' is currently unreachable, then apply the face (funcall face))) face))) +(defun transient--add-face (string face &optional append beg end) + (let ((str (copy-sequence string))) + (add-face-text-property (or beg 0) (or end (length str)) face append str) + str)) + (defun transient--key-face (&optional cmd enforce-type) (or (and transient-semantic-coloring (not transient--helpp) @@ -4060,12 +4122,13 @@ If the OBJ's `key' is currently unreachable, then apply the face (when-let ((pad (or (oref group pad-keys) (and parent (oref parent pad-keys))))) (oset group pad-keys - (apply #'max (cons (if (integerp pad) pad 0) - (seq-keep (lambda (suffix) - (and (eieio-object-p suffix) - (slot-boundp suffix 'key) - (length (oref suffix key)))) - (oref group suffixes))))))) + (apply #'max + (if (integerp pad) pad 0) + (seq-keep (lambda (suffix) + (and (eieio-object-p suffix) + (slot-boundp suffix 'key) + (length (oref suffix key)))) + (oref group suffixes)))))) (defun transient--pixel-width (string) (save-window-excursion @@ -4076,6 +4139,28 @@ If the OBJ's `key' is currently unreachable, then apply the face (car (window-text-pixel-size nil (line-beginning-position) (point)))))) +(defun transient--column-stops (columns) + (let* ((var-pitch (or transient-align-variable-pitch + (oref transient--prefix variable-pitch))) + (char-width (and var-pitch (transient--pixel-width " ")))) + (transient--seq-reductions-from + (apply-partially #'+ (* 2 (if var-pitch char-width 1))) + (transient--mapn + (lambda (cells min) + (apply #'max + (if min (if var-pitch (* min char-width) min) 0) + (mapcar (if var-pitch #'transient--pixel-width #'length) cells))) + columns + (oref transient--prefix column-widths)) + 0))) + +(defun transient--align-to (stop) + (unless (zerop stop) + (insert (if (or transient-align-variable-pitch + (oref transient--prefix variable-pitch)) + (propertize " " 'display `(space :align-to (,stop))) + (make-string (max 0 (- stop (current-column))) ?\s))))) + (defun transient-command-summary-or-name (obj) "Return the summary or name of the command represented by OBJ. @@ -4430,6 +4515,17 @@ we stop there." (push (funcall function (car acc) elt) acc)) (nreverse acc))) +(defun transient--mapn (function &rest lists) + "Apply FUNCTION to elements of LISTS. +Like `cl-mapcar' but while that stops when the shortest list +is exhausted, continue until the longest list is, using nil +as stand-in for elements of exhausted lists." + (let (result) + (while (catch 'more (mapc (lambda (l) (and l (throw 'more t))) lists) nil) + (push (apply function (mapcar #'car-safe lists)) result) + (setq lists (mapcar #'cdr lists))) + (nreverse result))) + ;;; Font-Lock (defconst transient-font-lock-keywords diff --git a/elpa/transient-20240421.1737/transient.info b/elpa/transient-20240729.1524/transient.info similarity index 97% rename from elpa/transient-20240421.1737/transient.info rename to elpa/transient-20240729.1524/transient.info index b293993a..bdfce816 100644 --- a/elpa/transient-20240421.1737/transient.info +++ b/elpa/transient-20240729.1524/transient.info @@ -1,4 +1,4 @@ -This is transient.info, produced by makeinfo version 6.7 from +This is transient.info, produced by makeinfo version 6.8 from transient.texi. Copyright (C) 2018–2024 Free Software Foundation, Inc. @@ -32,7 +32,7 @@ used to implement similar menus in other packages. resource to get over that hurdle is Psionic K’s interactive tutorial, available at . -This manual is for Transient version 0.6.0. +This manual is for Transient version 0.7.3. Copyright (C) 2018–2024 Free Software Foundation, Inc. @@ -1113,10 +1113,13 @@ constructor of that class. ‘transient-define-prefix’, described below. If you use the latter approach, you can use the ‘transient-parse-suffixes’ and ‘transient-parse-suffix’ functions to transform them from the - convenient to the expected form. + convenient to the expected form. Depending on the used group + class, ‘transient-parse-suffixes’’s SUFFIXES must be a list of + group vectors (for ‘transient-columns’) or a list of suffix lists + (for all other group classes). If you explicitly specify children and then transform them using - ‘:setup-chilren’, then the class of the group is determined as + ‘:setup-children’, then the class of the group is determined as usual, based on explicitly specified children. If you do not explicitly specify children and thus rely solely on @@ -1125,6 +1128,30 @@ constructor of that class. ‘transient-column’ is used and a warning is displayed. This warning will eventually be replaced with an error. + (transient-define-prefix my-finder-by-keyword () + "Select a keyword and list matching packages." + ;; The real `finder-by-keyword' is more convenient + ;; of course, but that is not the point here. + [:class transient-columns + :setup-children + (lambda (_) + (transient-parse-suffixes + 'my-finder-by-keyword + (let ((char (1- ?A))) + (mapcar ; a list ... + (lambda (partition) + (vconcat ; of group vectors ... + (mapcar (lambda (elt) + (let ((keyword (symbol-name (car elt)))) + ; ... where each suffix is a list + (list (format "%c" (cl-incf char)) + keyword + (lambda () + (interactive) + (finder-list-matches keyword))))) + partition))) + (seq-partition finder-known-keywords 7)))))]) + • The boolean ‘:pad-keys’ argument controls whether keys of all suffixes contained in a group are right padded, effectively aligning the descriptions. @@ -1359,14 +1386,30 @@ function, which for infix arguments serves about the same purpose as variable instead, i.e., if you need access to information beside the value. + -- Variable: transient-current-command + The transient from which this suffix command was invoked. The + returned value is a symbol, the transient prefix command. + -- Variable: transient-current-prefix The transient from which this suffix command was invoked. The returned value is a ‘transient-prefix’ object, which holds information associated with the transient prefix command. - -- Variable: transient-current-command - The transient from which this suffix command was invoked. The - returned value is a symbol, the transient prefix command. + -- Variable: transient-active-prefix + This function returns the active transient object. Return ‘nil’ if + there is no active transient, if the transient buffer isn’t shown, + and while the active transient is suspended (e.g., while the + minibuffer is in use). + + Unlike ‘transient-current-prefix’, which is only ever non-‘nil’ in + code that is run directly by a command that is invoked while a + transient is current, this function is also suitable for use in + asynchronous code, such as timers and callbacks (this function’s + main use-case). + + If optional PREFIXES is non-‘nil’, it must be a list of prefix + command symbols, in which case the active transient object is only + returned if it matches one of the PREFIXES."  File: transient.info, Node: Transient State, Prev: Using Infix Arguments, Up: Defining New Commands @@ -2178,19 +2221,31 @@ transient popup, you will be able to yank it in another buffer. "" #'transient--do-stay) -A.3 How does Transient compare to prefix keys and universal arguments? +A.3 How can I autoload prefix and suffix commands? +================================================== + +If your package only supports Emacs 30, just prefix the definition with +‘;;;###autoload’. If your package supports released versions of Emacs, +you unfortunately have to use a long form autoload comment as described +in *note (elisp)Autoload::. + + ;;;###autoload (autoload 'magit-dispatch "magit" nil t) + (transient-define-prefix magit-dispatch () + ...) + +A.4 How does Transient compare to prefix keys and universal arguments? ====================================================================== See . -A.4 How does Transient compare to Magit-Popup and Hydra? +A.5 How does Transient compare to Magit-Popup and Hydra? ======================================================== See . -A.5 Why did some of the key bindings change? +A.6 Why did some of the key bindings change? ============================================ You may have noticed that the bindings for some of the common commands @@ -2233,7 +2288,7 @@ and also using that for a common command would prevent me from doing so. (Also see the next question.) -A.6 Why does ‘q’ not quit popups anymore? +A.7 Why does ‘q’ not quit popups anymore? ========================================= I agree that ‘q’ is a good binding for commands that quit something. @@ -2395,11 +2450,13 @@ Appendix D Variable Index [index] * Menu: +* transient-active-prefix: Using Infix Arguments. + (line 61) * transient-align-variable-pitch: Configuration. (line 185) * transient-current-command: Using Infix Arguments. - (line 57) -* transient-current-prefix: Using Infix Arguments. (line 52) +* transient-current-prefix: Using Infix Arguments. + (line 56) * transient-current-suffixes: Using Infix Arguments. (line 44) * transient-default-level: Enabling and Disabling Suffixes. @@ -3215,42 +3272,43 @@ Node: Technical Introduction36414 Node: Defining Transients42115 Node: Binding Suffix and Infix Commands44582 Node: Group Specifications45440 -Node: Suffix Specifications50541 -Node: Defining Suffix and Infix Commands54754 -Node: Using Infix Arguments57802 -Node: Transient State60636 -Ref: Pre-commands for Infixes65451 -Ref: Pre-commands for Suffixes65971 -Ref: Pre-commands for Non-Suffixes68425 -Ref: Special Pre-Commands69561 -Node: Classes and Methods70069 -Node: Group Classes72253 -Node: Group Methods74180 -Node: Prefix Classes75433 -Node: Suffix Classes76524 -Node: Suffix Methods79611 -Node: Suffix Value Methods79932 -Node: Suffix Format Methods82690 -Node: Prefix Slots84169 -Ref: Internal Prefix Slots86304 -Node: Suffix Slots87561 -Ref: Slots of transient-suffix87929 -Ref: Slots of transient-infix89066 -Ref: Slots of transient-variable92362 -Ref: Slots of transient-switches92464 -Node: Predicate Slots92827 -Node: FAQ94262 -Ref: Can I control how the popup buffer is displayed?94391 -Ref: How can I copy text from the popup buffer?94572 -Ref: How does Transient compare to prefix keys and universal arguments?95066 -Ref: How does Transient compare to Magit-Popup and Hydra?95309 -Ref: Why did some of the key bindings change?95503 -Ref: Why does q not quit popups anymore?97856 -Node: Keystroke Index98959 -Node: Command and Function Index100824 -Node: Variable Index107416 -Node: Concept Index109689 -Node: GNU General Public License112425 +Node: Suffix Specifications51968 +Node: Defining Suffix and Infix Commands56181 +Node: Using Infix Arguments59229 +Node: Transient State62853 +Ref: Pre-commands for Infixes67668 +Ref: Pre-commands for Suffixes68188 +Ref: Pre-commands for Non-Suffixes70642 +Ref: Special Pre-Commands71778 +Node: Classes and Methods72286 +Node: Group Classes74470 +Node: Group Methods76397 +Node: Prefix Classes77650 +Node: Suffix Classes78741 +Node: Suffix Methods81828 +Node: Suffix Value Methods82149 +Node: Suffix Format Methods84907 +Node: Prefix Slots86386 +Ref: Internal Prefix Slots88521 +Node: Suffix Slots89778 +Ref: Slots of transient-suffix90146 +Ref: Slots of transient-infix91283 +Ref: Slots of transient-variable94579 +Ref: Slots of transient-switches94681 +Node: Predicate Slots95044 +Node: FAQ96479 +Ref: Can I control how the popup buffer is displayed?96608 +Ref: How can I copy text from the popup buffer?96789 +Ref: How can I autoload prefix and suffix commands?97283 +Ref: How does Transient compare to prefix keys and universal arguments?97757 +Ref: How does Transient compare to Magit-Popup and Hydra?98000 +Ref: Why did some of the key bindings change?98194 +Ref: Why does q not quit popups anymore?100547 +Node: Keystroke Index101650 +Node: Command and Function Index103515 +Node: Variable Index110107 +Node: Concept Index112517 +Node: GNU General Public License115253  End Tag Table -- 2.47.3