unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* bug#67523: check-declare doesn't account for shorthands
  2023-11-29 11:12  0%     ` João Távora
@ 2023-12-10 10:57  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-10 10:57 UTC (permalink / raw)
  To: João Távora; +Cc: 67523, Adam Porter, Jonas Bernoulli


João Távora <joaotavora@gmail.com> writes:

> On Wed, Nov 29, 2023 at 10:35 AM João Távora <joaotavora@gmail.com> wrote:
>>
>> On Wed, Nov 29, 2023 at 9:56 AM João Távora <joaotavora@gmail.com> wrote:
>> >
>> > On Wed, Nov 29, 2023 at 9:12 AM Joseph Turner <joseph@ushin.org> wrote:
>> >
>> > > A potential solution could be to convert the longhand symbol into its
>> > > shorthand form and pass that into re-search-forward.  This is tricky
>> > > since there may be multiple different shorthands which could yield the
>> > > same longhand form.  It might be more feasible to run re-search-forward
>> > > on a known common suffix portion of the symbol name, then with point on
>> > > the suspected definition, run `intern-soft' to get the full symbol name.
>> >
>> > No, this is brittle.  Check-declare, if it's to be useful (is it?)
>> > is probably meant to be as precise as possible.
>> >
>> > > A workaround is to not use shorthands in function definitions.
>> >
>> > That's letting the bad guys win :-)
>> >
>> > > Thoughts?
>> >
>> > As usual, my thoughts are that tools that read Lisp code
>> > should use the Lisp reader, not regular expressions.
>> >
>> > Here, check-declare should just walk the whole file.
>>
>> Or maybe just this 100% guaranteed untested patch would work:
>
> Sorry, that was 100% untested indeed.  This patch seems to work:
>
> diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
> index c887d95210c..bc3844ca9be 100644
> --- a/lisp/emacs-lisp/check-declare.el
> +++ b/lisp/emacs-lisp/check-declare.el
> @@ -145,21 +145,26 @@ check-declare-verify
>      (if (file-regular-p fnfile)
>          (with-temp-buffer
>            (insert-file-contents fnfile)
> +          (unless cflag
> +            ;; for syntax and shorthands
> +            (lisp-data-mode)
> +            (hack-local-variables))
>            ;; defsubst's don't _have_ to be known at compile time.
> -          (setq re (format (if cflag
> -                               "^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
> -                             "^[ \t]*(\\(fset[ \t]+'\\|\
> +          (setq re (if cflag
> +                       (format "^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
> +                               (regexp-opt (mapcar 'cadr fnlist) t))
> +                     "^[ \t]*(\\(fset[ \t]+'\\|\
>  cl-def\\(?:generic\\|method\\|un\\)\\|\
>  def\\(?:un\\|subst\\|foo\\|method\\|class\\|\
>  ine-\\(?:derived\\|generic\\|\\(?:global\\(?:ized\\)?-\\)?minor\\)-mode\\|\
>  \\(?:ine-obsolete-function-\\)?alias[ \t]+'\\|\
>  ine-overloadable-function\\)\\)\
> -[ \t]*%s\\([ \t;]+\\|$\\)")
> -                           (regexp-opt (mapcar 'cadr fnlist) t)))
> +[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)\\([ \t;]+\\|$\\)"))
>            (while (re-search-forward re nil t)
>              (skip-chars-forward " \t\n")
> -            (setq fn (match-string 2)
> -                  type (match-string 1)
> +            (setq fn (symbol-name (car (read-from-string (match-string 2)))))
> +            (when (member fn (mapcar 'cadr fnlist))
> +            (setq type (match-string 1)
>                    ;; (min . max) for a fixed number of arguments, or
>                    ;; arglists with optional elements.
>                    ;; (min) for arglists with &rest.
> @@ -202,7 +207,7 @@ check-declare-verify
>                              (t
>                               'err))
>                    ;; alist of functions and arglist signatures.
> -                  siglist (cons (cons fn sig) siglist)))))
> +                  siglist (cons (cons fn sig) siglist))))))
>      (dolist (e fnlist)
>        (setq arglist (nth 2 e)
>              type

IIUC, this patch is being merged in response to bug#67390.





^ permalink raw reply	[relevance 5%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
    2023-11-30 15:23  0%                 ` Eli Zaretskii
@ 2023-12-09 18:50  8%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-09 18:50 UTC (permalink / raw)
  To: João Távora; +Cc: 67390, Adam Porter, Eli Zaretskii, Jonas Bernoulli

Hi João!  Thanks for your patience - preparing for EmacsConf was a blast,
and now I'm on a plane to go visit my grandmother!

João Távora <joaotavora@gmail.com> writes:

> Hi all,
>
> I've been working on all these shorthand-related issues over the last
> two days and I have reasonably short fixes for all of them.
>
> For this particular issue (bug#67309), I've opted to
> use Joseph's patch with very slight adjustments, as it's the
> only one that guarantees correct behaviour and doesn't seem
> to impact performance.
>
> The other issues are:
>
> bug#63480 (loaddefs-gen.el doesn't know about shorthands)
> bug#67325 (prefix discovery i.e. register-definition-prefixes)
> bug#67523 (check-declare.el doesn't know about shorthands)
>
> I have all this in 6 commits in the bugfix/shorthand-fixes branch.
>
> Here's the full patch minus whitespace changes.  If there are
> no comments I'll push in a few days' time.
>
> João
>
> diff --git a/doc/lispref/symbols.texi b/doc/lispref/symbols.texi
> index 1f3b677d7fb..18e80311177 100644
> --- a/doc/lispref/symbols.texi
> +++ b/doc/lispref/symbols.texi
> @@ -761,6 +761,23 @@ Shorthands
>  ;; End:
>  @end example
>
> +Note that if you have two shorthands in the same file where one is the
> +prefix of the other, the longer shorthand will be attempted first.
> +This happens regardless of the order you specify shorthands in the
> +local variables section of your file.
> +
> +@example
> +'(
> +  t//foo ; reads to 'my-tricks--foo', not 'my-tricks-/foo'
> +  t/foo  ; reads to 'my-tricks-foo'
> +  )
> +
> +;; Local Variables:
> +;; read-symbol-shorthands: (("t/" . "my-tricks-")
> +;;                          ("t//" . "my-tricks--")
> +;; End:
> +@end example
> +
>  @subsection Exceptions

Clear and concise.

>  There are two exceptions to rules governing Shorthand transformations:
> diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
> index c887d95210c..b19aedf314d 100644
> --- a/lisp/emacs-lisp/check-declare.el
> +++ b/lisp/emacs-lisp/check-declare.el
> @@ -145,21 +145,26 @@ check-declare-verify
>      (if (file-regular-p fnfile)
>          (with-temp-buffer
>            (insert-file-contents fnfile)
> +          (unless cflag
> +            ;; If in Elisp, ensure syntax and shorthands available
> +            (set-syntax-table emacs-lisp-mode-syntax-table)
> +            (let (enable-local-variables) (hack-local-variables)))
>            ;; defsubst's don't _have_ to be known at compile time.
> -          (setq re (format (if cflag
> -                               "^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
> +          (setq re (if cflag
> +                       (format "^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
> +                               (regexp-opt (mapcar 'cadr fnlist) t))
>                       "^[ \t]*(\\(fset[ \t]+'\\|\
>  cl-def\\(?:generic\\|method\\|un\\)\\|\
>  def\\(?:un\\|subst\\|foo\\|method\\|class\\|\
>  ine-\\(?:derived\\|generic\\|\\(?:global\\(?:ized\\)?-\\)?minor\\)-mode\\|\
>  \\(?:ine-obsolete-function-\\)?alias[ \t]+'\\|\
>  ine-overloadable-function\\)\\)\
> -[ \t]*%s\\([ \t;]+\\|$\\)")
> -                           (regexp-opt (mapcar 'cadr fnlist) t)))
> +[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)\\([ \t;]+\\|$\\)"))

Would you explain what this regexp is intended to match?

>            (while (re-search-forward re nil t)
>              (skip-chars-forward " \t\n")
> -            (setq fn (match-string 2)
> -                  type (match-string 1)
> +            (setq fn (symbol-name (car (read-from-string (match-string 2)))))
> +            (when (member fn (mapcar 'cadr fnlist))
> +              (setq type (match-string 1)
>                      ;; (min . max) for a fixed number of arguments, or
>                      ;; arglists with optional elements.
>                      ;; (min) for arglists with &rest.
> @@ -202,7 +207,7 @@ check-declare-verify
>                                (t
>                                 'err))
>                      ;; alist of functions and arglist signatures.
> -                  siglist (cons (cons fn sig) siglist)))))
> +                    siglist (cons (cons fn sig) siglist))))))
>      (dolist (e fnlist)
>        (setq arglist (nth 2 e)
>              type

On my machine, this patch removes some of the check-declare "function
not found" errors, but not all.  For example, with hyperdrive-lib.el:

(check-declare-file "~/.local/src/hyperdrive.el/hyperdrive-lib.el")

Before this patch, the "*Check Declarations Warnings*" buffer shows:

--8<---------------cut here---------------start------------->8---
 ■ hyperdrive-lib.el:44:Warning (check-declare): said ‘h/mode’ was defined in
    ../../../.emacs.d/elpa/hyperdrive/hyperdrive.el: function not found
 ■ hyperdrive-lib.el:508:Warning (check-declare): said ‘h/history’ was defined
    in ../../../.emacs.d/elpa/hyperdrive/hyperdrive-history.el: function not
    found
 ■ hyperdrive-lib.el:1283:Warning (check-declare): said ‘h/org--link-goto’ was
    defined in ../../../.emacs.d/elpa/hyperdrive/hyperdrive-org.el: function
    not found
 ■ hyperdrive-lib.el:45:Warning (check-declare): said ‘h/dir-mode’ was defined
    in ../../../.emacs.d/elpa/hyperdrive/hyperdrive-dir.el: function not found
 ■ hyperdrive-lib.el:1069:Warning (check-declare): said
    ‘h/dir--entry-at-point’ was defined in
    ../../../.emacs.d/elpa/hyperdrive/hyperdrive-dir.el: function not found
 ■ hyperdrive-lib.el:1332:Warning (check-declare): said ‘h/dir-handler’ was
    defined in ../../../.emacs.d/elpa/hyperdrive/hyperdrive-dir.el: function
    not found
--8<---------------cut here---------------end--------------->8---

and after your patch:

--8<---------------cut here---------------start------------->8---
 ■ hyperdrive-lib.el:44:Warning (check-declare): said ‘h/mode’ was defined in
    ../../../.emacs.d/elpa/hyperdrive/hyperdrive.el: function not found
 ■ hyperdrive-lib.el:508:Warning (check-declare): said ‘h/history’ was defined
    in ../../../.emacs.d/elpa/hyperdrive/hyperdrive-history.el: function not
    found
 ■ hyperdrive-lib.el:1332:Warning (check-declare): said ‘h/dir-handler’ was
    defined in ../../../.emacs.d/elpa/hyperdrive/hyperdrive-dir.el: function
    not found
--8<---------------cut here---------------end--------------->8---

Are you able to reproduce this on your machine?

> diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
> index 04bea4723a2..e8093200bec 100644
> --- a/lisp/emacs-lisp/loaddefs-gen.el
> +++ b/lisp/emacs-lisp/loaddefs-gen.el
> @@ -378,6 +378,7 @@ loaddefs-generate--parse-file
>    (let ((defs nil)
>          (load-name (loaddefs-generate--file-load-name file main-outfile))
>          (compute-prefixes t)
> +        read-symbol-shorthands
>          local-outfile inhibit-autoloads)
>      (with-temp-buffer
>        (insert-file-contents file)
> @@ -399,7 +400,19 @@ loaddefs-generate--parse-file
>              (setq inhibit-autoloads (read (current-buffer)))))
>          (save-excursion
>            (when (re-search-forward "autoload-compute-prefixes: *" nil t)
> -            (setq compute-prefixes (read (current-buffer))))))
> +            (setq compute-prefixes (read (current-buffer)))))
> +        (save-excursion
> +          ;; since we're "open-coding" we have to repeat more
> +          ;; complicated logic in `hack-local-variables'.
> +          (when (re-search-forward "read-symbol-shorthands: *" nil t)
> +            (let* ((commentless (replace-regexp-in-string
> +                                 "\n\\s-*;+" ""
> +                                 (buffer-substring (point) (point-max))))
> +                   (unsorted-shorthands (car (read-from-string commentless))))
> +              (setq read-symbol-shorthands
> +                    (sort unsorted-shorthands
> +                          (lambda (sh1 sh2)
> +                            (> (length (car sh1)) (length (car sh2))))))))))

IIUC, the intention here is to jump to a final "Local Variables"
declaration at the end of the file, then remove ";;", then read in the
uncommented value of `read-symbol-shorthands'.

Since `read-from-string' just reads one expression, the above hunk works
when there are more local variables after read-symbol-shorthands:

;; Local Variables:
;; read-symbol-shorthands: (("bc-" . "breadcrumb-"))
;; autoload-compute-prefixes: nil
;; End:

But if the read-symbol-shorthands declaration comes at the top, as in...

-*- read-symbol-shorthands: (("bc-" . "breadcrumb-")); -*-

...then this form will allocate two strings almost as long as the file.

Here's an alternative hack attempting to uncomment and read the minimum:

diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index e8093200bec..406e4b28f1f 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -404,10 +404,13 @@ don't include."
         (save-excursion
           ;; since we're "open-coding" we have to repeat more
           ;; complicated logic in `hack-local-variables'.
-          (when (re-search-forward "read-symbol-shorthands: *" nil t)
-            (let* ((commentless (replace-regexp-in-string
+          (when-let ((beg
+                      (re-search-forward "read-symbol-shorthands: *" nil t)))
+            ;; `read-symbol-shorthands' alist ends with two parens.
+            (let* ((end (re-search-forward ")[;\n\s]*)"))
+                   (commentless (replace-regexp-in-string
                                  "\n\\s-*;+" ""
-                                 (buffer-substring (point) (point-max))))
+                                 (buffer-substring beg end)))
                    (unsorted-shorthands (car (read-from-string commentless))))
               (setq read-symbol-shorthands
                     (sort unsorted-shorthands

>        ;; We always return the package version (even for pre-dumped
>        ;; files).
> @@ -486,7 +499,11 @@ loaddefs-generate--compute-prefixes
>      (while (re-search-forward
>              "^(\\(def[^ \t\n]+\\)[ \t\n]+['(]*\\([^' ()\"\n]+\\)[\n \t]" nil t)
>        (unless (member (match-string 1) autoload-ignored-definitions)
> -        (let ((name (match-string-no-properties 2)))
> +        (let* ((name (match-string-no-properties 2))
> +               ;; Consider `read-symbol-shorthands'.
> +               (probe (let ((obarray (obarray-make)))
> +                        (car (read-from-string name)))))
> +          (setq name (symbol-name probe))
>            (when (save-excursion
>                    (goto-char (match-beginning 0))
>                    (or (bobp)
> diff --git a/lisp/emacs-lisp/shorthands.el b/lisp/emacs-lisp/shorthands.el
> index b0665a55695..69b562e3c7e 100644
> --- a/lisp/emacs-lisp/shorthands.el
> +++ b/lisp/emacs-lisp/shorthands.el
> @@ -52,38 +52,26 @@ elisp-shorthand-font-lock-face
>    :version "28.1"
>    :group 'font-lock-faces)
>
> -(defun shorthands--mismatch-from-end (str1 str2)
> -  "Tell index of first mismatch in STR1 and STR2, from end.
> -The index is a valid 0-based index on STR1.  Returns nil if STR1
> -equals STR2.  Return 0 if STR1 is a suffix of STR2."
> -  (cl-loop with l1 = (length str1) with l2 = (length str2)
> -           for i from 1
> -           for i1 = (- l1 i) for i2 = (- l2 i)
> -           while (eq (aref str1 i1) (aref str2 i2))
> -           if (zerop i2) return (if (zerop i1) nil i1)
> -           if (zerop i1) return 0
> -           finally (return i1)))
> -
>  (defun shorthands-font-lock-shorthands (limit)
> +  "Font lock until LIMIT considering `read-symbol-shorthands'."
>    (when read-symbol-shorthands
>      (while (re-search-forward
>              (concat "\\_<\\(" (rx lisp-mode-symbol) "\\)\\_>")
>              limit t)
>        (let* ((existing (get-text-property (match-beginning 1) 'face))
> +             (print-name (match-string 1))
>               (probe (and (not (memq existing '(font-lock-comment-face
>                                                 font-lock-string-face)))
> -                         (intern-soft (match-string 1))))
> -             (sname (and probe (symbol-name probe)))
> -             (mismatch (and sname (shorthands--mismatch-from-end
> -                                   (match-string 1) sname)))
> -             (guess (and mismatch (1+ mismatch))))
> -        (when guess
> -          (when (and (< guess (1- (length (match-string 1))))
> -                     ;; In bug#67390 we allow other separators
> -                     (eq (char-syntax (aref (match-string 1) guess)) ?_))
> -            (setq guess (1+ guess)))
> +                         (intern-soft print-name)))
> +             (symbol-name (and probe (symbol-name probe)))
> +             (prefix (and symbol-name
> +                          (not (string-equal print-name symbol-name))
> +                          (car (assoc print-name
> +                                      read-symbol-shorthands
> +                                      #'string-prefix-p)))))
> +        (when prefix
>            (add-face-text-property (match-beginning 1)
> -                                  (+ (match-beginning 1) guess)
> +                                  (+ (match-beginning 1) (length prefix))
>                                    'elisp-shorthand-font-lock-face))))))

Works well.  let-binding `symbol-name' and `print-name' is good improvement.

>  (font-lock-add-keywords 'emacs-lisp-mode
> '((shorthands-font-lock-shorthands)) t)
> diff --git a/lisp/files.el b/lisp/files.el
> index 1cdcec23b11..b266d0727ec 100644
> --- a/lisp/files.el
> +++ b/lisp/files.el
> @@ -3735,7 +3735,8 @@ before-hack-local-variables-hook
>  This hook is called only if there is at least one file-local
>  variable to set.")
>
> -(defvar permanently-enabled-local-variables '(lexical-binding)
> +(defvar permanently-enabled-local-variables
> +  '(lexical-binding read-symbol-shorthands)
>    "A list of file-local variables that are always enabled.
>  This overrides any `enable-local-variables' setting.")
>
> @@ -4171,6 +4172,13 @@ hack-local-variables--find-variables
>                                  ;; to use 'thisbuf's name in the
>                                  ;; warning message.
>                                  (or (buffer-file-name thisbuf) ""))))))
> +                          ((eq var 'read-symbol-shorthands)
> +                           ;; Sort automatically by shorthand length
> +                           ;; descending
> +                           (setq val (sort val
> +                                           (lambda (sh1 sh2) (>
> (length (car sh1))
> +
> (length (car sh2))))))
> +                           (push (cons 'read-symbol-shorthands val) result))
>                            ((and (eq var 'mode) handle-mode))
>     (t
>      (ignore-errors

Good catch.  I agree that longer shorthands should be applied first.

-----

A couple typo nits on the commit message of "Improve
shorthands-font-lock-shorthands (bug#67390)":

-  h//thingy     ; hilits "//"       reads to 'hyperdrive--thingy'
+  h//thingy     ; hilits "h//"       reads to 'hyperdrive--thingy'

-  Co-authored-by: João Távora <joaotavora@gmail.com>
+  Co-authored-by: Joseph Turner <joseph@breatheoutbreathe.in>


Thank you!

Joseph





^ permalink raw reply related	[relevance 8%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-11-27 12:01  0%                         ` Eli Zaretskii
@ 2023-12-08 10:25  5%                           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-08 10:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 66115-done, philipk


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: philipk@posteo.net, 66115-done@debbugs.gnu.org
>> Date: Sun, 26 Nov 2023 12:39:34 -0800
>>
>> > Thanks, installed on the emacs-29 branch, and closing the bug.
>>
>> Thank you, Eli!  I made a mistake - I forgot to add "Do not merge into
>> master" in the commit message.  Do we need to add a commit on the master
>> branch which reverts this one?
>
> Yes, after the next merge from emacs-29 to master.

I see that you've done this already.  Thank you!





^ permalink raw reply	[relevance 5%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  @ 2023-11-30 15:23  0%                 ` Eli Zaretskii
  2023-12-09 18:50  8%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 200+ results
From: Eli Zaretskii @ 2023-11-30 15:23 UTC (permalink / raw)
  To: João Távora; +Cc: joseph, 67390, jonas, adam

> From: João Távora <joaotavora@gmail.com>
> Date: Thu, 30 Nov 2023 14:16:51 +0000
> Cc: Joseph Turner <joseph@ushin.org>, 67390@debbugs.gnu.org, 
> 	Adam Porter <adam@alphapapa.net>
> 
> Hi all,
> 
> I've been working on all these shorthand-related issues over the last
> two days and I have reasonably short fixes for all of them.
> 
> For this particular issue (bug#67309), I've opted to
> use Joseph's patch with very slight adjustments, as it's the
> only one that guarantees correct behaviour and doesn't seem
> to impact performance.
> 
> The other issues are:
> 
> bug#63480 (loaddefs-gen.el doesn't know about shorthands)
> bug#67325 (prefix discovery i.e. register-definition-prefixes)
> bug#67523 (check-declare.el doesn't know about shorthands)
> 
> I have all this in 6 commits in the bugfix/shorthand-fixes branch.

Thanks.

> Here's the full patch minus whitespace changes.  If there are
> no comments I'll push in a few days' time.

The plan is to merge these to the master branch, right?





^ permalink raw reply	[relevance 0%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-29 13:30  0%           ` João Távora
@ 2023-11-29 23:27  0%             ` João Távora
    0 siblings, 1 reply; 200+ results
From: João Távora @ 2023-11-29 23:27 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: Joseph Turner, 67390, Adam Porter

On Wed, Nov 29, 2023 at 1:30 PM João Távora <joaotavora@gmail.com> wrote:
>
> On Sat, Nov 25, 2023 at 4:03 PM Jonas Bernoulli via Bug reports for
> GNU Emacs, the Swiss army knife of text editors
> <bug-gnu-emacs@gnu.org> wrote:
> >
> > Joseph Turner <joseph@ushin.org> writes:
> >
> > > +                          (car (shorthands--find-if
> > > +                                (lambda (short)
> > > +                                  (string-prefix-p short (match-string 1)))
> > > +                                read-symbol-shorthands #'car)))))
> >
> > Or simply:
> >   (car (assoc (match-string 1)
> >               read-symbol-shorthands
> >               #'string-prefix-p))
>
> I don't think it works, at least in my 'assoc', the order
> of string-prefix-p arguments must be switched.  Pity
> assoc or string-prefix-p decs didn't coordinate this.

nevermind, it does work if what you want is to see if the cars
of the alist are prefixes to the key, which is probably your
intention in this snippet.





^ permalink raw reply	[relevance 0%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-29  9:12  4%                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-29 13:56  5%                         ` João Távora
  0 siblings, 0 replies; 200+ results
From: João Távora @ 2023-11-29 13:56 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 67390, Adam Porter, Eli Zaretskii, Jonas Bernoulli

On Wed, Nov 29, 2023 at 9:29 AM Joseph Turner <joseph@ushin.org> wrote:

> > Joseph can you try these variations? They're slightly more exact. Also show at least one of the large lisp files or tell me how to generate
> > one. If you still don't find any significant slowdown, I think we can merge your patch.
>
> I'm happy to try Eli's variation if you don't beat me to it ;)

Great.  No I don't think I will beat you to it :-), you have the
machinery setup already.

> However, if we rearrange the values like:
>
> ;; read-symbol-shorthands: (
> ;;   ("he/"  . "hyperdrive-entry-")
> ;;   ("he//" . "hyperdrive-entry--")
> ;;   ("h/"   . "hyperdrive-")
> ;;   ("h//"  . "hyperdrive--"))
>
> then shorthands doesn't add fontification for either "h//" or "he//".
> (This surprised me - I was expecting to see just the "h/" and "he/"
> highlit)
>
> However, I'm starting to wonder whether this is a case of user error.
> Should we avoid overlapping shorthand prefixes?

No, but you should make sure the longer prefixes appear before.
It's not only a font-locking issue, if the shorter shorthand
appears before it could read to an unintended symbol.  If shorthands
are

  (("h/" . "hello-") ("h//" . "hyperdrive--"))

and you type

  "h//warp"

, I'm fairly sure this will be read to

    "hello-/warp"

, which is probably not what you intended

The documentation doesn't mention this, but it should, so patches
welcome for that.

In theory, lread.c could do this sorting for you.  I don't think
this would affect performance, so patches welcome for that,
too.

Anyway, here's another patch that more or less bridges our two patches
and seems to do the right thing every time, even making you aware of
that ordering pitfall.

It could be more performant (or less, or about the same), so if
you can, please include it in your benchmarks.  It does less
work when presented with a "/"-ending shorthand for a "-"-separated
symbol, so I'm starting to think that this "/" idea is a good
convention for shorthands (useful for distinguishing them in
github code, for example).

I've tested it briefly with those 'he/', 'he//', etc cases.

diff --git a/lisp/emacs-lisp/shorthands.el b/lisp/emacs-lisp/shorthands.el
index b0665a55695..69e9e252aee 100644
--- a/lisp/emacs-lisp/shorthands.el
+++ b/lisp/emacs-lisp/shorthands.el
@@ -76,14 +76,19 @@ shorthands-font-lock-shorthands
              (sname (and probe (symbol-name probe)))
              (mismatch (and sname (shorthands--mismatch-from-end
                                    (match-string 1) sname)))
-             (guess (and mismatch (1+ mismatch))))
-        (when guess
-          (when (and (< guess (1- (length (match-string 1))))
-                     ;; In bug#67390 we allow other separators
-                     (eq (char-syntax (aref (match-string 1) guess)) ?_))
-            (setq guess (1+ guess)))
+             probe2)
+        (when mismatch
+          (unless (eq (char-syntax (aref (match-string 1) mismatch)) ?_)
+            (or probe2
+                (setq probe2
+                      (buffer-substring (match-beginning 1)
+                                        (+ (match-beginning 1) mismatch))))
+            (setq mismatch (1- (length
+                                (car (assoc probe2
+                                            read-symbol-shorthands
+                                            (lambda (a b)
(string-prefix-p b a))))))))
           (add-face-text-property (match-beginning 1)
-                                  (+ (match-beginning 1) guess)
+                                  (+ (match-beginning 1) (1+ mismatch))
                                   'elisp-shorthand-font-lock-face))))))

 (font-lock-add-keywords 'emacs-lisp-mode
'((shorthands-font-lock-shorthands)) t)





^ permalink raw reply related	[relevance 5%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-25 16:01  5%         ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-25 22:42  9%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-29 13:30  0%           ` João Távora
  2023-11-29 23:27  0%             ` João Távora
  1 sibling, 1 reply; 200+ results
From: João Távora @ 2023-11-29 13:30 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: Joseph Turner, 67390, Adam Porter

On Sat, Nov 25, 2023 at 4:03 PM Jonas Bernoulli via Bug reports for
GNU Emacs, the Swiss army knife of text editors
<bug-gnu-emacs@gnu.org> wrote:
>
> Joseph Turner <joseph@ushin.org> writes:
>
> > +                          (car (shorthands--find-if
> > +                                (lambda (short)
> > +                                  (string-prefix-p short (match-string 1)))
> > +                                read-symbol-shorthands #'car)))))
>
> Or simply:
>   (car (assoc (match-string 1)
>               read-symbol-shorthands
>               #'string-prefix-p))

I don't think it works, at least in my 'assoc', the order
of string-prefix-p arguments must be switched.  Pity
assoc or string-prefix-p decs didn't coordinate this.

(assoc probe read-symbol-shorthands (lambda (a b) (string-prefix-p b a)))

works





^ permalink raw reply	[relevance 0%]

* bug#67523: check-declare doesn't account for shorthands
  2023-11-29 10:35  0%   ` João Távora
@ 2023-11-29 11:12  0%     ` João Távora
  2023-12-10 10:57  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: João Távora @ 2023-11-29 11:12 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 67523, Adam Porter, Jonas Bernoulli

On Wed, Nov 29, 2023 at 10:35 AM João Távora <joaotavora@gmail.com> wrote:
>
> On Wed, Nov 29, 2023 at 9:56 AM João Távora <joaotavora@gmail.com> wrote:
> >
> > On Wed, Nov 29, 2023 at 9:12 AM Joseph Turner <joseph@ushin.org> wrote:
> >
> > > A potential solution could be to convert the longhand symbol into its
> > > shorthand form and pass that into re-search-forward.  This is tricky
> > > since there may be multiple different shorthands which could yield the
> > > same longhand form.  It might be more feasible to run re-search-forward
> > > on a known common suffix portion of the symbol name, then with point on
> > > the suspected definition, run `intern-soft' to get the full symbol name.
> >
> > No, this is brittle.  Check-declare, if it's to be useful (is it?)
> > is probably meant to be as precise as possible.
> >
> > > A workaround is to not use shorthands in function definitions.
> >
> > That's letting the bad guys win :-)
> >
> > > Thoughts?
> >
> > As usual, my thoughts are that tools that read Lisp code
> > should use the Lisp reader, not regular expressions.
> >
> > Here, check-declare should just walk the whole file.
>
> Or maybe just this 100% guaranteed untested patch would work:

Sorry, that was 100% untested indeed.  This patch seems to work:

diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
index c887d95210c..bc3844ca9be 100644
--- a/lisp/emacs-lisp/check-declare.el
+++ b/lisp/emacs-lisp/check-declare.el
@@ -145,21 +145,26 @@ check-declare-verify
     (if (file-regular-p fnfile)
         (with-temp-buffer
           (insert-file-contents fnfile)
+          (unless cflag
+            ;; for syntax and shorthands
+            (lisp-data-mode)
+            (hack-local-variables))
           ;; defsubst's don't _have_ to be known at compile time.
-          (setq re (format (if cflag
-                               "^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
-                             "^[ \t]*(\\(fset[ \t]+'\\|\
+          (setq re (if cflag
+                       (format "^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
+                               (regexp-opt (mapcar 'cadr fnlist) t))
+                     "^[ \t]*(\\(fset[ \t]+'\\|\
 cl-def\\(?:generic\\|method\\|un\\)\\|\
 def\\(?:un\\|subst\\|foo\\|method\\|class\\|\
 ine-\\(?:derived\\|generic\\|\\(?:global\\(?:ized\\)?-\\)?minor\\)-mode\\|\
 \\(?:ine-obsolete-function-\\)?alias[ \t]+'\\|\
 ine-overloadable-function\\)\\)\
-[ \t]*%s\\([ \t;]+\\|$\\)")
-                           (regexp-opt (mapcar 'cadr fnlist) t)))
+[ \t]*\\(\\(?:\\sw\\|\\s_\\)+\\)\\([ \t;]+\\|$\\)"))
           (while (re-search-forward re nil t)
             (skip-chars-forward " \t\n")
-            (setq fn (match-string 2)
-                  type (match-string 1)
+            (setq fn (symbol-name (car (read-from-string (match-string 2)))))
+            (when (member fn (mapcar 'cadr fnlist))
+            (setq type (match-string 1)
                   ;; (min . max) for a fixed number of arguments, or
                   ;; arglists with optional elements.
                   ;; (min) for arglists with &rest.
@@ -202,7 +207,7 @@ check-declare-verify
                             (t
                              'err))
                   ;; alist of functions and arglist signatures.
-                  siglist (cons (cons fn sig) siglist)))))
+                  siglist (cons (cons fn sig) siglist))))))
     (dolist (e fnlist)
       (setq arglist (nth 2 e)
             type





^ permalink raw reply related	[relevance 0%]

* bug#67523: check-declare doesn't account for shorthands
  2023-11-29  9:56  5% ` João Távora
@ 2023-11-29 10:35  0%   ` João Távora
  2023-11-29 11:12  0%     ` João Távora
  0 siblings, 1 reply; 200+ results
From: João Távora @ 2023-11-29 10:35 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 67523, Adam Porter, Jonas Bernoulli

On Wed, Nov 29, 2023 at 9:56 AM João Távora <joaotavora@gmail.com> wrote:
>
> On Wed, Nov 29, 2023 at 9:12 AM Joseph Turner <joseph@ushin.org> wrote:
>
> > A potential solution could be to convert the longhand symbol into its
> > shorthand form and pass that into re-search-forward.  This is tricky
> > since there may be multiple different shorthands which could yield the
> > same longhand form.  It might be more feasible to run re-search-forward
> > on a known common suffix portion of the symbol name, then with point on
> > the suspected definition, run `intern-soft' to get the full symbol name.
>
> No, this is brittle.  Check-declare, if it's to be useful (is it?)
> is probably meant to be as precise as possible.
>
> > A workaround is to not use shorthands in function definitions.
>
> That's letting the bad guys win :-)
>
> > Thoughts?
>
> As usual, my thoughts are that tools that read Lisp code
> should use the Lisp reader, not regular expressions.
>
> Here, check-declare should just walk the whole file.

Or maybe just this 100% guaranteed untested patch would work:

diff --git a/lisp/emacs-lisp/check-declare.el b/lisp/emacs-lisp/check-declare.el
index c887d95210c..00440276643 100644
--- a/lisp/emacs-lisp/check-declare.el
+++ b/lisp/emacs-lisp/check-declare.el
@@ -145,6 +145,7 @@ check-declare-verify
     (if (file-regular-p fnfile)
         (with-temp-buffer
           (insert-file-contents fnfile)
+          (hack-local-variables) ;; for shorthands
           ;; defsubst's don't _have_ to be known at compile time.
           (setq re (format (if cflag
                                "^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
@@ -158,7 +159,7 @@ check-declare-verify
                            (regexp-opt (mapcar 'cadr fnlist) t)))
           (while (re-search-forward re nil t)
             (skip-chars-forward " \t\n")
-            (setq fn (match-string 2)
+            (setq fn (symbol-name (car (read-from-string (match-string 2))))
                   type (match-string 1)
                   ;; (min . max) for a fixed number of arguments, or
                   ;; arglists with optional elements.





^ permalink raw reply related	[relevance 0%]

* bug#67523: check-declare doesn't account for shorthands
  2023-11-29  8:03  4% bug#67523: check-declare doesn't account for shorthands Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-29  9:56  5% ` João Távora
  2023-11-29 10:35  0%   ` João Távora
  0 siblings, 1 reply; 200+ results
From: João Távora @ 2023-11-29  9:56 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 67523, Adam Porter, Jonas Bernoulli

On Wed, Nov 29, 2023 at 9:12 AM Joseph Turner <joseph@ushin.org> wrote:

> A potential solution could be to convert the longhand symbol into its
> shorthand form and pass that into re-search-forward.  This is tricky
> since there may be multiple different shorthands which could yield the
> same longhand form.  It might be more feasible to run re-search-forward
> on a known common suffix portion of the symbol name, then with point on
> the suspected definition, run `intern-soft' to get the full symbol name.

No, this is brittle.  Check-declare, if it's to be useful (is it?)
is probably meant to be as precise as possible.

> A workaround is to not use shorthands in function definitions.

That's letting the bad guys win :-)

> Thoughts?

As usual, my thoughts are that tools that read Lisp code
should use the Lisp reader, not regular expressions.

Here, check-declare should just walk the whole file.
When it finds a a symbol atom that matches a definition
form,  look in the next atom and check if it matches the probe.
If you don't want to intern all the symbols in the you can read
to a separate obarray I think.

João





^ permalink raw reply	[relevance 5%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-29  8:21  0%                     ` João Távora
@ 2023-11-29  9:12  4%                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-29 13:56  5%                         ` João Távora
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-29  9:12 UTC (permalink / raw)
  To: João Távora; +Cc: 67390, Adam Porter, Eli Zaretskii, Jonas Bernoulli

João Távora <joaotavora@gmail.com> writes:

> On Mon, Nov 27, 2023, 12:12 Eli Zaretskii <eliz@gnu.org> wrote:
>
>  > From: João Távora <joaotavora@gmail.com>
>  > Date: Sun, 26 Nov 2023 22:02:01 +0000
>  > Cc: Jonas Bernoulli <jonas@bernoul.li>, 67390@debbugs.gnu.org,
>  >       Adam Porter <adam@alphapapa.net>
>  >
>  > On Sun, Nov 26, 2023 at 8:38 PM Joseph Turner <joseph@ushin.org> wrote:
>  > >
>  > > João Távora <joaotavora@gmail.com> writes:
>  > >
>  > > > On Sat, Nov 25, 2023 at 10:43 PM Joseph Turner <joseph@ushin.org> wrote:
>  >
>  > > > So, benchmarking it will have to be, I'm afraid, because AFAIK
>  > > > font-locking is a very performance sensitive area of Emacs.
>  > >
>  > > Yes.  I would like to learn how to do this!
>  >
>  > I'm CCing Eli.
>  >
>  > In the past, ISTR, Eli suggested to benchmark such things by visiting a
>  > very large file in its beginning, then scrolling down by holding
>  > the down arrow or PgDn for some fixed time period, like 30 seconds.
>  > The  Emacs that scrolls the farthest is the most performant.  Not
>  > entirely fail-proof (other processes may interfere, etc), but not
>  > bad either.
>
>  I still recommend this method.  Something like the below:
>
>    (defun scroll-up-benchmark ()
>      (interactive)
>      (let ((oldgc gcs-done)
>            (oldtime (float-time)))
>        (condition-case nil (while t (scroll-up) (redisplay))
>          (error (message "GCs: %d Elapsed time: %f seconds"
>                          (- gcs-done oldgc) (- (float-time) oldtime))))))
>
>  Evaluate the above, and the invoke it at the beginning of a large
>  file.  Then compare the timings with different font-lock arrangements.
>
>  A variant is to scroll by N lines, not by pages.  Just change the
>  above to call scroll-up with the argument of N, for example 1 (or any
>  other number, if you want).
>
> Joseph can you try these variations? They're slightly more exact. Also show at least one of the large lisp files or tell me how to generate
> one. If you still don't find any significant slowdown, I think we can merge your patch.

I'm happy to try Eli's variation if you don't beat me to it ;)

My large lisp file consisted of copy-pasting with a kbd macro the body of
https://git.sr.ht/~ushin/hyperdrive.el/tree/master/item/hyperdrive-lib.el
until the file reached ~50K lines -- well over the limit I expected to
reach on my machine.

One potential issue with the patch is that multiple shorthand prefixes
might match, while assoc will return the first matching cons pair
read-symbol-shorthand.

For example in hyperdrive-lib.el, we use the following shorthands in
order to display "//" instead of "/-" as the prefix separator for
private symbols, like "h//format-entry" instead of "h/-format-entry":

;; read-symbol-shorthands: (
;;   ("he//" . "hyperdrive-entry--")
;;   ("he/"  . "hyperdrive-entry-")
;;   ("h//"  . "hyperdrive--")
;;   ("h/"   . "hyperdrive-"))

However, if we rearrange the values like:

;; read-symbol-shorthands: (
;;   ("he/"  . "hyperdrive-entry-")
;;   ("he//" . "hyperdrive-entry--")
;;   ("h/"   . "hyperdrive-")
;;   ("h//"  . "hyperdrive--"))

then shorthands doesn't add fontification for either "h//" or "he//".
(This surprised me - I was expecting to see just the "h/" and "he/"
highlit)

However, I'm starting to wonder whether this is a case of user error.
Should we avoid overlapping shorthand prefixes?

Thank you!!

Joseph






^ permalink raw reply	[relevance 4%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-27 12:10  0%                   ` Eli Zaretskii
@ 2023-11-29  8:21  0%                     ` João Távora
  2023-11-29  9:12  4%                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: João Távora @ 2023-11-29  8:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Joseph Turner, 67390, Jonas Bernoulli, Adam Porter

[-- Attachment #1: Type: text/plain, Size: 2083 bytes --]

On Mon, Nov 27, 2023, 12:12 Eli Zaretskii <eliz@gnu.org> wrote:

> > From: João Távora <joaotavora@gmail.com>
> > Date: Sun, 26 Nov 2023 22:02:01 +0000
> > Cc: Jonas Bernoulli <jonas@bernoul.li>, 67390@debbugs.gnu.org,
> >       Adam Porter <adam@alphapapa.net>
> >
> > On Sun, Nov 26, 2023 at 8:38 PM Joseph Turner <joseph@ushin.org> wrote:
> > >
> > > João Távora <joaotavora@gmail.com> writes:
> > >
> > > > On Sat, Nov 25, 2023 at 10:43 PM Joseph Turner <joseph@ushin.org>
> wrote:
> >
> > > > So, benchmarking it will have to be, I'm afraid, because AFAIK
> > > > font-locking is a very performance sensitive area of Emacs.
> > >
> > > Yes.  I would like to learn how to do this!
> >
> > I'm CCing Eli.
> >
> > In the past, ISTR, Eli suggested to benchmark such things by visiting a
> > very large file in its beginning, then scrolling down by holding
> > the down arrow or PgDn for some fixed time period, like 30 seconds.
> > The  Emacs that scrolls the farthest is the most performant.  Not
> > entirely fail-proof (other processes may interfere, etc), but not
> > bad either.
>
> I still recommend this method.  Something like the below:
>
>   (defun scroll-up-benchmark ()
>     (interactive)
>     (let ((oldgc gcs-done)
>           (oldtime (float-time)))
>       (condition-case nil (while t (scroll-up) (redisplay))
>         (error (message "GCs: %d Elapsed time: %f seconds"
>                         (- gcs-done oldgc) (- (float-time) oldtime))))))
>
> Evaluate the above, and the invoke it at the beginning of a large
> file.  Then compare the timings with different font-lock arrangements.
>
> A variant is to scroll by N lines, not by pages.  Just change the
> above to call scroll-up with the argument of N, for example 1 (or any
> other number, if you want).
>

Joseph can you try these variations? They're slightly more exact. Also show
at least one of the large lisp files or tell me how to generate one. If you
still don't find any significant slowdown, I think we can merge your patch.

João

>

[-- Attachment #2: Type: text/html, Size: 3396 bytes --]

^ permalink raw reply	[relevance 0%]

* bug#63480: 30.0.50; [BUG] unimplemented logic regarding read-symbol-shorthands
  2023-11-29  7:45  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-29  8:12  5%     ` João Távora
  0 siblings, 0 replies; 200+ results
From: João Távora @ 2023-11-29  8:12 UTC (permalink / raw)
  To: Joseph Turner
  Cc: 63480, Ruijie Yu, Jonas Bernoulli, Stefan Kangas, Adam Porter

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

On Wed, Nov 29, 2023, 07:45 Joseph Turner <joseph@breatheoutbreathe.in>
wrote:

> :
>
> ;;;###autoload
> (with-eval-after-load 'optional-dependency
>   (cl-pushnew 'sns-var optional-dependency-var))
>
> Instead, you must expand the shorthand symbol into its full form:
>
> ;;;###autoload
> (with-eval-after-load 'optional-dependency
>   (cl-pushnew 'some-nice-string-utils-var optional-dependency-var))
>
> For a real-world example, see
>
>
> https://git.sr.ht/~ushin/hyperdrive.el/commit/48afc51ac22713f2c54f75a7ea3b5c6b0e12b53d


Thanks for the extra case. I think this merits a fix in the autoload
extractor, watch should become autoload aware. I'll try to look at it.

João

>
>

[-- Attachment #2: Type: text/html, Size: 1435 bytes --]

^ permalink raw reply	[relevance 5%]

* bug#67523: check-declare doesn't account for shorthands
@ 2023-11-29  8:03  4% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-29  9:56  5% ` João Távora
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-29  8:03 UTC (permalink / raw)
  To: 67523; +Cc: Adam Porter, Jonas Bernoulli, João Távora

On Emacs 29.1, when running `check-declare-file' on a file with
`declare-function' forms, I get

Warning (check-declare): said ‘some-nice-string-utils-foobar’ was defined in
some-nice-string-utils.el: function not found

The problem is that `check-declare-verify' attempts to search for the
full symbol name using this regular expression:

(setq re (format (if cflag
                     "^[ \t]*\\(DEFUN\\)[ \t]*([ \t]*\"%s\""
                   "^[ \t]*(\\(fset[ \t]+'\\|\
cl-def\\(?:generic\\|method\\|un\\)\\|\
def\\(?:un\\|subst\\|foo\\|method\\|class\\|\
ine-\\(?:derived\\|generic\\|\\(?:global\\(?:ized\\)?-\\)?minor\\)-mode\\|\
\\(?:ine-obsolete-function-\\)?alias[ \t]+'\\|\
ine-overloadable-function\\)\\)\
[ \t]*%s\\([ \t;]+\\|$\\)")
                 (regexp-opt (mapcar 'cadr fnlist) t)))
(while (re-search-forward re nil t)
  ...
  )

where (mapcar 'cadr fnlist) is the full symbol name.

Since the full symbol name never appears in the file in which it was
defined, re-search-forward never finds it, and so "function not found".

A potential solution could be to convert the longhand symbol into its
shorthand form and pass that into re-search-forward.  This is tricky
since there may be multiple different shorthands which could yield the
same longhand form.  It might be more feasible to run re-search-forward
on a known common suffix portion of the symbol name, then with point on
the suspected definition, run `intern-soft' to get the full symbol name.

A workaround is to not use shorthands in function definitions.

Thoughts?

Joseph





^ permalink raw reply	[relevance 4%]

* bug#63480: 30.0.50; [BUG] unimplemented logic regarding read-symbol-shorthands
  @ 2023-11-29  7:45  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-29  8:12  5%     ` João Távora
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-29  7:45 UTC (permalink / raw)
  To: stefankangas; +Cc: 63480, ruijie, Jonas Bernoulli, joaotavora, Adam Porter

From: Stefan Kangas <stefankangas@gmail.com>

> João Távora <joaotavora@gmail.com> writes:

> > This is a duplicate of
> >
> >    https://github.com/joaotavora/breadcrumb/issues/3
> >
> > which has already been solved.  I updated the autoloads to use
> > longhand versions already a couple of months ago.

> OK, thanks.

> > I'll leave it to you if this issue can be closed or not.

> I guess the issue here is what you describe below?  If so, I guess it
> should remain open until it is fixed.

> > Anyway, the problem with shorthands and autoloads remains.
> > The GitHub user 'dickmao' proposed a patch there, which I
> > didn't test, but I attach here.
> >
> > My idea for an alternative patch would be for the "autoload
> > extractor" (which I'm not familiar with) to see the shorthand
> > autoload but place it in longhand form in the generated
> > autoloads file.  I don't have a patch for that idea,
> > unfortunately.

This bug affects not only autoloaded function definitions, but any
autoloaded form.  For example, the following will not generate the
correct autoloads:

;;;###autoload
(with-eval-after-load 'optional-dependency
  (cl-pushnew 'sns-var optional-dependency-var))

Instead, you must expand the shorthand symbol into its full form:

;;;###autoload
(with-eval-after-load 'optional-dependency
  (cl-pushnew 'some-nice-string-utils-var optional-dependency-var))

For a real-world example, see

https://git.sr.ht/~ushin/hyperdrive.el/commit/48afc51ac22713f2c54f75a7ea3b5c6b0e12b53d

Thank you!

Joseph





^ permalink raw reply	[relevance 5%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-26 22:02  5%                 ` João Távora
  2023-11-27  3:48  5%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-27 12:10  0%                   ` Eli Zaretskii
  2023-11-29  8:21  0%                     ` João Távora
  1 sibling, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-11-27 12:10 UTC (permalink / raw)
  To: João Távora; +Cc: joseph, 67390, jonas, adam

> From: João Távora <joaotavora@gmail.com>
> Date: Sun, 26 Nov 2023 22:02:01 +0000
> Cc: Jonas Bernoulli <jonas@bernoul.li>, 67390@debbugs.gnu.org, 
> 	Adam Porter <adam@alphapapa.net>
> 
> On Sun, Nov 26, 2023 at 8:38 PM Joseph Turner <joseph@ushin.org> wrote:
> >
> > João Távora <joaotavora@gmail.com> writes:
> >
> > > On Sat, Nov 25, 2023 at 10:43 PM Joseph Turner <joseph@ushin.org> wrote:
> 
> > > So, benchmarking it will have to be, I'm afraid, because AFAIK
> > > font-locking is a very performance sensitive area of Emacs.
> >
> > Yes.  I would like to learn how to do this!
> 
> I'm CCing Eli.
> 
> In the past, ISTR, Eli suggested to benchmark such things by visiting a
> very large file in its beginning, then scrolling down by holding
> the down arrow or PgDn for some fixed time period, like 30 seconds.
> The  Emacs that scrolls the farthest is the most performant.  Not
> entirely fail-proof (other processes may interfere, etc), but not
> bad either.

I still recommend this method.  Something like the below:

  (defun scroll-up-benchmark ()
    (interactive)
    (let ((oldgc gcs-done)
	  (oldtime (float-time)))
      (condition-case nil (while t (scroll-up) (redisplay))
	(error (message "GCs: %d Elapsed time: %f seconds"
			(- gcs-done oldgc) (- (float-time) oldtime))))))

Evaluate the above, and the invoke it at the beginning of a large
file.  Then compare the timings with different font-lock arrangements.

A variant is to scroll by N lines, not by pages.  Just change the
above to call scroll-up with the argument of N, for example 1 (or any
other number, if you want).





^ permalink raw reply	[relevance 0%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-11-26 20:39  5%                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-27 12:01  0%                         ` Eli Zaretskii
  2023-12-08 10:25  5%                           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-11-27 12:01 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66115-done, philipk

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: philipk@posteo.net, 66115-done@debbugs.gnu.org
> Date: Sun, 26 Nov 2023 12:39:34 -0800
> 
> > Thanks, installed on the emacs-29 branch, and closing the bug.
> 
> Thank you, Eli!  I made a mistake - I forgot to add "Do not merge into
> master" in the commit message.  Do we need to add a commit on the master
> branch which reverts this one?

Yes, after the next merge from emacs-29 to master.





^ permalink raw reply	[relevance 0%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-26 22:02  5%                 ` João Távora
@ 2023-11-27  3:48  5%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-27 12:10  0%                   ` Eli Zaretskii
  1 sibling, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-27  3:48 UTC (permalink / raw)
  To: João Távora; +Cc: 67390, Adam Porter, Eli Zaretskii, Jonas Bernoulli

João Távora <joaotavora@gmail.com> writes:

> In the past, ISTR, Eli suggested to benchmark such things by visiting a
> very large file in its beginning, then scrolling down by holding
> the down arrow or PgDn for some fixed time period, like 30 seconds.
> The  Emacs that scrolls the farthest is the most performant.  Not
> entirely fail-proof (other processes may interfere, etc), but not
> bad either.
>
> So here you could create very large fictitious Elisp file with 0, 1, 3 and
> 10 shorthands each and then run your version vs my version and record
> the final line numbers.  Then show the files and the numbers.

In a 2.5M Elisp file with 0 shorthand prefixes, after 30s of pressing
C-v (scroll-up-command), point was on line 19238.

I then tried the same file with 1 and 4 shorthands, and I got basically
the same result:

| With 1 shorthand prefix |       |
|-------------------------+-------|
| No patch                | 19447 |
| mismatch                | 19238 |
| compare all prefixes    | 19024 |

| With 4 shorthand prefixes |       |
|---------------------------+-------|
| No patch                  | 19211 |
| mismatch                  | 19521 |
| compare all prefixes      | 19339 |

There is a big margin of error (probably around 500-1000 lines) since my
method wasn't at all exact. I stopped holding C-v when the stopwatch on
another device hit 30s, and I might have held for ±1s.

If this approach to benchmarking is valid, I think it indicates that
shorthands has no significant effect on performance in either case,
though there may be a greater difference with more shorthand prefixes.

> My version keeps a behaviour that can be considered buggy.
> If a shorthand prefix has a common suffix with the longhand prefix
> then that suffix will not be highlighted. Like:

> ;; Local Variables:
> ;; read-symbol-shorthands: (("bcrumb-" . "breadcrumb-")
> ;; End:

> Here only "b" would be highlighted, effectively showing the user
> how much typing was saved.  Is this wrong?  Does it makes sense
> to use shorthands like this?

Another example case:

;; Local Variables:
;; read-symbol-shorthands: (("aw-" . "ace-window-")
;; End:

Here only "a" would be highlighted.

Thanks,

Joseph





^ permalink raw reply	[relevance 5%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-26 20:35  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-26 22:02  5%                 ` João Távora
  2023-11-27  3:48  5%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-27 12:10  0%                   ` Eli Zaretskii
  0 siblings, 2 replies; 200+ results
From: João Távora @ 2023-11-26 22:02 UTC (permalink / raw)
  To: Joseph Turner, Eli Zaretskii; +Cc: 67390, Adam Porter, Jonas Bernoulli

On Sun, Nov 26, 2023 at 8:38 PM Joseph Turner <joseph@ushin.org> wrote:
>
> João Távora <joaotavora@gmail.com> writes:
>
> > On Sat, Nov 25, 2023 at 10:43 PM Joseph Turner <joseph@ushin.org> wrote:

> > So, benchmarking it will have to be, I'm afraid, because AFAIK
> > font-locking is a very performance sensitive area of Emacs.
>
> Yes.  I would like to learn how to do this!

I'm CCing Eli.

In the past, ISTR, Eli suggested to benchmark such things by visiting a
very large file in its beginning, then scrolling down by holding
the down arrow or PgDn for some fixed time period, like 30 seconds.
The  Emacs that scrolls the farthest is the most performant.  Not
entirely fail-proof (other processes may interfere, etc), but not
bad either.

So here you could create very large fictitious Elisp file with 0, 1, 3 and
10 shorthands each and then run your version vs my version and record
the final line numbers.  Then show the files and the numbers.

> > In the meantime I will push my patch, but keep the bug open to see
> > if it is worth pushing Joseph's version.
>
> Thank you!!

Now done in 36941e9e6a (master).

> I'm happy to discuss this further if others are interested.

I'm keeping this open.

João





^ permalink raw reply	[relevance 5%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-11-26 10:41  0%                     ` Eli Zaretskii
@ 2023-11-26 20:39  5%                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-27 12:01  0%                         ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-26 20:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 66115-done, philipk


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: philipk@posteo.net, 66115@debbugs.gnu.org
>> Date: Sat, 25 Nov 2023 14:59:46 -0800
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > From: Joseph Turner <joseph@breatheoutbreathe.in>
>> >> Would you be willing to merge the attached patch?
>> >
>> > I tried, but it doesn't apply to emacs-29.  Would you please submit a
>> > change relative to the emacs-29 branch?
>>
>> Sorry about that!  Here you go!
>
> Thanks, installed on the emacs-29 branch, and closing the bug.

Thank you, Eli!  I made a mistake - I forgot to add "Do not merge into
master" in the commit message.  Do we need to add a commit on the master
branch which reverts this one?

Joseph





^ permalink raw reply	[relevance 5%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-26 13:52  4%             ` João Távora
@ 2023-11-26 20:35  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-26 22:02  5%                 ` João Távora
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-26 20:35 UTC (permalink / raw)
  To: João Távora; +Cc: 67390, Adam Porter, Jonas Bernoulli

João Távora <joaotavora@gmail.com> writes:

> On Sat, Nov 25, 2023 at 10:43 PM Joseph Turner <joseph@ushin.org> wrote:
>>
>> Jonas Bernoulli <jonas@bernoul.li> writes:
>>
>> > Joseph Turner <joseph@ushin.org> writes:
>> >
>> >> +                          (car (shorthands--find-if
>> >> +                                (lambda (short)
>> >> +                                  (string-prefix-p short (match-string 1)))
>> >> +                                read-symbol-shorthands #'car)))))
>> >
>> > Or simply:
>> >   (car (assoc (match-string 1)
>> >               read-symbol-shorthands
>> >               #'string-prefix-p))
>>
>> Much nicer - see patch.  Thanks, Jonas!
>
> So, I had a look at this patch and I think we should compare it
> with the patch after my sig, which keeps 'shorthands--mismatch-from-end'
> and also fixes this bug.
>
> The main difference I see is that my patch keeps doing one string
> comparison, via the mismatch function (which btw is now perfectly
> analogous to CL mismatch and thus correctly named).  In the worst case,
> Josheph's patch does 1 + N where N is the number of shorthands.  So
> this is a fundamental complexity change.
>
> Normally, that would be the end of the story, but here, it isn't.
> For two reasons.
>
> My version keeps a behaviour that can be considered buggy.
> If a shorthand prefix has a common suffix with the longhand prefix
> then that suffix will not be highlighted. Like:
>
> ;; Local Variables:
> ;; read-symbol-shorthands: (("bcrumb-" . "breadcrumb-")
> ;; End:
>
> Here only "b" would be highlighted, effectively showing the user
> how much typing was saved.  Is this wrong?  Does it makes sense
> to use shorthands like this?

I would expect the entire the shorthand to be highlit, I don't feeling
strongly about this.

> The other reason why this isn't the end of the story is that even
> if we take that bug for granted, the string comparison functions in
> Joshep's patch delegate to built-in C  comparison operators, which are
> often much, much faster than Elisp.  At least before the advent of native
> compilation, it used to be like this. Of course for a large enough  N
> number of shorthands, my version wins, but that is probably not very
> common either (or is it?  Not very hard to imagine a file making use
> of many libraries and shorthanding each of them?)
>
> So, benchmarking it will have to be, I'm afraid, because AFAIK
> font-locking is a very performance sensitive area of Emacs.

Yes.  I would like to learn how to do this!

> In the meantime I will push my patch, but keep the bug open to see
> if it is worth pushing Joseph's version.

Thank you!!  I'm happy to discuss this further if others are interested.

Joseph





^ permalink raw reply	[relevance 5%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-25 22:42  9%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-26 13:52  4%             ` João Távora
  2023-11-26 20:35  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: João Távora @ 2023-11-26 13:52 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 67390, Adam Porter, Jonas Bernoulli

On Sat, Nov 25, 2023 at 10:43 PM Joseph Turner <joseph@ushin.org> wrote:
>
> Jonas Bernoulli <jonas@bernoul.li> writes:
>
> > Joseph Turner <joseph@ushin.org> writes:
> >
> >> +                          (car (shorthands--find-if
> >> +                                (lambda (short)
> >> +                                  (string-prefix-p short (match-string 1)))
> >> +                                read-symbol-shorthands #'car)))))
> >
> > Or simply:
> >   (car (assoc (match-string 1)
> >               read-symbol-shorthands
> >               #'string-prefix-p))
>
> Much nicer - see patch.  Thanks, Jonas!

So, I had a look at this patch and I think we should compare it
with the patch after my sig, which keeps 'shorthands--mismatch-from-end'
and also fixes this bug.

The main difference I see is that my patch keeps doing one string
comparison, via the mismatch function (which btw is now perfectly
analogous to CL mismatch and thus correctly named).  In the worst case,
Josheph's patch does 1 + N where N is the number of shorthands.  So
this is a fundamental complexity change.

Normally, that would be the end of the story, but here, it isn't.
For two reasons.

My version keeps a behaviour that can be considered buggy.
If a shorthand prefix has a common suffix with the longhand prefix
then that suffix will not be highlighted. Like:

;; Local Variables:
;; read-symbol-shorthands: (("bcrumb-" . "breadcrumb-")
;; End:

Here only "b" would be highlighted, effectively showing the user
how much typing was saved.  Is this wrong?  Does it makes sense
to use shorthands like this?

The other reason why this isn't the end of the story is that even
if we take that bug for granted, the string comparison functions in
Joshep's patch delegate to built-in C  comparison operators, which are
often much, much faster than Elisp.  At least before the advent of native
compilation, it used to be like this. Of course for a large enough  N
number of shorthands, my version wins, but that is probably not very
common either (or is it?  Not very hard to imagine a file making use
of many libraries and shorthanding each of them?)

So, benchmarking it will have to be, I'm afraid, because AFAIK
font-locking is a very performance sensitive area of Emacs.

In the meantime I will push my patch, but keep the bug open to see
if it is worth pushing Joseph's version.

João


diff --git a/lisp/emacs-lisp/shorthands.el b/lisp/emacs-lisp/shorthands.el
index 82200ab88e9..b0665a55695 100644
--- a/lisp/emacs-lisp/shorthands.el
+++ b/lisp/emacs-lisp/shorthands.el
@@ -53,11 +53,16 @@ elisp-shorthand-font-lock-face
   :group 'font-lock-faces)

 (defun shorthands--mismatch-from-end (str1 str2)
+  "Tell index of first mismatch in STR1 and STR2, from end.
+The index is a valid 0-based index on STR1.  Returns nil if STR1
+equals STR2.  Return 0 if STR1 is a suffix of STR2."
   (cl-loop with l1 = (length str1) with l2 = (length str2)
            for i from 1
            for i1 = (- l1 i) for i2 = (- l2 i)
-           while (and (>= i1 0) (>= i2 0) (eq (aref str1 i1) (aref str2 i2)))
-           finally (return (1- i))))
+           while (eq (aref str1 i1) (aref str2 i2))
+           if (zerop i2) return (if (zerop i1) nil i1)
+           if (zerop i1) return 0
+           finally (return i1)))

 (defun shorthands-font-lock-shorthands (limit)
   (when read-symbol-shorthands
@@ -69,10 +74,16 @@ shorthands-font-lock-shorthands
                                                font-lock-string-face)))
                          (intern-soft (match-string 1))))
              (sname (and probe (symbol-name probe)))
-             (mm (and sname (shorthands--mismatch-from-end
-                             (match-string 1) sname))))
-        (unless (or (null mm) (= mm (length sname)))
-          (add-face-text-property (match-beginning 1) (1+ (- (match-end 1) mm))
+             (mismatch (and sname (shorthands--mismatch-from-end
+                                   (match-string 1) sname)))
+             (guess (and mismatch (1+ mismatch))))
+        (when guess
+          (when (and (< guess (1- (length (match-string 1))))
+                     ;; In bug#67390 we allow other separators
+                     (eq (char-syntax (aref (match-string 1) guess)) ?_))
+            (setq guess (1+ guess)))
+          (add-face-text-property (match-beginning 1)
+                                  (+ (match-beginning 1) guess)
                                   'elisp-shorthand-font-lock-face))))))

 (font-lock-add-keywords 'emacs-lisp-mode
'((shorthands-font-lock-shorthands)) t)





^ permalink raw reply related	[relevance 4%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-11-25 22:59 11%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-26 10:41  0%                     ` Eli Zaretskii
  2023-11-26 20:39  5%                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-11-26 10:41 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66115-done, philipk

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: philipk@posteo.net, 66115@debbugs.gnu.org
> Date: Sat, 25 Nov 2023 14:59:46 -0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > From: Joseph Turner <joseph@breatheoutbreathe.in>
> >> Would you be willing to merge the attached patch?
> >
> > I tried, but it doesn't apply to emacs-29.  Would you please submit a
> > change relative to the emacs-29 branch?
> 
> Sorry about that!  Here you go!

Thanks, installed on the emacs-29 branch, and closing the bug.





^ permalink raw reply	[relevance 0%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-11-12 21:26 10%                                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-26  6:49 11%                                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-26  6:49 UTC (permalink / raw)
  To: Stefan Monnier, Eli Zaretskii, michael_heerdegen, philipk, 66187

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>> Then I think we should install your patch on the emacs-29 branch,
>>> thanks.
>>
>> Thanks for the vote of confidence, but as Joseph points out, the patch
>> isn't actually doing what it says on the tin, so we first have to fix
>> it :-)
>
> Here's another potential solution.  While the attached patch seems to
> work, I'm not sure that minibuffer-completion-confirm should be checked
> in completion--do-completion instead of completion--complete-and-exit.
>
> Thoughts?

I just ran the tests in /test/lisp/minibuffer-tests.el with this patch,
and they all still pass.

> Thanks!
>
> Joseph
>
> [2. text/x-diff; 0001-Fix-completing-read-functional-REQUIRE-MATCH-behavio.patch]...





^ permalink raw reply	[relevance 11%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-11-25 10:17  0%                 ` Eli Zaretskii
@ 2023-11-25 22:59 11%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-26 10:41  0%                     ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-25 22:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 66115, philipk

[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Would you be willing to merge the attached patch?
>
> I tried, but it doesn't apply to emacs-29.  Would you please submit a
> change relative to the emacs-29 branch?

Sorry about that!  Here you go!

Thanks,

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Ensure-that-directory-is-expanded-in-package-vc-chec.patch --]
[-- Type: text/x-diff, Size: 1053 bytes --]

From 49a94115d7f6bde1618f754265ec3ea8154dd922 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sat, 25 Nov 2023 14:57:45 -0800
Subject: [PATCH] Ensure that directory is expanded in package-vc-checkout

* lisp/emacs-lisp/package-vc.el (package-vc-checkout)

bug#66115
---
 lisp/emacs-lisp/package-vc.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index c7a30736e32..2a5f14b3ee3 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -829,6 +829,7 @@ for the last released version of the package."
                            (lambda (dir) (or (not (file-exists-p dir))
                                              (directory-empty-p dir))))
            (and current-prefix-arg :last-release))))
+  (setf directory (expand-file-name directory))
   (package-vc--archives-initialize)
   (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
                       (and-let* ((extras (package-desc-extras pkg-desc))
-- 
2.41.0


^ permalink raw reply related	[relevance 11%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-25 16:01  5%         ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-25 22:42  9%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-26 13:52  4%             ` João Távora
  2023-11-29 13:30  0%           ` João Távora
  1 sibling, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-25 22:42 UTC (permalink / raw)
  To: Jonas Bernoulli; +Cc: 67390, Adam Porter, João Távora

[-- Attachment #1: Type: text/plain, Size: 512 bytes --]

Jonas Bernoulli <jonas@bernoul.li> writes:

> Joseph Turner <joseph@ushin.org> writes:
>
>> +                          (car (shorthands--find-if
>> +                                (lambda (short)
>> +                                  (string-prefix-p short (match-string 1)))
>> +                                read-symbol-shorthands #'car)))))
>
> Or simply:
>   (car (assoc (match-string 1)
>               read-symbol-shorthands
>               #'string-prefix-p))

Much nicer - see patch.  Thanks, Jonas!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Support-shorthand-prefixes-besides.patch --]
[-- Type: text/x-diff, Size: 2341 bytes --]

From 5033a0e14950ed1622db78df1828c40de4b5a23a Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Fri, 24 Nov 2023 19:17:13 -0800
Subject: [PATCH] Support shorthand prefixes besides "-"

* lisp/emacs-lisp/shorthands.el (shorthands-font-lock-shorthands):
Add font locking to the shorthand prefix by checking if any of the
shorthand prefixes in read-symbol-shorthands are a prefix for the
current symbol name (bug#67390).

Co-authored-by: Jonas Bernoulli <jonas@bernoul.li>
---
 lisp/emacs-lisp/shorthands.el | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/lisp/emacs-lisp/shorthands.el b/lisp/emacs-lisp/shorthands.el
index 82200ab88e9..6ce9984a353 100644
--- a/lisp/emacs-lisp/shorthands.el
+++ b/lisp/emacs-lisp/shorthands.el
@@ -52,13 +52,6 @@
   :version "28.1"
   :group 'font-lock-faces)
 
-(defun shorthands--mismatch-from-end (str1 str2)
-  (cl-loop with l1 = (length str1) with l2 = (length str2)
-           for i from 1
-           for i1 = (- l1 i) for i2 = (- l2 i)
-           while (and (>= i1 0) (>= i2 0) (eq (aref str1 i1) (aref str2 i2)))
-           finally (return (1- i))))
-
 (defun shorthands-font-lock-shorthands (limit)
   (when read-symbol-shorthands
     (while (re-search-forward
@@ -69,10 +62,14 @@
                                                font-lock-string-face)))
                          (intern-soft (match-string 1))))
              (sname (and probe (symbol-name probe)))
-             (mm (and sname (shorthands--mismatch-from-end
-                             (match-string 1) sname))))
-        (unless (or (null mm) (= mm (length sname)))
-          (add-face-text-property (match-beginning 1) (1+ (- (match-end 1) mm))
+             (prefix (and sname
+                          (not (string-equal (match-string 1) sname))
+                          (car (assoc (match-string 1)
+                                      read-symbol-shorthands
+                                      #'string-prefix-p)))))
+        (when prefix
+          (add-face-text-property (match-beginning 1)
+                                  (+ (match-beginning 1) (length prefix))
                                   'elisp-shorthand-font-lock-face))))))
 
 (font-lock-add-keywords 'emacs-lisp-mode '((shorthands-font-lock-shorthands)) t)
-- 
2.41.0


^ permalink raw reply related	[relevance 9%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  2023-11-25  3:26  9%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-25 16:01  5%         ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-25 22:42  9%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-29 13:30  0%           ` João Távora
  0 siblings, 2 replies; 200+ results
From: Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-25 16:01 UTC (permalink / raw)
  To: Joseph Turner, João Távora; +Cc: 67390, Adam Porter

Joseph Turner <joseph@ushin.org> writes:

> +                          (car (shorthands--find-if
> +                                (lambda (short)
> +                                  (string-prefix-p short (match-string 1)))
> +                                read-symbol-shorthands #'car)))))

Or simply:
  (car (assoc (match-string 1)
              read-symbol-shorthands
              #'string-prefix-p))





^ permalink raw reply	[relevance 5%]

* bug#67325: shorthands: Incorrect autoloaded register-definition-prefixes
  2023-11-25  4:18  5%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-25 12:44  5%       ` João Távora
  0 siblings, 0 replies; 200+ results
From: João Távora @ 2023-11-25 12:44 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 67325, Eli Zaretskii, public, Jonas Bernoulli

[-- Attachment #1: Type: text/plain, Size: 611 bytes --]

On Sat, Nov 25, 2023, 04:21 Joseph Turner <joseph@ushin.org> wrote:

> João Távora <joaotavora@gmail.com> writes:
> >> From:  Joseph Turner
> >> > Also see bug#63480.
> >
> > What about it?  What's the relation to this bug?
>
> bug#63480 is also related to incorrect autoload generation with
> shorthands.


Hmmm. The two bugs are not related anymore than two Emacs bugs are related.
That bug has a (very decent IMO) workaround. If you want something to be
done there additionally, request it there

> I don't know if these two bugs will have related solutions.

I don't think so.

João

[-- Attachment #2: Type: text/html, Size: 1182 bytes --]

^ permalink raw reply	[relevance 5%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-11-19 22:16 11%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-25 10:17  0%                 ` Eli Zaretskii
  2023-11-25 22:59 11%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-11-25 10:17 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66115, philipk

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: Eli Zaretskii <eliz@gnu.org>, 66115@debbugs.gnu.org
> Date: Sun, 19 Nov 2023 14:16:39 -0800
> 
> Philip Kaludercic <philipk@posteo.net> writes:
> 
> > Joseph Turner <joseph@breatheoutbreathe.in> writes:
> >
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >>
> >>>> Cc: 66115-done@debbugs.gnu.org
> >>>> Date: Sat, 23 Sep 2023 22:34:24 -0700
> >>>> From:  Joseph Turner via "Bug reports for GNU Emacs,
> >>>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> >>>>
> >>>> It appears that the fix was applied to master. Would it make sense to
> >>>> apply it to emacs-29?
> >>>
> >>> The installed change affects much more than the original issue, so I'd
> >>> prefer for it to stay on master.
> >>>
> >>> I'm okay with installing the original patch on emacs-29, but be sure
> >>> to say "do not merge to master" in the commit log message if you do.
> >>
> >> Philip, shall we merge the original patch on emacs-29 with "do not merge
> >> to master"?
> >
> > I don't object.
> 
> Would you be willing to merge the attached patch?

I tried, but it doesn't apply to emacs-29.  Would you please submit a
change relative to the emacs-29 branch?

TIA





^ permalink raw reply	[relevance 0%]

* bug#67325: shorthands: Incorrect autoloaded register-definition-prefixes
  2023-11-24  9:24  0%   ` João Távora
@ 2023-11-25  4:18  5%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-25 12:44  5%       ` João Távora
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-25  4:18 UTC (permalink / raw)
  To: João Távora; +Cc: 67325, Eli Zaretskii, public, jonas

João Távora <joaotavora@gmail.com> writes:
>> From:  Joseph Turner
>> > Also see bug#63480.
>
> What about it?  What's the relation to this bug?

bug#63480 is also related to incorrect autoload generation with
shorthands.  I don't know if these two bugs will have related solutions.

Joseph





^ permalink raw reply	[relevance 5%]

* bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator
  @ 2023-11-25  3:26  9%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-25 16:01  5%         ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-25  3:26 UTC (permalink / raw)
  To: João Távora; +Cc: 67390, Adam Porter, Jonas Bernoulli

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

João Távora <joaotavora@gmail.com> writes:

> On Fri, Nov 24, 2023 at 9:51 PM Jonas Bernoulli <jonas@bernoul.li> wrote:
>
>> Also, have you considered throwing in a
>>   (not (string-equal (match-string 1) sname))
>>
>> to avoid having to call `shorthands--mismatch-from-end' at all?
>
> Where and how this be thrown in?  How would you know what to highlight
> in the shorthand printed form?  There can be many shorthand prefixes
> in a given file.  But do show some code.

Please see the attached patch, inspired by Jonas's comment.

>> Maybe you have, but concluded it is cheaper to do a bit too much work
>> for non-shorthands, than to effectively repeat some work for shorthands.
>
> Maybe.  Not sure this is more work (string-equal must still compare
> every character right?), but, in summary, I'm not married to this
> implementation.  I somewhat appreciate that I could still read it
> after not having looked  at it for a couple years, but feel free to
> change it.

I haven't done any benchmarking - I'm curious to learn how to benchmark
font lock though!

Thanks!!

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Support-shorthand-prefixes-besides.patch --]
[-- Type: text/x-diff, Size: 2991 bytes --]

From e469c9d621116857bd1d84720eb2eb43d4560074 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Fri, 24 Nov 2023 19:17:13 -0800
Subject: [PATCH] Support shorthand prefixes besides "-"

Previously, shorthands-font-lock-shorthands added font locking to the
shorthand prefix by checking for a mismatch between the shorthand and
longhand symbols.  This broke font-locking when the shorthand prefix
separator was not "-" (bug#67390).

Now, shorthands-font-lock-shorthands adds font locking to the
shorthand prefix by checking if any of the shorthand prefixes in
read-symbol-shorthands are a prefix for the current symbol name.

Thanks to Jonas Bernoulli for the idea to use
(not (string-equal (match-string 1) sname))
---
 lisp/emacs-lisp/shorthands.el | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/lisp/emacs-lisp/shorthands.el b/lisp/emacs-lisp/shorthands.el
index 82200ab88e9..141b6115a3d 100644
--- a/lisp/emacs-lisp/shorthands.el
+++ b/lisp/emacs-lisp/shorthands.el
@@ -52,12 +52,14 @@
   :version "28.1"
   :group 'font-lock-faces)
 
-(defun shorthands--mismatch-from-end (str1 str2)
-  (cl-loop with l1 = (length str1) with l2 = (length str2)
-           for i from 1
-           for i1 = (- l1 i) for i2 = (- l2 i)
-           while (and (>= i1 0) (>= i2 0) (eq (aref str1 i1) (aref str2 i2)))
-           finally (return (1- i))))
+(defun shorthands--find-if (predicate seq &optional key)
+  "Find the first item satisfying PREDICATE in SEQ.
+Return the matching item, or nil if not found. Optional argument
+KEY is used to filter SEQ, as in `cl-find-if'."
+  (catch 'found
+    (dolist (el seq)
+      (when (funcall predicate (funcall (or key #'identity) el))
+        (throw 'found el)))))
 
 (defun shorthands-font-lock-shorthands (limit)
   (when read-symbol-shorthands
@@ -69,10 +71,15 @@
                                                font-lock-string-face)))
                          (intern-soft (match-string 1))))
              (sname (and probe (symbol-name probe)))
-             (mm (and sname (shorthands--mismatch-from-end
-                             (match-string 1) sname))))
-        (unless (or (null mm) (= mm (length sname)))
-          (add-face-text-property (match-beginning 1) (1+ (- (match-end 1) mm))
+             (prefix (and sname
+                          (not (string-equal (match-string 1) sname))
+                          (car (shorthands--find-if
+                                (lambda (short)
+                                  (string-prefix-p short (match-string 1)))
+                                read-symbol-shorthands #'car)))))
+        (when prefix
+          (add-face-text-property (match-beginning 1)
+                                  (+ (match-beginning 1) (length prefix))
                                   'elisp-shorthand-font-lock-face))))))
 
 (font-lock-add-keywords 'emacs-lisp-mode '((shorthands-font-lock-shorthands)) t)
-- 
2.41.0


^ permalink raw reply related	[relevance 9%]

* bug#67325: shorthands: Incorrect autoloaded register-definition-prefixes
  2023-11-24  8:06  0% ` Eli Zaretskii
@ 2023-11-24  9:24  0%   ` João Távora
  2023-11-25  4:18  5%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: João Távora @ 2023-11-24  9:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Joseph Turner, 67325, jonas, public

On Fri, Nov 24, 2023 at 8:06 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > Cc: Protesilaos Stavrou <public@protesilaos.com>,
> >  Jonas Bernoulli <jonas@bernoul.li>,
> >  João Távora <joaotavora@gmail.com>
> > Date: Mon, 20 Nov 2023 11:50:50 -0800
> > From:  Joseph Turner via "Bug reports for GNU Emacs,
> >  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> >
> > When using shorthands.el, autoload generation inserts a call to
> > register-definition-prefixes with the shorthand prefix, instead of the
> > translated print name prefix.  For example, breadcrumb-autoloads.el
> > contains the line:
> >
> > (register-definition-prefixes "breadcrumb" '("bc-"))
> >
> > instead of
> >
> > (register-definition-prefixes "breadcrumb" '("breadcrumb-"))
> >
> > This PR attempts to resolve this issue in breadcrumb.el by adding the
> > correct autoload line at the bottom of the file:
> >
> > https://github.com/joaotavora/breadcrumb/pull/24
> >
> > What needs to be done in core Emacs to fix autoload generation with
> > shorthands.el?
> >
> > Also see bug#63480.
>
> João, any comments?

Yes.  Well first, we are talking about an imperfect heuristic here
which lives in lisp/emacs-lisp/loaddefs-gen.el.  That's where
the definition prefixes for a given file are collected and the
common prefix is guessed, leading to the generation of the
register-definition-prefixes form.

The logic seems to have a number of exceptions and corner cases
baked into it already, and there seems to be even a specific
kill-switch for this particular register-definition-prefixes form:

;; Local Variables:
;; autoload-compute-prefixes: nil
;; End:

This form should probably be added to breadcrumb.el so that
the autoload mechanism would stop trying to guess the prefix
using its current flawed methods.  I've already asked the
submitters of the pull request to do so at the Breadcrumb
upstream.

BTW.  Grepping for autoload-compute-prefixes seems to indicate
it is totally undocumented. It's not even a defvar,
just an autoload-specific cookies.  This is fine, but I guess
it should still be documented somewhere.

OK so that solves the problem for breadcrumb.el and other
such shorthand-using packages such as beardbolt.el and others
I see popping up.

But maybe this issue can still be kept open.  It shouldn't be
terribly hard to add a fix to loaddefs-generate--compute-prefixes
or loaddefs-generate--make-prefixes that takes shorthands in
consideration.  In fact, the presence of a shorthand might
be a more reliable indicator of the package's intended "external"
prefix than any of the current heuristics.

> > Also see bug#63480.

What about it?  What's the relation to this bug?

João





^ permalink raw reply	[relevance 0%]

* bug#67325: shorthands: Incorrect autoloaded register-definition-prefixes
  2023-11-20 19:50  5% bug#67325: shorthands: Incorrect autoloaded register-definition-prefixes Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-24  8:06  0% ` Eli Zaretskii
  2023-11-24  9:24  0%   ` João Távora
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-11-24  8:06 UTC (permalink / raw)
  To: Joseph Turner, joaotavora; +Cc: 67325, jonas, public

> Cc: Protesilaos Stavrou <public@protesilaos.com>,
>  Jonas Bernoulli <jonas@bernoul.li>,
>  João Távora <joaotavora@gmail.com>
> Date: Mon, 20 Nov 2023 11:50:50 -0800
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> When using shorthands.el, autoload generation inserts a call to
> register-definition-prefixes with the shorthand prefix, instead of the
> translated print name prefix.  For example, breadcrumb-autoloads.el
> contains the line:
> 
> (register-definition-prefixes "breadcrumb" '("bc-"))
> 
> instead of
> 
> (register-definition-prefixes "breadcrumb" '("breadcrumb-"))
> 
> This PR attempts to resolve this issue in breadcrumb.el by adding the
> correct autoload line at the bottom of the file:
> 
> https://github.com/joaotavora/breadcrumb/pull/24
> 
> What needs to be done in core Emacs to fix autoload generation with
> shorthands.el?
> 
> Also see bug#63480.

João, any comments?





^ permalink raw reply	[relevance 0%]

* bug#63480: 30.0.50; [BUG] unimplemented logic regarding read-symbol-shorthands
    @ 2023-11-23 21:38  5% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-23 21:38 UTC (permalink / raw)
  To: stefankangas; +Cc: 63480, ruijie, joaotavora

Also see https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-11/msg01151.html





^ permalink raw reply	[relevance 5%]

* bug#67325: shorthands: Incorrect autoloaded register-definition-prefixes
@ 2023-11-20 19:50  5% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-24  8:06  0% ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-20 19:50 UTC (permalink / raw)
  To: 67325; +Cc: Protesilaos Stavrou, Jonas Bernoulli, João Távora

When using shorthands.el, autoload generation inserts a call to
register-definition-prefixes with the shorthand prefix, instead of the
translated print name prefix.  For example, breadcrumb-autoloads.el
contains the line:

(register-definition-prefixes "breadcrumb" '("bc-"))

instead of

(register-definition-prefixes "breadcrumb" '("breadcrumb-"))

This PR attempts to resolve this issue in breadcrumb.el by adding the
correct autoload line at the bottom of the file:

https://github.com/joaotavora/breadcrumb/pull/24

What needs to be done in core Emacs to fix autoload generation with
shorthands.el?

Also see bug#63480.

Thanks!

Joseph





^ permalink raw reply	[relevance 5%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-11-16  6:44  5%             ` Philip Kaludercic
@ 2023-11-19 22:16 11%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-25 10:17  0%                 ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-19 22:16 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 66115, Eli Zaretskii

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]


Philip Kaludercic <philipk@posteo.net> writes:

> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>>>> Cc: 66115-done@debbugs.gnu.org
>>>> Date: Sat, 23 Sep 2023 22:34:24 -0700
>>>> From:  Joseph Turner via "Bug reports for GNU Emacs,
>>>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>>>
>>>> It appears that the fix was applied to master. Would it make sense to
>>>> apply it to emacs-29?
>>>
>>> The installed change affects much more than the original issue, so I'd
>>> prefer for it to stay on master.
>>>
>>> I'm okay with installing the original patch on emacs-29, but be sure
>>> to say "do not merge to master" in the commit log message if you do.
>>
>> Philip, shall we merge the original patch on emacs-29 with "do not merge
>> to master"?
>
> I don't object.

Would you be willing to merge the attached patch?

Thank you!!

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Ensure-that-directory-is-expanded-in-package-vc-chec.patch --]
[-- Type: text/x-diff, Size: 1015 bytes --]

From 75a6ec74ff5e31edc7592b68e7ad9d1ec26f515c Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Wed, 20 Sep 2023 00:12:10 -0700
Subject: [PATCH] Ensure that directory is expanded in package-vc-checkout

* lisp/emacs-lisp/package-vc.el (package-vc-checkout)
---
 lisp/emacs-lisp/package-vc.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 29b540d86b8..47d8c996ff0 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -834,6 +834,7 @@ for the last released version of the package."
              (setf dir subdir)
            (user-error "Directory not empty: %S" (expand-file-name dir)))))
      (list desc dir (and current-prefix-arg :last-release))))
+  (setf directory (expand-file-name directory))
   (package-vc--archives-initialize)
   (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
                       (and-let* ((extras (package-desc-extras pkg-desc))
-- 
2.41.0


^ permalink raw reply related	[relevance 11%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
       [not found]               ` <87msviogui.fsf@breatheoutbreathe.in>
@ 2023-11-16  6:44  5%             ` Philip Kaludercic
  2023-11-19 22:16 11%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Philip Kaludercic @ 2023-11-16  6:44 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66115, Eli Zaretskii

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> Cc: 66115-done@debbugs.gnu.org
>>> Date: Sat, 23 Sep 2023 22:34:24 -0700
>>> From:  Joseph Turner via "Bug reports for GNU Emacs,
>>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>>
>>> It appears that the fix was applied to master. Would it make sense to
>>> apply it to emacs-29?
>>
>> The installed change affects much more than the original issue, so I'd
>> prefer for it to stay on master.
>>
>> I'm okay with installing the original patch on emacs-29, but be sure
>> to say "do not merge to master" in the commit log message if you do.
>
> Philip, shall we merge the original patch on emacs-29 with "do not merge
> to master"?

I don't object.

> Thank you!!
>
> Joseph





^ permalink raw reply	[relevance 5%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  @ 2023-11-12 21:26 10%                                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-26  6:49 11%                                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-12 21:26 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: michael_heerdegen, Eli Zaretskii, philipk, 66187

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Then I think we should install your patch on the emacs-29 branch,
>> thanks.
>
> Thanks for the vote of confidence, but as Joseph points out, the patch
> isn't actually doing what it says on the tin, so we first have to fix
> it :-)

Here's another potential solution.  While the attached patch seems to
work, I'm not sure that minibuffer-completion-confirm should be checked
in completion--do-completion instead of completion--complete-and-exit.

Thoughts?

Thanks!

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-completing-read-functional-REQUIRE-MATCH-behavio.patch --]
[-- Type: text/x-diff, Size: 1407 bytes --]

From 609bf4964f88b01f4843e29b2cf71ee1cd2f6125 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sun, 12 Nov 2023 13:21:50 -0800
Subject: [PATCH] Fix completing-read functional REQUIRE-MATCH behavior

* lisp/minibuffer.el (completion--complete-and-exit): If
minibuffer-completion-confirm is a function which returns nil,
immediately fail to complete.

See bug#66187.
---
 lisp/minibuffer.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 3e30b68d5e9..9fad3e71fad 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1847,10 +1847,13 @@ appear to be a match."
    ;; Allow user to specify null string
    ((= beg end) (funcall exit-function))
    ;; The CONFIRM argument is a predicate.
-   ((and (functionp minibuffer-completion-confirm)
-         (funcall minibuffer-completion-confirm
-                  (buffer-substring beg end)))
-    (funcall exit-function))
+   ((functionp minibuffer-completion-confirm)
+    (if (funcall minibuffer-completion-confirm
+                 (buffer-substring beg end))
+        (funcall exit-function)
+      (unless completion-fail-discreetly
+	(ding)
+	(completion--message "No match"))))
    ;; See if we have a completion from the table.
    ((test-completion (buffer-substring beg end)
                      minibuffer-completion-table
-- 
2.41.0


^ permalink raw reply related	[relevance 10%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-10-05  1:34  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-12 20:42 11%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-12 20:42 UTC (permalink / raw)
  To: michael_heerdegen, 66224, philipk


Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Michael Heerdegen <michael_heerdegen@web.de> writes:
>
>> Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
>> text editors" <bug-gnu-emacs@gnu.org> writes:
>>
>>> I'm not sure what you mean. In both of the following examples, PREDICATE
>>> is used to narrow the completion candidates to only empty directories:
>>>
>>> (read-directory-name "Prompt: " "~/" nil t nil #'directory-empty-p)
>>> (read-directory-name "Prompt: " "~/" nil nil nil #'directory-empty-p)
>>
>> In the second version also non-empty directories will be accepted.
>
> Yes, PREDICATE narrows the completion candidates but doesn't determine a
> valid return value.

Ping!  I'm happy to keep discussing this patch if others are interested.





^ permalink raw reply	[relevance 11%]

* bug#65768: Bump persist.el version
  2023-11-06 20:38  5%             ` phillip.lord
@ 2023-11-12  4:27  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-12  4:27 UTC (permalink / raw)
  To: phillip.lord; +Cc: Eli Zaretskii, stefankangas, 65768


phillip.lord@russet.org.uk writes:

> On 2023-10-31 17:05, Joseph Turner wrote:
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>>> Cc: Stefan Kangas <stefankangas@gmail.com>, Eli Zaretskii
>>>> <eliz@gnu.org>,
>>>>  65768@debbugs.gnu.org
>>>> Date: Tue, 31 Oct 2023 08:41:55 -0700
>>>> phillip.lord@russet.org.uk writes:
>>>>  > Would you be interested in taking over maintainership of
>>>> persist? I am
>>>> > very short of Emacs time these days.
>>>> Yes, I am interested!  Stefan, Eli, what do you think?
>>> I can only welcome you.  Thanks for volunteering!
>> Thank you :)
>
>
> And thank you indeed! I will be very interested to see where you take
> persist.

Thank you, Phil!!






^ permalink raw reply	[relevance 5%]

* bug#65768: Bump persist.el version
  2023-11-01  0:34  5%             ` Stefan Kangas
@ 2023-11-12  4:26 28%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-12  4:26 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Eli Zaretskii, 65768, phillip.lord

[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

Stefan Kangas <stefankangas@gmail.com> writes:

> Perhaps before releasing v0.6, it would make sense to update the
> Maintainer header comment to reflect that you're now the maintainer?
> If you agree, feel free to send a patch.

Sounds good!  Please see attached patches.

Thank you!

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Update-Maintainer-header.patch --]
[-- Type: text/x-diff, Size: 687 bytes --]

From ada801226c3a64d02e5178280614f513eab0f911 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sat, 11 Nov 2023 20:24:54 -0800
Subject: [PATCH 1/2] Update Maintainer header

---
 persist.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/persist.el b/persist.el
index e43171459e..26b8b84e2e 100644
--- a/persist.el
+++ b/persist.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2019 Free Software Foundation, Inc.
 
 ;; Author: Phillip Lord <phillip.lord@russet.org.uk>
-;; Maintainer: Phillip Lord <phillip.lord@russet.org.uk>
+;; Maintainer: Joseph Turner <persist-el@breatheoutbreathe.in>
 ;; Package-Type: multi
 ;; Version: 0.5
 
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Bump-version.patch --]
[-- Type: text/x-diff, Size: 654 bytes --]

From ff168c39915f1dd3ce475ce33dfea5280746148d Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 5 Sep 2023 19:13:06 -0700
Subject: [PATCH 2/2] Bump version

---
 persist.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/persist.el b/persist.el
index 26b8b84e2e..19ad8bd871 100644
--- a/persist.el
+++ b/persist.el
@@ -5,7 +5,7 @@
 ;; Author: Phillip Lord <phillip.lord@russet.org.uk>
 ;; Maintainer: Joseph Turner <persist-el@breatheoutbreathe.in>
 ;; Package-Type: multi
-;; Version: 0.5
+;; Version: 0.6
 
 ;; The contents of this file are subject to the GPL License, Version 3.0.
 
-- 
2.41.0


^ permalink raw reply related	[relevance 28%]

* bug#65768: Bump persist.el version
  2023-10-31 17:05  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-01  0:34  5%             ` Stefan Kangas
@ 2023-11-06 20:38  5%             ` phillip.lord
  2023-11-12  4:27  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 200+ results
From: phillip.lord @ 2023-11-06 20:38 UTC (permalink / raw)
  To: Joseph Turner; +Cc: Eli Zaretskii, stefankangas, 65768

On 2023-10-31 17:05, Joseph Turner wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
> 
>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>> Cc: Stefan Kangas <stefankangas@gmail.com>, Eli Zaretskii 
>>> <eliz@gnu.org>,
>>>  65768@debbugs.gnu.org
>>> Date: Tue, 31 Oct 2023 08:41:55 -0700
>>> 
>>> phillip.lord@russet.org.uk writes:
>>> 
>>> > Would you be interested in taking over maintainership of persist? I am
>>> > very short of Emacs time these days.
>>> 
>>> Yes, I am interested!  Stefan, Eli, what do you think?
>> 
>> I can only welcome you.  Thanks for volunteering!
> 
> Thank you :)


And thank you indeed! I will be very interested to see where you take 
persist.

Phil





^ permalink raw reply	[relevance 5%]

* bug#65768: Bump persist.el version
  2023-10-31 17:05  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-11-01  0:34  5%             ` Stefan Kangas
  2023-11-12  4:26 28%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-06 20:38  5%             ` phillip.lord
  1 sibling, 1 reply; 200+ results
From: Stefan Kangas @ 2023-11-01  0:34 UTC (permalink / raw)
  To: Joseph Turner, Eli Zaretskii; +Cc: 65768, phillip.lord

Joseph Turner <joseph@breatheoutbreathe.in> writes:

>>> Yes, I am interested!  Stefan, Eli, what do you think?
>>
>> I can only welcome you.  Thanks for volunteering!
>
> Thank you :)

Indeed, welcome and thanks.

Perhaps before releasing v0.6, it would make sense to update the
Maintainer header comment to reflect that you're now the maintainer?
If you agree, feel free to send a patch.





^ permalink raw reply	[relevance 5%]

* bug#65768: Bump persist.el version
  2023-10-31 16:43  0%         ` Eli Zaretskii
@ 2023-10-31 17:05  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-01  0:34  5%             ` Stefan Kangas
  2023-11-06 20:38  5%             ` phillip.lord
  0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-31 17:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 65768, stefankangas, phillip.lord


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: Stefan Kangas <stefankangas@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
>>  65768@debbugs.gnu.org
>> Date: Tue, 31 Oct 2023 08:41:55 -0700
>>
>> phillip.lord@russet.org.uk writes:
>>
>> > Would you be interested in taking over maintainership of persist? I am
>> > very short of Emacs time these days.
>>
>> Yes, I am interested!  Stefan, Eli, what do you think?
>
> I can only welcome you.  Thanks for volunteering!

Thank you :)

>> Stefan, before I commit to maintainership of persist, please let me know
>> of any maintainer guidelines I should be aware of.  I have read
>> emacs/CONTRIBUTE and elpa/README.  Would persist.el maintainership
>> require subscribing to the mailing list?
>
> From my POV, the only request is to subscribe to
> bug-gnu-emacs@gnu.org, so that you see any bug reports about
> persist.el.  Otherwise, we will have to forward the reports to you.

Sounds good.  I am subscribed to bug-gnu-emacs@gnu.org.

Joseph





^ permalink raw reply	[relevance 5%]

* bug#65768: Bump persist.el version
  2023-10-31 15:41  7%       ` Joseph Turner
@ 2023-10-31 16:43  0%         ` Eli Zaretskii
  2023-10-31 17:05  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-10-31 16:43 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 65768, stefankangas, phillip.lord

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: Stefan Kangas <stefankangas@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
>  65768@debbugs.gnu.org
> Date: Tue, 31 Oct 2023 08:41:55 -0700
> 
> phillip.lord@russet.org.uk writes:
> 
> > Would you be interested in taking over maintainership of persist? I am
> > very short of Emacs time these days.
> 
> Yes, I am interested!  Stefan, Eli, what do you think?

I can only welcome you.  Thanks for volunteering!

> Stefan, before I commit to maintainership of persist, please let me know
> of any maintainer guidelines I should be aware of.  I have read
> emacs/CONTRIBUTE and elpa/README.  Would persist.el maintainership
> require subscribing to the mailing list?

From my POV, the only request is to subscribe to
bug-gnu-emacs@gnu.org, so that you see any bug reports about
persist.el.  Otherwise, we will have to forward the reports to you.





^ permalink raw reply	[relevance 0%]

* bug#65768: Bump persist.el version
  2023-10-31 12:07  5%     ` phillip.lord
@ 2023-10-31 15:41  7%       ` Joseph Turner
  2023-10-31 16:43  0%         ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner @ 2023-10-31 15:41 UTC (permalink / raw)
  To: phillip.lord; +Cc: Eli Zaretskii, Stefan Kangas, 65768

Hi Phillip!

phillip.lord@russet.org.uk writes:

> Oh dear, you have had to ping on this many times.

No worries :)

> Would you be interested in taking over maintainership of persist? I am
> very short of Emacs time these days.

Yes, I am interested!  Stefan, Eli, what do you think?

Stefan, before I commit to maintainership of persist, please let me know
of any maintainer guidelines I should be aware of.  I have read
emacs/CONTRIBUTE and elpa/README.  Would persist.el maintainership
require subscribing to the mailing list?

Thank you!

Joseph





^ permalink raw reply	[relevance 7%]

* bug#65768: Bump persist.el version
  2023-10-30 20:54  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-31 12:07  5%     ` phillip.lord
  2023-10-31 15:41  7%       ` Joseph Turner
  0 siblings, 1 reply; 200+ results
From: phillip.lord @ 2023-10-31 12:07 UTC (permalink / raw)
  To: Joseph Turner; +Cc: Stefan Kangas, 65768



Oh dear, you have had to ping on this many times.

Would you be interested in taking over maintainership of persist? I am 
very short of Emacs time these days.

Phil

On 2023-10-30 20:54, Joseph Turner wrote:
> Ping :)
> 
> Stefan Kangas <stefankangas@gmail.com> writes:
> 
>> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>> 
>>> Please bump the version now that we've fixed that hash
>>> table issue in persist.
>>> 
>>> See patch.
>> 
>> Phillip, what do you think?
>> 
>>> From 8b5ec447c3ac0c6f5efa15737f22e984bba99992 Mon Sep 17 00:00:00 
>>> 2001
>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>> Date: Tue, 5 Sep 2023 19:13:06 -0700
>>> Subject: [PATCH] Bump version
>>> 
>>> ---
>>>  persist.el | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/persist.el b/persist.el
>>> index e43171459e..8a1f746ddd 100644
>>> --- a/persist.el
>>> +++ b/persist.el
>>> @@ -5,7 +5,7 @@
>>>  ;; Author: Phillip Lord <phillip.lord@russet.org.uk>
>>>  ;; Maintainer: Phillip Lord <phillip.lord@russet.org.uk>
>>>  ;; Package-Type: multi
>>> -;; Version: 0.5
>>> +;; Version: 0.6
>>> 
>>>  ;; The contents of this file are subject to the GPL License, Version 
>>> 3.0.





^ permalink raw reply	[relevance 5%]

* bug#65768: Bump persist.el version
  2023-09-06 16:39  5% ` Stefan Kangas
  2023-09-16 22:28  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-30 20:54  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-31 12:07  5%     ` phillip.lord
  1 sibling, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-30 20:54 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Phillip Lord, 65768

Ping :)

Stefan Kangas <stefankangas@gmail.com> writes:

> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> Please bump the version now that we've fixed that hash
>> table issue in persist.
>>
>> See patch.
>
> Phillip, what do you think?
>
>> From 8b5ec447c3ac0c6f5efa15737f22e984bba99992 Mon Sep 17 00:00:00 2001
>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Date: Tue, 5 Sep 2023 19:13:06 -0700
>> Subject: [PATCH] Bump version
>>
>> ---
>>  persist.el | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/persist.el b/persist.el
>> index e43171459e..8a1f746ddd 100644
>> --- a/persist.el
>> +++ b/persist.el
>> @@ -5,7 +5,7 @@
>>  ;; Author: Phillip Lord <phillip.lord@russet.org.uk>
>>  ;; Maintainer: Phillip Lord <phillip.lord@russet.org.uk>
>>  ;; Package-Type: multi
>> -;; Version: 0.5
>> +;; Version: 0.6
>>
>>  ;; The contents of this file are subject to the GPL License, Version 3.0.






^ permalink raw reply	[relevance 5%]

* bug#66716: Reconcile display-fill-column-indicator-character behavior and customization description
  2023-10-25  2:29  0%     ` Eli Zaretskii
@ 2023-10-25  3:11  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-25  3:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 66716-done


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: 66716@debbugs.gnu.org
>> Date: Tue, 24 Oct 2023 12:46:11 -0700
>>
>> >> What do folks think about changing the behavior of
>> >> display-fill-column-indicator-character to match this description?
>> >
>> > I don't understand the proposal.  We don't use U+2502 by default
>> > because not all terminals support it.
>>
>> When enabling display-fill-column-indicator in .dir-locals.el, is it
>> possible to dynamically set display-fill-column-indicator-character
>> according to what characters are displayable without using eval?
>
> I don't think so.

Thank you!!





^ permalink raw reply	[relevance 5%]

* bug#66716: Reconcile display-fill-column-indicator-character behavior and customization description
  2023-10-24 19:46  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-25  2:29  0%     ` Eli Zaretskii
  2023-10-25  3:11  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-10-25  2:29 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66716

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: 66716@debbugs.gnu.org
> Date: Tue, 24 Oct 2023 12:46:11 -0700
> 
> >> What do folks think about changing the behavior of
> >> display-fill-column-indicator-character to match this description?
> >
> > I don't understand the proposal.  We don't use U+2502 by default
> > because not all terminals support it.
> 
> When enabling display-fill-column-indicator in .dir-locals.el, is it
> possible to dynamically set display-fill-column-indicator-character
> according to what characters are displayable without using eval?

I don't think so.





^ permalink raw reply	[relevance 0%]

* bug#66716: Reconcile display-fill-column-indicator-character behavior and customization description
  2023-10-24 12:31  0% ` Eli Zaretskii
@ 2023-10-24 19:46  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-25  2:29  0%     ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-24 19:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 66716


Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Mon, 23 Oct 2023 14:23:06 -0700
>> From:  Joseph Turner via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> AFAICT, setting display-fill-column-indicator-character to nil means
>> that no fill indicator is displayed.
>
> That's not true, AFAICT.  The default value is nil, but when you turn
> on the mode, it modifies the value of the character to be either
> U+2502 or '|'.
>
>> This patch changes the customization description to match the
>> current behavior.
>
> I don't think the patch is correct.

Indeed, the patch is incorrect.  I misunderstood the behavior of
display-fill-column-indicator-mode when
display-fill-column-indicator-character is nil.

>> However, I like the behavior that's currently described in the
>> customization option:
>>
>> "If possible, use U+2502 to indicate fill column, otherwise use |"
>>
>> What do folks think about changing the behavior of
>> display-fill-column-indicator-character to match this description?
>
> I don't understand the proposal.  We don't use U+2502 by default
> because not all terminals support it.

When enabling display-fill-column-indicator in .dir-locals.el, is it
possible to dynamically set display-fill-column-indicator-character
according to what characters are displayable without using eval?

Currently in my project, I have:

((emacs-lisp-mode . ((display-fill-column-indicator . t)
                     ;; This won't work on some terminals
                     (display-fill-column-indicator-character . ?\u2502)
                     (fill-column . 80))))

Please let me know if you have suggestions for improvement!

Thank you!!!

Joseph





^ permalink raw reply	[relevance 5%]

* bug#66716: Reconcile display-fill-column-indicator-character behavior and customization description
  2023-10-23 21:23 10% bug#66716: Reconcile display-fill-column-indicator-character behavior and customization description Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-24 12:31  0% ` Eli Zaretskii
  2023-10-24 19:46  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-10-24 12:31 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66716

> Date: Mon, 23 Oct 2023 14:23:06 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> AFAICT, setting display-fill-column-indicator-character to nil means
> that no fill indicator is displayed.

That's not true, AFAICT.  The default value is nil, but when you turn
on the mode, it modifies the value of the character to be either
U+2502 or '|'.

> This patch changes the customization description to match the
> current behavior.

I don't think the patch is correct.

> However, I like the behavior that's currently described in the
> customization option:
> 
> "If possible, use U+2502 to indicate fill column, otherwise use |"
> 
> What do folks think about changing the behavior of
> display-fill-column-indicator-character to match this description?

I don't understand the proposal.  We don't use U+2502 by default
because not all terminals support it.





^ permalink raw reply	[relevance 0%]

* bug#66716: Reconcile display-fill-column-indicator-character behavior and customization description
@ 2023-10-23 21:23 10% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-24 12:31  0% ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-23 21:23 UTC (permalink / raw)
  To: 66716

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

Tags: patch

Tags: patch

Tags: patch

AFAICT, setting display-fill-column-indicator-character to nil means
that no fill indicator is displayed. This patch changes the
customization description to match the current behavior.

However, I like the behavior that's currently described in the
customization option:

"If possible, use U+2502 to indicate fill column, otherwise use |"

What do folks think about changing the behavior of
display-fill-column-indicator-character to match this description?

Thank you!!

Joseph


[-- Attachment #2: 0001-Fix-customization-description-display-fill-column-in.patch --]
[-- Type: text/patch, Size: 1089 bytes --]

From 846252d0c3912623ba2d8ff9832e00dfa00fc091 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Mon, 23 Oct 2023 14:20:09 -0700
Subject: [PATCH] Fix customization description:
 display-fill-column-indicator-character

* lisp/cus-start.el (standard): Change the description of the nil
value to its current behavior: to not display a fill indicator.
---
 lisp/cus-start.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 054683d7cf6..2fc5d3d727c 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -806,7 +806,7 @@ since it could result in memory overflow and make Emacs crash."
                       :value ?│)
                (character :tag "Use | to indicate fill column"
                       :value ?|)
-               (const :tag "If possible, use U+2502 to indicate fill column, otherwise use |"
+               (const :tag "Do not indicate fill column"
                       :value nil)
                character)
               "27.1"
-- 
2.41.0


^ permalink raw reply related	[relevance 10%]

* bug#66626: [PATCH] elpa-packages (hyperdrive): Update ':doc' property
  2023-10-19  5:45 11% bug#66626: [PATCH] elpa-packages (hyperdrive): Update ':doc' property Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-20 20:04  5% ` Stefan Kangas
  0 siblings, 0 replies; 200+ results
From: Stefan Kangas @ 2023-10-20 20:04 UTC (permalink / raw)
  To: Joseph Turner, 66626-done

Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> Tags: patch
>
> We shortened the info manual name.

Thanks, installed.

[1: e5adab3409]: 2023-10-20 22:01:55 +0200
  * elpa-packages (hyperdrive): Update ':doc' property.
  https://git.savannah.gnu.org/cgit/emacs/nongnu.git/commit/?id=e5adab3409abfa69ecbaeb07bb88d48f78e03d3f





^ permalink raw reply	[relevance 5%]

* bug#66626: [PATCH] elpa-packages (hyperdrive): Update ':doc' property
@ 2023-10-19  5:45 11% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-20 20:04  5% ` Stefan Kangas
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-19  5:45 UTC (permalink / raw)
  To: 66626

[-- Attachment #1: Type: text/plain, Size: 70 bytes --]

Tags: patch

We shortened the info manual name.

Thank you!!

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-elpa-packages-hyperdrive-Update-doc-property.patch --]
[-- Type: text/patch, Size: 738 bytes --]

From d3b91bcb42703b940551b2e0e084e423d82211b3 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Wed, 18 Oct 2023 22:43:29 -0700
Subject: [PATCH] * * elpa-packages (hyperdrive): Update ':doc' property

---
 elpa-packages | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elpa-packages b/elpa-packages
index da7efbf6b6..0f722f7fd5 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -362,7 +362,7 @@
 
  (hyperdrive		:url "https://git.sr.ht/~ushin/hyperdrive.el"
   :readme "README.md"
-  :doc "doc/hyperdrive-manual.org")
+  :doc "doc/hyperdrive.org")
 
  (idle-highlight-mode	:url "https://codeberg.org/ideasman42/emacs-idle-highlight-mode"
   :ignored-files (".elisp-autofmt"))
-- 
2.41.0


^ permalink raw reply related	[relevance 11%]

* bug#65797: `buffer-match-p` should not use `func-arity`
  @ 2023-10-16 20:16  5%                                           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-16 20:16 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: dmitry, Eli Zaretskii, mattias.engdegard, philipk, 65797


Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Sigh.  I guess we can install this on emacs-29 and cross the
>> fingers...
>
> I'm not insisting on it.
> If you think it's risky, let's just have it on `master`.
>
> BTW, see below the actual patch, including changes to etc/NEWS, manual,
> as well as the addition of a runtime warning (without which I can't see
> how we'll ever be able to get rid of the ugly backward compatibility
> hack).

Minor nit: There's a typo in the NEWS file. "tho" should be "though".

>         Stefan
>
> [2. text/x-diff; buffer-match.patch]
> diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi
> index 86c47ae7310..a2d0f5687ba 100644
> --- a/doc/lispref/buffers.texi
> +++ b/doc/lispref/buffers.texi
> @@ -957,10 +957,10 @@ Buffer List
>  infinite recursion.
>  @end defvar
>
> -@defun buffer-match-p condition buffer-or-name &optional arg
> +@defun buffer-match-p condition buffer-or-name &rest args
>  This function checks if a buffer designated by @code{buffer-or-name}
> -satisfies the specified @code{condition}.  Optional third argument
> -@var{arg} is passed to the predicate function in @var{condition}.  A
> +satisfies the specified @code{condition}.  Optional arguments
> +@var{args} are passed to the predicate function in @var{condition}.  A
>  valid @var{condition} can be one of the following:
>  @itemize @bullet{}
>  @item
> @@ -969,23 +969,21 @@ Buffer List
>  name.
>  @item
>  A predicate function, which should return non-@code{nil} if the buffer
> -matches.  If the function expects one argument, it is called with
> -@var{buffer-or-name} as the argument; if it expects 2 arguments, the
> -first argument is @var{buffer-or-name} and the second is @var{arg}
> -(or @code{nil} if @var{arg} is omitted).
> +matches.  It is called with
> +@var{buffer-or-name} as the first argument followed by @var{args}.
>  @item
>  A cons-cell @code{(@var{oper} . @var{expr})} where @var{oper} is one
>  of
>  @table @code
>  @item (not @var{cond})
>  Satisfied if @var{cond} doesn't satisfy @code{buffer-match-p} with
> -the same buffer and @code{arg}.
> +the same buffer and @code{args}.
>  @item (or @var{conds}@dots{})
>  Satisfied if @emph{any} condition in @var{conds} satisfies
> -@code{buffer-match-p}, with the same buffer and @code{arg}.
> +@code{buffer-match-p}, with the same buffer and @code{args}.
>  @item (and @var{conds}@dots{})
>  Satisfied if @emph{all} the conditions in @var{conds} satisfy
> -@code{buffer-match-p}, with the same buffer and @code{arg}.
> +@code{buffer-match-p}, with the same buffer and @code{args}.
>  @item derived-mode
>  Satisfied if the buffer's major mode derives from @var{expr}.
>  @item major-mode
> @@ -998,14 +996,14 @@ Buffer List
>  @end itemize
>  @end defun
>
> -@defun match-buffers condition &optional buffer-list arg
> +@defun match-buffers condition &optional buffer-list &rest args
>  This function returns a list of all buffers that satisfy the
>  @code{condition}.  If no buffers match, the function returns
>  @code{nil}.  The argument @var{condition} is as defined in
>  @code{buffer-match-p} above.  By default, all the buffers are
>  considered, but this can be restricted via the optional argument
>  @code{buffer-list}, which should be a list of buffers to consider.
> -Optional third argument @var{arg} will be passed to @var{condition} in
> +Remaining arguments @var{args} will be passed to @var{condition} in
>  the same way as @code{buffer-match-p} does.
>  @end defun
>
> diff --git a/etc/NEWS b/etc/NEWS
> index 3bd47a0112b..c74b4978afe 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -945,6 +945,13 @@ the file listing's performance is still optimized.
>  \f
>  * Incompatible Lisp Changes in Emacs 30.1
>
> +** `buffer-match-p and `match-buffers` take `&rest args`
> +They used to take a single `&optional arg` and were documented to use
> +an unreliable hack to try and accommodate condition predicates that
> +don't accept this optional arg.
> +The new semantics makes no such affordances, tho the code still
> +supports it (with a warning) for backward compatibility.
> +
>  ** 'post-gc-hook' runs after updating 'gcs-done' and 'gcs-elapsed'.
>
>  ---
> diff --git a/lisp/subr.el b/lisp/subr.el
> index 58274987d71..0732319ccd0 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -7277,13 +7277,15 @@ string-lines
>              (setq start (length string)))))
>        (nreverse lines))))
>
> -(defun buffer-match-p (condition buffer-or-name &optional arg)
> +(defvar buffer-match-p--past-warnings nil)
> +
> +(defun buffer-match-p (condition buffer-or-name &rest args)
>    "Return non-nil if BUFFER-OR-NAME matches CONDITION.
>  CONDITION is either:
>  - the symbol t, to always match,
>  - the symbol nil, which never matches,
>  - a regular expression, to match a buffer name,
> -- a predicate function that takes BUFFER-OR-NAME and ARG as
> +- a predicate function that takes BUFFER-OR-NAME plus ARGS as
>    arguments, and returns non-nil if the buffer matches,
>  - a cons-cell, where the car describes how to interpret the cdr.
>    The car can be one of the following:
> @@ -7308,9 +7310,18 @@ buffer-match-p
>                        ((pred stringp)
>                         (string-match-p condition (buffer-name buffer)))
>                        ((pred functionp)
> -                       (if (eq 1 (cdr (func-arity condition)))
> -                           (funcall condition buffer-or-name)
> -                         (funcall condition buffer-or-name arg)))
> +                       (if (cdr args)
> +                           ;; New in Emacs>29.1. no need for compatibility hack.
> +                           (apply condition buffer-or-name args)
> +                         (condition-case-unless-debug err
> +                             (apply condition buffer-or-name args)
> +                           (wrong-number-of-arguments
> +                            (unless (member condition
> +                                            buffer-match-p--past-warnings)
> +                              (message "%s" (error-message-string err))
> +                              (push condition buffer-match-p--past-warnings))
> +                            (apply condition buffer-or-name
> +                                   (if args nil '(nil)))))))
>                        (`(major-mode . ,mode)
>                         (eq
>                          (buffer-local-value 'major-mode buffer)
> @@ -7332,17 +7343,17 @@ buffer-match-p
>                  (throw 'match t)))))))
>      (funcall match (list condition))))
>
> -(defun match-buffers (condition &optional buffers arg)
> +(defun match-buffers (condition &optional buffers &rest args)
>    "Return a list of buffers that match CONDITION, or nil if none match.
>  See `buffer-match-p' for various supported CONDITIONs.
>  By default all buffers are checked, but the optional
>  argument BUFFERS can restrict that: its value should be
>  an explicit list of buffers to check.
> -Optional argument ARG is passed to `buffer-match-p', for
> +Optional arguments ARGS are passed to `buffer-match-p', for
>  predicate conditions in CONDITION."
>    (let (bufs)
>      (dolist (buf (or buffers (buffer-list)))
> -      (when (buffer-match-p condition (get-buffer buf) arg)
> +      (when (apply #'buffer-match-p condition (get-buffer buf) args)
>          (push buf bufs)))
>      bufs))
>
> diff --git a/lisp/window.el b/lisp/window.el
> index 2f9b46ebb0a..12d3fb1dfe7 100644
> --- a/lisp/window.el
> +++ b/lisp/window.el
> @@ -7535,10 +7535,8 @@ display-buffer-alist
>    arguments: a buffer to display and an alist of the same form as
>    ALIST.  See `display-buffer' for details.
>
> -`display-buffer' scans this alist until it either finds a
> -matching regular expression or the function specified by a
> -condition returns non-nil.  In any of these cases, it adds the
> -associated action to the list of actions it will try."
> +`display-buffer' scans this alist until the CONDITION is satisfied
> +and adds the associated ACTION to the list of actions it will try."
>    :type `(alist :key-type
>  		(choice :tag "Condition"
>  			regexp






^ permalink raw reply	[relevance 5%]

* bug#65797: `buffer-match-p` should not use `func-arity`
  @ 2023-10-14  6:13  0%                                   ` Eli Zaretskii
    0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-10-14  6:13 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 65797, dmitry, philipk, mattias.engdegard, joseph

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  Philip Kaludercic
>  <philipk@posteo.net>,  Mattias Engdegård
>  <mattias.engdegard@gmail.com>,
>   Eli Zaretskii <eliz@gnu.org>,  65797@debbugs.gnu.org
> Date: Fri, 13 Oct 2023 11:57:59 -0400
> 
> >> Then how 'bout something like the patch below which changes the
> >> `&optional` into an `&rest` but tries to preserve compatibility with the
> >> old calling convention.
> > Personally, I figured that using &rest would already help with backward
> > compatibility to an extent.
> 
> I don't have a good intuition for how important backward compatibility
> is here, so I went for the "safe" choice.  But maybe we don't need to go
> that far.  The patch below keeps the same compatibility hack as we
> currently have but doesn't add any new compatibility, so it will break
> those uses where `buffer-match-p` is called without additional args but
> the predicate function still expects 2 args (where the second is always
> nil).  Indeed, that case seemes extremely unlikely.
> 
> Eli, Stefan, WDYT?

TBH, I have no way of assessing the risks in such a change.

Do we have to make this change on the release branch?  What bad things
will happen if we leave emacs-29 with no changes?  The discussion
thread is quite long, but my personal take from it is that the
arguments for making any changes in the current code are largely
theoretical and aesthetic.  Am I wrong?





^ permalink raw reply	[relevance 0%]

* bug#65797: `buffer-match-p` should not use `func-arity`
  @ 2023-10-12  4:53  5%                               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
    1 sibling, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-12  4:53 UTC (permalink / raw)
  To: Stefan Monnier
  Cc: Dmitry Gutov, Philip Kaludercic, Eli Zaretskii,
	Mattias Engdegård, 65797


Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I am in favor of this solution as well.
>
> Then how 'bout something like the patch below which changes the
> `&optional` into an `&rest` but tries to preserve compatibility with the
> old calling convention.
>
>
>         Stefan
>
>
> diff --git a/lisp/subr.el b/lisp/subr.el
> index e88815fa58c..06c9923b525 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -7295,13 +7292,13 @@ string-lines
>              (setq start (length string)))))
>        (nreverse lines))))
>
> -(defun buffer-match-p (condition buffer-or-name &optional arg)
> +(defun buffer-match-p (condition buffer-or-name &rest args)
>    "Return non-nil if BUFFER-OR-NAME matches CONDITION.
>  CONDITION is either:
>  - the symbol t, to always match,
>  - the symbol nil, which never matches,
>  - a regular expression, to match a buffer name,
> -- a predicate function that takes BUFFER-OR-NAME and ARG as
> +- a predicate function that takes BUFFER-OR-NAME plus ARGS as
>    arguments, and returns non-nil if the buffer matches,
>  - a cons-cell, where the car describes how to interpret the cdr.
>    The car can be one of the following:
> @@ -7326,9 +7323,18 @@ buffer-match-p
>                        ((pred stringp)
>                         (string-match-p condition (buffer-name buffer)))
>                        ((pred functionp)
> -                       (if (eq 1 (cdr (func-arity condition)))
> -                           (funcall condition buffer-or-name)
> -                         (funcall condition buffer-or-name arg)))
> +                       (if (cdr args)
> +                           ;; More than 1 argument: no need for
> +                           ;; Emacs-29 backward compatibility!
> +                           (apply condition buffer-or-name args)
> +                         (condition-case err
> +                             (apply condition buffer-or-name args)
> +                           (wrong-number-of-arguments
> +                            ;; Backward compatibility with Emacs-29 semantics.
> +                            (message "Trying obsolete calling convention for: %S"
> +                                     Condition)
> +                            (apply condition buffer-or-name
> +                                   (if args '(nil) nil))))))
>                        (`(major-mode . ,mode)
>                         (eq
>                          (buffer-local-value 'major-mode buffer)
> @@ -7350,17 +7356,17 @@ buffer-match-p
>                  (throw 'match t)))))))
>      (funcall match (list condition))))

At first, I was concerned that the condition-case would mess up error
handling in user code, but all 9 permutations give the expected results:

(let ((condition
       (lambda (buf) t)
       ;; (lambda (buf arg1) t)
       ;; (lambda (buf arg1 arg2) t)
       ))
  (condition-case err
      (buffer-match-p condition (current-buffer)
                      ;; 'arg1
                      ;; 'arg2
                      )
    (wrong-number-of-arguments
     "Caught")))

> -(defun match-buffers (condition &optional buffers arg)
> +(defun match-buffers (condition &optional buffers &rest args)
>    "Return a list of buffers that match CONDITION, or nil if none match.
>  See `buffer-match-p' for various supported CONDITIONs.
>  By default all buffers are checked, but the optional
>  argument BUFFERS can restrict that: its value should be
>  an explicit list of buffers to check.
> -Optional argument ARG is passed to `buffer-match-p', for
> +Optional arguments ARGS are passed to `buffer-match-p', for
>  predicate conditions in CONDITION."
>    (let (bufs)
>      (dolist (buf (or buffers (buffer-list)))
> -      (when (buffer-match-p condition (get-buffer buf) arg)
> +      (when (apply #'buffer-match-p condition (get-buffer buf) args)
>          (push buf bufs)))
>      bufs))
>





^ permalink raw reply	[relevance 5%]

* bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional
  2023-10-07 18:40 10% bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-08 15:43  5% ` Philip Kaludercic
@ 2023-10-08 21:35  5% ` Philip Kaludercic
  1 sibling, 0 replies; 200+ results
From: Philip Kaludercic @ 2023-10-08 21:35 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66393-done

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Tags: patch
>
> The purpose of this change is to simplify the noninteractive usage of
> package-vc-install-from-checkout.

Thanks, pushed with slight modifications.





^ permalink raw reply	[relevance 5%]

* bug#66403: [PATCH] Use delete-all-overlays in clean-mode
  2023-10-08  9:57 11% bug#66403: [PATCH] Use delete-all-overlays in clean-mode Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-08 10:25  0% ` Eli Zaretskii
@ 2023-10-08 21:24  5% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-08 21:24 UTC (permalink / raw)
  To: 66403-done

delete-all-overlays deletes all overlays regardless of narrowing.





^ permalink raw reply	[relevance 5%]

* bug#66403: [PATCH] Use delete-all-overlays in clean-mode
  2023-10-08 10:25  0% ` Eli Zaretskii
@ 2023-10-08 21:21  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-08 21:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 66403


Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Sun, 08 Oct 2023 02:57:25 -0700
>> From:  Joseph Turner via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> Is there a reason to use dolist instead of delete-all-overlays?
>
> Can the buffer be narrowed?

Ah, good catch. The following snippet only deletes ov1, whereas if you
replace the dolist with delete-all-overlays, both are deleted.

(with-current-buffer (generate-new-buffer "test-overlay-deletion")
  (insert "hello\n\nworld")
  (let ((ov1 (make-overlay 0 6))
        (ov2 (make-overlay 8 13)))
    (overlay-put ov1 'display "aaaaa")
    (overlay-put ov2 'display "bbbbb"))
  (narrow-to-region 1 6)
  ;; (delete-all-overlays)
  (dolist (overlay (overlays-in (point-min) (point-max)))
    (delete-overlay overlay))
  (widen)
  (pop-to-buffer (current-buffer)))

Joseph





^ permalink raw reply	[relevance 5%]

* bug#66404: [PATCH] Use delete-all-overlays in clean-mode
  2023-10-08 11:40  0%     ` Eli Zaretskii
@ 2023-10-08 20:54  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-08 20:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 66404-done, Stefan Kangas


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>
>> (Is there a way for me to close my own issues?)
>
> Yes, see admin/notes/bugtracker.

Thank you!! I was not aware of this.

Stefan: Please consider mentioning admin/notes/bugtracker in your talk.

Joseph





^ permalink raw reply	[relevance 5%]

* bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional
  2023-10-08 15:43  5% ` Philip Kaludercic
@ 2023-10-08 20:50  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-08 20:50 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 66393


Philip Kaludercic <philipk@posteo.net> writes:

> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> Tags: patch
>>
>> The purpose of this change is to simplify the noninteractive usage of package-vc-install-from-checkout.
>>
>> From cfdd990c6e00decff370e5f224d60862c13be309 Mon Sep 17 00:00:00 2001
>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Date: Sat, 7 Oct 2023 11:38:43 -0700
>> Subject: [PATCH] Make package-vc-install-from-checkout NAME argument optional
>>
>> * lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout):
>> Allow nil NAME; update documentation.
>> ---
>>  lisp/emacs-lisp/package-vc.el | 12 +++++-------
>>  1 file changed, 5 insertions(+), 7 deletions(-)
>>
>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
>> index c7a30736e32..e47deca6d7a 100644
>> --- a/lisp/emacs-lisp/package-vc.el
>> +++ b/lisp/emacs-lisp/package-vc.el
>> @@ -841,18 +841,16 @@ for the last released version of the package."
>>      (find-file directory)))
>>
>>  ;;;###autoload
>> -(defun package-vc-install-from-checkout (dir name)
>> +(defun package-vc-install-from-checkout (dir &optional name)
>>    "Set up the package NAME in DIR by linking it into the ELPA directory.
>> +NAME defaults to the base name of DIR.
>>  Interactively, prompt the user for DIR, which should be a directory
>>  under version control, typically one created by `package-vc-checkout'.
>>  If invoked interactively with a prefix argument, prompt the user
>> -for the NAME of the package to set up.  Otherwise infer the package
>> -name from the base name of DIR."
>> +for the NAME of the package to set up."
>>    (interactive (let ((dir (read-directory-name "Directory: ")))
>> -                 (list dir
>> -                       (if current-prefix-arg
>> -                           (read-string "Package name: ")
>> -                         (file-name-base (directory-file-name dir))))))
>> +                 (list dir (when current-prefix-arg
>
> This looks fine, I'm just going to replace the `when' with a `and', ok?

Sure!

>> +                             (read-string "Package name: ")))))
>>    (unless (vc-responsible-backend dir)
>>      (user-error "Directory %S is not under version control" dir))
>>    (package-vc--archives-initialize)






^ permalink raw reply	[relevance 5%]

* bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional
  2023-10-07 18:40 10% bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-08 15:43  5% ` Philip Kaludercic
  2023-10-08 20:50  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-08 21:35  5% ` Philip Kaludercic
  1 sibling, 1 reply; 200+ results
From: Philip Kaludercic @ 2023-10-08 15:43 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66393

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Tags: patch
>
> The purpose of this change is to simplify the noninteractive usage of package-vc-install-from-checkout.
>
> From cfdd990c6e00decff370e5f224d60862c13be309 Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Sat, 7 Oct 2023 11:38:43 -0700
> Subject: [PATCH] Make package-vc-install-from-checkout NAME argument optional
>
> * lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout):
> Allow nil NAME; update documentation.
> ---
>  lisp/emacs-lisp/package-vc.el | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index c7a30736e32..e47deca6d7a 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -841,18 +841,16 @@ for the last released version of the package."
>      (find-file directory)))
>  
>  ;;;###autoload
> -(defun package-vc-install-from-checkout (dir name)
> +(defun package-vc-install-from-checkout (dir &optional name)
>    "Set up the package NAME in DIR by linking it into the ELPA directory.
> +NAME defaults to the base name of DIR.
>  Interactively, prompt the user for DIR, which should be a directory
>  under version control, typically one created by `package-vc-checkout'.
>  If invoked interactively with a prefix argument, prompt the user
> -for the NAME of the package to set up.  Otherwise infer the package
> -name from the base name of DIR."
> +for the NAME of the package to set up."
>    (interactive (let ((dir (read-directory-name "Directory: ")))
> -                 (list dir
> -                       (if current-prefix-arg
> -                           (read-string "Package name: ")
> -                         (file-name-base (directory-file-name dir))))))
> +                 (list dir (when current-prefix-arg

This looks fine, I'm just going to replace the `when' with a `and', ok?

> +                             (read-string "Package name: ")))))
>    (unless (vc-responsible-backend dir)
>      (user-error "Directory %S is not under version control" dir))
>    (package-vc--archives-initialize)





^ permalink raw reply	[relevance 5%]

* bug#66404: [PATCH] Use delete-all-overlays in clean-mode
  2023-10-08 10:32  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-08 11:40  0%     ` Eli Zaretskii
  2023-10-08 20:54  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-10-08 11:40 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66404-done

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: 66404@debbugs.gnu.org
> Date: Sun, 08 Oct 2023 03:32:40 -0700
> 
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> Date: Sun, 08 Oct 2023 02:58:45 -0700
> >> From:  Joseph Turner via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> >>
> >> Is there a reason to use dolist instead of delete-all-overlays?
> >
> > Already asked.
> 
> Oops! Sorry, please close this.

Done.

> (Is there a way for me to close my own issues?)

Yes, see admin/notes/bugtracker.





^ permalink raw reply	[relevance 0%]

* bug#66404: [PATCH] Use delete-all-overlays in clean-mode
  2023-10-08 10:26  0% ` Eli Zaretskii
@ 2023-10-08 10:32  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-08 11:40  0%     ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-08 10:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 66404


Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Sun, 08 Oct 2023 02:58:45 -0700
>> From:  Joseph Turner via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> Is there a reason to use dolist instead of delete-all-overlays?
>
> Already asked.

Oops! Sorry, please close this. (Is there a way for me to close my own issues?)





^ permalink raw reply	[relevance 5%]

* bug#66404: [PATCH] Use delete-all-overlays in clean-mode
  2023-10-08  9:58 11% bug#66404: " Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-08 10:26  0% ` Eli Zaretskii
  2023-10-08 10:32  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-10-08 10:26 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66404

> Date: Sun, 08 Oct 2023 02:58:45 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Is there a reason to use dolist instead of delete-all-overlays?

Already asked.





^ permalink raw reply	[relevance 0%]

* bug#65797: `buffer-match-p` should not use `func-arity`
  2023-10-08  9:10  5%                           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-08 10:25  5%                             ` Dmitry Gutov
    1 sibling, 0 replies; 200+ results
From: Dmitry Gutov @ 2023-10-08 10:25 UTC (permalink / raw)
  To: Joseph Turner
  Cc: 65797, Philip Kaludercic, Mattias Engdegård, Stefan Monnier,
	Eli Zaretskii

On 08/10/2023 12:10, Joseph Turner wrote:
>> Though we'll still have to document the distinction in the docstrings
>> of project-kill-buffer-conditions and etc (the number of the arguments
>> called with).
> How do the project.el docstrings need to be updated?

Bad phrasing on my part, sorry: no need to touch them in this particular 
patch. Or probably after (the number of args will stay unchanged).

But other similar variables, especially new ones, related to the user of 
buffer-match-p, would need to mention the number of args passed to PRED.





^ permalink raw reply	[relevance 5%]

* bug#66403: [PATCH] Use delete-all-overlays in clean-mode
  2023-10-08  9:57 11% bug#66403: [PATCH] Use delete-all-overlays in clean-mode Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-08 10:25  0% ` Eli Zaretskii
  2023-10-08 21:21  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-08 21:24  5% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-10-08 10:25 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66403

> Date: Sun, 08 Oct 2023 02:57:25 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Is there a reason to use dolist instead of delete-all-overlays?

Can the buffer be narrowed?





^ permalink raw reply	[relevance 0%]

* bug#66404: [PATCH] Use delete-all-overlays in clean-mode
@ 2023-10-08  9:58 11% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-08 10:26  0% ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-08  9:58 UTC (permalink / raw)
  To: 66404

[-- Attachment #1: Type: text/plain, Size: 78 bytes --]

Tags: patch

Is there a reason to use dolist instead of delete-all-overlays?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-delete-all-overlays-in-clean-mode.patch --]
[-- Type: text/patch, Size: 902 bytes --]

From d47e0cbe9ecaeb0cd4da12ab70f03d4c138f9265 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sun, 8 Oct 2023 02:54:10 -0700
Subject: [PATCH] Use delete-all-overlays in clean-mode

* lisp/simple.el (clean-mode): Replace dolist
---
 lisp/simple.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index b770d9d7d33..8f2bd84d805 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -549,8 +549,7 @@ Other major modes are defined by comparison with this one."
   "A mode that removes all overlays and text properties."
   (kill-all-local-variables t)
   (let ((inhibit-read-only t))
-    (dolist (overlay (overlays-in (point-min) (point-max)))
-      (delete-overlay overlay))
+    (delete-all-overlays)
     (set-text-properties (point-min) (point-max) nil)
     (setq-local yank-excluded-properties t)))
 
-- 
2.41.0


^ permalink raw reply related	[relevance 11%]

* bug#66403: [PATCH] Use delete-all-overlays in clean-mode
@ 2023-10-08  9:57 11% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-08 10:25  0% ` Eli Zaretskii
  2023-10-08 21:24  5% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-08  9:57 UTC (permalink / raw)
  To: 66403

[-- Attachment #1: Type: text/plain, Size: 78 bytes --]

Tags: patch

Is there a reason to use dolist instead of delete-all-overlays?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-delete-all-overlays-in-clean-mode.patch --]
[-- Type: text/patch, Size: 902 bytes --]

From d47e0cbe9ecaeb0cd4da12ab70f03d4c138f9265 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sun, 8 Oct 2023 02:54:10 -0700
Subject: [PATCH] Use delete-all-overlays in clean-mode

* lisp/simple.el (clean-mode): Replace dolist
---
 lisp/simple.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index b770d9d7d33..8f2bd84d805 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -549,8 +549,7 @@ Other major modes are defined by comparison with this one."
   "A mode that removes all overlays and text properties."
   (kill-all-local-variables t)
   (let ((inhibit-read-only t))
-    (dolist (overlay (overlays-in (point-min) (point-max)))
-      (delete-overlay overlay))
+    (delete-all-overlays)
     (set-text-properties (point-min) (point-max) nil)
     (setq-local yank-excluded-properties t)))
 
-- 
2.41.0


^ permalink raw reply related	[relevance 11%]

* bug#65797: `buffer-match-p` should not use `func-arity`
  @ 2023-10-08  9:10  5%                           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-08 10:25  5%                             ` Dmitry Gutov
    0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-08  9:10 UTC (permalink / raw)
  To: Dmitry Gutov
  Cc: 65797, Philip Kaludercic, Mattias Engdegård, Stefan Monnier,
	Eli Zaretskii


Dmitry Gutov <dmitry@gutov.dev> writes:

> On 19/09/2023 16:56, Philip Kaludercic wrote:
>> Dmitry Gutov<dmitry@gutov.dev>  writes:
>>
>>> On 19/09/2023 11:34, Philip Kaludercic wrote:
>>>>> [ BTW, changing the code to use `&rest args` instead of `&optional arg`
>>>>>     would help for this, right?  ]
>>>> How come?
>>> In project.el buffer-match-p would be called without an extra
>>> argument, so the predicates would be called without an extra argument
>>> as well.
>>>
>>> That should take care of that compatibility, I think.
>> But what does that have to do with &rest vs &optional?
>
> Stringly speaking, nothing, because you can manage the same scheme
> with &optional - just dispatching to pred with different number of
> arguments depending on whether the &optional arg is nil. Though that
> breaks a little when nil is a meaningful value (probably a rare case).
>
> Rewriting the function in terms of &rest just makes this solution the
> most natural one, I suppose.

I am in favor of this solution as well.

> Though we'll still have to document the distinction in the docstrings
> of project-kill-buffer-conditions and etc (the number of the arguments
> called with).

How do the project.el docstrings need to be updated?

Thank you!

Joseph





^ permalink raw reply	[relevance 5%]

* bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional
@ 2023-10-07 18:40 10% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-08 15:43  5% ` Philip Kaludercic
  2023-10-08 21:35  5% ` Philip Kaludercic
  0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-07 18:40 UTC (permalink / raw)
  To: 66393; +Cc: Philip Kaludercic

[-- Attachment #1: Type: text/plain, Size: 118 bytes --]

Tags: patch

The purpose of this change is to simplify the noninteractive usage of package-vc-install-from-checkout.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Make-package-vc-install-from-checkout-NAME-argument-.patch --]
[-- Type: text/patch, Size: 1872 bytes --]

From cfdd990c6e00decff370e5f224d60862c13be309 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sat, 7 Oct 2023 11:38:43 -0700
Subject: [PATCH] Make package-vc-install-from-checkout NAME argument optional

* lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout):
Allow nil NAME; update documentation.
---
 lisp/emacs-lisp/package-vc.el | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index c7a30736e32..e47deca6d7a 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -841,18 +841,16 @@ for the last released version of the package."
     (find-file directory)))
 
 ;;;###autoload
-(defun package-vc-install-from-checkout (dir name)
+(defun package-vc-install-from-checkout (dir &optional name)
   "Set up the package NAME in DIR by linking it into the ELPA directory.
+NAME defaults to the base name of DIR.
 Interactively, prompt the user for DIR, which should be a directory
 under version control, typically one created by `package-vc-checkout'.
 If invoked interactively with a prefix argument, prompt the user
-for the NAME of the package to set up.  Otherwise infer the package
-name from the base name of DIR."
+for the NAME of the package to set up."
   (interactive (let ((dir (read-directory-name "Directory: ")))
-                 (list dir
-                       (if current-prefix-arg
-                           (read-string "Package name: ")
-                         (file-name-base (directory-file-name dir))))))
+                 (list dir (when current-prefix-arg
+                             (read-string "Package name: ")))))
   (unless (vc-responsible-backend dir)
     (user-error "Directory %S is not under version control" dir))
   (package-vc--archives-initialize)
-- 
2.41.0


^ permalink raw reply related	[relevance 10%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
      2023-10-06  4:45  0%                     ` Eli Zaretskii
@ 2023-10-06  5:55  5%                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-06  5:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: michael_heerdegen, Eli Zaretskii, philipk, 66187


Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> For example, given:
>>>
>>> (completing-read "Prompt: " '("a" "b") nil
>>>                  (lambda (input)
>>>                    (string= "a" input)))
>>>
>>> I expected that the prompt would refuse to complete "b". I was wrong.
>>>
>>> Since completing-read is such a fundamental part of Emacs, I doubt it
>>> will be possible to change this behavior.  What do you think about the
>>> attached patch to clarify the completing-read docstring?
>
> The use of a function as `require-match` is brand new in Emacs-29, so
> I think it's not too late to fix it.  I think rather than fixing the doc
> we should fix the behavior, e.g. with the patch below.
>
>
>         Stefan
>
>
> diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
> index 2120e31775e..d4da2d0d19b 100644
> --- a/lisp/minibuffer.el
> +++ b/lisp/minibuffer.el
> @@ -1835,15 +1835,13 @@ completion--complete-and-exit
>    (cond
>     ;; Allow user to specify null string
>     ((= beg end) (funcall exit-function))
> -   ;; The CONFIRM argument is a predicate.
> -   ((and (functionp minibuffer-completion-confirm)
> -         (funcall minibuffer-completion-confirm
> -                  (buffer-substring beg end)))
> -    (funcall exit-function))
>     ;; See if we have a completion from the table.
> -   ((test-completion (buffer-substring beg end)
> -                     minibuffer-completion-table
> -                     minibuffer-completion-predicate)
> +   ((if (functionp minibuffer-completion-confirm)
> +        (funcall minibuffer-completion-confirm
> +                 (buffer-substring beg end))
> +      (test-completion (buffer-substring beg end)
> +                       minibuffer-completion-table
> +                       minibuffer-completion-predicate))
>      ;; FIXME: completion-ignore-case has various slightly
>      ;; incompatible meanings.  E.g. it can reflect whether the user
>      ;; wants completion to pay attention to case, or whether the

Thank you!! The above change fixes completion--complete-and-exit:
attempting to exit with "b" now runs the final catchall cond clause.

However, the unexpected behavior persists (it is possible to exit with
"b") because the completion-function that completion-complete-and-exit
passes to completion--complete-and-exit returns "b" anyway since "b"
exactly matches one of elements of COLLECTION.

Thank you!

Joseph





^ permalink raw reply	[relevance 5%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  @ 2023-10-06  4:47  0%                       ` Eli Zaretskii
  0 siblings, 0 replies; 200+ results
From: Eli Zaretskii @ 2023-10-06  4:47 UTC (permalink / raw)
  To: Drew Adams; +Cc: michael_heerdegen, philipk, joseph, monnier, 66187

> From: Drew Adams <drew.adams@oracle.com>
> CC: "michael_heerdegen@web.de" <michael_heerdegen@web.de>,
>         "philipk@posteo.net" <philipk@posteo.net>,
>         "66187@debbugs.gnu.org"
> 	<66187@debbugs.gnu.org>,
>         Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Thu, 5 Oct 2023 20:20:46 +0000
> 
> > The use of a function as `require-match` is
> > brand new in Emacs-29, so I think it's not
> > too late to fix it.  I think rather than
> > fixing the doc we should fix the behavior 
> 
> If it's not too late to fix what was introduced
> in Emacs 29

That is not yet established.

> then how about not breaking the
> behavior of REQUIRE-MATCH at all, and instead
> just add a separate argument for what a function
> value of REQUIRE-MATCH does in 29.1?

That is definitely not a change suitable for Emacs 29 at this point.





^ permalink raw reply	[relevance 0%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
    @ 2023-10-06  4:45  0%                     ` Eli Zaretskii
    2023-10-06  5:55  5%                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-10-06  4:45 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: michael_heerdegen, philipk, 66187, joseph

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  michael_heerdegen@web.de,
>   philipk@posteo.net,  66187@debbugs.gnu.org
> Date: Thu, 05 Oct 2023 15:34:32 -0400
> 
> >> For example, given:
> >> 
> >> (completing-read "Prompt: " '("a" "b") nil
> >>                  (lambda (input)
> >>                    (string= "a" input)))
> >> 
> >> I expected that the prompt would refuse to complete "b". I was wrong.
> >> 
> >> Since completing-read is such a fundamental part of Emacs, I doubt it
> >> will be possible to change this behavior.  What do you think about the
> >> attached patch to clarify the completing-read docstring?
> 
> The use of a function as `require-match` is brand new in Emacs-29, so
> I think it's not too late to fix it.  I think rather than fixing the doc
> we should fix the behavior, e.g. with the patch below.

What change in behavior (wrt Emacs 29.1) does this patch cause?





^ permalink raw reply	[relevance 0%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-10-05  1:23  5%             ` Michael Heerdegen
@ 2023-10-05  1:34  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-11-12 20:42 11%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-05  1:34 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 66224, philipk


Michael Heerdegen <michael_heerdegen@web.de> writes:

> Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs@gnu.org> writes:
>
>> I'm not sure what you mean. In both of the following examples, PREDICATE
>> is used to narrow the completion candidates to only empty directories:
>>
>> (read-directory-name "Prompt: " "~/" nil t nil #'directory-empty-p)
>> (read-directory-name "Prompt: " "~/" nil nil nil #'directory-empty-p)
>
> In the second version also non-empty directories will be accepted.

Yes, PREDICATE narrows the completion candidates but doesn't determine a
valid return value.







^ permalink raw reply	[relevance 5%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-10-03 23:20  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-05  1:23  5%             ` Michael Heerdegen
  2023-10-05  1:34  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Michael Heerdegen @ 2023-10-05  1:23 UTC (permalink / raw)
  To: 66224; +Cc: philipk, joseph

Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> I'm not sure what you mean. In both of the following examples, PREDICATE
> is used to narrow the completion candidates to only empty directories:
>
> (read-directory-name "Prompt: " "~/" nil t nil #'directory-empty-p)
> (read-directory-name "Prompt: " "~/" nil nil nil #'directory-empty-p)

In the second version also non-empty directories will be accepted.

Michael.





^ permalink raw reply	[relevance 5%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-10-04  5:22  5%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-05  1:12  5%                     ` Michael Heerdegen
  0 siblings, 0 replies; 200+ results
From: Michael Heerdegen @ 2023-10-05  1:12 UTC (permalink / raw)
  To: 66187; +Cc: philipk, joseph

Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> My original expectations:
>
> - PREDICATE narrows the list of completion candidates
> - MUST-MATCH function determines whether to accept the input
> [...]

> > This is only about `read-file-name'
>
> Doesn't the unexpected behavior originate in completing-read?

If that's the behavioral aspect you mean, then yes, the meaning of the
arguments is analogue, and they are passed to `completing-read'.

Michael.





^ permalink raw reply	[relevance 5%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-10-03 21:18  9%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-04  3:35  5%                 ` Michael Heerdegen
@ 2023-10-04  7:03  0%                 ` Eli Zaretskii
    1 sibling, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-10-04  7:03 UTC (permalink / raw)
  To: Joseph Turner, Stefan Monnier; +Cc: michael_heerdegen, philipk, 66187

> Cc: philipk@posteo.net, 66187@debbugs.gnu.org
> Date: Tue, 03 Oct 2023 14:18:42 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> I dug a little more and realized that the IMO unexpected behavior
> resides in completing-read itself.  According to the completing-read
> docstring, its REQUIRE-MATCH argument can be
> 
> - a function, which will be called with the input as the
>   argument.  If the function returns a non-nil value, the
>   minibuffer is exited with that argument as the value.
> 
> I incorrectly assumed that this function would prevent matching items
> inside COLLECTION for which the function returns nil.  What it actually
> does it accept input which is not part of COLLECTION if the
> REQUIRE-MATCH function returns non-nil.  IOW, it doesn't narrow the
> potential completion options; it widens them.
> 
> For example, given:
> 
> (completing-read "Prompt: " '("a" "b") nil
>                  (lambda (input)
>                    (string= "a" input)))
> 
> I expected that the prompt would refuse to complete "b". I was wrong.
> 
> Since completing-read is such a fundamental part of Emacs, I doubt it
> will be possible to change this behavior.  What do you think about the
> attached patch to clarify the completing-read docstring?

I don't think I see how your proposed change clarifies this issue.

Adding Stefan for possibly more comments and ideas.





^ permalink raw reply	[relevance 0%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-10-04  6:05  0%                 ` Eli Zaretskii
@ 2023-10-04  6:25 10%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-04  6:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: michael_heerdegen, philipk, 66187

[-- Attachment #1: Type: text/plain, Size: 1014 bytes --]


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: michael_heerdegen@web.de, philipk@posteo.net, 66187@debbugs.gnu.org
>> Date: Tue, 03 Oct 2023 13:43:56 -0700
>>
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > This is okay, except that we do document the other arguments.  So why
>> > not just copy/paste the description of MUSTMATCH from read-file-name
>> > to read-directory-name instead?
>>
>> The read-file-name docstring for MUSTMATCH is lengthy, and duplicating
>> it will mean that if read-file-name changes, we'll need to remember to
>> change the docstring of read-directory-name.
>
> That's true, but it doesn't sound like a grave problem to me.  We have
> the same duplication elsewhere, so this isn't a precedent.  Moreover,
> when a doc string is long and complicated, asking the reader to read
> part of it elsewhere is also quite a hassle.
>
> So I still think duplication is the lesser evil here.

Thanks for the explanation! See patch.

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-MUSTMATCH-description-in-read-directory-name-doc.patch --]
[-- Type: text/x-diff, Size: 2014 bytes --]

From 3a653d681083d8d14d2d2437cb3f405dd7f07f04 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 26 Sep 2023 18:01:27 -0700
Subject: [PATCH] Fix MUSTMATCH description in read-directory-name docstring

* lisp/files.el (read-directory-name): Copy from read-file-name
description, replacing "file" with "directory".
---
 lisp/files.el | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index b72f141c0ee..c31cb13653e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -817,8 +817,23 @@ non-empty string that was inserted by this function.
 If the user exits with an empty minibuffer, this function returns
 an empty string.  (This can happen only if the user erased the
 pre-inserted contents or if `insert-default-directory' is nil.)
-Fourth arg MUSTMATCH non-nil means require existing directory's name.
- Non-nil and non-t means also require confirmation after completion.
+
+Fourth arg MUSTMATCH can take the following values:
+- nil means that the user can exit with any input.
+- t means that the user is not allowed to exit unless
+  the input is (or completes to) an existing directory.
+- `confirm' means that the user can exit with any input, but she needs
+  to confirm her choice if the input is not an existing directory.
+- `confirm-after-completion' means that the user can exit with any
+  input, but she needs to confirm her choice if she called
+  `minibuffer-complete' right before `minibuffer-complete-and-exit'
+  and the input is not an existing directory.
+- a function, which will be called with the input as the
+  argument.  If the function returns a non-nil value, the
+  minibuffer is exited with that argument as the value.
+- anything else behaves like t except that typing RET does not exit if it
+  does non-null completion.
+
 Fifth arg INITIAL specifies text to start with.
 DIR should be an absolute directory name.  It defaults to
 the value of `default-directory'."
-- 
2.41.0


^ permalink raw reply related	[relevance 10%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-10-03 20:43  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-04  6:05  0%                 ` Eli Zaretskii
  2023-10-04  6:25 10%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-10-04  6:05 UTC (permalink / raw)
  To: Joseph Turner; +Cc: michael_heerdegen, philipk, 66187

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: michael_heerdegen@web.de, philipk@posteo.net, 66187@debbugs.gnu.org
> Date: Tue, 03 Oct 2023 13:43:56 -0700
> 
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> Cc: philipk@posteo.net, 66187@debbugs.gnu.org
> >> Date: Tue, 26 Sep 2023 17:55:37 -0700
> >> From:  Joseph Turner via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> >>
> >> > Finally, I think the docstring of `read-directory-name' needs to be
> >> > updated: it fails to mention that MUSTMATCH can be a function (the
> >> > argument is passed directly to `read-file-name').
> >>
> >> How about the attached patch?
> >
> > This is okay, except that we do document the other arguments.  So why
> > not just copy/paste the description of MUSTMATCH from read-file-name
> > to read-directory-name instead?
> 
> The read-file-name docstring for MUSTMATCH is lengthy, and duplicating
> it will mean that if read-file-name changes, we'll need to remember to
> change the docstring of read-directory-name.

That's true, but it doesn't sound like a grave problem to me.  We have
the same duplication elsewhere, so this isn't a precedent.  Moreover,
when a doc string is long and complicated, asking the reader to read
part of it elsewhere is also quite a hassle.

So I still think duplication is the lesser evil here.





^ permalink raw reply	[relevance 0%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-10-04  3:35  5%                 ` Michael Heerdegen
@ 2023-10-04  5:22  5%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-05  1:12  5%                     ` Michael Heerdegen
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-04  5:22 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 66187, philipk


Michael Heerdegen <michael_heerdegen@web.de> writes:

> Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs@gnu.org> writes:
>
>> Since completing-read is such a fundamental part of Emacs, I doubt it
>> will be possible to change this behavior.
>
> This is only about `read-file-name' - and MUST-MATCH being allowed to be
> a function is quite new (June 2022).  If we have good reasons to change
> the behavior because we find that the case when both MUST-MATCH and
> PREDICATE are specified does not work intuitively I think it would still
> be possible to tune it a bit.
>
> But we have to know which behavior is more expected than what we
> currently have.

My original expectations:

- PREDICATE narrows the list of completion candidates
- MUST-MATCH function determines whether to accept the input

I had thought that the two arguments would work independently of one
another.  IOW, the return value of MUST-MATCH would be the only factor
that determines whether input is accepted.  If MUST-MATCH returns
non-nil, the input is unconditionally accepted, and vice versa.

> This is only about `read-file-name'

Doesn't the unexpected behavior originate in completing-read?

Joseph





^ permalink raw reply	[relevance 5%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-10-03 21:18  9%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-04  3:35  5%                 ` Michael Heerdegen
  2023-10-04  5:22  5%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-04  7:03  0%                 ` Eli Zaretskii
  1 sibling, 1 reply; 200+ results
From: Michael Heerdegen @ 2023-10-04  3:35 UTC (permalink / raw)
  To: 66187; +Cc: philipk, joseph

Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> Since completing-read is such a fundamental part of Emacs, I doubt it
> will be possible to change this behavior.

This is only about `read-file-name' - and MUST-MATCH being allowed to be
a function is quite new (June 2022).  If we have good reasons to change
the behavior because we find that the case when both MUST-MATCH and
PREDICATE are specified does not work intuitively I think it would still
be possible to tune it a bit.

But we have to know which behavior is more expected than what we
currently have.

Michael.





^ permalink raw reply	[relevance 5%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-10-03  3:30  5%         ` Michael Heerdegen
@ 2023-10-03 23:20  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-05  1:23  5%             ` Michael Heerdegen
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-03 23:20 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 66224, philipk


Michael Heerdegen <michael_heerdegen@web.de> writes:

> You know that the predicate will be ignored when MUSTMATCH is t?
> The behavior is not different than for `read-file-name'.

I'm not sure what you mean. In both of the following examples, PREDICATE
is used to narrow the completion candidates to only empty directories:

(read-directory-name "Prompt: " "~/" nil t nil #'directory-empty-p)
(read-directory-name "Prompt: " "~/" nil nil nil #'directory-empty-p)

Thank you!

Joseph





^ permalink raw reply	[relevance 5%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-09-29 12:05  0% ` Eli Zaretskii
@ 2023-10-03 23:08  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-03 23:08 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 66224

[-- Attachment #1: Type: text/plain, Size: 2440 bytes --]


Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Tue, 26 Sep 2023 18:16:40 -0700
>> From:  Joseph Turner via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> This patch makes read-directory-name accept an optional PREDICATE arg
>> so it can be used like read-file-name.
>
> Any rationale?

Mainly code clarity. If you want to prompt for a certain type of
directory, then IMO the intent is more clear like this:

(read-directory-name "Prompt: " "~/" nil nil nil #'my/predicate)

than like this:

(read-file-name "Prompt: " "~/" nil nil nil
                (lambda (filename)
                  (and (funcall #'file-directory-p filename)
                       (funcall #'my/predicate filename))))

Also, I think that it would follow the principle of least suprise to
have read-file-name and read-directory-name accept the same args.

>> @@ -1719,7 +1719,9 @@ combining @var{directory} (or the current buffer's default directory
>>  if @var{directory} is @code{nil}) and @var{initial}.  If both
>>  @var{default} and @var{initial} are @code{nil}, this function uses
>>  @var{directory} as substitute default, or the current buffer's default
>> -directory if @var{directory} is @code{nil}.
>> +directory if @var{directory} is @code{nil}.  The union of sixth arg
>> +@code{predicate} and @code{file-directory-p} is passed as the
>
> This should be elaborated: what is meant by "the union of sixth arg
> and 'file-directory-p'"?
>
>> +@code{predicate} argument to ‘read-file-name’.
>                                 ^^^^^^^^^^^^^^^^
> That should be @code{read-file-name}
>
>> +** 'read-directory-name' now accepts an optional PREDICATE argument.
>> +The union of sixth arg PREDICATE and 'file-directory-p' is passed
>> +as the PREDICATE argument to 'read-file-name'.
>
> Likewise here, regarding the "union" part.
>
> Also, since you submit the patch for the manual, this NEWS entry
> should be marked with "+++".
>
>>  Fifth arg INITIAL specifies text to start with.
>>  DIR should be an absolute directory name.  It defaults to
>> -the value of `default-directory'."
>> +the value of `default-directory'.
>> +The union of sixth arg PREDICATE and `file-directory-p' is passed
>> +as the PREDICATE argument to `read-file-name'."
>
> The "union" part again.

Thanks for the review!! Please see attached patch.

Best,

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-optional-PREDICATE-argument-to-read-directory-na.patch --]
[-- Type: text/x-diff, Size: 4288 bytes --]

From 1c7581914c1b446ea17692d425a4605d915fa7ef Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Thu, 28 Sep 2023 20:27:47 -0700
Subject: [PATCH] Add optional PREDICATE argument to read-directory-name

* lisp/files.el (read-directory-name): Add optional PREDICATE arg.
* doc/lispref/minibuf.texi (Reading File Names): Document change.
* etc/NEWS: Note change.
---
 doc/lispref/minibuf.texi |  8 ++++++--
 etc/NEWS                 |  7 +++++++
 lisp/files.el            | 14 +++++++++++---
 3 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 620c58ec6e9..eb344595ae3 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1709,7 +1709,7 @@ If this variable is non-@code{nil}, @code{read-file-name} ignores case
 when performing completion.
 @end defopt
 
-@defun read-directory-name prompt &optional directory default require-match initial
+@defun read-directory-name prompt &optional directory default require-match initial predicate
 This function is like @code{read-file-name} but allows only directory
 names as completion alternatives.
 
@@ -1719,7 +1719,11 @@ combining @var{directory} (or the current buffer's default directory
 if @var{directory} is @code{nil}) and @var{initial}.  If both
 @var{default} and @var{initial} are @code{nil}, this function uses
 @var{directory} as substitute default, or the current buffer's default
-directory if @var{directory} is @code{nil}.
+directory if @var{directory} is @code{nil}.  Sixth arg
+@code{predicate}, if non-nil, should be a function of one argument;
+then a file name is considered an acceptable completion alternative if
+both @code{file-directory-p} and @code{predicate} return non-nil with
+the file name argument.
 @end defun
 
 @defopt insert-default-directory
diff --git a/etc/NEWS b/etc/NEWS
index 1b3532b5657..a5a41d6546f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3541,6 +3541,13 @@ This function is called to see whether what the user has typed is a
 match.  This is also available from functions that call
 'completing-read', like 'read-file-name'.
 
++++
+** 'read-directory-name' now accepts an optional PREDICATE argument.
+Sixth arg PREDICATE, if non-nil, should be a function of one argument;
+then a file name is considered an acceptable completion alternative if
+both `file-directory-p' and PREDICATE return non-nil with the file
+name argument.
+
 ** 'posn-col-row' can now give position data based on windows.
 Previously, it reported data only based on the frame.
 
diff --git a/lisp/files.el b/lisp/files.el
index b72f141c0ee..1663f1e2d71 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -807,7 +807,7 @@ See Info node `(elisp)Standard File Names' for more details."
     (dos-convert-standard-filename filename))
    (t filename)))
 
-(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial)
+(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial predicate)
   "Read directory name, prompting with PROMPT and completing in directory DIR.
 Value is not expanded---you must call `expand-file-name' yourself.
 Default name to DEFAULT-DIRNAME if user exits with the same
@@ -821,14 +821,22 @@ Fourth arg MUSTMATCH non-nil means require existing directory's name.
  Non-nil and non-t means also require confirmation after completion.
 Fifth arg INITIAL specifies text to start with.
 DIR should be an absolute directory name.  It defaults to
-the value of `default-directory'."
+the value of `default-directory'.
+Sixth arg PREDICATE, if non-nil, should be a function of one
+argument; then a file name is considered an acceptable completion
+alternative if both `file-directory-p' and PREDICATE return
+non-nil with the file name argument."
   (unless dir
     (setq dir default-directory))
   (read-file-name prompt dir (or default-dirname
 				 (if initial (expand-file-name initial dir)
 				   dir))
 		  mustmatch initial
-		  'file-directory-p))
+                  (if predicate
+                      (lambda (filename)
+                        (and (file-directory-p filename)
+                             (funcall predicate filename)))
+                    #'file-directory-p)))
 
 \f
 (defun pwd (&optional insert)
-- 
2.41.0


^ permalink raw reply related	[relevance 8%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-09-27  1:43  4%             ` Michael Heerdegen
@ 2023-10-03 21:18  9%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-04  3:35  5%                 ` Michael Heerdegen
  2023-10-04  7:03  0%                 ` Eli Zaretskii
  0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-03 21:18 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: philipk, 66187

[-- Attachment #1: Type: text/plain, Size: 4573 bytes --]


Michael Heerdegen <michael_heerdegen@web.de> writes:

> I had a look and tried this:
>
> [2. text/x-diff; 0001-WIP-Bug-66187.patch]
> From ad895d2df5c69e015c2c7eba5116ab2d440e1fbc Mon Sep 17 00:00:00 2001
> From: Michael Heerdegen <michael_heerdegen@web.de>
> Date: Wed, 27 Sep 2023 03:32:37 +0200
> Subject: [PATCH] WIP: Bug#66187
>
> ---
>  lisp/minibuffer.el | 29 +++++++++++++++--------------
>  1 file changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
> index 2120e31775e..79a8786fbac 100644
> --- a/lisp/minibuffer.el
> +++ b/lisp/minibuffer.el
> @@ -3061,13 +3061,23 @@ completion-file-name-table
>            (funcall (or pred 'file-exists-p) string)))
>
>         (t
> -        (let* ((name (file-name-nondirectory string))
> +        (let* ((test-directory (lambda (s)
> +                                 (let ((len (length s)))
> +                                   (and (> len 0) (eq (aref s (1- len)) ?/)))))
> +               (should-complete
> +                (and pred
> +                     (if (eq pred 'file-directory-p)
> +                         test-directory
> +                       (lambda (f)
> +                         (or (funcall test-directory f)
> +                             (funcall pred f))))))
> +               (name (file-name-nondirectory string))
>                 (specdir (file-name-directory string))
>                 (realdir (or specdir default-directory)))
>
>            (cond
>             ((null action)
> -            (let ((comp (file-name-completion name realdir pred)))
> +            (let ((comp (file-name-completion name realdir should-complete)))
>                (if (stringp comp)
>                    (concat specdir comp)
>                  comp)))
> @@ -3078,18 +3088,9 @@ completion-file-name-table
>                ;; Check the predicate, if necessary.
>                (unless (memq pred '(nil file-exists-p))
>                  (let ((comp ())
> -                      (pred
> -                       (if (eq pred 'file-directory-p)
> -                           ;; Brute-force speed up for directory checking:
> -                           ;; Discard strings which don't end in a slash.
> -                           (lambda (s)
> -                             (let ((len (length s)))
> -                               (and (> len 0) (eq (aref s (1- len)) ?/))))
> -                         ;; Must do it the hard (and slow) way.
> -                         pred)))
> -                  (let ((default-directory (expand-file-name realdir)))
> -                    (dolist (tem all)
> -                      (if (funcall pred tem) (push tem comp))))
> +                      (default-directory (expand-file-name realdir)))
> +                  (dolist (tem all)
> +                    (if (funcall should-complete tem) (push tem comp)))
>                    (setq all (nreverse comp))))
>
>                all))))))

> I thought this would make Emacs complete as you want.  But: what files
> should be shown when hitting TAB?  I decided to show only matching
> files, plus all directories (seems logical, since these may contain
> matching files).

> But that gives a bad user experience: When I tried this I thought it
> would not work because completion did not accept an existing empty
> directory.  Then I saw that it actually was not empty.  But it contained only
> plain files, no subdirectories, and TAB displayed nothing.  Quite confusing!

I dug a little more and realized that the IMO unexpected behavior
resides in completing-read itself.  According to the completing-read
docstring, its REQUIRE-MATCH argument can be

- a function, which will be called with the input as the
  argument.  If the function returns a non-nil value, the
  minibuffer is exited with that argument as the value.

I incorrectly assumed that this function would prevent matching items
inside COLLECTION for which the function returns nil.  What it actually
does it accept input which is not part of COLLECTION if the
REQUIRE-MATCH function returns non-nil.  IOW, it doesn't narrow the
potential completion options; it widens them.

For example, given:

(completing-read "Prompt: " '("a" "b") nil
                 (lambda (input)
                   (string= "a" input)))

I expected that the prompt would refuse to complete "b". I was wrong.

Since completing-read is such a fundamental part of Emacs, I doubt it
will be possible to change this behavior.  What do you think about the
attached patch to clarify the completing-read docstring?

Thank you!!

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Clarify-completing-read-REQUIRE-MATCH-function-docst.patch --]
[-- Type: text/x-diff, Size: 1316 bytes --]

From 10fa6dd5c659bed2b818fb925445cab2cbbb5325 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 3 Oct 2023 14:40:22 -0700
Subject: [PATCH] Clarify completing-read REQUIRE-MATCH function docstring

* src/minibuf.c (Fcompleting_read): Explicitly note that REQUIRE-MATCH
function does not narrow the completion candidates.
---
 src/minibuf.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/minibuf.c b/src/minibuf.c
index 58adde1bf66..616be7091ee 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1999,8 +1999,11 @@ REQUIRE-MATCH can take the following values:
   `minibuffer-complete' right before `minibuffer-complete-and-exit'
   and the input is not an element of COLLECTION.
 - a function, which will be called with the input as the
-  argument.  If the function returns a non-nil value, the
-  minibuffer is exited with that argument as the value.
+  argument.  If the function returns a non-nil value or if
+  the input is a member of COLLECTION, the minibuffer is
+  exited with that argument as the value.  If the function
+  returns nil and the input is not a member of COLLECTION,
+  then the user is not allowed to exit.
 - anything else behaves like t except that typing RET does not exit if it
   does non-null completion.
 
-- 
2.41.0


^ permalink raw reply related	[relevance 9%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-09-29 12:00  0%             ` Eli Zaretskii
@ 2023-10-03 20:43  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-04  6:05  0%                 ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-10-03 20:43 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: michael_heerdegen, philipk, 66187


Eli Zaretskii <eliz@gnu.org> writes:

>> Cc: philipk@posteo.net, 66187@debbugs.gnu.org
>> Date: Tue, 26 Sep 2023 17:55:37 -0700
>> From:  Joseph Turner via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> > Finally, I think the docstring of `read-directory-name' needs to be
>> > updated: it fails to mention that MUSTMATCH can be a function (the
>> > argument is passed directly to `read-file-name').
>>
>> How about the attached patch?
>
> This is okay, except that we do document the other arguments.  So why
> not just copy/paste the description of MUSTMATCH from read-file-name
> to read-directory-name instead?

The read-file-name docstring for MUSTMATCH is lengthy, and duplicating
it will mean that if read-file-name changes, we'll need to remember to
change the docstring of read-directory-name.





^ permalink raw reply	[relevance 5%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-09-29  4:19  8%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-10-03  3:30  5%         ` Michael Heerdegen
  2023-10-03 23:20  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Michael Heerdegen @ 2023-10-03  3:30 UTC (permalink / raw)
  To: 66224; +Cc: philipk, joseph

Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> Thank you!! See attached patch.

Yes, thanks, the code LGTM now.

You know that the predicate will be ignored when MUSTMATCH is t?
The behavior is not different than for `read-file-name'.

I think your patch is definitely a step in the right direction, but I
also still think we should think about the semantics of the restricting
arguments as a whole.

Michael.





^ permalink raw reply	[relevance 5%]

* bug#65768: Bump persist.el version
  2023-09-16 22:28  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-30 14:30 11%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-30 14:30 UTC (permalink / raw)
  To: Stefan Kangas, 65768, Phillip Lord

Ping :)

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Ping.






^ permalink raw reply	[relevance 11%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-09-27  1:16  8% bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-28  9:05  5% ` Philip Kaludercic
@ 2023-09-29 12:05  0% ` Eli Zaretskii
  2023-10-03 23:08  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-09-29 12:05 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66224

> Date: Tue, 26 Sep 2023 18:16:40 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> This patch makes read-directory-name accept an optional PREDICATE arg
> so it can be used like read-file-name.

Any rationale?

> @@ -1719,7 +1719,9 @@ combining @var{directory} (or the current buffer's default directory
>  if @var{directory} is @code{nil}) and @var{initial}.  If both
>  @var{default} and @var{initial} are @code{nil}, this function uses
>  @var{directory} as substitute default, or the current buffer's default
> -directory if @var{directory} is @code{nil}.
> +directory if @var{directory} is @code{nil}.  The union of sixth arg
> +@code{predicate} and @code{file-directory-p} is passed as the

This should be elaborated: what is meant by "the union of sixth arg
and 'file-directory-p'"?

> +@code{predicate} argument to ‘read-file-name’.
                                ^^^^^^^^^^^^^^^^
That should be @code{read-file-name}

> +** 'read-directory-name' now accepts an optional PREDICATE argument.
> +The union of sixth arg PREDICATE and 'file-directory-p' is passed
> +as the PREDICATE argument to 'read-file-name'.

Likewise here, regarding the "union" part.

Also, since you submit the patch for the manual, this NEWS entry
should be marked with "+++".

>  Fifth arg INITIAL specifies text to start with.
>  DIR should be an absolute directory name.  It defaults to
> -the value of `default-directory'."
> +the value of `default-directory'.
> +The union of sixth arg PREDICATE and `file-directory-p' is passed
> +as the PREDICATE argument to `read-file-name'."

The "union" part again.

Thanks.





^ permalink raw reply	[relevance 0%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-09-27  0:55 10%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-27  1:43  4%             ` Michael Heerdegen
@ 2023-09-29 12:00  0%             ` Eli Zaretskii
  2023-10-03 20:43  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-09-29 12:00 UTC (permalink / raw)
  To: Joseph Turner; +Cc: michael_heerdegen, philipk, 66187

> Cc: philipk@posteo.net, 66187@debbugs.gnu.org
> Date: Tue, 26 Sep 2023 17:55:37 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> > Finally, I think the docstring of `read-directory-name' needs to be
> > updated: it fails to mention that MUSTMATCH can be a function (the
> > argument is passed directly to `read-file-name').
> 
> How about the attached patch?

This is okay, except that we do document the other arguments.  So why
not just copy/paste the description of MUSTMATCH from read-file-name
to read-directory-name instead?





^ permalink raw reply	[relevance 0%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-09-29  3:54  5%     ` Michael Heerdegen
@ 2023-09-29  4:19  8%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-03  3:30  5%         ` Michael Heerdegen
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-29  4:19 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 66224, philipk

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]


Michael Heerdegen <michael_heerdegen@web.de> writes:

> Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs@gnu.org> writes:
>
>> -		  'file-directory-p))
>> +                  (lambda (filename)
>> +                    (if predicate
>> +                        (and (file-directory-p filename)
>> +                             (funcall predicate filename))
>> +                      (file-directory-p filename)))))
>
> Yip.  Nitpick: The code will be faster if you move the test out of the
> predicate (so that it will not be performed repeatedly):
>
> #+begin_src emacs-lisp
> (if predicate
>     (lambda (filename)
>       (and (file-directory-p filename)
>            (funcall predicate filename)))
>   #'file-directory-p)
> #+end_src

Thank you!! See attached patch.

Joseph

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-optional-PREDICATE-argument-to-read-directory-na.patch --]
[-- Type: text/x-diff, Size: 4110 bytes --]

From 894e44bce60cf30c9e8bc8c5323eaed91d135bbb Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Thu, 28 Sep 2023 20:27:47 -0700
Subject: [PATCH] Add optional PREDICATE argument to read-directory-name

* lisp/files.el (read-directory-name): Add optional PREDICATE arg.
* doc/lispref/minibuf.texi (Reading File Names): Document change.
* etc/NEWS: Note change.
---
 doc/lispref/minibuf.texi |  7 +++++--
 etc/NEWS                 |  5 +++++
 lisp/files.el            | 13 ++++++++++---
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 620c58ec6e9..bf4d6e13d3a 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1709,7 +1709,7 @@ If this variable is non-@code{nil}, @code{read-file-name} ignores case
 when performing completion.
 @end defopt
 
-@defun read-directory-name prompt &optional directory default require-match initial
+@defun read-directory-name prompt &optional directory default require-match initial predicate
 This function is like @code{read-file-name} but allows only directory
 names as completion alternatives.
 
@@ -1719,7 +1719,10 @@ combining @var{directory} (or the current buffer's default directory
 if @var{directory} is @code{nil}) and @var{initial}.  If both
 @var{default} and @var{initial} are @code{nil}, this function uses
 @var{directory} as substitute default, or the current buffer's default
-directory if @var{directory} is @code{nil}.
+directory if @var{directory} is @code{nil}.  When optional sixth
+argument @code{predicate} is non-nil, the union of @code{predicate}
+and @code{file-directory-p} is passed as the @code{predicate} argument
+to @code{read-file-name}.
 @end defun
 
 @defopt insert-default-directory
diff --git a/etc/NEWS b/etc/NEWS
index 1b3532b5657..fb9f6a0b43f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3541,6 +3541,11 @@ This function is called to see whether what the user has typed is a
 match.  This is also available from functions that call
 'completing-read', like 'read-file-name'.
 
+** 'read-directory-name' now accepts an optional PREDICATE argument.
+When optional sixth argument PREDICATE is non-nil, the union of
+PREDICATE and 'file-directory-p' is passed as the PREDICATE argument
+to 'read-file-name'.
+
 ** 'posn-col-row' can now give position data based on windows.
 Previously, it reported data only based on the frame.
 
diff --git a/lisp/files.el b/lisp/files.el
index b72f141c0ee..68855cd1c6d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -807,7 +807,7 @@ See Info node `(elisp)Standard File Names' for more details."
     (dos-convert-standard-filename filename))
    (t filename)))
 
-(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial)
+(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial predicate)
   "Read directory name, prompting with PROMPT and completing in directory DIR.
 Value is not expanded---you must call `expand-file-name' yourself.
 Default name to DEFAULT-DIRNAME if user exits with the same
@@ -821,14 +821,21 @@ Fourth arg MUSTMATCH non-nil means require existing directory's name.
  Non-nil and non-t means also require confirmation after completion.
 Fifth arg INITIAL specifies text to start with.
 DIR should be an absolute directory name.  It defaults to
-the value of `default-directory'."
+the value of `default-directory'.
+When sixth arg PREDICATE is non-nil, the union of PREDICATE and
+`file-directory-p' is passed as the PREDICATE argument to
+`read-file-name'. Otherwise, only `file-directory-p' is passed."
   (unless dir
     (setq dir default-directory))
   (read-file-name prompt dir (or default-dirname
 				 (if initial (expand-file-name initial dir)
 				   dir))
 		  mustmatch initial
-		  'file-directory-p))
+                  (if predicate
+                      (lambda (filename)
+                        (and (file-directory-p filename)
+                             (funcall predicate filename)))
+                    #'file-directory-p)))
 
 \f
 (defun pwd (&optional insert)
-- 
2.41.0


^ permalink raw reply related	[relevance 8%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-09-29  3:28  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-29  3:54  5%     ` Michael Heerdegen
  2023-09-29  4:19  8%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Michael Heerdegen @ 2023-09-29  3:54 UTC (permalink / raw)
  To: 66224; +Cc: philipk, joseph

Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> -		  'file-directory-p))
> +                  (lambda (filename)
> +                    (if predicate
> +                        (and (file-directory-p filename)
> +                             (funcall predicate filename))
> +                      (file-directory-p filename)))))

Yip.  Nitpick: The code will be faster if you move the test out of the
predicate (so that it will not be performed repeatedly):

#+begin_src emacs-lisp
(if predicate
    (lambda (filename)
      (and (file-directory-p filename)
           (funcall predicate filename)))
  #'file-directory-p)
#+end_src


Michael.






^ permalink raw reply	[relevance 5%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-09-28  9:05  5% ` Philip Kaludercic
  2023-09-29  3:28  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-29  3:28  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-29  3:54  5%     ` Michael Heerdegen
  1 sibling, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-29  3:28 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 66224

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]


Philip Kaludercic <philipk@posteo.net> writes:
>
> I am not sure this makes sense, #'file-directory-p is always non-nil but
> a PREDICATE will only be passed on to `read-file-name' is PREDICATE is
> also non-nil.  So if no PREDICATE is passed, the expression ignored
> #'file-directory-p, breaking `read-directory-name', or am I mistaken (I
> haven't tried it out)?

Oops! Thanks for catching my error!! The attached patch should actually
do what I intended.

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-optional-PREDICATE-argument-to-read-directory-na.patch --]
[-- Type: text/x-diff, Size: 4119 bytes --]

From 58f4215a6742c6cefc318f84544cc74495c901c1 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Thu, 28 Sep 2023 20:27:47 -0700
Subject: [PATCH] Add optional PREDICATE argument to read-directory-name

* lisp/files.el (read-directory-name): Add optional PREDICATE arg.
* doc/lispref/minibuf.texi (Reading File Names): Document change.
* etc/NEWS: Note change.
---
 doc/lispref/minibuf.texi |  7 +++++--
 etc/NEWS                 |  5 +++++
 lisp/files.el            | 13 ++++++++++---
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 620c58ec6e9..bf4d6e13d3a 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1709,7 +1709,7 @@ If this variable is non-@code{nil}, @code{read-file-name} ignores case
 when performing completion.
 @end defopt
 
-@defun read-directory-name prompt &optional directory default require-match initial
+@defun read-directory-name prompt &optional directory default require-match initial predicate
 This function is like @code{read-file-name} but allows only directory
 names as completion alternatives.
 
@@ -1719,7 +1719,10 @@ combining @var{directory} (or the current buffer's default directory
 if @var{directory} is @code{nil}) and @var{initial}.  If both
 @var{default} and @var{initial} are @code{nil}, this function uses
 @var{directory} as substitute default, or the current buffer's default
-directory if @var{directory} is @code{nil}.
+directory if @var{directory} is @code{nil}.  When optional sixth
+argument @code{predicate} is non-nil, the union of @code{predicate}
+and @code{file-directory-p} is passed as the @code{predicate} argument
+to @code{read-file-name}.
 @end defun
 
 @defopt insert-default-directory
diff --git a/etc/NEWS b/etc/NEWS
index 1b3532b5657..fb9f6a0b43f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3541,6 +3541,11 @@ This function is called to see whether what the user has typed is a
 match.  This is also available from functions that call
 'completing-read', like 'read-file-name'.
 
+** 'read-directory-name' now accepts an optional PREDICATE argument.
+When optional sixth argument PREDICATE is non-nil, the union of
+PREDICATE and 'file-directory-p' is passed as the PREDICATE argument
+to 'read-file-name'.
+
 ** 'posn-col-row' can now give position data based on windows.
 Previously, it reported data only based on the frame.
 
diff --git a/lisp/files.el b/lisp/files.el
index b72f141c0ee..17f433fd339 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -807,7 +807,7 @@ See Info node `(elisp)Standard File Names' for more details."
     (dos-convert-standard-filename filename))
    (t filename)))
 
-(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial)
+(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial predicate)
   "Read directory name, prompting with PROMPT and completing in directory DIR.
 Value is not expanded---you must call `expand-file-name' yourself.
 Default name to DEFAULT-DIRNAME if user exits with the same
@@ -821,14 +821,21 @@ Fourth arg MUSTMATCH non-nil means require existing directory's name.
  Non-nil and non-t means also require confirmation after completion.
 Fifth arg INITIAL specifies text to start with.
 DIR should be an absolute directory name.  It defaults to
-the value of `default-directory'."
+the value of `default-directory'.
+When sixth arg PREDICATE is non-nil, the union of PREDICATE and
+`file-directory-p' is passed as the PREDICATE argument to
+`read-file-name'. Otherwise, only `file-directory-p' is passed."
   (unless dir
     (setq dir default-directory))
   (read-file-name prompt dir (or default-dirname
 				 (if initial (expand-file-name initial dir)
 				   dir))
 		  mustmatch initial
-		  'file-directory-p))
+                  (lambda (filename)
+                    (if predicate
+                        (and (file-directory-p filename)
+                             (funcall predicate filename))
+                      (file-directory-p filename)))))
 
 \f
 (defun pwd (&optional insert)
-- 
2.41.0


^ permalink raw reply related	[relevance 8%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-09-28  9:05  5% ` Philip Kaludercic
@ 2023-09-29  3:28  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-29  3:28  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-29  3:28 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 66224

[-- Attachment #1: Type: text/plain, Size: 469 bytes --]


Philip Kaludercic <philipk@posteo.net> writes:
>
> I am not sure this makes sense, #'file-directory-p is always non-nil but
> a PREDICATE will only be passed on to `read-file-name' is PREDICATE is
> also non-nil.  So if no PREDICATE is passed, the expression ignored
> #'file-directory-p, breaking `read-directory-name', or am I mistaken (I
> haven't tried it out)?

Oops! Thanks for catching my error!! The attached patch should actually
do what I intended.

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-optional-PREDICATE-argument-to-read-directory-na.patch --]
[-- Type: text/x-diff, Size: 4119 bytes --]

From 58f4215a6742c6cefc318f84544cc74495c901c1 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Thu, 28 Sep 2023 20:27:47 -0700
Subject: [PATCH] Add optional PREDICATE argument to read-directory-name

* lisp/files.el (read-directory-name): Add optional PREDICATE arg.
* doc/lispref/minibuf.texi (Reading File Names): Document change.
* etc/NEWS: Note change.
---
 doc/lispref/minibuf.texi |  7 +++++--
 etc/NEWS                 |  5 +++++
 lisp/files.el            | 13 ++++++++++---
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 620c58ec6e9..bf4d6e13d3a 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1709,7 +1709,7 @@ If this variable is non-@code{nil}, @code{read-file-name} ignores case
 when performing completion.
 @end defopt
 
-@defun read-directory-name prompt &optional directory default require-match initial
+@defun read-directory-name prompt &optional directory default require-match initial predicate
 This function is like @code{read-file-name} but allows only directory
 names as completion alternatives.
 
@@ -1719,7 +1719,10 @@ combining @var{directory} (or the current buffer's default directory
 if @var{directory} is @code{nil}) and @var{initial}.  If both
 @var{default} and @var{initial} are @code{nil}, this function uses
 @var{directory} as substitute default, or the current buffer's default
-directory if @var{directory} is @code{nil}.
+directory if @var{directory} is @code{nil}.  When optional sixth
+argument @code{predicate} is non-nil, the union of @code{predicate}
+and @code{file-directory-p} is passed as the @code{predicate} argument
+to @code{read-file-name}.
 @end defun
 
 @defopt insert-default-directory
diff --git a/etc/NEWS b/etc/NEWS
index 1b3532b5657..fb9f6a0b43f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3541,6 +3541,11 @@ This function is called to see whether what the user has typed is a
 match.  This is also available from functions that call
 'completing-read', like 'read-file-name'.
 
+** 'read-directory-name' now accepts an optional PREDICATE argument.
+When optional sixth argument PREDICATE is non-nil, the union of
+PREDICATE and 'file-directory-p' is passed as the PREDICATE argument
+to 'read-file-name'.
+
 ** 'posn-col-row' can now give position data based on windows.
 Previously, it reported data only based on the frame.
 
diff --git a/lisp/files.el b/lisp/files.el
index b72f141c0ee..17f433fd339 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -807,7 +807,7 @@ See Info node `(elisp)Standard File Names' for more details."
     (dos-convert-standard-filename filename))
    (t filename)))
 
-(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial)
+(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial predicate)
   "Read directory name, prompting with PROMPT and completing in directory DIR.
 Value is not expanded---you must call `expand-file-name' yourself.
 Default name to DEFAULT-DIRNAME if user exits with the same
@@ -821,14 +821,21 @@ Fourth arg MUSTMATCH non-nil means require existing directory's name.
  Non-nil and non-t means also require confirmation after completion.
 Fifth arg INITIAL specifies text to start with.
 DIR should be an absolute directory name.  It defaults to
-the value of `default-directory'."
+the value of `default-directory'.
+When sixth arg PREDICATE is non-nil, the union of PREDICATE and
+`file-directory-p' is passed as the PREDICATE argument to
+`read-file-name'. Otherwise, only `file-directory-p' is passed."
   (unless dir
     (setq dir default-directory))
   (read-file-name prompt dir (or default-dirname
 				 (if initial (expand-file-name initial dir)
 				   dir))
 		  mustmatch initial
-		  'file-directory-p))
+                  (lambda (filename)
+                    (if predicate
+                        (and (file-directory-p filename)
+                             (funcall predicate filename))
+                      (file-directory-p filename)))))
 
 \f
 (defun pwd (&optional insert)
-- 
2.41.0


^ permalink raw reply related	[relevance 8%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
  2023-09-27  1:16  8% bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-28  9:05  5% ` Philip Kaludercic
  2023-09-29  3:28  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-29  3:28  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-29 12:05  0% ` Eli Zaretskii
  1 sibling, 2 replies; 200+ results
From: Philip Kaludercic @ 2023-09-28  9:05 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66224

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Hello!
>
> This patch makes read-directory-name accept an optional PREDICATE arg
> so it can be used like read-file-name.
>
> Joseph
>
>>From 78ba02683bd163d8991b182ec4e8ec370e734f95 Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Tue, 26 Sep 2023 18:14:23 -0700
> Subject: [PATCH] Add optional PREDICATE argument to read-directory-name
>
> * lisp/files.el (read-directory-name): Add optional PREDICATE arg.
> * doc/lispref/minibuf.texi (Reading File Names): Document change.
> * etc/NEWS: Note change.
> ---
>  doc/lispref/minibuf.texi | 6 ++++--
>  etc/NEWS                 | 4 ++++
>  lisp/files.el            | 8 +++++---
>  3 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
> index 620c58ec6e9..c3528ea74d2 100644
> --- a/doc/lispref/minibuf.texi
> +++ b/doc/lispref/minibuf.texi
> @@ -1709,7 +1709,7 @@ If this variable is non-@code{nil}, @code{read-file-name} ignores case
>  when performing completion.
>  @end defopt
>  
> -@defun read-directory-name prompt &optional directory default require-match initial
> +@defun read-directory-name prompt &optional directory default require-match initial predicate
>  This function is like @code{read-file-name} but allows only directory
>  names as completion alternatives.
>  
> @@ -1719,7 +1719,9 @@ combining @var{directory} (or the current buffer's default directory
>  if @var{directory} is @code{nil}) and @var{initial}.  If both
>  @var{default} and @var{initial} are @code{nil}, this function uses
>  @var{directory} as substitute default, or the current buffer's default
> -directory if @var{directory} is @code{nil}.
> +directory if @var{directory} is @code{nil}.  The union of sixth arg
> +@code{predicate} and @code{file-directory-p} is passed as the
> +@code{predicate} argument to ‘read-file-name’.
>  @end defun
>  
>  @defopt insert-default-directory
> diff --git a/etc/NEWS b/etc/NEWS
> index 1b3532b5657..ee0143b1958 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -3541,6 +3541,10 @@ This function is called to see whether what the user has typed is a
>  match.  This is also available from functions that call
>  'completing-read', like 'read-file-name'.
>  
> +** 'read-directory-name' now accepts an optional PREDICATE argument.
> +The union of sixth arg PREDICATE and 'file-directory-p' is passed
> +as the PREDICATE argument to 'read-file-name'.
> +
>  ** 'posn-col-row' can now give position data based on windows.
>  Previously, it reported data only based on the frame.
>  
> diff --git a/lisp/files.el b/lisp/files.el
> index b72f141c0ee..e78e8ea0a36 100644
> --- a/lisp/files.el
> +++ b/lisp/files.el
> @@ -807,7 +807,7 @@ See Info node `(elisp)Standard File Names' for more details."
>      (dos-convert-standard-filename filename))
>     (t filename)))
>  
> -(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial)
> +(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial predicate)
>    "Read directory name, prompting with PROMPT and completing in directory DIR.
>  Value is not expanded---you must call `expand-file-name' yourself.
>  Default name to DEFAULT-DIRNAME if user exits with the same
> @@ -821,14 +821,16 @@ Fourth arg MUSTMATCH non-nil means require existing directory's name.
>   Non-nil and non-t means also require confirmation after completion.
>  Fifth arg INITIAL specifies text to start with.
>  DIR should be an absolute directory name.  It defaults to
> -the value of `default-directory'."
> +the value of `default-directory'.
> +The union of sixth arg PREDICATE and `file-directory-p' is passed
> +as the PREDICATE argument to `read-file-name'."
>    (unless dir
>      (setq dir default-directory))
>    (read-file-name prompt dir (or default-dirname
>  				 (if initial (expand-file-name initial dir)
>  				   dir))
>  		  mustmatch initial
> -		  'file-directory-p))
> +		  (and #'file-directory-p predicate)))

I am not sure this makes sense, #'file-directory-p is always non-nil but
a PREDICATE will only be passed on to `read-file-name' is PREDICATE is
also non-nil.  So if no PREDICATE is passed, the expression ignored
#'file-directory-p, breaking `read-directory-name', or am I mistaken (I
haven't tried it out)?

>  
>  \f
>  (defun pwd (&optional insert)





^ permalink raw reply	[relevance 5%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-09-27  0:55 10%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-27  1:43  4%             ` Michael Heerdegen
  2023-10-03 21:18  9%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-29 12:00  0%             ` Eli Zaretskii
  1 sibling, 1 reply; 200+ results
From: Michael Heerdegen @ 2023-09-27  1:43 UTC (permalink / raw)
  To: Joseph Turner; +Cc: philipk, 66187

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> > Yes, looks like a bug that this is not possible.  It should be possible
> > to complete directory names that do not match.
>
> I'm happy to work on the bug, if others agree that this change is
> desired.

I had a look and tried this:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-WIP-Bug-66187.patch --]
[-- Type: text/x-diff, Size: 2765 bytes --]

From ad895d2df5c69e015c2c7eba5116ab2d440e1fbc Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen@web.de>
Date: Wed, 27 Sep 2023 03:32:37 +0200
Subject: [PATCH] WIP: Bug#66187

---
 lisp/minibuffer.el | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 2120e31775e..79a8786fbac 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -3061,13 +3061,23 @@ completion-file-name-table
           (funcall (or pred 'file-exists-p) string)))

        (t
-        (let* ((name (file-name-nondirectory string))
+        (let* ((test-directory (lambda (s)
+                                 (let ((len (length s)))
+                                   (and (> len 0) (eq (aref s (1- len)) ?/)))))
+               (should-complete
+                (and pred
+                     (if (eq pred 'file-directory-p)
+                         test-directory
+                       (lambda (f)
+                         (or (funcall test-directory f)
+                             (funcall pred f))))))
+               (name (file-name-nondirectory string))
                (specdir (file-name-directory string))
                (realdir (or specdir default-directory)))

           (cond
            ((null action)
-            (let ((comp (file-name-completion name realdir pred)))
+            (let ((comp (file-name-completion name realdir should-complete)))
               (if (stringp comp)
                   (concat specdir comp)
                 comp)))
@@ -3078,18 +3088,9 @@ completion-file-name-table
               ;; Check the predicate, if necessary.
               (unless (memq pred '(nil file-exists-p))
                 (let ((comp ())
-                      (pred
-                       (if (eq pred 'file-directory-p)
-                           ;; Brute-force speed up for directory checking:
-                           ;; Discard strings which don't end in a slash.
-                           (lambda (s)
-                             (let ((len (length s)))
-                               (and (> len 0) (eq (aref s (1- len)) ?/))))
-                         ;; Must do it the hard (and slow) way.
-                         pred)))
-                  (let ((default-directory (expand-file-name realdir)))
-                    (dolist (tem all)
-                      (if (funcall pred tem) (push tem comp))))
+                      (default-directory (expand-file-name realdir)))
+                  (dolist (tem all)
+                    (if (funcall should-complete tem) (push tem comp)))
                   (setq all (nreverse comp))))

               all))))))
--
2.39.2


[-- Attachment #3: Type: text/plain, Size: 1179 bytes --]


I thought this would make Emacs complete as you want.  But: what files
should be shown when hitting TAB?  I decided to show only matching
files, plus all directories (seems logical, since these may contain
matching files).

But that gives a bad user experience: When I tried this I thought it
would not work because completion did not accept an existing empty
directory.  Then I saw that it actually was not empty.  But it contained only
plain files, no subdirectories, and TAB displayed nothing.  Quite confusing!


> How about the attached patch?

| diff --git a/lisp/files.el b/lisp/files.el
| index b72f141c0ee..1fe124848b9 100644
| --- a/lisp/files.el
| +++ b/lisp/files.el
| @@ -817,7 +817,7 @@ non-empty string that was inserted by this function.
|  If the user exits with an empty minibuffer, this function returns
|  an empty string.  (This can happen only if the user erased the
|  pre-inserted contents or if `insert-default-directory' is nil.)
| -Fourth arg MUSTMATCH non-nil means require existing directory's name.
| +Fourth arg MUSTMATCH is passed as-is to `read-file-name', which see.

Ok from my side.

What do others think about all of this?


Thx,

Michael.


^ permalink raw reply related	[relevance 4%]

* bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name
@ 2023-09-27  1:16  8% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-28  9:05  5% ` Philip Kaludercic
  2023-09-29 12:05  0% ` Eli Zaretskii
  0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-27  1:16 UTC (permalink / raw)
  To: 66224

[-- Attachment #1: Type: text/plain, Size: 126 bytes --]

Hello!

This patch makes read-directory-name accept an optional PREDICATE arg
so it can be used like read-file-name.

Joseph


[-- Attachment #2: 0001-Add-optional-PREDICATE-argument-to-read-directory-na.patch --]
[-- Type: text/x-diff, Size: 3826 bytes --]

From 78ba02683bd163d8991b182ec4e8ec370e734f95 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 26 Sep 2023 18:14:23 -0700
Subject: [PATCH] Add optional PREDICATE argument to read-directory-name

* lisp/files.el (read-directory-name): Add optional PREDICATE arg.
* doc/lispref/minibuf.texi (Reading File Names): Document change.
* etc/NEWS: Note change.
---
 doc/lispref/minibuf.texi | 6 ++++--
 etc/NEWS                 | 4 ++++
 lisp/files.el            | 8 +++++---
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi
index 620c58ec6e9..c3528ea74d2 100644
--- a/doc/lispref/minibuf.texi
+++ b/doc/lispref/minibuf.texi
@@ -1709,7 +1709,7 @@ If this variable is non-@code{nil}, @code{read-file-name} ignores case
 when performing completion.
 @end defopt
 
-@defun read-directory-name prompt &optional directory default require-match initial
+@defun read-directory-name prompt &optional directory default require-match initial predicate
 This function is like @code{read-file-name} but allows only directory
 names as completion alternatives.
 
@@ -1719,7 +1719,9 @@ combining @var{directory} (or the current buffer's default directory
 if @var{directory} is @code{nil}) and @var{initial}.  If both
 @var{default} and @var{initial} are @code{nil}, this function uses
 @var{directory} as substitute default, or the current buffer's default
-directory if @var{directory} is @code{nil}.
+directory if @var{directory} is @code{nil}.  The union of sixth arg
+@code{predicate} and @code{file-directory-p} is passed as the
+@code{predicate} argument to ‘read-file-name’.
 @end defun
 
 @defopt insert-default-directory
diff --git a/etc/NEWS b/etc/NEWS
index 1b3532b5657..ee0143b1958 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3541,6 +3541,10 @@ This function is called to see whether what the user has typed is a
 match.  This is also available from functions that call
 'completing-read', like 'read-file-name'.
 
+** 'read-directory-name' now accepts an optional PREDICATE argument.
+The union of sixth arg PREDICATE and 'file-directory-p' is passed
+as the PREDICATE argument to 'read-file-name'.
+
 ** 'posn-col-row' can now give position data based on windows.
 Previously, it reported data only based on the frame.
 
diff --git a/lisp/files.el b/lisp/files.el
index b72f141c0ee..e78e8ea0a36 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -807,7 +807,7 @@ See Info node `(elisp)Standard File Names' for more details."
     (dos-convert-standard-filename filename))
    (t filename)))
 
-(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial)
+(defun read-directory-name (prompt &optional dir default-dirname mustmatch initial predicate)
   "Read directory name, prompting with PROMPT and completing in directory DIR.
 Value is not expanded---you must call `expand-file-name' yourself.
 Default name to DEFAULT-DIRNAME if user exits with the same
@@ -821,14 +821,16 @@ Fourth arg MUSTMATCH non-nil means require existing directory's name.
  Non-nil and non-t means also require confirmation after completion.
 Fifth arg INITIAL specifies text to start with.
 DIR should be an absolute directory name.  It defaults to
-the value of `default-directory'."
+the value of `default-directory'.
+The union of sixth arg PREDICATE and `file-directory-p' is passed
+as the PREDICATE argument to `read-file-name'."
   (unless dir
     (setq dir default-directory))
   (read-file-name prompt dir (or default-dirname
 				 (if initial (expand-file-name initial dir)
 				   dir))
 		  mustmatch initial
-		  'file-directory-p))
+		  (and #'file-directory-p predicate)))
 
 \f
 (defun pwd (&optional insert)
-- 
2.41.0


^ permalink raw reply related	[relevance 8%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-09-27  0:26  5%         ` Michael Heerdegen
@ 2023-09-27  0:55 10%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-27  1:43  4%             ` Michael Heerdegen
  2023-09-29 12:00  0%             ` Eli Zaretskii
  0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-27  0:55 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: philipk, 66187

[-- Attachment #1: Type: text/plain, Size: 1057 bytes --]


Michael Heerdegen <michael_heerdegen@web.de> writes:
> Ah - ok, now finally I've understood all the parts.
>
> You want to prompt for a directory that is either empty or not yet
> existing.  But with `read-file-name' you only get either (a) non-empty
> directories accepted as input, or (b) failing completion of existing
> non-empty directories, which makes it impossible to choose a directory
> inside an existing directory.
>
> Yes, looks like a bug that this is not possible.  It should be possible
> to complete directory names that do not match.

I'm happy to work on the bug, if others agree that this change is desired.

> Then the documentation needs to be improved: what exactly is accepted
> when both MUSTMATCH and PREDICATE are specified?

I can improve the docs too, once I have the answer that questions.

> Finally, I think the docstring of `read-directory-name' needs to be
> updated: it fails to mention that MUSTMATCH can be a function (the
> argument is passed directly to `read-file-name').

How about the attached patch?

> Michael.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-MUSTMATCH-description-in-read-directory-name-doc.patch --]
[-- Type: text/x-diff, Size: 1069 bytes --]

From e0ea8501af4e0dfd9777879e44a07902f86d1a7e Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 26 Sep 2023 18:01:27 -0700
Subject: [PATCH] Fix MUSTMATCH description in read-directory-name docstring

* lisp/files.el (read-directory-name)
---
 lisp/files.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/files.el b/lisp/files.el
index b72f141c0ee..1fe124848b9 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -817,7 +817,7 @@ non-empty string that was inserted by this function.
 If the user exits with an empty minibuffer, this function returns
 an empty string.  (This can happen only if the user erased the
 pre-inserted contents or if `insert-default-directory' is nil.)
-Fourth arg MUSTMATCH non-nil means require existing directory's name.
+Fourth arg MUSTMATCH is passed as-is to `read-file-name', which see.
  Non-nil and non-t means also require confirmation after completion.
 Fifth arg INITIAL specifies text to start with.
 DIR should be an absolute directory name.  It defaults to
-- 
2.41.0


^ permalink raw reply related	[relevance 10%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-09-26  8:37  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-27  0:26  5%         ` Michael Heerdegen
  2023-09-27  0:55 10%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Michael Heerdegen @ 2023-09-27  0:26 UTC (permalink / raw)
  To: Joseph Turner; +Cc: philipk, 66187

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Thank you! What I was hoping for may not have a clean solution:
>
> - the completions buffer displays and allows tab-completion for all
>   directories, empty or not, then
> - upon pressing RET on a non-empty directory, the "[Match required]"
>   message appears. Only upon pressing RET on an empty directory does
>   completion succeed.

Ah - ok, now finally I've understood all the parts.

You want to prompt for a directory that is either empty or not yet
existing.  But with `read-file-name' you only get either (a) non-empty
directories accepted as input, or (b) failing completion of existing
non-empty directories, which makes it impossible to choose a directory
inside an existing directory.

Yes, looks like a bug that this is not possible.  It should be possible
to complete directory names that do not match.

Then the documentation needs to be improved: what exactly is accepted
when both MUSTMATCH and PREDICATE are specified?

Finally, I think the docstring of `read-directory-name' needs to be
updated: it fails to mention that MUSTMATCH can be a function (the
argument is passed directly to `read-file-name').


Michael.





^ permalink raw reply	[relevance 5%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-09-25 21:33  5%     ` Michael Heerdegen
@ 2023-09-26  8:37  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-27  0:26  5%         ` Michael Heerdegen
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-26  8:37 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: philipk, 66187


Michael Heerdegen <michael_heerdegen@web.de> writes:

> AFAIU the algorithm
> works like this: first it's checked whether a completion is allowed (by
> checking whether it's the name of an existing file and consulting
> PREDICATE when specified).  Only when it is not allowed we check whether
> MUSTMATCH declares it acceptable.

Thank you!! That makes sense now.

> This is not really explained in the docstring, however.
>
> In your example, the default-directory is the name of an existing file,
> so the MUSTMATCH argument is irrelevant, the specified PREDICATE is
> fulfilled, so it's accepted as input.
>
> If I guess correctly I think you want something like this:
>
> #+begin_src emacs-lisp
> (let ((acceptable-p (lambda (filename)
>                       (and (file-directory-p filename)
>                            (directory-empty-p filename)))))
>   (read-file-name "Clone into new or empty directory: " nil nil
>                   (lambda (filename)
>                     (if (file-exists-p filename)
>                         (funcall acceptable-p filename)
>                       t))
>                   nil
>                   acceptable-p))
> #+end_src
>
> Does that come close?

Thank you! What I was hoping for may not have a clean solution:

- the completions buffer displays and allows tab-completion for all
  directories, empty or not, then
- upon pressing RET on a non-empty directory, the "[Match required]"
  message appears. Only upon pressing RET on an empty directory does
  completion succeed.

If this cannot be accomplished elegantly, I'll consider other designs
for the interactive prompt in package-vc-checkout.

Thanks!!

Joseph






^ permalink raw reply	[relevance 5%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-09-25  5:12  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-25 21:33  5%     ` Michael Heerdegen
  2023-09-26  8:37  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Michael Heerdegen @ 2023-09-25 21:33 UTC (permalink / raw)
  To: Joseph Turner; +Cc: philipk, 66187

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> (mkdir "/tmp/foo" t)
> (with-temp-buffer
>   (write-file "/tmp/foo/bar"))
> (setq default-directory "/tmp/foo/")
> (read-file-name "Clone into new or empty directory: " nil nil
>                 (lambda (filename)
>                   (or (not (file-exists-p filename))
>                       (directory-empty-p filename)))
>                 nil
>                 (lambda (filename)
>                   (file-directory-p filename)))
>
> The default prompt is "/tmp/foo/". In my Emacs (29.0.92), when I
> immediately press RET, read-file-name (erroneously?) returns "/tmp/foo/"
> (which exists and is not empty) instead of saying "[Match required]".
>
> Are you able to reproduce this on your machine?

Yes, I see the same.  But I think it's expected.  AFAIU the algorithm
works like this: first it's checked whether a completion is allowed (by
checking whether it's the name of an existing file and consulting
PREDICATE when specified).  Only when it is not allowed we check whether
MUSTMATCH declares it acceptable.

This is not really explained in the docstring, however.

In your example, the default-directory is the name of an existing file,
so the MUSTMATCH argument is irrelevant, the specified PREDICATE is
fulfilled, so it's accepted as input.

If I guess correctly I think you want something like this:

#+begin_src emacs-lisp
(let ((acceptable-p (lambda (filename)
                      (and (file-directory-p filename)
                           (directory-empty-p filename)))))
  (read-file-name "Clone into new or empty directory: " nil nil
                  (lambda (filename)
                    (if (file-exists-p filename)
                        (funcall acceptable-p filename)
                      t))
                  nil
                  acceptable-p))
#+end_src

Does that come close?


Michael.





^ permalink raw reply	[relevance 5%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-09-25  3:58  5% ` Michael Heerdegen
@ 2023-09-25  5:12  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-25 21:33  5%     ` Michael Heerdegen
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-25  5:12 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: philipk, 66187

Thanks for your help!!

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs@gnu.org> writes:
>
>> Would someone kindly explain the intended behavior here?
>
> I don't know, but I would expect that when the MUST-MATCH predicate
> fails the behavior is the same as with MUST-MATCH t, and when it
> succeeds, the behavior is like MUST-MATCH nil.  Quite simple I think.
> Do you see something different?

Yes. In emacs -Q:

(mkdir "/tmp/foo" t)
(with-temp-buffer
  (write-file "/tmp/foo/bar"))
(setq default-directory "/tmp/foo/")
(read-file-name "Clone into new or empty directory: " nil nil
                (lambda (filename)
                  (or (not (file-exists-p filename))
                      (directory-empty-p filename)))
                nil
                (lambda (filename)
                  (file-directory-p filename)))

The default prompt is "/tmp/foo/". In my Emacs (29.0.92), when I
immediately press RET, read-file-name (erroneously?) returns "/tmp/foo/"
(which exists and is not empty) instead of saying "[Match required]".

Are you able to reproduce this on your machine?

> Hmm - or, maybe the confusion is about the behavior for the members of
> the collection?  With other words, whether the argument can be used to
> restrict which existing files are matched, vs. whether it can only be
> used to limit what additionally matches?  AFAIU the latter is the case -
> existing files always match.
>
>> This issue originally came up in this thread about package-vc-checkout:
>> https://yhetil.org/emacs-bugs/87v8bzi7iz.fsf@breatheoutbreathe.in/T/#m224de986dcc97f23e17386fb0dd2db4a513726bf
>
> I didn't understand the "this erroneously returns the default filename"
> part.  What default filename is returned?

Does my above comment answer this question?

Thank you!!

Joseph






^ permalink raw reply	[relevance 5%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
  2023-09-24 21:31  5% bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-25  3:58  5% ` Michael Heerdegen
  2023-09-25  5:12  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Michael Heerdegen @ 2023-09-25  3:58 UTC (permalink / raw)
  To: 66187; +Cc: philipk, joseph

Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> Would someone kindly explain the intended behavior here?

I don't know, but I would expect that when the MUST-MATCH predicate
fails the behavior is the same as with MUST-MATCH t, and when it
succeeds, the behavior is like MUST-MATCH nil.  Quite simple I think.
Do you see something different?

Hmm - or, maybe the confusion is about the behavior for the members of
the collection?  With other words, whether the argument can be used to
restrict which existing files are matched, vs. whether it can only be
used to limit what additionally matches?  AFAIU the latter is the case -
existing files always match.

> This issue originally came up in this thread about package-vc-checkout:
> https://yhetil.org/emacs-bugs/87v8bzi7iz.fsf@breatheoutbreathe.in/T/#m224de986dcc97f23e17386fb0dd2db4a513726bf

I didn't understand the "this erroneously returns the default filename"
part.  What default filename is returned?

Michael.





^ permalink raw reply	[relevance 5%]

* bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function
@ 2023-09-24 21:31  5% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-25  3:58  5% ` Michael Heerdegen
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-24 21:31 UTC (permalink / raw)
  To: 66187; +Cc: Philip Kaludercic

Hello!

When the MUSTMATCH argument to read-file-name is a function, I'd expect
to see a message like "[Match required]" when the function returns nil.

For example, I'd expect the following to never match:

(read-file-name "Prompt: " nil nil #'ignore)

The behavior of read-file-name is unspecified when a MUSTMATCH function
returns nil:

- a function, which will be called with the input as the
  argument.  If the function returns a non-nil value, the
  minibuffer is exited with that argument as the value.

Would someone kindly explain the intended behavior here?

This issue originally came up in this thread about package-vc-checkout:
https://yhetil.org/emacs-bugs/87v8bzi7iz.fsf@breatheoutbreathe.in/T/#m224de986dcc97f23e17386fb0dd2db4a513726bf

Thanks!

Joseph





^ permalink raw reply	[relevance 5%]

* bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory
  2023-09-24 14:37  5%     ` Philip Kaludercic
@ 2023-09-24 21:27  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-24 21:27 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 66114


Philip Kaludercic <philipk@posteo.net> writes:

> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> Philip Kaludercic <philipk@posteo.net> writes:
>>
>>> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>>>
>>>> Tags: patch
>>>>
>>>> This patch fixes the interactive prompt in package-vc-checkout.
>>>> See
>>>> commit message for details.
>>>>
>>>> From 70061d76542968575555f247d4715d18ed3c4e75 Mon Sep 17 00:00:00
>>>> 2001
>>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>>> Date: Tue, 19 Sep 2023 23:58:43 -0700
>>>> Subject: [PATCH] Fix interactive prompt for selecting checkout
>>>> directory
>>>>
>>>> * lisp/emacs-lisp/package-vc.el (package-vc-checkout): Use
>>>> read-directory-name instead of read-file-name with
>>>> predicate. Previously, it was impossible to interactively navigate
>>>> to
>>>> a nested subdirectory.
>>>
>>> I can "navigate" into whatever directory I want, but I don't get
>>> completion.
>>
>> You're right.
>>
>>>> ---
>>>>  lisp/emacs-lisp/package-vc.el | 17 +++++++++++------
>>>>  1 file changed, 11 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
>>>> index c7a30736e32..29b540d86b8 100644
>>>> --- a/lisp/emacs-lisp/package-vc.el
>>>> +++ b/lisp/emacs-lisp/package-vc.el
>>>> @@ -823,12 +823,17 @@ repository.  If REV has the special value
>>>>  `:last-release' (interactively, the prefix argument), that stands
>>>>  for the last released version of the package."
>>>>    (interactive
>>>> -   (let* ((name (package-vc--read-package-name "Fetch package source: ")))
>>>> -     (list (cadr (assoc name package-archive-contents #'string=))
>>>> -           (read-file-name "Clone into new or empty directory: " nil nil t nil
>>>> -                           (lambda (dir) (or (not (file-exists-p dir))
>>>> -                                             (directory-empty-p dir))))
>>>> -           (and current-prefix-arg :last-release))))
>>>> +   (let* ((name (package-vc--read-package-name "Fetch package source: "))
>>>> +          (desc (cadr (assoc name package-archive-contents #'string=)))
>>>> +          (dir (read-directory-name "Clone into new or empty directory: ")))
>>>> +     (unless (or (not (file-exists-p dir))
>>>> +                 (directory-empty-p dir))
>>>> +       (let ((subdir (expand-file-name (package-desc-full-name desc) dir)))
>>>> +         (if (and (not (file-exists-p subdir))
>>>> +                  (y-or-n-p (format "Create new directory %s ?" subdir)))
>>>> +             (setf dir subdir)
>>>
>>> I'd prefer to use a setq here.
>>>
>>>> + (user-error "Directory not empty: %S" (expand-file-name dir)))))
>>>
>>> This seems like an anti-feature to me, because you need to know
>>> what
>>> directory is empty before confirming your choice, and if it is not
>>> empty, you have to restart the entire command again.
>>
>> Yes, I agree.
>>
>> IIUC, we want to read from the user a directory which is either
>> nonexistent or empty. However, we also want the completions to
>> include
>> non-empty directories so that the user can easily select a deeply
>> nested
>> directory. The current solution does not offer non-empty directories
>> for
>> completions, meaning that users must manually type in a potentially
>> long
>> path to a nested empty or nonexistent directory.
>
> It is funny to me, that I probably never noticed this issue because I
> have the habit of using hippie-expand to complete partial file names,
> including in the minibuffer :)

Ah, that makes sense :)

>> Here's a different idea I tried:
>>
>> (read-file-name "Clone into new or empty directory: " nil nil
>>                 ;; Must match a nonexistent or empty directory
>>                 (lambda (dir) (or (not (file-exists-p dir))
>>                                   (directory-empty-p dir)))
>>                 nil
>>                 ;; `read-directory-name' accepts no PREDICATE
>>                 ;; argument: hack `read-file-name' instead.
>>                 (lambda (file-name) (file-directory-p file-name)))
>>
>> but this erroneously returns the default filename, which might be
>> buffer-file-name or whatever string is currently in the minibuffer.
>
> An issue I am observing, is that it allows selecting non-empty
> directories.
>
>> I would have expected that when MUSTMATCH is a function and it
>> returns
>> nil, a "[Match required]" message would appear.
>
> For the record, what completion system are you using. I don't appear
> to
> see this message at all.

I also do not see the message, but I expect to see it. I am using
vertico + orderless.

>>                                                  However, the behavior of
>> read-file-name is unspecified when a MUSTMATCH function returns nil:
>>
>> - a function, which will be called with the input as the
>>   argument.  If the function returns a non-nil value, the
>>   minibuffer is exited with that argument as the value.
>>
>> Is this a bug, a case of under-documentation, or do I misunderstand something?
>>
>> I'm happy to post this in a separate bug thread if you think it's worth it.
>
> Perhaps that would be worth doing, that way the people who know more
> about completion than I do would be more likely to see it and help
> out.

Okay, thanks! I'll do that.

>>
>> Joseph
>>
>>>> +     (list desc dir (and current-prefix-arg :last-release))))
>>>>    (package-vc--archives-initialize)
>>>>    (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
>>>>                        (and-let* ((extras (package-desc-extras pkg-desc))






^ permalink raw reply	[relevance 5%]

* bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory
  2023-09-24  5:06  4%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-24 14:37  5%     ` Philip Kaludercic
  2023-09-24 21:27  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Philip Kaludercic @ 2023-09-24 14:37 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66114

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>>
>>> Tags: patch
>>>
>>> This patch fixes the interactive prompt in package-vc-checkout. See
>>> commit message for details.
>>>
>>> From 70061d76542968575555f247d4715d18ed3c4e75 Mon Sep 17 00:00:00 2001
>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>> Date: Tue, 19 Sep 2023 23:58:43 -0700
>>> Subject: [PATCH] Fix interactive prompt for selecting checkout directory
>>>
>>> * lisp/emacs-lisp/package-vc.el (package-vc-checkout): Use
>>> read-directory-name instead of read-file-name with
>>> predicate.  Previously, it was impossible to interactively navigate to
>>> a nested subdirectory.
>>
>> I can "navigate" into whatever directory I want, but I don't get completion.
>
> You're right.
>
>>> ---
>>>  lisp/emacs-lisp/package-vc.el | 17 +++++++++++------
>>>  1 file changed, 11 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
>>> index c7a30736e32..29b540d86b8 100644
>>> --- a/lisp/emacs-lisp/package-vc.el
>>> +++ b/lisp/emacs-lisp/package-vc.el
>>> @@ -823,12 +823,17 @@ repository.  If REV has the special value
>>>  `:last-release' (interactively, the prefix argument), that stands
>>>  for the last released version of the package."
>>>    (interactive
>>> -   (let* ((name (package-vc--read-package-name "Fetch package source: ")))
>>> -     (list (cadr (assoc name package-archive-contents #'string=))
>>> -           (read-file-name "Clone into new or empty directory: " nil nil t nil
>>> -                           (lambda (dir) (or (not (file-exists-p dir))
>>> -                                             (directory-empty-p dir))))
>>> -           (and current-prefix-arg :last-release))))
>>> +   (let* ((name (package-vc--read-package-name "Fetch package source: "))
>>> +          (desc (cadr (assoc name package-archive-contents #'string=)))
>>> +          (dir (read-directory-name "Clone into new or empty directory: ")))
>>> +     (unless (or (not (file-exists-p dir))
>>> +                 (directory-empty-p dir))
>>> +       (let ((subdir (expand-file-name (package-desc-full-name desc) dir)))
>>> +         (if (and (not (file-exists-p subdir))
>>> +                  (y-or-n-p (format "Create new directory %s ?" subdir)))
>>> +             (setf dir subdir)
>>
>> I'd prefer to use a setq here.
>>
>>> +           (user-error "Directory not empty: %S" (expand-file-name dir)))))
>>
>> This seems like an anti-feature to me, because you need to know what
>> directory is empty before confirming your choice, and if it is not
>> empty, you have to restart the entire command again.
>
> Yes, I agree.
>
> IIUC, we want to read from the user a directory which is either
> nonexistent or empty.  However, we also want the completions to include
> non-empty directories so that the user can easily select a deeply nested
> directory.  The current solution does not offer non-empty directories for
> completions, meaning that users must manually type in a potentially long
> path to a nested empty or nonexistent directory.

It is funny to me, that I probably never noticed this issue because I
have the habit of using hippie-expand to complete partial file names,
including in the minibuffer :)

> Here's a different idea I tried:
>
> (read-file-name "Clone into new or empty directory: " nil nil
>                 ;; Must match a nonexistent or empty directory
>                 (lambda (dir) (or (not (file-exists-p dir))
>                                   (directory-empty-p dir)))
>                 nil
>                 ;; `read-directory-name' accepts no PREDICATE
>                 ;; argument: hack `read-file-name' instead.
>                 (lambda (file-name) (file-directory-p file-name)))
>
> but this erroneously returns the default filename, which might be
> buffer-file-name or whatever string is currently in the minibuffer.

An issue I am observing, is that it allows selecting non-empty
directories.

> I would have expected that when MUSTMATCH is a function and it returns
> nil, a "[Match required]" message would appear.  

For the record, what completion system are you using.  I don't appear to
see this message at all.

>                                                  However, the behavior of
> read-file-name is unspecified when a MUSTMATCH function returns nil:
>
> - a function, which will be called with the input as the
>   argument.  If the function returns a non-nil value, the
>   minibuffer is exited with that argument as the value.
>
> Is this a bug, a case of under-documentation, or do I misunderstand something?
>
> I'm happy to post this in a separate bug thread if you think it's worth it.

Perhaps that would be worth doing, that way the people who know more
about completion than I do would be more likely to see it and help out.

>
> Joseph
>
>>> +     (list desc dir (and current-prefix-arg :last-release))))
>>>    (package-vc--archives-initialize)
>>>    (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
>>>                        (and-let* ((extras (package-desc-extras pkg-desc))

-- 
Philip Kaludercic





^ permalink raw reply	[relevance 5%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-09-24  5:34  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-24  6:54  0%         ` Eli Zaretskii
       [not found]               ` <87msviogui.fsf@breatheoutbreathe.in>
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-09-24  6:54 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66115, philipk

> Cc: 66115-done@debbugs.gnu.org
> Date: Sat, 23 Sep 2023 22:34:24 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> It appears that the fix was applied to master. Would it make sense to
> apply it to emacs-29?

The installed change affects much more than the original issue, so I'd
prefer for it to stay on master.

I'm okay with installing the original patch on emacs-29, but be sure
to say "do not merge to master" in the commit log message if you do.





^ permalink raw reply	[relevance 0%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-09-22 10:51  5%     ` Philip Kaludercic
@ 2023-09-24  5:34  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-24  6:54  0%         ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-24  5:34 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 66115-done

It appears that the fix was applied to master. Would it make sense to
apply it to emacs-29?





^ permalink raw reply	[relevance 5%]

* bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory
  2023-09-22  8:21  5% ` bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Philip Kaludercic
@ 2023-09-24  5:06  4%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-24 14:37  5%     ` Philip Kaludercic
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-24  5:06 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 66114


Philip Kaludercic <philipk@posteo.net> writes:

> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> Tags: patch
>>
>> This patch fixes the interactive prompt in package-vc-checkout. See
>> commit message for details.
>>
>> From 70061d76542968575555f247d4715d18ed3c4e75 Mon Sep 17 00:00:00 2001
>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Date: Tue, 19 Sep 2023 23:58:43 -0700
>> Subject: [PATCH] Fix interactive prompt for selecting checkout directory
>>
>> * lisp/emacs-lisp/package-vc.el (package-vc-checkout): Use
>> read-directory-name instead of read-file-name with
>> predicate.  Previously, it was impossible to interactively navigate to
>> a nested subdirectory.
>
> I can "navigate" into whatever directory I want, but I don't get completion.

You're right.

>> ---
>>  lisp/emacs-lisp/package-vc.el | 17 +++++++++++------
>>  1 file changed, 11 insertions(+), 6 deletions(-)
>>
>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
>> index c7a30736e32..29b540d86b8 100644
>> --- a/lisp/emacs-lisp/package-vc.el
>> +++ b/lisp/emacs-lisp/package-vc.el
>> @@ -823,12 +823,17 @@ repository.  If REV has the special value
>>  `:last-release' (interactively, the prefix argument), that stands
>>  for the last released version of the package."
>>    (interactive
>> -   (let* ((name (package-vc--read-package-name "Fetch package source: ")))
>> -     (list (cadr (assoc name package-archive-contents #'string=))
>> -           (read-file-name "Clone into new or empty directory: " nil nil t nil
>> -                           (lambda (dir) (or (not (file-exists-p dir))
>> -                                             (directory-empty-p dir))))
>> -           (and current-prefix-arg :last-release))))
>> +   (let* ((name (package-vc--read-package-name "Fetch package source: "))
>> +          (desc (cadr (assoc name package-archive-contents #'string=)))
>> +          (dir (read-directory-name "Clone into new or empty directory: ")))
>> +     (unless (or (not (file-exists-p dir))
>> +                 (directory-empty-p dir))
>> +       (let ((subdir (expand-file-name (package-desc-full-name desc) dir)))
>> +         (if (and (not (file-exists-p subdir))
>> +                  (y-or-n-p (format "Create new directory %s ?" subdir)))
>> +             (setf dir subdir)
>
> I'd prefer to use a setq here.
>
>> +           (user-error "Directory not empty: %S" (expand-file-name dir)))))
>
> This seems like an anti-feature to me, because you need to know what
> directory is empty before confirming your choice, and if it is not
> empty, you have to restart the entire command again.

Yes, I agree.

IIUC, we want to read from the user a directory which is either
nonexistent or empty.  However, we also want the completions to include
non-empty directories so that the user can easily select a deeply nested
directory.  The current solution does not offer non-empty directories for
completions, meaning that users must manually type in a potentially long
path to a nested empty or nonexistent directory.

Here's a different idea I tried:

(read-file-name "Clone into new or empty directory: " nil nil
                ;; Must match a nonexistent or empty directory
                (lambda (dir) (or (not (file-exists-p dir))
                                  (directory-empty-p dir)))
                nil
                ;; `read-directory-name' accepts no PREDICATE
                ;; argument: hack `read-file-name' instead.
                (lambda (file-name) (file-directory-p file-name)))

but this erroneously returns the default filename, which might be
buffer-file-name or whatever string is currently in the minibuffer.

I would have expected that when MUSTMATCH is a function and it returns
nil, a "[Match required]" message would appear.  However, the behavior of
read-file-name is unspecified when a MUSTMATCH function returns nil:

- a function, which will be called with the input as the
  argument.  If the function returns a non-nil value, the
  minibuffer is exited with that argument as the value.

Is this a bug, a case of under-documentation, or do I misunderstand something?

I'm happy to post this in a separate bug thread if you think it's worth it.

Joseph

>> +     (list desc dir (and current-prefix-arg :last-release))))
>>    (package-vc--archives-initialize)
>>    (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
>>                        (and-let* ((extras (package-desc-extras pkg-desc))





^ permalink raw reply	[relevance 4%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-09-22  8:33  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-22 10:51  5%     ` Philip Kaludercic
  2023-09-24  5:34  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Philip Kaludercic @ 2023-09-22 10:51 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66115-done

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>>
>>> Tags: patch
>>>
>>> Tags: patch
>>>
>>> This patch fixes a serious bug which caused package-vc-checkout to fail
>>> entirely when its second argument `directory' was not expanded.
>>>
>>> From 75a6ec74ff5e31edc7592b68e7ad9d1ec26f515c Mon Sep 17 00:00:00 2001
>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>> Date: Wed, 20 Sep 2023 00:12:10 -0700
>>> Subject: [PATCH] Ensure that directory is expanded in package-vc-checkout
>>>
>>> * lisp/emacs-lisp/package-vc.el (package-vc-checkout)
>>> ---
>>>  lisp/emacs-lisp/package-vc.el | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
>>> index 29b540d86b8..47d8c996ff0 100644
>>> --- a/lisp/emacs-lisp/package-vc.el
>>> +++ b/lisp/emacs-lisp/package-vc.el
>>> @@ -834,6 +834,7 @@ for the last released version of the package."
>>>               (setf dir subdir)
>>>             (user-error "Directory not empty: %S" (expand-file-name dir)))))
>>>       (list desc dir (and current-prefix-arg :last-release))))
>>> +  (setf directory (expand-file-name directory))
>>>    (package-vc--archives-initialize)
>>>    (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
>>>                        (and-let* ((extras (package-desc-extras pkg-desc))
>>
>> DIRECTORY is passed on to `package-vc--clone' and in turn `vc-clone'.
>> Wouldn't it be more robust to ensure that `vc-clone' can handle
>> unexpanded directory names, eg. like this:
>>
>> diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
>> index 2f4b028bb4a..7f334397a5e 100644
>> --- a/lisp/vc/vc.el
>> +++ b/lisp/vc/vc.el
>> @@ -3676,8 +3676,7 @@ vc-clone
>>  checkout.  If BACKEND is nil, iterate through every known backend
>>  in `vc-handled-backends' until one succeeds.  If REV is non-nil,
>>  it indicates a specific revision to check out."
>> -  (unless directory
>> -    (setq directory default-directory))
>> +  (setq directory (expand-file-name (or directory default-directory)))
>>    (if backend
>>        (progn
>>          (unless (memq backend vc-handled-backends)
>
> Yes, certainly. Your solution is better.

OK, closing the issue.





^ permalink raw reply	[relevance 5%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-09-22  8:17  5% ` Philip Kaludercic
@ 2023-09-22  8:33  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-22 10:51  5%     ` Philip Kaludercic
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-22  8:33 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 66115


Philip Kaludercic <philipk@posteo.net> writes:

> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> Tags: patch
>>
>> Tags: patch
>>
>> This patch fixes a serious bug which caused package-vc-checkout to fail
>> entirely when its second argument `directory' was not expanded.
>>
>> From 75a6ec74ff5e31edc7592b68e7ad9d1ec26f515c Mon Sep 17 00:00:00 2001
>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Date: Wed, 20 Sep 2023 00:12:10 -0700
>> Subject: [PATCH] Ensure that directory is expanded in package-vc-checkout
>>
>> * lisp/emacs-lisp/package-vc.el (package-vc-checkout)
>> ---
>>  lisp/emacs-lisp/package-vc.el | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
>> index 29b540d86b8..47d8c996ff0 100644
>> --- a/lisp/emacs-lisp/package-vc.el
>> +++ b/lisp/emacs-lisp/package-vc.el
>> @@ -834,6 +834,7 @@ for the last released version of the package."
>>               (setf dir subdir)
>>             (user-error "Directory not empty: %S" (expand-file-name dir)))))
>>       (list desc dir (and current-prefix-arg :last-release))))
>> +  (setf directory (expand-file-name directory))
>>    (package-vc--archives-initialize)
>>    (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
>>                        (and-let* ((extras (package-desc-extras pkg-desc))
>
> DIRECTORY is passed on to `package-vc--clone' and in turn `vc-clone'.
> Wouldn't it be more robust to ensure that `vc-clone' can handle
> unexpanded directory names, eg. like this:
>
> diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
> index 2f4b028bb4a..7f334397a5e 100644
> --- a/lisp/vc/vc.el
> +++ b/lisp/vc/vc.el
> @@ -3676,8 +3676,7 @@ vc-clone
>  checkout.  If BACKEND is nil, iterate through every known backend
>  in `vc-handled-backends' until one succeeds.  If REV is non-nil,
>  it indicates a specific revision to check out."
> -  (unless directory
> -    (setq directory default-directory))
> +  (setq directory (expand-file-name (or directory default-directory)))
>    (if backend
>        (progn
>          (unless (memq backend vc-handled-backends)

Yes, certainly. Your solution is better.





^ permalink raw reply	[relevance 5%]

* bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory
  2023-09-20  7:02  9% bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
       [not found]     ` <handler.66114.B.16951935749180.ack@debbugs.gnu.org>
@ 2023-09-22  8:21  5% ` Philip Kaludercic
  2023-09-24  5:06  4%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 200+ results
From: Philip Kaludercic @ 2023-09-22  8:21 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66114

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Tags: patch
>
> This patch fixes the interactive prompt in package-vc-checkout. See
> commit message for details.
>
> From 70061d76542968575555f247d4715d18ed3c4e75 Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Tue, 19 Sep 2023 23:58:43 -0700
> Subject: [PATCH] Fix interactive prompt for selecting checkout directory
>
> * lisp/emacs-lisp/package-vc.el (package-vc-checkout): Use
> read-directory-name instead of read-file-name with
> predicate.  Previously, it was impossible to interactively navigate to
> a nested subdirectory.

I can "navigate" into whatever directory I want, but I don't get completion.

> ---
>  lisp/emacs-lisp/package-vc.el | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index c7a30736e32..29b540d86b8 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -823,12 +823,17 @@ repository.  If REV has the special value
>  `:last-release' (interactively, the prefix argument), that stands
>  for the last released version of the package."
>    (interactive
> -   (let* ((name (package-vc--read-package-name "Fetch package source: ")))
> -     (list (cadr (assoc name package-archive-contents #'string=))
> -           (read-file-name "Clone into new or empty directory: " nil nil t nil
> -                           (lambda (dir) (or (not (file-exists-p dir))
> -                                             (directory-empty-p dir))))
> -           (and current-prefix-arg :last-release))))
> +   (let* ((name (package-vc--read-package-name "Fetch package source: "))
> +          (desc (cadr (assoc name package-archive-contents #'string=)))
> +          (dir (read-directory-name "Clone into new or empty directory: ")))
> +     (unless (or (not (file-exists-p dir))
> +                 (directory-empty-p dir))
> +       (let ((subdir (expand-file-name (package-desc-full-name desc) dir)))
> +         (if (and (not (file-exists-p subdir))
> +                  (y-or-n-p (format "Create new directory %s ?" subdir)))
> +             (setf dir subdir)

I'd prefer to use a setq here.

> +           (user-error "Directory not empty: %S" (expand-file-name dir)))))

This seems like an anti-feature to me, because you need to know what
directory is empty before confirming your choice, and if it is not
empty, you have to restart the entire command again.

> +     (list desc dir (and current-prefix-arg :last-release))))
>    (package-vc--archives-initialize)
>    (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
>                        (and-let* ((extras (package-desc-extras pkg-desc))





^ permalink raw reply	[relevance 5%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
  2023-09-20  7:14 10% bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-22  8:17  5% ` Philip Kaludercic
  2023-09-22  8:33  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Philip Kaludercic @ 2023-09-22  8:17 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 66115

[-- Attachment #1: Type: text/plain, Size: 1451 bytes --]

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Tags: patch
>
> Tags: patch
>
> This patch fixes a serious bug which caused package-vc-checkout to fail
> entirely when its second argument `directory' was not expanded.
>
> From 75a6ec74ff5e31edc7592b68e7ad9d1ec26f515c Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Wed, 20 Sep 2023 00:12:10 -0700
> Subject: [PATCH] Ensure that directory is expanded in package-vc-checkout
>
> * lisp/emacs-lisp/package-vc.el (package-vc-checkout)
> ---
>  lisp/emacs-lisp/package-vc.el | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index 29b540d86b8..47d8c996ff0 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -834,6 +834,7 @@ for the last released version of the package."
>               (setf dir subdir)
>             (user-error "Directory not empty: %S" (expand-file-name dir)))))
>       (list desc dir (and current-prefix-arg :last-release))))
> +  (setf directory (expand-file-name directory))
>    (package-vc--archives-initialize)
>    (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
>                        (and-let* ((extras (package-desc-extras pkg-desc))

DIRECTORY is passed on to `package-vc--clone' and in turn `vc-clone'.
Wouldn't it be more robust to ensure that `vc-clone' can handle
unexpanded directory names, eg. like this:


[-- Attachment #2: Type: text/plain, Size: 549 bytes --]

diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 2f4b028bb4a..7f334397a5e 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -3676,8 +3676,7 @@ vc-clone
 checkout.  If BACKEND is nil, iterate through every known backend
 in `vc-handled-backends' until one succeeds.  If REV is non-nil,
 it indicates a specific revision to check out."
-  (unless directory
-    (setq directory default-directory))
+  (setq directory (expand-file-name (or directory default-directory)))
   (if backend
       (progn
         (unless (memq backend vc-handled-backends)

^ permalink raw reply related	[relevance 5%]

* bug#66114: Acknowledgement ([PATCH] Fix interactive prompt for selecting checkout directory)
  2023-09-20  7:24  9%   ` bug#66114: Acknowledgement ([PATCH] Fix interactive prompt for selecting checkout directory) Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-20  7:31  9%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-20  7:31 UTC (permalink / raw)
  To: 66114

[-- Attachment #1: Type: text/plain, Size: 96 bytes --]

Oops! I forgot how contrapositives work for a moment.

Please ignore the previous two patches.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-interactive-prompt-for-selecting-checkout-direct.patch --]
[-- Type: text/x-diff, Size: 2193 bytes --]

From aa3aca16755a8edec8d761e28d4ad0125cc5b7cd Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 19 Sep 2023 23:58:43 -0700
Subject: [PATCH] Fix interactive prompt for selecting checkout directory

* lisp/emacs-lisp/package-vc.el (package-vc-checkout): Use
read-directory-name instead of read-file-name with
predicate.  Previously, it was impossible to interactively navigate to
a nested subdirectory.
---
 lisp/emacs-lisp/package-vc.el | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index c7a30736e32..14014a84448 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -823,12 +823,16 @@ repository.  If REV has the special value
 `:last-release' (interactively, the prefix argument), that stands
 for the last released version of the package."
   (interactive
-   (let* ((name (package-vc--read-package-name "Fetch package source: ")))
-     (list (cadr (assoc name package-archive-contents #'string=))
-           (read-file-name "Clone into new or empty directory: " nil nil t nil
-                           (lambda (dir) (or (not (file-exists-p dir))
-                                             (directory-empty-p dir))))
-           (and current-prefix-arg :last-release))))
+   (let* ((name (package-vc--read-package-name "Fetch package source: "))
+          (desc (cadr (assoc name package-archive-contents #'string=)))
+          (dir (read-directory-name "Clone into new or empty directory: ")))
+     (when (and (file-exists-p dir) (not (directory-empty-p dir)))
+       (let ((subdir (expand-file-name (package-desc-full-name desc) dir)))
+         (if (and (not (file-exists-p subdir))
+                  (y-or-n-p (format "Create new directory %s ?" subdir)))
+             (setf dir subdir)
+           (user-error "Directory not empty: %S" (expand-file-name dir)))))
+     (list desc dir (and current-prefix-arg :last-release))))
   (package-vc--archives-initialize)
   (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
                       (and-let* ((extras (package-desc-extras pkg-desc))
-- 
2.41.0


^ permalink raw reply related	[relevance 9%]

* bug#66114: Acknowledgement ([PATCH] Fix interactive prompt for selecting checkout directory)
       [not found]     ` <handler.66114.B.16951935749180.ack@debbugs.gnu.org>
@ 2023-09-20  7:24  9%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-20  7:31  9%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-20  7:24 UTC (permalink / raw)
  To: 66114

[-- Attachment #1: Type: text/plain, Size: 63 bytes --]

In this updated patch, I didn't not remove a double negative.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-interactive-prompt-for-selecting-checkout-direct.patch --]
[-- Type: text/x-diff, Size: 2209 bytes --]

From cc5d53e59928747b324eef312a4c83266a3bb8c3 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 19 Sep 2023 23:58:43 -0700
Subject: [PATCH] Fix interactive prompt for selecting checkout directory

* lisp/emacs-lisp/package-vc.el (package-vc-checkout): Use
read-directory-name instead of read-file-name with
predicate.  Previously, it was impossible to interactively navigate to
a nested subdirectory.
---
 lisp/emacs-lisp/package-vc.el | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index c7a30736e32..9caa1931af8 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -823,12 +823,17 @@ repository.  If REV has the special value
 `:last-release' (interactively, the prefix argument), that stands
 for the last released version of the package."
   (interactive
-   (let* ((name (package-vc--read-package-name "Fetch package source: ")))
-     (list (cadr (assoc name package-archive-contents #'string=))
-           (read-file-name "Clone into new or empty directory: " nil nil t nil
-                           (lambda (dir) (or (not (file-exists-p dir))
-                                             (directory-empty-p dir))))
-           (and current-prefix-arg :last-release))))
+   (let* ((name (package-vc--read-package-name "Fetch package source: "))
+          (desc (cadr (assoc name package-archive-contents #'string=)))
+          (dir (read-directory-name "Clone into new or empty directory: ")))
+     (when (or (file-exists-p dir)
+               (not (directory-empty-p dir)))
+       (let ((subdir (expand-file-name (package-desc-full-name desc) dir)))
+         (if (and (not (file-exists-p subdir))
+                  (y-or-n-p (format "Create new directory %s ?" subdir)))
+             (setf dir subdir)
+           (user-error "Directory not empty: %S" (expand-file-name dir)))))
+     (list desc dir (and current-prefix-arg :last-release))))
   (package-vc--archives-initialize)
   (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
                       (and-let* ((extras (package-desc-extras pkg-desc))
-- 
2.41.0


^ permalink raw reply related	[relevance 9%]

* bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout
@ 2023-09-20  7:14 10% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-22  8:17  5% ` Philip Kaludercic
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-20  7:14 UTC (permalink / raw)
  To: 66115; +Cc: Philip Kaludercic

[-- Attachment #1: Type: text/plain, Size: 163 bytes --]

Tags: patch

Tags: patch

This patch fixes a serious bug which caused package-vc-checkout to fail
entirely when its second argument `directory' was not expanded.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Ensure-that-directory-is-expanded-in-package-vc-chec.patch --]
[-- Type: text/patch, Size: 1015 bytes --]

From 75a6ec74ff5e31edc7592b68e7ad9d1ec26f515c Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Wed, 20 Sep 2023 00:12:10 -0700
Subject: [PATCH] Ensure that directory is expanded in package-vc-checkout

* lisp/emacs-lisp/package-vc.el (package-vc-checkout)
---
 lisp/emacs-lisp/package-vc.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 29b540d86b8..47d8c996ff0 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -834,6 +834,7 @@ for the last released version of the package."
              (setf dir subdir)
            (user-error "Directory not empty: %S" (expand-file-name dir)))))
      (list desc dir (and current-prefix-arg :last-release))))
+  (setf directory (expand-file-name directory))
   (package-vc--archives-initialize)
   (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
                       (and-let* ((extras (package-desc-extras pkg-desc))
-- 
2.41.0


^ permalink raw reply related	[relevance 10%]

* bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory
@ 2023-09-20  7:02  9% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
       [not found]     ` <handler.66114.B.16951935749180.ack@debbugs.gnu.org>
  2023-09-22  8:21  5% ` bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Philip Kaludercic
  0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-20  7:02 UTC (permalink / raw)
  To: 66114; +Cc: Philip Kaludercic

[-- Attachment #1: Type: text/plain, Size: 110 bytes --]

Tags: patch

This patch fixes the interactive prompt in package-vc-checkout. See
commit message for details.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-interactive-prompt-for-selecting-checkout-direct.patch --]
[-- Type: text/patch, Size: 2213 bytes --]

From 70061d76542968575555f247d4715d18ed3c4e75 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 19 Sep 2023 23:58:43 -0700
Subject: [PATCH] Fix interactive prompt for selecting checkout directory

* lisp/emacs-lisp/package-vc.el (package-vc-checkout): Use
read-directory-name instead of read-file-name with
predicate.  Previously, it was impossible to interactively navigate to
a nested subdirectory.
---
 lisp/emacs-lisp/package-vc.el | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index c7a30736e32..29b540d86b8 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -823,12 +823,17 @@ repository.  If REV has the special value
 `:last-release' (interactively, the prefix argument), that stands
 for the last released version of the package."
   (interactive
-   (let* ((name (package-vc--read-package-name "Fetch package source: ")))
-     (list (cadr (assoc name package-archive-contents #'string=))
-           (read-file-name "Clone into new or empty directory: " nil nil t nil
-                           (lambda (dir) (or (not (file-exists-p dir))
-                                             (directory-empty-p dir))))
-           (and current-prefix-arg :last-release))))
+   (let* ((name (package-vc--read-package-name "Fetch package source: "))
+          (desc (cadr (assoc name package-archive-contents #'string=)))
+          (dir (read-directory-name "Clone into new or empty directory: ")))
+     (unless (or (not (file-exists-p dir))
+                 (directory-empty-p dir))
+       (let ((subdir (expand-file-name (package-desc-full-name desc) dir)))
+         (if (and (not (file-exists-p subdir))
+                  (y-or-n-p (format "Create new directory %s ?" subdir)))
+             (setf dir subdir)
+           (user-error "Directory not empty: %S" (expand-file-name dir)))))
+     (list desc dir (and current-prefix-arg :last-release))))
   (package-vc--archives-initialize)
   (let ((pkg-spec (or (package-vc--desc->spec pkg-desc)
                       (and-let* ((extras (package-desc-extras pkg-desc))
-- 
2.41.0


^ permalink raw reply related	[relevance 9%]

* bug#65768: Bump persist.el version
  2023-09-06 16:39  5% ` Stefan Kangas
@ 2023-09-16 22:28  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-30 14:30 11%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-30 20:54  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-16 22:28 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Phillip Lord, 65768

Ping.





^ permalink raw reply	[relevance 5%]

* bug#65797: `buffer-match-p` should not use `func-arity`
  2023-09-15 17:54  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-15 18:00  5%             ` Dmitry Gutov
  0 siblings, 0 replies; 200+ results
From: Dmitry Gutov @ 2023-09-15 18:00 UTC (permalink / raw)
  To: Joseph Turner; +Cc: Philip Kaludercic, Stefan Monnier, 65797

On 15/09/2023 20:54, Joseph Turner wrote:
> Dmitry Gutov<dmitry@gutov.dev>  writes:
> 
>> BTW, do we want to change '&optional ARG' to '&rest ARGS'? I don't
>> have a use case in mind, but this would be the most flexible.
> Like this?
> 
> https://yhetil.org/emacs-bugs/jwvv8cmdmzz.fsf-monnier+emacs@gnu.org/T/#mc073d249234777e6f04d809e7107c1893c7f6b2d

Pretty much. Sorry for the repetition.





^ permalink raw reply	[relevance 5%]

* bug#65797: `buffer-match-p` should not use `func-arity`
  @ 2023-09-15 17:54  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-15 18:00  5%             ` Dmitry Gutov
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-15 17:54 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: Philip Kaludercic, Stefan Monnier, 65797


Dmitry Gutov <dmitry@gutov.dev> writes:

> BTW, do we want to change '&optional ARG' to '&rest ARGS'? I don't
> have a use case in mind, but this would be the most flexible.

Like this?

https://yhetil.org/emacs-bugs/jwvv8cmdmzz.fsf-monnier+emacs@gnu.org/T/#mc073d249234777e6f04d809e7107c1893c7f6b2d





^ permalink raw reply	[relevance 5%]

* bug#65797: 29.0.92; func-arity should not return (0 . many) with apply-partially
  2023-09-11 16:57  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-11 18:58  0%             ` Eli Zaretskii
  0 siblings, 0 replies; 200+ results
From: Eli Zaretskii @ 2023-09-11 18:58 UTC (permalink / raw)
  To: Joseph Turner; +Cc: monnier, 65797

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 65797@debbugs.gnu.org
> Date: Mon, 11 Sep 2023 09:57:51 -0700
> 
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > I think one of the alternatives you proposed was backward-compatible
> > (albeit not very elegant).  So my vote is for that alternative.
> 
> I'm in favor of the solution in the patch (from Stefan's suggestion):
> 
> > - Replace `&optional arg` with `&rest args` and pass those args via
> >   `apply`, so the number of args passed doesn't depend on the function
> >   but on the caller.
> 
> The "&rest args" solution is clean and hack-free. It breaks
> compatibility, but in unlikely cases:
> 
> - CONDITION pred accepts only a buffer argument, but additional ARG was
>   passed (why would you do this?)
> 
> - CONDITION pred accepts two arguments, and no ARG was passed (this code
>   would be broken anyway, right?)
> 
> Since buffer-match-p is new in Emacs 29, is it acceptable to assume that
> code affected by this breakage can be updated?

We have an alternative that doesn't break any compatibility, so I
think it is preferred.





^ permalink raw reply	[relevance 0%]

* bug#65797: 29.0.92; func-arity should not return (0 . many) with apply-partially
  2023-09-08 18:20  0%         ` Eli Zaretskii
@ 2023-09-11 16:57  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-11 18:58  0%             ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-11 16:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Stefan Monnier, 65797


Eli Zaretskii <eliz@gnu.org> writes:

> I think one of the alternatives you proposed was backward-compatible
> (albeit not very elegant).  So my vote is for that alternative.

I'm in favor of the solution in the patch (from Stefan's suggestion):

> - Replace `&optional arg` with `&rest args` and pass those args via
>   `apply`, so the number of args passed doesn't depend on the function
>   but on the caller.

The "&rest args" solution is clean and hack-free. It breaks
compatibility, but in unlikely cases:

- CONDITION pred accepts only a buffer argument, but additional ARG was
  passed (why would you do this?)

- CONDITION pred accepts two arguments, and no ARG was passed (this code
  would be broken anyway, right?)

Since buffer-match-p is new in Emacs 29, is it acceptable to assume that
code affected by this breakage can be updated?

Joseph





^ permalink raw reply	[relevance 5%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  2023-09-09 10:01  5%                               ` Ihor Radchenko
@ 2023-09-09 10:15  0%                                 ` Daniel Mendler
  0 siblings, 0 replies; 200+ results
From: Daniel Mendler @ 2023-09-09 10:15 UTC (permalink / raw)
  To: Ihor Radchenko, Joseph Turner
  Cc: Adam Porter, Eli Zaretskii, 63513-done, Stefan Monnier,
	phillip.lord

On 9/9/23 12:01, Ihor Radchenko wrote:
> Joseph Turner <joseph@breatheoutbreathe.in> writes:
> 
>>> Then, wouldn't it be better to contribute this function to compat.el and
>>> use it from there?
>>
>> The new behavior of copy-tree has already been added to compat.el:
>>
>> https://github.com/emacs-compat/compat/pull/25
>>
>> However, that change currently only exists in compat's emacs-30 branch.
> 
> I see.
>
>> I did not know if it was acceptable for persist.el to require compat
>> when I wrote these patches. If we agree that it is acceptable, then I'm
>> happy to submit a patch to replace (persist-copy-tree ...) with
>> (compat-call copy-tree ...), but we'll have to wait to apply the patch
>> until after the compat.el emacs-30 branch is merged into master.
> 
> AFAIU, the recommended way to implement compat function definitions that
> are not yet added to compat.el is using `compat-defun' + `compat-call'.
> Then, one can simply drop `compat-defun' after the function is finally
> release with compat.el without touching the rest of the code.

`compat-call` is meant to be used to call "extended functions", for
example functions with additional arguments. See the Compat manual for
details.

The macros from compat-macs.el (`compat-defun` etc.) are internal as
documented in the file compat-macs.el. These macros must not be used
outside Compat.

So using Compat here has to wait until compat-30.x is released.

Daniel





^ permalink raw reply	[relevance 0%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  2023-09-08 17:10  5%                             ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-09 10:01  5%                               ` Ihor Radchenko
  2023-09-09 10:15  0%                                 ` Daniel Mendler
  0 siblings, 1 reply; 200+ results
From: Ihor Radchenko @ 2023-09-09 10:01 UTC (permalink / raw)
  To: Joseph Turner
  Cc: 63513-done, Daniel Mendler, Stefan Monnier, Adam Porter,
	Eli Zaretskii, phillip.lord

Joseph Turner <joseph@breatheoutbreathe.in> writes:

>> Then, wouldn't it be better to contribute this function to compat.el and
>> use it from there?
>
> The new behavior of copy-tree has already been added to compat.el:
>
> https://github.com/emacs-compat/compat/pull/25
>
> However, that change currently only exists in compat's emacs-30 branch.

I see.

> I did not know if it was acceptable for persist.el to require compat
> when I wrote these patches. If we agree that it is acceptable, then I'm
> happy to submit a patch to replace (persist-copy-tree ...) with
> (compat-call copy-tree ...), but we'll have to wait to apply the patch
> until after the compat.el emacs-30 branch is merged into master.

AFAIU, the recommended way to implement compat function definitions that
are not yet added to compat.el is using `compat-defun' + `compat-call'.
Then, one can simply drop `compat-defun' after the function is finally
release with compat.el without touching the rest of the code.

CCing Daniel.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>





^ permalink raw reply	[relevance 5%]

* bug#59609: 29.0.50; [PATCH] Better advertise (Non-)GNU ELPA in emacs manual
  @ 2023-09-08 20:10  5%           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-08 20:10 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 59609, stefankangas

>> FWIW, GNU ELPA packages don't necessarily "adhere to the Emacs coding
>> conventions" either and neither are they all "supervised by the Emacs
>> maintainers" or "have to coordinate their development decisions with the
>> Emacs team".  Some do, but not all of them by a long shot.
>
> Only because we decide not to do that, or are lazy, or whatever.
> Basically, it's our decision for GNU ELPA, and not so for NonGNU ELPA.

We have just as much control in one as in the other, in practice.
Maybe we tend to invest more efforts in the GNU part, but I'd argue that
it's not "because it's in GNU" but because there is a positive
correlation between people agreeing to assign their copyright and people
sharing our goals.

>> In practice the real deciding factor *is* the copyright assignment
>> (which often ends up selecting for a kind of "philosophical agreement"
>> about the primacy of ethical goals over technical ones).
> I think this is just the tip of a very large iceberg, and the FAQ
> should say that explicitly.

When I said:

    In practice the real deciding factor *is* the copyright assignment

I really meant that this is usually the only factor that makes me decide
whether to add a package to GNU or to NonGNU.
I can't speak for Philip, but I have the impression he does the same.

> Saying that just the CA is the difference is both very inaccurate and
> misrepresents the actual situation: NonGNU ELPA is a collection of
> packages that someone else decided could be useful, but we basically
> have nothing to do with them except hosting them.

"someone else"?  Packages are added there by "us":

    % git log -- elpa-packages| grep Author: | sort | uniq -c | sort -n
          1 Author: Alfred M. Szmidt <ams@gnu.org>
          1 Author: Bastien <bzg@gnu.org>
          1 Author: Bozhidar Batsov <bozhidar@batsov.com>
          1 Author: Bozhidar Batsov <bozhidar@batsov.dev>
          1 Author: Daniel Mendler <mail@daniel-mendler.de>
          1 Author: Danny Freeman <danny@dfreeman.email>
          1 Author: Distopico <distopico@riseup.net>
          1 Author: Dmitry Gutov <dgutov@yandex.ru>
          1 Author: Joseph Turner <joseph@ushin.org>
          1 Author: Sean Whitton <spwhitton@spwhitton.name>
          1 Author: Tassilo Horn <tsdh@gnu.org>
          1 Author: yilkalargaw <yilkalargawworkneh@gmail.com>
          3 Author: Daniel Semyonov <daniel@dsemy.com>
          3 Author: Eshel Yaron <me@eshelyaron.com>
          7 Author: Jonas Bernoulli <jonas@bernoul.li>
         15 Author: Akib Azmain Turja <akib@disroot.org>
         18 Author: Stefan Kangas <stefankangas@gmail.com>
         49 Author: Stefan Kangas <stefan@marxist.se>
         49 Author: Stefan Monnier <monnier@iro.umontreal.ca>
         87 Author: Philip Kaludercic <philipk@posteo.net>
    %

The result is not really different for `elpa.git`.  Several NonGNU
packages are (co)maintained by "us" (i.e. people who are regular
contributors to Emacs) and on the flip side, there are many GNU ELPA
packages for which "we basically have nothing to do with them except
hosting them".

I don't deny that there are other statistically qualitative differences
between GNU and NonGNU, but I think they're very fuzzy and to a large
extent they can be seen as a consequence of the copyright paperwork
(which makes it possible to imagine the package as being part of Emacs,
for example, thus justifying their presence in Debbugs).


        Stefan






^ permalink raw reply	[relevance 5%]

* bug#65797: 29.0.92; func-arity should not return (0 . many) with apply-partially
    2023-09-08 16:37  5%         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-08 18:20  0%         ` Eli Zaretskii
  2023-09-11 16:57  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-09-08 18:20 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 65797, joseph

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  65797@debbugs.gnu.org
> Date: Fri, 08 Sep 2023 11:52:25 -0400
> 
> >> This isn't backwards compatible, is it?
> > Neither is what you propose, AFAIU.  We are in effect changing a
> > public API in incompatible ways.
> 
> Yup, AFAICT there's no way to implement the Texinfo-documented
> behavior reliably.
> 
> So some backward-incompatibility is inevitable, unless we decide to
> stick to the current code to be "bug compatible" :-(

I think one of the alternatives you proposed was backward-compatible
(albeit not very elegant).  So my vote is for that alternative.





^ permalink raw reply	[relevance 0%]

* bug#65797: 29.0.92; func-arity should not return (0 . many) with apply-partially
  @ 2023-09-08 18:16  5%             ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-08 18:16 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, 65797


Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> IIUC, the patch breaks code that passes a CONDITION predicate that accepts
>> only one argument and also passes an ARG argument.
>>
>> Is there another case which would break?
>
> Yes, it also breaks the reverse: when you don't pass ARG but the
> function needs 2 arguments.
>
>
>         Stefan

You are right.





^ permalink raw reply	[relevance 5%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  @ 2023-09-08 17:10  5%                             ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-09 10:01  5%                               ` Ihor Radchenko
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-08 17:10 UTC (permalink / raw)
  To: Ihor Radchenko
  Cc: Adam Porter, Eli Zaretskii, 63513-done, Stefan Monnier,
	phillip.lord


Ihor Radchenko <yantar92@posteo.net> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>>>> Here you go!
>>>> Thanks, pushed!
>>> May it be possible to promote `persist-hash-equal' and
>>> `persist-copy-tree' to common subr.el functions?
>>> The topic of comparing hash tables has been previously discussed in
>>> https://yhetil.org/emacs-devel/871qvz4kdw.fsf@localhost/
>>
>> Hmm... AFAICT `persist-copy-tree` is a copy of our current `copy-tree`,
>> so there's nothing to do there :-)
>
> Err...
> Then, wouldn't it be better to contribute this function to compat.el and
> use it from there?

The new behavior of copy-tree has already been added to compat.el:

https://github.com/emacs-compat/compat/pull/25

However, that change currently only exists in compat's emacs-30 branch.

I did not know if it was acceptable for persist.el to require compat
when I wrote these patches. If we agree that it is acceptable, then I'm
happy to submit a patch to replace (persist-copy-tree ...) with
(compat-call copy-tree ...), but we'll have to wait to apply the patch
until after the compat.el emacs-30 branch is merged into master.






^ permalink raw reply	[relevance 5%]

* bug#65797: 29.0.92; func-arity should not return (0 . many) with apply-partially
  @ 2023-09-08 16:37  5%         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
    2023-09-08 18:20  0%         ` Eli Zaretskii
  1 sibling, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-08 16:37 UTC (permalink / raw)
  To: Stefan Monnier, Eli Zaretskii; +Cc: 65797



On September 8, 2023 8:52:25 AM PDT, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>> This isn't backwards compatible, is it?
>> Neither is what you propose, AFAIU.  We are in effect changing a
>> public API in incompatible ways.
>
>Yup, AFAICT there's no way to implement the Texinfo-documented
>behavior reliably.
>
>So some backward-incompatibility is inevitable, unless we decide to
>stick to the current code to be "bug compatible" 

IIUC, the patch breaks code that passes a CONDITION predicate that accepts only one argument and also passes an ARG argument.

Is there another case which would break?





^ permalink raw reply	[relevance 5%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  @ 2023-09-08 11:58  0%                         ` Eli Zaretskii
    1 sibling, 0 replies; 200+ results
From: Eli Zaretskii @ 2023-09-08 11:58 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: adam, phillip.lord, 63513-done, monnier, joseph

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: Joseph Turner <joseph@breatheoutbreathe.in>, Adam Porter
>  <adam@alphapapa.net>, Eli Zaretskii <eliz@gnu.org>,
>  phillip.lord@russet.org.uk, 63513-done@debbugs.gnu.org
> Date: Fri, 08 Sep 2023 11:30:52 +0000
> 
> May it be possible to promote `persist-hash-equal' and
> `persist-copy-tree' to common subr.el functions?

Why do we need them in subr.el, i.e. preloaded?  Why cannot these
functions be autoloaded instead?





^ permalink raw reply	[relevance 0%]

* bug#65797: 29.0.92; func-arity should not return (0 . many) with apply-partially
  2023-09-08  4:40  7%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-08  6:46  0%     ` Eli Zaretskii
    0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-09-08  6:46 UTC (permalink / raw)
  To: Joseph Turner; +Cc: monnier, 65797

> Cc: 65797@debbugs.gnu.org
> Date: Thu, 07 Sep 2023 21:40:28 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
> > - Replace `&optional arg` with `&rest args` and pass those args via
> >   `apply`, so the number of args passed doesn't depend on the function
> >   but on the caller.
> 
> I like this idea. See patch.
> 
> > - Always pass both args to the function (i.e. as documented in the
> >   docstring).
> 
> This isn't backwards compatible, is it?

Neither is what you propose, AFAIU.  We are in effect changing a
public API in incompatible ways.





^ permalink raw reply	[relevance 0%]

* bug#65797: 29.0.92; func-arity should not return (0 . many) with apply-partially
  @ 2023-09-08  4:40  7%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-08  6:46  0%     ` Eli Zaretskii
    1 sibling, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-08  4:40 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 65797

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]


Stefan Monnier <monnier@iro.umontreal.ca> writes:

> - Replace `&optional arg` with `&rest args` and pass those args via
>   `apply`, so the number of args passed doesn't depend on the function
>   but on the caller.

I like this idea. See patch.

> - Always pass both args to the function (i.e. as documented in the
>   docstring).

This isn't backwards compatible, is it?

Joseph



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Don-t-use-func-arity-in-buffer-match-p.patch --]
[-- Type: text/x-diff, Size: 6225 bytes --]

From 5abc2ff47b0c61baecaddd615d7f2783fe8f9c0e Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Thu, 7 Sep 2023 21:27:01 -0700
Subject: [PATCH] Don't use func-arity in buffer-match-p

* lisp/subr.el (buffer-match-p): Use &rest args instead of &optional
arg so that the number of args passed doesn't depend on the function
but on the caller. (Bug#65797)
(match-buffers): Use &rest args instead of &optional arg to match
function signature of buffer-match-p.
* doc/lispref/buffers.texi (Buffer List): Update documentation to say
ARGS instead of ARG.
---
 doc/lispref/buffers.texi | 23 ++++++++++-------------
 lisp/subr.el             | 17 ++++++++---------
 2 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi
index 86c47ae7310..fa29afd2697 100644
--- a/doc/lispref/buffers.texi
+++ b/doc/lispref/buffers.texi
@@ -957,11 +957,11 @@ with a @code{nil} @var{norecord} argument since this may lead to
 infinite recursion.
 @end defvar
 
-@defun buffer-match-p condition buffer-or-name &optional arg
+@defun buffer-match-p condition buffer-or-name &rest args
 This function checks if a buffer designated by @code{buffer-or-name}
-satisfies the specified @code{condition}.  Optional third argument
-@var{arg} is passed to the predicate function in @var{condition}.  A
-valid @var{condition} can be one of the following:
+satisfies the specified @code{condition}.  Remaining arguments
+@var{args} are passed using @code{apply} to the predicate function in
+@var{condition}.  A valid @var{condition} can be one of the following:
 @itemize @bullet{}
 @item
 A string, interpreted as a regular expression.  The buffer
@@ -969,23 +969,20 @@ satisfies the condition if the regular expression matches the buffer
 name.
 @item
 A predicate function, which should return non-@code{nil} if the buffer
-matches.  If the function expects one argument, it is called with
-@var{buffer-or-name} as the argument; if it expects 2 arguments, the
-first argument is @var{buffer-or-name} and the second is @var{arg}
-(or @code{nil} if @var{arg} is omitted).
+matches.
 @item
 A cons-cell @code{(@var{oper} . @var{expr})} where @var{oper} is one
 of
 @table @code
 @item (not @var{cond})
 Satisfied if @var{cond} doesn't satisfy @code{buffer-match-p} with
-the same buffer and @code{arg}.
+the same buffer and @code{args}.
 @item (or @var{conds}@dots{})
 Satisfied if @emph{any} condition in @var{conds} satisfies
-@code{buffer-match-p}, with the same buffer and @code{arg}.
+@code{buffer-match-p}, with the same buffer and @code{args}.
 @item (and @var{conds}@dots{})
 Satisfied if @emph{all} the conditions in @var{conds} satisfy
-@code{buffer-match-p}, with the same buffer and @code{arg}.
+@code{buffer-match-p}, with the same buffer and @code{args}.
 @item derived-mode
 Satisfied if the buffer's major mode derives from @var{expr}.
 @item major-mode
@@ -998,14 +995,14 @@ string) or @code{(and)} (empty conjunction).
 @end itemize
 @end defun
 
-@defun match-buffers condition &optional buffer-list arg
+@defun match-buffers condition &optional buffer-list &rest args
 This function returns a list of all buffers that satisfy the
 @code{condition}.  If no buffers match, the function returns
 @code{nil}.  The argument @var{condition} is as defined in
 @code{buffer-match-p} above.  By default, all the buffers are
 considered, but this can be restricted via the optional argument
 @code{buffer-list}, which should be a list of buffers to consider.
-Optional third argument @var{arg} will be passed to @var{condition} in
+Remaining arguments @var{args} will be passed to @var{condition} in
 the same way as @code{buffer-match-p} does.
 @end defun
 
diff --git a/lisp/subr.el b/lisp/subr.el
index ce23a699624..87f08c669d4 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -7079,14 +7079,15 @@ lines."
             (setq start (length string)))))
       (nreverse lines))))
 
-(defun buffer-match-p (condition buffer-or-name &optional arg)
+(defun buffer-match-p (condition buffer-or-name &rest args)
   "Return non-nil if BUFFER-OR-NAME matches CONDITION.
 CONDITION is either:
 - the symbol t, to always match,
 - the symbol nil, which never matches,
 - a regular expression, to match a buffer name,
-- a predicate function that takes BUFFER-OR-NAME and ARG as
-  arguments, and returns non-nil if the buffer matches,
+- a predicate function that takes BUFFER-OR-NAME as its first
+  argument and remaining arguments ARGS, and returns non-nil if
+  the buffer matches,
 - a cons-cell, where the car describes how to interpret the cdr.
   The car can be one of the following:
   * `derived-mode': the buffer matches if the buffer's major mode
@@ -7110,9 +7111,7 @@ CONDITION is either:
                       ((pred stringp)
                        (string-match-p condition (buffer-name buffer)))
                       ((pred functionp)
-                       (if (eq 1 (cdr (func-arity condition)))
-                           (funcall condition buffer-or-name)
-                         (funcall condition buffer-or-name arg)))
+                       (apply condition buffer-or-name args))
                       (`(major-mode . ,mode)
                        (eq
                         (buffer-local-value 'major-mode buffer)
@@ -7134,17 +7133,17 @@ CONDITION is either:
                 (throw 'match t)))))))
     (funcall match (list condition))))
 
-(defun match-buffers (condition &optional buffers arg)
+(defun match-buffers (condition &optional buffers &rest args)
   "Return a list of buffers that match CONDITION, or nil if none match.
 See `buffer-match-p' for various supported CONDITIONs.
 By default all buffers are checked, but the optional
 argument BUFFERS can restrict that: its value should be
 an explicit list of buffers to check.
-Optional argument ARG is passed to `buffer-match-p', for
+Remaining arguments ARGS are passed to `buffer-match-p', for
 predicate conditions in CONDITION."
   (let (bufs)
     (dolist (buf (or buffers (buffer-list)))
-      (when (buffer-match-p condition (get-buffer buf) arg)
+      (when (buffer-match-p condition (get-buffer buf) args)
         (push buf bufs)))
     bufs))
 
-- 
2.41.0


^ permalink raw reply related	[relevance 7%]

* bug#65797: 29.0.92; func-arity should not return (0 . many) with apply-partially
@ 2023-09-07  7:53  1% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
    0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-07  7:53 UTC (permalink / raw)
  To: 65797

Sorry, I accidentally sent an email about this to the emacs-devel list.

(func-arity (apply-partially #'eq 'foo))
  ⇒ (0 . many)

gives the impression that the following is valid:

(funcall (apply-partially #'eq 'foo) 'foo 'bar)
     error→ (wrong-number-of-arguments #<subr eq> 3)

Here's an example of where this bug comes up in real code.

This should return a list of buffers which locally bind foo:

(match-buffers (apply-partially #'local-variable-p 'foo))

but instead it signals an error:

Debugger entered--Lisp error: (wrong-number-of-arguments #<subr local-variable-p> 3)
local-variable-p(foo #<buffer *scratch*> nil)
apply(local-variable-p (foo #<buffer *scratch*> nil))
...

because buffer-match-p uses func-arity to conditionally apply ARG.

Sidenote - compat.el's buffer-match-p does this

(condition-case nil
    (funcall condition buffer)
  (wrong-number-of-arguments
   (funcall condition buffer arg)))

instead of

(if (eq 1 (cdr (func-arity condition)))
    (funcall condition buffer-or-name)
  (funcall condition buffer-or-name arg))

and is therefore immune to this bug.

Joseph

In GNU Emacs 29.0.92 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.37, cairo version 1.16.0)
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure
 CONFIG_SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash
 SHELL=/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin/bash
 --prefix=/gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92
 --enable-fast-install --with-modules --with-cairo
 --with-native-compilation --disable-build-details'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM
GTK3 ZLIB

Important settings:
  value of $EMACSLOADPATH: /home/joseph/.guix-extra-profiles/emacs/emacs/share/emacs/site-lisp:/gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp
  value of $EMACSNATIVELOADPATH: /home/joseph/.guix-extra-profiles/emacs/emacs/lib/emacs/native-site-lisp
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: mu4e:view

Minor modes in effect:
  mu4e-search-minor-mode: t
  mu4e-context-minor-mode: t
  mu4e-modeline-mode: t
  repeat-mode: t
  pixel-scroll-precision-mode: t
  engine-mode: t
  ws-butler-global-mode: t
  ws-butler-mode: t
  diff-hl-flydiff-mode: t
  magit-todos-mode: t
  global-hl-todo-mode: t
  magit-wip-initial-backup-mode: t
  magit-wip-before-change-mode: t
  magit-wip-after-apply-mode: t
  magit-wip-after-save-mode: t
  magit-wip-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  whole-line-or-region-global-mode: t
  whole-line-or-region-local-mode: t
  corfu-history-mode: t
  global-corfu-mode: t
  corfu-mode: t
  marginalia-mode: t
  vertico-reverse-mode: t
  vertico-mode: t
  display-battery-mode: t
  display-time-mode: t
  global-aggressive-indent-mode: t
  recentf-mode: t
  shell-dirtrack-mode: t
  pulsar-global-mode: t
  pulsar-mode: t
  desktop-environment-mode: t
  server-mode: t
  global-subword-mode: t
  subword-mode: t
  delete-selection-mode: t
  electric-pair-mode: t
  savehist-mode: t
  save-place-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  window-divider-mode: t
  buffer-read-only: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  abbrev-mode: t

Load-path shadows:
/home/joseph/.emacs.d/elpa/jabber/jabber-autoloads hides /home/joseph/.emacs.d/elpa/jabber/lisp/jabber-autoloads
/gnu/store/gfp1flcfi9yxrlg35mwh4xbssd4yix20-emacs-transient-0.4.3/share/emacs/site-lisp/transient-0.4.3/transient hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/transient
/gnu/store/r5w8fq8jznd21r8pzcvb0xb1zxl6y2sc-emacs-use-package-2.4.4/share/emacs/site-lisp/use-package-2.4.4/use-package-diminish hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/use-package/use-package-diminish
/gnu/store/r5w8fq8jznd21r8pzcvb0xb1zxl6y2sc-emacs-use-package-2.4.4/share/emacs/site-lisp/use-package-2.4.4/use-package-lint hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/use-package/use-package-lint
/gnu/store/r5w8fq8jznd21r8pzcvb0xb1zxl6y2sc-emacs-use-package-2.4.4/share/emacs/site-lisp/use-package-2.4.4/use-package-jump hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/use-package/use-package-jump
/gnu/store/r5w8fq8jznd21r8pzcvb0xb1zxl6y2sc-emacs-use-package-2.4.4/share/emacs/site-lisp/use-package-2.4.4/use-package-ensure hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/use-package/use-package-ensure
/gnu/store/r5w8fq8jznd21r8pzcvb0xb1zxl6y2sc-emacs-use-package-2.4.4/share/emacs/site-lisp/use-package-2.4.4/bind-key hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/use-package/bind-key
/gnu/store/r5w8fq8jznd21r8pzcvb0xb1zxl6y2sc-emacs-use-package-2.4.4/share/emacs/site-lisp/use-package-2.4.4/use-package hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/use-package/use-package
/gnu/store/r5w8fq8jznd21r8pzcvb0xb1zxl6y2sc-emacs-use-package-2.4.4/share/emacs/site-lisp/use-package-2.4.4/use-package-delight hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/use-package/use-package-delight
/gnu/store/r5w8fq8jznd21r8pzcvb0xb1zxl6y2sc-emacs-use-package-2.4.4/share/emacs/site-lisp/use-package-2.4.4/use-package-core hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/use-package/use-package-core
/gnu/store/r5w8fq8jznd21r8pzcvb0xb1zxl6y2sc-emacs-use-package-2.4.4/share/emacs/site-lisp/use-package-2.4.4/use-package-bind-key hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/use-package/use-package-bind-key
/gnu/store/r5w8fq8jznd21r8pzcvb0xb1zxl6y2sc-emacs-use-package-2.4.4/share/emacs/site-lisp/use-package-2.4.4/use-package-ensure-system-package hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/use-package/use-package-ensure-system-package
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/oc-csl hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/oc-csl
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-haskell hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-haskell
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-pcomplete hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-pcomplete
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-fortran hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-fortran
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-eval hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-eval
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-ascii hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-ascii
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-faces hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-faces
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-irc hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-irc
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-latex hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-latex
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/oc-biblatex hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/oc-biblatex
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-keys hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-keys
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-entities hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-entities
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-octave hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-octave
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-forth hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-forth
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-list hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-list
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-plantuml hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-plantuml
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-md hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-md
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-feed hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-feed
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-eshell hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-eshell
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-eww hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-eww
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-java hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-java
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-doi hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-doi
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-src hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-src
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-goto hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-goto
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-habit hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-habit
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-lisp hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-lisp
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-js hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-js
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-tangle hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-tangle
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-clojure hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-clojure
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-julia hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-julia
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-info hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-info
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-sqlite hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-sqlite
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-sed hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-sed
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-gnus hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-gnus
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-exp hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-exp
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-gnuplot hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-gnuplot
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-table hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-table
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-num hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-num
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-lilypond hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-lilypond
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-w3m hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-w3m
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-sql hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-sql
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-attach hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-attach
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-capture hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-capture
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-emacs-lisp hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-emacs-lisp
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-cycle hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-cycle
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-sass hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-sass
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-fold-core hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-fold-core
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-macs hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-macs
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-archive hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-archive
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-footnote hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-footnote
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-tempo hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-tempo
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-odt hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-odt
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-screen hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-screen
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-timer hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-timer
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-comint hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-comint
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-shell hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-shell
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-dot hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-dot
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-macro hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-macro
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-mhe hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-mhe
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/oc-bibtex hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/oc-bibtex
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-ruby hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-ruby
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-groovy hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-groovy
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/oc-basic hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/oc-basic
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-plot hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-plot
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-lua hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-lua
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-awk hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-awk
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-calc hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-calc
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-agenda hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-agenda
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-mobile hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-mobile
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-man hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-man
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/oc hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/oc
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-R hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-R
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-beamer hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-beamer
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-icalendar hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-icalendar
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-processing hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-processing
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-indent hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-indent
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-inlinetask hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-inlinetask
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/oc-natbib hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/oc-natbib
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-fold hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-fold
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-attach-git hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-attach-git
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-bibtex hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-bibtex
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-refile hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-refile
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-protocol hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-protocol
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-python hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-python
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-latex hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-latex
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-colview hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-colview
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-duration hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-duration
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-lob hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-lob
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-ocaml hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-ocaml
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-version hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-version
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-scheme hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-scheme
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-matlab hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-matlab
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-makefile hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-makefile
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-ref hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-ref
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-org hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-org
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-loaddefs hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-loaddefs
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-texinfo hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-texinfo
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-rmail hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-rmail
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-perl hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-perl
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-mouse hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-mouse
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-maxima hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-maxima
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-ditaa hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-ditaa
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-bbdb hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-bbdb
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-koma-letter hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-koma-letter
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-lint hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-lint
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-crypt hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-crypt
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-C hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-C
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-html hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-html
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-core hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-core
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-id hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-id
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-eshell hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-eshell
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-compat hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-compat
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ol-docview hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ol-docview
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-datetree hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-datetree
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-element hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-element
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-ctags hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-ctags
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-table hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-table
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-man hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-man
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-org hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-org
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-persist hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-persist
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ob-css hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ob-css
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/org-clock hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/org-clock
/gnu/store/l4x0hyy62q491djdwx995gnss4pklp93-emacs-org-9.6.8/share/emacs/site-lisp/org-9.6.8/ox-publish hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/org/ox-publish
/gnu/store/wpbwpy52q2n6khqjplndx33gvln1clii-emacs-soap-client-3.2.3/share/emacs/site-lisp/soap-client-3.2.3/soap-inspect hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/net/soap-inspect
/gnu/store/wpbwpy52q2n6khqjplndx33gvln1clii-emacs-soap-client-3.2.3/share/emacs/site-lisp/soap-client-3.2.3/soap-client hides /gnu/store/rsyqw1rk4qswgmi1yc7jryb4fmq56y9h-emacs-next-tree-sitter-29.0.92/share/emacs/29.0.92/lisp/net/soap-client

Features:
(shadow emacsbug compat-macs rect dabbrev help-at-pt tramp-cmds crux
tramp tramp-loaddefs trampver tramp-integration tramp-compat
tempel-collection tempel hyperdrive-history hyperdrive-mirror completion
xref edebug hyperdrive-dir magit-patch magit-subtree magit-gitignore
magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help
ediff-init ediff-util embark-org embark-consult embark elisp-demos
shortdoc texinfo texinfo-loaddefs cl-print package-x help-fns hyperdrive
hyperdrive-org hyperdrive-ewoc hyperdrive-lib hyperdrive-vars plz
persist ert debug backtrace org-transclusion org-transclusion-font-lock
org-transclusion-src-lines text-clone ox-texinfo ox-odt rng-loc rng-uri
rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns
nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table ox-ascii
ox-publish ox loaddefs-gen radix-tree network-stream url-cache url-http
url-auth url-gw nsm misc cus-edit cus-start package-vc lisp-mnt
org-archive cal-move ace-window avy dired-aux gnus-dired ledger-mode
ledger-check ledger-texi ledger-test ledger-sort ledger-report
ledger-reconcile ledger-occur ledger-fonts ledger-fontify ledger-state
ledger-complete ledger-schedule ledger-init ledger-xact ledger-post
ledger-exec ledger-navigate eshell esh-cmd esh-ext esh-opt esh-proc
esh-io esh-arg esh-module esh-groups esh-util files-x ledger-context
ledger-commodities ledger-regex vc-hg vc-bzr vc-src vc-sccs vc-svn
vc-cvs vc-rcs bug-reference magit-extras org-clock undo-fu orderless
consult misearch multi-isearch qp cursor-sensor sort gnus-cite shr-color
mm-archive mail-extr textsec uni-scripts idna-mapping ucs-normalize
uni-confusable textsec-check mu4e mu4e-org mu4e-notification
notifications mu4e-main mu4e-view mu4e-headers mu4e-compose mu4e-draft
mu4e-actions smtpmail mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark
mu4e-message flow-fill mule-util hl-line mu4e-contacts mu4e-update
mu4e-folders mu4e-context mu4e-query-items mu4e-server mu4e-modeline
mu4e-vars mu4e-helpers mu4e-config mu4e-window magit-bookmark bookmark
pp ido mu4e-obsolete elide-head diary-lib diary-loaddefs cal-iso vc-git
org-indent org-appear outli oc-basic ol-eww eww url-queue mm-url
ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect ol-docview doc-view
jka-compr image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m ol-doi
org-link-doi face-remap topsy makem project repeat smartparens
dired-subtree dired-hacks-utils jabber jabber-time jabber-autoaway
jabber-vcard-avatars jabber-chatstates jabber-events jabber-vcard
jabber-avatar jabber-activity jabber-watch jabber-modeline
jabber-ahc-presence jabber-ahc jabber-version jabber-ourversion
jabber-muc-nick-completion hippie-exp jabber-muc jabber-bookmarks
jabber-muc-nick-coloring jabber-browse jabber-search jabber-register
jabber-widget jabber-chat jabber-history jabber-chatbuffer jabber-roster
jabber-carbons jabber-presence jabber-private jabber-logon jabber-conn
srv dns starttls jabber-core jabber-keepalive jabber-ping jabber-disco
jabber-iq jabber-console sgml-mode facemenu jabber-truncate jabber-alert
jabber-keymap jabber-sasl sasl sasl-anonymous sasl-login sasl-plain
jabber-menu jabber-util fsm jabber-xml goto-addr pixel-scroll cua-base
engine-mode ws-butler diff-hl-flydiff diff-hl log-view vc-dir ewoc vc
vc-dispatcher magit-todos pcre2el rxt advice re-builder hl-todo f s
async grep compile magit-submodule magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log which-func imenu
magit-diff smerge-mode diff diff-mode git-commit log-edit pcvs-util
add-log magit-core magit-autorevert autorevert filenotify magit-margin
magit-transient magit-process with-editor magit-mode transient edmacro
magit-git magit-base magit-section crm dash auth-source-pass
whole-line-or-region corfu-history corfu marginalia vertico-reverse
vertico battery time aggressive-indent easy-mmode recentf tree-widget
no-littering compat compat-29 org-contacts org-capture gnus-art mm-uu
mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill
kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus
gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601
gnus-spec gnus-int gnus-range message sendmail yank-media puny dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus nnheader
mail-utils range mm-util mail-prsvr wid-edit gnus-util
text-property-search org-agenda org-element org-persist xdg org-id
avl-tree generator org-refile org ob-dot ob-shell shell ob-js ob
ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint
org-pcomplete pcomplete comint ansi-osc ansi-color ring org-list
org-footnote org-faces org-entities time-date noutline outline
ob-emacs-lisp ob-core ob-eval org-cycle org-table org-keys oc
org-loaddefs cal-menu calendar cal-loaddefs ol org-fold org-fold-core
org-compat org-version org-macs format-spec pulsar pulse color
desktop-environment dbus xml comp comp-cstr warnings icons cl-extra
help-mode exwm exwm-input xcb-keysyms xcb-xkb exwm-manage exwm-floating
xcb-cursor xcb-render exwm-layout exwm-workspace exwm-core xcb-ewmh
xcb-icccm xcb xcb-xproto xcb-types xcb-debug server
elfeed-tube-mpv-autoloads elfeed-tube-autoloads org-make-toc-autoloads
org-modern-autoloads org-ql-autoloads org-super-agenda-autoloads
ht-autoloads ts-autoloads cus-load setup kmacro org-bookmarks ffap
thingatpt cap-words superword subword modus-vivendi-theme modus-themes
pcase delsel elec-pair find-func savehist saveplace move-bank-csvs
wgrep-autoloads ws-butler-autoloads simple-httpd-autoloads
orderless-autoloads marginalia-autoloads diff-hl-autoloads
git-link-autoloads pcre2el-autoloads hl-todo-autoloads
magit-todos-autoloads interactive-align-autoloads
ace-window-breatheoutbreathein-autoloads ztree-autoloads
posframe-autoloads vertico-autoloads expand-region-autoloads
avy-autoloads embark-autoloads tempel-collection-autoloads
tempel-autoloads corfu-autoloads eat-autoloads sqlite3-api-autoloads
pg-autoloads finalize-autoloads emacsql-autoloads
emacsql-sqlite3-autoloads org-roam-autoloads consult-org-roam-autoloads
consult-dir-autoloads consult-autoloads eimp-autoloads
dired-hacks-autoloads org-appear-autoloads csv-mode-autoloads
ledger-mode-autoloads aggressive-indent-autoloads vundo-autoloads
undo-fu-autoloads crux-autoloads inspector-autoloads
soap-client-autoloads debbugs-autoloads markdown-mode-autoloads
smartparens-autoloads outli-breatheoutbreathein-autoloads
macrostep-autoloads nameless-autoloads shut-up-autoloads
spinner-autoloads loop-autoloads suggest-autoloads treepy-autoloads
elisp-demos-autoloads detached-autoloads tmr-autoloads f-autoloads
password-store-autoloads pass-autoloads disk-usage-autoloads
mpv-autoloads simple-mpc-breatheoutbreathein-autoloads kv-autoloads
esxml-autoloads nov-el-autoloads tablist-autoloads pdf-tools-autoloads
org-noter-autoloads s-autoloads elfeed-org-autoloads elfeed-autoloads
transmission-autoloads deferred-autoloads request-autoloads
webpaste-autoloads org-contacts-autoloads mu4e-autoloads
org-mime-autoloads org-present-autoloads org-autoloads
org-download-autoloads async-autoloads with-editor-autoloads
transient-autoloads magit-autoloads orgit-autoloads
org-cliplink-autoloads magit-popup-autoloads geiser-guile-autoloads
geiser-autoloads edit-indirect-autoloads dash-autoloads bui-autoloads
guix-autoloads rx pulsar-autoloads showtip-autoloads pos-tip-autoloads
popup-autoloads sdcv-autoloads nord-theme-autoloads compat-autoloads
no-littering-autoloads disable-mouse-autoloads engine-mode-autoloads
vterm-autoloads exwm-edit-autoloads desktop-environment-autoloads
xelb-autoloads exwm-autoloads setup-autoloads diminish-autoloads
use-package-autoloads guix-emacs aio-autoloads chordpro-mode-autoloads
emms-autoloads fsm-autoloads gemini-mode-autoloads hyperdrive-autoloads
jabber-autoloads org-timeblock-autoloads org-transclusion-autoloads
ov-autoloads peg-autoloads persist-autoloads pipewire-autoloads info
plz-autoloads srv-autoloads svg-tag-mode-autoloads svg-lib-autoloads
topsy-autoloads finder-inf ushin-shapes-autoloads
whole-line-or-region-autoloads xr-autoloads package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x
map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc
iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 1840338 193031)
 (symbols 48 65655 5)
 (strings 32 345161 25227)
 (string-bytes 1 14452803)
 (vectors 16 178178)
 (vector-slots 8 3960622 378098)
 (floats 8 987 1313)
 (intervals 56 74447 7074)
 (buffers 984 75))





^ permalink raw reply	[relevance 1%]

* bug#65768: Bump persist.el version
  2023-09-06  2:13 11% bug#65768: Bump persist.el version Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-06 16:39  5% ` Stefan Kangas
  2023-09-16 22:28  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-10-30 20:54  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 200+ results
From: Stefan Kangas @ 2023-09-06 16:39 UTC (permalink / raw)
  To: Joseph Turner; +Cc: Phillip Lord, 65768

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Please bump the version now that we've fixed that hash
> table issue in persist.
>
> See patch.

Phillip, what do you think?

> From 8b5ec447c3ac0c6f5efa15737f22e984bba99992 Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Tue, 5 Sep 2023 19:13:06 -0700
> Subject: [PATCH] Bump version
>
> ---
>  persist.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/persist.el b/persist.el
> index e43171459e..8a1f746ddd 100644
> --- a/persist.el
> +++ b/persist.el
> @@ -5,7 +5,7 @@
>  ;; Author: Phillip Lord <phillip.lord@russet.org.uk>
>  ;; Maintainer: Phillip Lord <phillip.lord@russet.org.uk>
>  ;; Package-Type: multi
> -;; Version: 0.5
> +;; Version: 0.6
>
>  ;; The contents of this file are subject to the GPL License, Version 3.0.





^ permalink raw reply	[relevance 5%]

* bug#65768: Bump persist.el version
@ 2023-09-06  2:13 11% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-06 16:39  5% ` Stefan Kangas
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-06  2:13 UTC (permalink / raw)
  To: 65768

[-- Attachment #1: Type: text/plain, Size: 92 bytes --]

Please bump the version now that we've fixed that hash
table issue in persist.

See patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Bump-version.patch --]
[-- Type: text/x-diff, Size: 644 bytes --]

From 8b5ec447c3ac0c6f5efa15737f22e984bba99992 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 5 Sep 2023 19:13:06 -0700
Subject: [PATCH] Bump version

---
 persist.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/persist.el b/persist.el
index e43171459e..8a1f746ddd 100644
--- a/persist.el
+++ b/persist.el
@@ -5,7 +5,7 @@
 ;; Author: Phillip Lord <phillip.lord@russet.org.uk>
 ;; Maintainer: Phillip Lord <phillip.lord@russet.org.uk>
 ;; Package-Type: multi
-;; Version: 0.5
+;; Version: 0.6
 
 ;; The contents of this file are subject to the GPL License, Version 3.0.
 
-- 
2.41.0


^ permalink raw reply related	[relevance 11%]

* bug#65764: Fix typo in backward-word-strictly
  2023-09-05 19:35 11% bug#65764: Fix typo in backward-word-strictly Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-05 19:50  5% ` Stefan Kangas
  0 siblings, 0 replies; 200+ results
From: Stefan Kangas @ 2023-09-05 19:50 UTC (permalink / raw)
  To: Joseph Turner, 65764-close

Version: 29.2

Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> From 577be585960191bd1de077aaf451f5b08895a836 Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Tue, 5 Sep 2023 12:05:58 -0700
> Subject: [PATCH] Fix typo
>
> * lisp/subr.el (backward-word-strictly):

Thanks, installed on emacs-29.





^ permalink raw reply	[relevance 5%]

* bug#65764: Fix typo in backward-word-strictly
@ 2023-09-05 19:35 11% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-05 19:50  5% ` Stefan Kangas
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-05 19:35 UTC (permalink / raw)
  To: 65764

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Fix-typo.patch --]
[-- Type: text/x-diff, Size: 924 bytes --]

From 577be585960191bd1de077aaf451f5b08895a836 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 5 Sep 2023 12:05:58 -0700
Subject: [PATCH] Fix typo

* lisp/subr.el (backward-word-strictly):
---
 lisp/subr.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index 34d87e83310..6cedaffa806 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -6039,7 +6039,7 @@ by `find-word-boundary-function-table'.  It is also not interactive."
 With argument ARG, do this that many times.
 If ARG is omitted or nil, move point backward one word.
 
-This function is like `forward-word', but it is not affected
+This function is like `backward-word', but it is not affected
 by `find-word-boundary-function-table'.  It is also not interactive."
   (let ((find-word-boundary-function-table
          (if (char-table-p word-move-empty-char-table)
-- 
2.41.0






^ permalink raw reply related	[relevance 11%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  2023-09-04 17:05  5%                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-04 22:28  8%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-05 15:08  0%                   ` phillip.lord
  1 sibling, 0 replies; 200+ results
From: phillip.lord @ 2023-09-05 15:08 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: adam.porter, Eli Zaretskii, 63513, Joseph Turner

On 2023-09-04 18:05, Stefan Monnier wrote:
> Joseph Turner [2023-09-04 08:57:13] wrote:
>> On September 4, 2023 4:33:55 AM PDT, Eli Zaretskii <eliz@gnu.org> 
>> wrote:
>>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>>> Cc: phillip.lord@russet.org.uk, monnier@iro.umontreal.ca,
>>>>  63513@debbugs.gnu.org, Adam Porter <adam.porter@47ap.net>
>>>> Date: Sun, 03 Sep 2023 17:29:22 -0700
>>>> 
>>>> > Also, I think the new features warrant a NEWS entry.
>>>> 
>>>> Should that go in the NEWS file in the main Emacs repo? I don't see 
>>>> a
>>>> NEWS file in either of the main or externals/persist ELPA branches.
>>> 
>>> I'm terribly sorry: I haven't realized this is for ELPA, I thought it
>>> was for emacs.git.  My bad Please ignore what I wrote in my previous
>>> message.
>> 
>> No problem! It gave me a chance to do a final editing pass. What's the 
>> next
>> step? I would be glad for Phillip's review, if possible.
> 
> I was about to ping Phil over on https://gitlab.com/phillord/persist/
> but was reminded along the way that Phil gave me write access to
> that repository.
> 
> Could you send me the result of your final editing pass?


Indeed! I am afraid I am fairly unresponsive these days ("real life" 
intrudes), but I am more than happy for you to update there.

Phil





^ permalink raw reply	[relevance 0%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  2023-09-04 17:05  5%                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-04 22:28  8%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
    2023-09-05 15:08  0%                   ` phillip.lord
  1 sibling, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-04 22:28 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Adam Porter, Eli Zaretskii, 63513, phillip.lord

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]


Stefan Monnier <monnier@iro.umontreal.ca> writes:
> I was about to ping Phil over on https://gitlab.com/phillord/persist/
> but was reminded along the way that Phil gave me write access to
> that repository.
>
> Could you send me the result of your final editing pass?

Here you go!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-test-persist-save-macro.patch --]
[-- Type: text/x-diff, Size: 3629 bytes --]

From 2ca778a44c10f11059f16ef5922cf1eff9118105 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 23 May 2023 12:57:02 -0700
Subject: [PATCH 1/5] Add test-persist-save macro

* test/persist-tests.el (persist-test-persist-save):
Consolidate logic of test-persist-save and
test-persist-save-non-number.
(test-persist-save-number test-persist-save-string): Simple wrappers
over persist-test-persist-save
---
 test/persist-tests.el | 76 +++++++++++++++++++------------------------
 1 file changed, 33 insertions(+), 43 deletions(-)

diff --git a/test/persist-tests.el b/test/persist-tests.el
index b6645a9297..f2b04769ef 100644
--- a/test/persist-tests.el
+++ b/test/persist-tests.el
@@ -25,51 +25,41 @@ (ert-deftest test-persist-save-only-persistant ()
    :type 'error
    :exclude-subtypes t))
 
-(ert-deftest test-persist-save ()
-  (with-local-temp-persist
-   (let ((sym (cl-gensym)))
-     ;; precondition
-   (should-not (file-exists-p (persist--file-location sym)))
-     (set sym 10)
-     (persist-symbol sym 10)
-     (persist-save sym)
-     (should t)
-     (should-not (file-exists-p (persist--file-location sym)))
-     (set sym 20)
-     (persist-save sym)
-     (should (file-exists-p (persist--file-location sym)))
-     (should
-      (string-match-p
-       "20"
-       (with-temp-buffer
-         (insert-file-contents (persist--file-location sym))
-         (buffer-string))))
-     (set sym 10)
-     (persist-save sym)
-     (should-not (file-exists-p (persist--file-location sym)))
-     (should-error
-      (persist-save 'fred)))))
+(defmacro persist-test-persist-save (init default change printed-changed)
+  "Test persisting symbols.
+- symbol is not persisted when value is set to INIT and default
+  value is set to DEFAULT.
+- symbol is persisted when value is changed according to CHANGE.
+- persisted file contents match PRINTED-CHANGED.
+- symbol is not persisted after value is set back to DEFAULT."
+  `(with-local-temp-persist
+    (let ((sym (cl-gensym)))
+      (should-not (file-exists-p (persist--file-location sym)))
+      (set sym ,init)
+      (persist-symbol sym ,default)
+      (persist-save sym)
+      (should t)
+      (should-not (file-exists-p (persist--file-location sym)))
+      ,change
+      (persist-save sym)
+      (should (file-exists-p (persist--file-location sym)))
+      (should
+       (string-match-p
+        ,printed-changed
+        (with-temp-buffer
+          (insert-file-contents (persist--file-location sym))
+          (buffer-string))))
+      (set sym ,default)
+      (persist-save sym)
+      (should-not (file-exists-p (persist--file-location sym))))))
 
-(ert-deftest test-persist-save-non-number ()
-  "Test saving something that is not a number.
+(ert-deftest test-persist-save-number ()
+  "Test saving number."
+  (persist-test-persist-save 1 1 (set sym 2) "2"))
 
-`test-persist-save' missed "
-  (with-local-temp-persist
-   (let ((sym (cl-gensym)))
-     (set sym "fred")
-     (persist-symbol sym "fred")
-     (persist-save sym)
-     (should t)
-     (should-not (file-exists-p (persist--file-location sym)))
-     (set sym "george")
-     (persist-save sym)
-     (should (file-exists-p (persist--file-location sym)))
-     (should
-      (string-match-p
-       "george"
-       (with-temp-buffer
-         (insert-file-contents (persist--file-location sym))
-         (buffer-string)))))))
+(ert-deftest test-persist-save-string ()
+  "Test saving string."
+  (persist-test-persist-save "foo" "foo" (set sym "bar") "bar"))
 
 (ert-deftest test-persist-load ()
   (with-local-temp-persist
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Add-persist-equal.patch --]
[-- Type: text/x-diff, Size: 1394 bytes --]

From b379d8d1779e0190541ef7f8adf39dfe4d4c551a Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sat, 2 Sep 2023 16:52:31 -0700
Subject: [PATCH 2/5] Add persist-equal

* persist.el (persist-hash-equal): Like equal, but compares hash
tables also.
See bug#63671 for a discussion of built-in hash table comparison.
---
 persist.el | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/persist.el b/persist.el
index d80943d19e..a707d038cd 100644
--- a/persist.el
+++ b/persist.el
@@ -187,5 +187,25 @@ (defun persist--save-all ()
 (add-hook 'kill-emacs-hook
           'persist--save-all)
 
+(defun persist-equal (a b)
+  "Return non-nil when the values of A and B are equal.
+A and B are compared using `equal' unless they are both hash
+tables. In that case, the following are compared:
+
+- hash table count
+- hash table predicate
+- values, using `persist-equal'"
+  (if (and (hash-table-p a) (hash-table-p b))
+      (and (= (hash-table-count a) (hash-table-count b))
+           (eq (hash-table-test a) (hash-table-test b))
+           (catch 'done
+             (maphash
+              (lambda (key a-value)
+                (unless (persist-equal a-value (gethash key b (not a-value)))
+                  (throw 'done nil)))
+              a)
+             t))
+    (equal a b)))
+
 (provide 'persist)
 ;;; persist.el ends here
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-Make-persist-defvar-work-with-hash-tables.patch --]
[-- Type: text/x-diff, Size: 2645 bytes --]

From 11194569423dcdf8778a55f59dbca8f49e8b7b37 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sun, 3 Sep 2023 17:10:38 -0700
Subject: [PATCH 3/5] Make persist-defvar work with hash tables

Previously, when persist-defvar received a hash table for an initial
value, updated values were not persisted.

* persist.el (persist-symbol): Use hash table copy as default so that
the original table can be modified without modifying the default value.
(persist-save): Use persist-equal to ensure that hash tables are
correctly compared
* test/persist-tests.el (test-persist-save-hash): Test hash tables
persistence.
---
 persist.el            | 8 +++++---
 test/persist-tests.el | 8 ++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/persist.el b/persist.el
index a707d038cd..7b2ab491d7 100644
--- a/persist.el
+++ b/persist.el
@@ -118,7 +118,9 @@ (defun persist-symbol (symbol &optional initvalue)
   (let ((initvalue (or initvalue (symbol-value symbol))))
     (add-to-list 'persist--symbols symbol)
     (put symbol 'persist t)
-    (put symbol 'persist-default initvalue)))
+    (if (hash-table-p initvalue)
+        (put symbol 'persist-default (copy-hash-table initvalue))
+      (put symbol 'persist-default initvalue))))
 
 (defun persist--persistant-p (symbol)
   "Return non-nil if SYMBOL is a persistant variable."
@@ -133,8 +135,8 @@ (defun persist-save (symbol)
     (error (format
             "Symbol %s is not persistant" symbol)))
   (let ((symbol-file-loc (persist--file-location symbol)))
-    (if (equal (symbol-value symbol)
-               (persist-default symbol))
+    (if (persist-equal (symbol-value symbol)
+                       (persist-default symbol))
         (when (file-exists-p symbol-file-loc)
           (delete-file symbol-file-loc))
       (let ((dir-loc
diff --git a/test/persist-tests.el b/test/persist-tests.el
index f2b04769ef..90adf1c6d6 100644
--- a/test/persist-tests.el
+++ b/test/persist-tests.el
@@ -61,6 +61,14 @@ (ert-deftest test-persist-save-string ()
   "Test saving string."
   (persist-test-persist-save "foo" "foo" (set sym "bar") "bar"))
 
+(ert-deftest test-persist-save-hash ()
+  "Test saving hash table."
+  (let* ((hash (make-hash-table))
+         (default (copy-hash-table hash)))
+    (persist-test-persist-save hash default
+                               (puthash 'foo "bar" (symbol-value sym))
+                               "#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data (foo \"bar\"))")))
+
 (ert-deftest test-persist-load ()
   (with-local-temp-persist
    (let ((sym (cl-gensym)))
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0004-Add-persist-copy-tree.patch --]
[-- Type: text/x-diff, Size: 1983 bytes --]

From f360f7ae53125a847c2a8d5762ca5f08d16445b9 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 23 May 2023 13:43:02 -0700
Subject: [PATCH 4/5] Add persist-copy-tree

The behavior of copy-tree was changed in Emacs 30. This function will
ensure that persist works correctly for previous Emacs versions.

* persist.el (persist-copy-tree): Add copy-tree, so that records can
be compared.
---
 persist.el | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/persist.el b/persist.el
index 7b2ab491d7..93444995f2 100644
--- a/persist.el
+++ b/persist.el
@@ -209,5 +209,33 @@ (defun persist-equal (a b)
              t))
     (equal a b)))
 
+(defun persist-copy-tree (tree &optional vectors-and-records)
+  "Make a copy of TREE.
+If TREE is a cons cell, this recursively copies both its car and its cdr.
+Contrast to `copy-sequence', which copies only along the cdrs.
+With the second argument VECTORS-AND-RECORDS non-nil, this
+traverses and copies vectors and records as well as conses."
+  (declare (side-effect-free error-free))
+  (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 (persist-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)))
+                   (persist-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 (persist-copy-tree (aref tree i) vectors-and-records)))
+	  tree)
+      tree)))
+
 (provide 'persist)
 ;;; persist.el ends here
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0005-Make-persist-defvar-work-with-records.patch --]
[-- Type: text/x-diff, Size: 2019 bytes --]

From ea57e6205b10678b9c26f7dcf3704e2a7acb25a7 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 23 May 2023 13:44:40 -0700
Subject: [PATCH 5/5] Make persist-defvar work with records

Previously, when persist-defvar received a record for an initial
value, updated values were not persisted.

* persist.el (persist-symbol): Set default to a copy of initvalue so
when initvalue is a record, the original can be modified without
modifying the default.
* test/persist-tests.el: Test persist-save with a record.
---
 persist.el            | 2 +-
 test/persist-tests.el | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/persist.el b/persist.el
index 93444995f2..e43171459e 100644
--- a/persist.el
+++ b/persist.el
@@ -120,7 +120,7 @@ (defun persist-symbol (symbol &optional initvalue)
     (put symbol 'persist t)
     (if (hash-table-p initvalue)
         (put symbol 'persist-default (copy-hash-table initvalue))
-      (put symbol 'persist-default initvalue))))
+      (put symbol 'persist-default (persist-copy-tree initvalue t)))))
 
 (defun persist--persistant-p (symbol)
   "Return non-nil if SYMBOL is a persistant variable."
diff --git a/test/persist-tests.el b/test/persist-tests.el
index 90adf1c6d6..62d8501493 100644
--- a/test/persist-tests.el
+++ b/test/persist-tests.el
@@ -69,6 +69,14 @@ (ert-deftest test-persist-save-hash ()
                                (puthash 'foo "bar" (symbol-value sym))
                                "#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data (foo \"bar\"))")))
 
+(ert-deftest test-persist-save-record ()
+  "Test saving record."
+  (let* ((rec (record 'foo 'a 'b))
+         (default (copy-sequence rec)))
+    (persist-test-persist-save rec default
+                               (setf (aref (symbol-value sym) 2) 'quux)
+                               "#s(foo a quux)")))
+
 (ert-deftest test-persist-load ()
   (with-local-temp-persist
    (let ((sym (cl-gensym)))
-- 
2.41.0


^ permalink raw reply related	[relevance 8%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  2023-09-04 15:57  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-04 17:05  5%                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-04 22:28  8%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-05 15:08  0%                   ` phillip.lord
  0 siblings, 2 replies; 200+ results
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-04 17:05 UTC (permalink / raw)
  To: Joseph Turner; +Cc: adam.porter, Eli Zaretskii, 63513, phillip.lord

Joseph Turner [2023-09-04 08:57:13] wrote:
> On September 4, 2023 4:33:55 AM PDT, Eli Zaretskii <eliz@gnu.org> wrote:
>>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>>> Cc: phillip.lord@russet.org.uk, monnier@iro.umontreal.ca,
>>>  63513@debbugs.gnu.org, Adam Porter <adam.porter@47ap.net>
>>> Date: Sun, 03 Sep 2023 17:29:22 -0700
>>> 
>>> > Also, I think the new features warrant a NEWS entry.
>>> 
>>> Should that go in the NEWS file in the main Emacs repo? I don't see a
>>> NEWS file in either of the main or externals/persist ELPA branches.
>>
>>I'm terribly sorry: I haven't realized this is for ELPA, I thought it
>>was for emacs.git.  My bad Please ignore what I wrote in my previous
>>message.
>
> No problem! It gave me a chance to do a final editing pass. What's the next
> step? I would be glad for Phillip's review, if possible.

I was about to ping Phil over on https://gitlab.com/phillord/persist/
but was reminded along the way that Phil gave me write access to
that repository.

Could you send me the result of your final editing pass?


        Stefan






^ permalink raw reply	[relevance 5%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  2023-09-04 15:54  5%                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-04 15:59  0%                       ` Eli Zaretskii
  0 siblings, 0 replies; 200+ results
From: Eli Zaretskii @ 2023-09-04 15:59 UTC (permalink / raw)
  To: Joseph Turner; +Cc: jonas, monnier, 65414-done

> Date: Mon, 04 Sep 2023 08:54:52 -0700
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> CC: monnier@iro.umontreal.ca, 65414@debbugs.gnu.org, jonas@bernoul.li
> 
> 
> 
> On September 4, 2023 3:53:24 AM PDT, Eli Zaretskii <eliz@gnu.org> wrote:
> >Does this mean we can close this issue without any changes to the
> >save-some-buffers-functions machinery?
> 
> That's fine by me, yes.

Done.

> Thank you for taking the time to walk me through to a solution!!

You are welcome.





^ permalink raw reply	[relevance 0%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  2023-09-04 11:33  0%             ` Eli Zaretskii
@ 2023-09-04 15:57  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-04 17:05  5%                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-04 15:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: adam.porter, 63513, monnier, phillip.lord



On September 4, 2023 4:33:55 AM PDT, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: phillip.lord@russet.org.uk, monnier@iro.umontreal.ca,
>>  63513@debbugs.gnu.org, Adam Porter <adam.porter@47ap.net>
>> Date: Sun, 03 Sep 2023 17:29:22 -0700
>> 
>> > Also, I think the new features warrant a NEWS entry.
>> 
>> Should that go in the NEWS file in the main Emacs repo? I don't see a
>> NEWS file in either of the main or externals/persist ELPA branches.
>
>I'm terribly sorry: I haven't realized this is for ELPA, I thought it
>was for emacs.git.  My bad Please ignore what I wrote in my previous
>message.

No problem! It gave me a chance to do a final editing pass. What's the next step? I would be glad for Phillip's review, if possible.





^ permalink raw reply	[relevance 5%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  2023-09-04 10:53  0%                   ` Eli Zaretskii
@ 2023-09-04 15:54  5%                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-04 15:59  0%                       ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-04 15:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: jonas, monnier, 65414



On September 4, 2023 3:53:24 AM PDT, Eli Zaretskii <eliz@gnu.org> wrote:
>Does this mean we can close this issue without any changes to the
>save-some-buffers-functions machinery?

That's fine by me, yes.

Thank you for taking the time to walk me through to a solution!!

Joseph





^ permalink raw reply	[relevance 5%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  2023-09-04  0:29  8%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-04 11:33  0%             ` Eli Zaretskii
  2023-09-04 15:57  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-09-04 11:33 UTC (permalink / raw)
  To: Joseph Turner; +Cc: adam.porter, 63513, monnier, phillip.lord

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: phillip.lord@russet.org.uk, monnier@iro.umontreal.ca,
>  63513@debbugs.gnu.org, Adam Porter <adam.porter@47ap.net>
> Date: Sun, 03 Sep 2023 17:29:22 -0700
> 
> > Also, I think the new features warrant a NEWS entry.
> 
> Should that go in the NEWS file in the main Emacs repo? I don't see a
> NEWS file in either of the main or externals/persist ELPA branches.

I'm terribly sorry: I haven't realized this is for ELPA, I thought it
was for emacs.git.  My bad Please ignore what I wrote in my previous
message.





^ permalink raw reply	[relevance 0%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  2023-09-03 17:52  5%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  @ 2023-09-04 10:53  0%                   ` Eli Zaretskii
  2023-09-04 15:54  5%                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-09-04 10:53 UTC (permalink / raw)
  To: Joseph Turner; +Cc: jonas, monnier, 65414

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: Eli Zaretskii <eliz@gnu.org>, 65414@debbugs.gnu.org, jonas@bernoul.li
> Date: Sun, 03 Sep 2023 10:52:39 -0700
> 
> 
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
> > [ Arguably, it would be even better to arrange for `hyperdrive.el` to
> >   save its buffers "in the usual way", i.e. relying on
> >   `buffer-offer-save`, `save-buffer`, `buffer-save-without-query, ...  ]
> 
> I was not aware of `buffer-offer-save`. Thank you for the suggestion!
> Since we already rely on `save-buffer`, setting `buffer-offer-save` to t
> is much simpler than adding to `save-some-buffers-functions`. It also
> resolves the interference between Magit and hyperdrive.el.

Does this mean we can close this issue without any changes to the
save-some-buffers-functions machinery?





^ permalink raw reply	[relevance 0%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  2023-09-03  6:08  0%         ` Eli Zaretskii
@ 2023-09-04  0:29  8%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-04 11:33  0%             ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-04  0:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Adam Porter, 63513, monnier, phillip.lord

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks, but this lacks the commit log messages (see CONTRIBUTE).

I have added commit log messages. See attached patches.

> Also, I think the new features warrant a NEWS entry.

Should that go in the NEWS file in the main Emacs repo? I don't see a
NEWS file in either of the main or externals/persist ELPA branches.

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-test-persist-save-macro.patch --]
[-- Type: text/x-diff, Size: 3629 bytes --]

From 2ca778a44c10f11059f16ef5922cf1eff9118105 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 23 May 2023 12:57:02 -0700
Subject: [PATCH 1/5] Add test-persist-save macro

* test/persist-tests.el (persist-test-persist-save):
Consolidate logic of test-persist-save and
test-persist-save-non-number.
(test-persist-save-number test-persist-save-string): Simple wrappers
over persist-test-persist-save
---
 test/persist-tests.el | 76 +++++++++++++++++++------------------------
 1 file changed, 33 insertions(+), 43 deletions(-)

diff --git a/test/persist-tests.el b/test/persist-tests.el
index b6645a9297..f2b04769ef 100644
--- a/test/persist-tests.el
+++ b/test/persist-tests.el
@@ -25,51 +25,41 @@ (ert-deftest test-persist-save-only-persistant ()
    :type 'error
    :exclude-subtypes t))
 
-(ert-deftest test-persist-save ()
-  (with-local-temp-persist
-   (let ((sym (cl-gensym)))
-     ;; precondition
-   (should-not (file-exists-p (persist--file-location sym)))
-     (set sym 10)
-     (persist-symbol sym 10)
-     (persist-save sym)
-     (should t)
-     (should-not (file-exists-p (persist--file-location sym)))
-     (set sym 20)
-     (persist-save sym)
-     (should (file-exists-p (persist--file-location sym)))
-     (should
-      (string-match-p
-       "20"
-       (with-temp-buffer
-         (insert-file-contents (persist--file-location sym))
-         (buffer-string))))
-     (set sym 10)
-     (persist-save sym)
-     (should-not (file-exists-p (persist--file-location sym)))
-     (should-error
-      (persist-save 'fred)))))
+(defmacro persist-test-persist-save (init default change printed-changed)
+  "Test persisting symbols.
+- symbol is not persisted when value is set to INIT and default
+  value is set to DEFAULT.
+- symbol is persisted when value is changed according to CHANGE.
+- persisted file contents match PRINTED-CHANGED.
+- symbol is not persisted after value is set back to DEFAULT."
+  `(with-local-temp-persist
+    (let ((sym (cl-gensym)))
+      (should-not (file-exists-p (persist--file-location sym)))
+      (set sym ,init)
+      (persist-symbol sym ,default)
+      (persist-save sym)
+      (should t)
+      (should-not (file-exists-p (persist--file-location sym)))
+      ,change
+      (persist-save sym)
+      (should (file-exists-p (persist--file-location sym)))
+      (should
+       (string-match-p
+        ,printed-changed
+        (with-temp-buffer
+          (insert-file-contents (persist--file-location sym))
+          (buffer-string))))
+      (set sym ,default)
+      (persist-save sym)
+      (should-not (file-exists-p (persist--file-location sym))))))
 
-(ert-deftest test-persist-save-non-number ()
-  "Test saving something that is not a number.
+(ert-deftest test-persist-save-number ()
+  "Test saving number."
+  (persist-test-persist-save 1 1 (set sym 2) "2"))
 
-`test-persist-save' missed "
-  (with-local-temp-persist
-   (let ((sym (cl-gensym)))
-     (set sym "fred")
-     (persist-symbol sym "fred")
-     (persist-save sym)
-     (should t)
-     (should-not (file-exists-p (persist--file-location sym)))
-     (set sym "george")
-     (persist-save sym)
-     (should (file-exists-p (persist--file-location sym)))
-     (should
-      (string-match-p
-       "george"
-       (with-temp-buffer
-         (insert-file-contents (persist--file-location sym))
-         (buffer-string)))))))
+(ert-deftest test-persist-save-string ()
+  "Test saving string."
+  (persist-test-persist-save "foo" "foo" (set sym "bar") "bar"))
 
 (ert-deftest test-persist-load ()
   (with-local-temp-persist
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Add-persist-equal.patch --]
[-- Type: text/x-diff, Size: 1394 bytes --]

From b379d8d1779e0190541ef7f8adf39dfe4d4c551a Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sat, 2 Sep 2023 16:52:31 -0700
Subject: [PATCH 2/5] Add persist-equal

* persist.el (persist-hash-equal): Like equal, but compares hash
tables also.
See bug#63671 for a discussion of built-in hash table comparison.
---
 persist.el | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/persist.el b/persist.el
index d80943d19e..a707d038cd 100644
--- a/persist.el
+++ b/persist.el
@@ -187,5 +187,25 @@ (defun persist--save-all ()
 (add-hook 'kill-emacs-hook
           'persist--save-all)
 
+(defun persist-equal (a b)
+  "Return non-nil when the values of A and B are equal.
+A and B are compared using `equal' unless they are both hash
+tables. In that case, the following are compared:
+
+- hash table count
+- hash table predicate
+- values, using `persist-equal'"
+  (if (and (hash-table-p a) (hash-table-p b))
+      (and (= (hash-table-count a) (hash-table-count b))
+           (eq (hash-table-test a) (hash-table-test b))
+           (catch 'done
+             (maphash
+              (lambda (key a-value)
+                (unless (persist-equal a-value (gethash key b (not a-value)))
+                  (throw 'done nil)))
+              a)
+             t))
+    (equal a b)))
+
 (provide 'persist)
 ;;; persist.el ends here
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-Make-persist-defvar-work-with-hash-tables.patch --]
[-- Type: text/x-diff, Size: 2645 bytes --]

From 11194569423dcdf8778a55f59dbca8f49e8b7b37 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sun, 3 Sep 2023 17:10:38 -0700
Subject: [PATCH 3/5] Make persist-defvar work with hash tables

Previously, when persist-defvar received a hash table for an initial
value, updated values were not persisted.

* persist.el (persist-symbol): Use hash table copy as default so that
the original table can be modified without modifying the default value.
(persist-save): Use persist-equal to ensure that hash tables are
correctly compared
* test/persist-tests.el (test-persist-save-hash): Test hash tables
persistence.
---
 persist.el            | 8 +++++---
 test/persist-tests.el | 8 ++++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/persist.el b/persist.el
index a707d038cd..7b2ab491d7 100644
--- a/persist.el
+++ b/persist.el
@@ -118,7 +118,9 @@ (defun persist-symbol (symbol &optional initvalue)
   (let ((initvalue (or initvalue (symbol-value symbol))))
     (add-to-list 'persist--symbols symbol)
     (put symbol 'persist t)
-    (put symbol 'persist-default initvalue)))
+    (if (hash-table-p initvalue)
+        (put symbol 'persist-default (copy-hash-table initvalue))
+      (put symbol 'persist-default initvalue))))
 
 (defun persist--persistant-p (symbol)
   "Return non-nil if SYMBOL is a persistant variable."
@@ -133,8 +135,8 @@ (defun persist-save (symbol)
     (error (format
             "Symbol %s is not persistant" symbol)))
   (let ((symbol-file-loc (persist--file-location symbol)))
-    (if (equal (symbol-value symbol)
-               (persist-default symbol))
+    (if (persist-equal (symbol-value symbol)
+                       (persist-default symbol))
         (when (file-exists-p symbol-file-loc)
           (delete-file symbol-file-loc))
       (let ((dir-loc
diff --git a/test/persist-tests.el b/test/persist-tests.el
index f2b04769ef..90adf1c6d6 100644
--- a/test/persist-tests.el
+++ b/test/persist-tests.el
@@ -61,6 +61,14 @@ (ert-deftest test-persist-save-string ()
   "Test saving string."
   (persist-test-persist-save "foo" "foo" (set sym "bar") "bar"))
 
+(ert-deftest test-persist-save-hash ()
+  "Test saving hash table."
+  (let* ((hash (make-hash-table))
+         (default (copy-hash-table hash)))
+    (persist-test-persist-save hash default
+                               (puthash 'foo "bar" (symbol-value sym))
+                               "#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data (foo \"bar\"))")))
+
 (ert-deftest test-persist-load ()
   (with-local-temp-persist
    (let ((sym (cl-gensym)))
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0004-Add-persist-copy-tree.patch --]
[-- Type: text/x-diff, Size: 1983 bytes --]

From f360f7ae53125a847c2a8d5762ca5f08d16445b9 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 23 May 2023 13:43:02 -0700
Subject: [PATCH 4/5] Add persist-copy-tree

The behavior of copy-tree was changed in Emacs 30. This function will
ensure that persist works correctly for previous Emacs versions.

* persist.el (persist-copy-tree): Add copy-tree, so that records can
be compared.
---
 persist.el | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/persist.el b/persist.el
index 7b2ab491d7..93444995f2 100644
--- a/persist.el
+++ b/persist.el
@@ -209,5 +209,33 @@ (defun persist-equal (a b)
              t))
     (equal a b)))
 
+(defun persist-copy-tree (tree &optional vectors-and-records)
+  "Make a copy of TREE.
+If TREE is a cons cell, this recursively copies both its car and its cdr.
+Contrast to `copy-sequence', which copies only along the cdrs.
+With the second argument VECTORS-AND-RECORDS non-nil, this
+traverses and copies vectors and records as well as conses."
+  (declare (side-effect-free error-free))
+  (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 (persist-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)))
+                   (persist-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 (persist-copy-tree (aref tree i) vectors-and-records)))
+	  tree)
+      tree)))
+
 (provide 'persist)
 ;;; persist.el ends here
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0005-Make-persist-defvar-work-with-records.patch --]
[-- Type: text/x-diff, Size: 2019 bytes --]

From ea57e6205b10678b9c26f7dcf3704e2a7acb25a7 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 23 May 2023 13:44:40 -0700
Subject: [PATCH 5/5] Make persist-defvar work with records

Previously, when persist-defvar received a record for an initial
value, updated values were not persisted.

* persist.el (persist-symbol): Set default to a copy of initvalue so
when initvalue is a record, the original can be modified without
modifying the default.
* test/persist-tests.el: Test persist-save with a record.
---
 persist.el            | 2 +-
 test/persist-tests.el | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/persist.el b/persist.el
index 93444995f2..e43171459e 100644
--- a/persist.el
+++ b/persist.el
@@ -120,7 +120,7 @@ (defun persist-symbol (symbol &optional initvalue)
     (put symbol 'persist t)
     (if (hash-table-p initvalue)
         (put symbol 'persist-default (copy-hash-table initvalue))
-      (put symbol 'persist-default initvalue))))
+      (put symbol 'persist-default (persist-copy-tree initvalue t)))))
 
 (defun persist--persistant-p (symbol)
   "Return non-nil if SYMBOL is a persistant variable."
diff --git a/test/persist-tests.el b/test/persist-tests.el
index 90adf1c6d6..62d8501493 100644
--- a/test/persist-tests.el
+++ b/test/persist-tests.el
@@ -69,6 +69,14 @@ (ert-deftest test-persist-save-hash ()
                                (puthash 'foo "bar" (symbol-value sym))
                                "#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data (foo \"bar\"))")))
 
+(ert-deftest test-persist-save-record ()
+  "Test saving record."
+  (let* ((rec (record 'foo 'a 'b))
+         (default (copy-sequence rec)))
+    (persist-test-persist-save rec default
+                               (setf (aref (symbol-value sym) 2) 'quux)
+                               "#s(foo a quux)")))
+
 (ert-deftest test-persist-load ()
   (with-local-temp-persist
    (let ((sym (cl-gensym)))
-- 
2.41.0


^ permalink raw reply related	[relevance 8%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  @ 2023-09-03 19:04  5%                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-03 19:04 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, jonas, 65414


Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> However... I wonder what the intended purpose of
>> `save-some-buffers-functions` is if packages like `hyperdrive.el` are
>> intended to use `buffer-offer-save`?
>
> IIUC the purpose is to save things that are kept in variables rather
> than buffers.

Good to know. Thanks!





^ permalink raw reply	[relevance 5%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
    2023-09-03 17:29  0%                 ` Eli Zaretskii
@ 2023-09-03 17:52  5%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
    2023-09-04 10:53  0%                   ` Eli Zaretskii
  1 sibling, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-03 17:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, jonas, 65414


Stefan Monnier <monnier@iro.umontreal.ca> writes:

> [ Arguably, it would be even better to arrange for `hyperdrive.el` to
>   save its buffers "in the usual way", i.e. relying on
>   `buffer-offer-save`, `save-buffer`, `buffer-save-without-query, ...  ]

I was not aware of `buffer-offer-save`. Thank you for the suggestion!
Since we already rely on `save-buffer`, setting `buffer-offer-save` to t
is much simpler than adding to `save-some-buffers-functions`. It also
resolves the interference between Magit and hyperdrive.el.

However... I wonder what the intended purpose of
`save-some-buffers-functions` is if packages like `hyperdrive.el` are
intended to use `buffer-offer-save`?

Joseph





^ permalink raw reply	[relevance 5%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  @ 2023-09-03 17:44  0%                 ` Eli Zaretskii
  0 siblings, 0 replies; 200+ results
From: Eli Zaretskii @ 2023-09-03 17:44 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 65414, jonas, monnier, joseph

> From: Juri Linkov <juri@linkov.net>
> Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  Stefan Monnier
>  <monnier@iro.umontreal.ca>,  jonas@bernoul.li,  65414@debbugs.gnu.org
> Date: Sun, 03 Sep 2023 20:22:56 +0300
> 
> > Hmm... but how to make this change backward-compatible?  I mean, if
> > there's some function out there that is used in
> > save-some-buffers-functions, and it was written to accept only 2
> > arguments, we cannot safely call it with 3 arguments, can we?
> 
> If nothing else helps, just catch 'wrong-number-of-arguments',
> then call with an obsolete signature again.

I was hoping for a cleaner, more elegant solution.  Still do.





^ permalink raw reply	[relevance 0%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  @ 2023-09-03 17:29  0%                 ` Eli Zaretskii
  2023-09-03 17:52  5%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 200+ results
From: Eli Zaretskii @ 2023-09-03 17:29 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: jonas, 65414, joseph

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  65414@debbugs.gnu.org,
>   jonas@bernoul.li
> Date: Sun, 03 Sep 2023 13:06:07 -0400
> 
>  Sorry, `debbugs.gnu.org` appears to be down

It is back up.





^ permalink raw reply	[relevance 0%]

* bug#65666: Lockfiles break package-vc-install-from-checkout
  2023-09-02 17:21  0%           ` Eli Zaretskii
@ 2023-09-03  7:03  0%             ` Philip Kaludercic
  0 siblings, 0 replies; 200+ results
From: Philip Kaludercic @ 2023-09-03  7:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: adam.porter, 65666-done, Joseph Turner

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: philipk@posteo.net, 65666@debbugs.gnu.org, adam.porter@47ap.net
>> Date: Sat, 02 Sep 2023 10:15:48 -0700
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> > Or make the REGEXP argument to directory-files-recursively more
>> > specific, to reject lock files.
>> >
>> > But yes, the use of file-exists-p is not TRT, IMO.
>> 
>> See patch.
>
> Thanks, this LGTM.

Agree, I have pushed the change to master.





^ permalink raw reply	[relevance 0%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
  2023-09-02 16:49  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-03  7:00  5%                 ` Philip Kaludercic
  0 siblings, 0 replies; 200+ results
From: Philip Kaludercic @ 2023-09-03  7:00 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 65649-done

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> I think it would be better to wrap only the org code in the
>> `condition-case' body, ideally with a more specific error type (if that
>> doesn't exist, that is something we could mention to the Org
>> maintainers).
>
> The reason I wrapped both the org-export and makeinfo logic in
> condition-case is so that the makeinfo logic does not run when the
> org-export logic fails. Is there a better way?
>
> We could let-bind a flag like failed-org-export-p, then set it to t in
> the condition case handler, then only run makeinfo when
> failed-org-export-p is nil. Seems a bit ugly.

Oh right, never-mind then, I guess this is the simplest solution.

> The only define-error in org-mode that's relevant to org-export is not
> general enough:
>
> (define-error 'org-link-broken "Unable to resolve link; aborting")

Then this should be fine.  I'll apply the changes the master.  Thanks.





^ permalink raw reply	[relevance 5%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  2023-09-02 23:54  9%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-03  6:08  0%         ` Eli Zaretskii
  2023-09-04  0:29  8%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-09-03  6:08 UTC (permalink / raw)
  To: Joseph Turner; +Cc: adam, 63513, monnier, phillip.lord

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Sat, 02 Sep 2023 16:54:00 -0700
> 
> I fixed the definition of persist-hash-equal, and rebased.

Thanks, but this lacks the commit log messages (see CONTRIBUTE).

Also, I think the new features warrant a NEWS entry.





^ permalink raw reply	[relevance 0%]

* bug#63513: [PATCH] Make persist-defvar work with records and hash tables
  @ 2023-09-02 23:54  9%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-03  6:08  0%         ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-02 23:54 UTC (permalink / raw)
  To: Eli Zaretskii, Phillip Lord, Stefan Monnier, 63513, adam

[-- Attachment #1: Type: text/plain, Size: 60 bytes --]

I fixed the definition of persist-hash-equal, and rebased.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-test-persist-save-macro.patch --]
[-- Type: text/x-diff, Size: 3379 bytes --]

From 6ec3955a521266e0661bbd0b2a6d1984875ae1a1 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 23 May 2023 12:57:02 -0700
Subject: [PATCH 1/5] Add test-persist-save macro

---
 test/persist-tests.el | 76 +++++++++++++++++++------------------------
 1 file changed, 33 insertions(+), 43 deletions(-)

diff --git a/test/persist-tests.el b/test/persist-tests.el
index b6645a9297..0a85b78767 100644
--- a/test/persist-tests.el
+++ b/test/persist-tests.el
@@ -25,51 +25,41 @@ (ert-deftest test-persist-save-only-persistant ()
    :type 'error
    :exclude-subtypes t))
 
-(ert-deftest test-persist-save ()
-  (with-local-temp-persist
-   (let ((sym (cl-gensym)))
-     ;; precondition
-   (should-not (file-exists-p (persist--file-location sym)))
-     (set sym 10)
-     (persist-symbol sym 10)
-     (persist-save sym)
-     (should t)
-     (should-not (file-exists-p (persist--file-location sym)))
-     (set sym 20)
-     (persist-save sym)
-     (should (file-exists-p (persist--file-location sym)))
-     (should
-      (string-match-p
-       "20"
-       (with-temp-buffer
-         (insert-file-contents (persist--file-location sym))
-         (buffer-string))))
-     (set sym 10)
-     (persist-save sym)
-     (should-not (file-exists-p (persist--file-location sym)))
-     (should-error
-      (persist-save 'fred)))))
+(defmacro test-persist-save (init default change printed-changed)
+  "Test persisting symbols.
+- symbol is not persisted when value is set to INIT and default
+  value is set to DEFAULT.
+- symbol is persisted when value is changed according to CHANGE.
+- persisted file contents match PRINTED-CHANGED.
+- symbol is not persisted after value is set back to DEFAULT."
+  `(with-local-temp-persist
+    (let ((sym (cl-gensym)))
+      (should-not (file-exists-p (persist--file-location sym)))
+      (set sym ,init)
+      (persist-symbol sym ,default)
+      (persist-save sym)
+      (should t)
+      (should-not (file-exists-p (persist--file-location sym)))
+      ,change
+      (persist-save sym)
+      (should (file-exists-p (persist--file-location sym)))
+      (should
+       (string-match-p
+        ,printed-changed
+        (with-temp-buffer
+          (insert-file-contents (persist--file-location sym))
+          (buffer-string))))
+      (set sym ,default)
+      (persist-save sym)
+      (should-not (file-exists-p (persist--file-location sym))))))
 
-(ert-deftest test-persist-save-non-number ()
-  "Test saving something that is not a number.
+(ert-deftest test-persist-save-number ()
+  "Test saving number."
+  (test-persist-save 1 1 (set sym 2) "2"))
 
-`test-persist-save' missed "
-  (with-local-temp-persist
-   (let ((sym (cl-gensym)))
-     (set sym "fred")
-     (persist-symbol sym "fred")
-     (persist-save sym)
-     (should t)
-     (should-not (file-exists-p (persist--file-location sym)))
-     (set sym "george")
-     (persist-save sym)
-     (should (file-exists-p (persist--file-location sym)))
-     (should
-      (string-match-p
-       "george"
-       (with-temp-buffer
-         (insert-file-contents (persist--file-location sym))
-         (buffer-string)))))))
+(ert-deftest test-persist-save-string ()
+  "Test saving string."
+  (test-persist-save "foo" "foo" (set sym "bar") "bar"))
 
 (ert-deftest test-persist-load ()
   (with-local-temp-persist
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Add-persist-hash-equal.patch --]
[-- Type: text/x-diff, Size: 1475 bytes --]

From 1f6fae3a9799dbb58b742095480917c2e3b99a7f Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sat, 2 Sep 2023 16:52:31 -0700
Subject: [PATCH 2/5] Add persist-hash-equal

See bug#63671.
---
 persist.el | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/persist.el b/persist.el
index d80943d19e..fd0d750161 100644
--- a/persist.el
+++ b/persist.el
@@ -187,5 +187,22 @@ (defun persist--save-all ()
 (add-hook 'kill-emacs-hook
           'persist--save-all)
 
+(defun persist-hash-equal (hash1 hash2)
+  "Return non-nil when the contents of HASH1 and HASH2 are equal.
+Table values are compared using `equal' unless they are both hash
+tables themselves, in which case `persist-hash-equal' is used.
+Does not compare equality predicates."
+  (and (= (hash-table-count hash1)
+          (hash-table-count hash2))
+       (catch 'flag (maphash (lambda (key hash1-value)
+                               (let ((hash2-value (gethash key hash2)))
+                                 (or (if (and (hash-table-p hash1-value)
+                                              (hash-table-p hash2-value))
+                                         (persist-hash-equal hash1-value hash2-value)
+                                       (equal hash1-value hash2-value))
+                                     (throw 'flag nil))))
+                             hash1)
+              t)))
+
 (provide 'persist)
 ;;; persist.el ends here
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-Make-persist-defvar-work-with-hash-tables.patch --]
[-- Type: text/x-diff, Size: 3100 bytes --]

From ae35177b30bf1fabbc56ebf315b25a6074102201 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 23 May 2023 13:09:29 -0700
Subject: [PATCH 3/5] Make persist-defvar work with hash tables

Previously, when persist-defvar received a hash table for an initial
value, updated values were not persisted.
---
 persist.el            | 17 ++++++++++++-----
 test/persist-tests.el |  8 ++++++++
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/persist.el b/persist.el
index fd0d750161..9a0ee33a65 100644
--- a/persist.el
+++ b/persist.el
@@ -118,7 +118,9 @@ (defun persist-symbol (symbol &optional initvalue)
   (let ((initvalue (or initvalue (symbol-value symbol))))
     (add-to-list 'persist--symbols symbol)
     (put symbol 'persist t)
-    (put symbol 'persist-default initvalue)))
+    (if (hash-table-p initvalue)
+        (put symbol 'persist-default (copy-hash-table initvalue))
+      (put symbol 'persist-default initvalue))))
 
 (defun persist--persistant-p (symbol)
   "Return non-nil if SYMBOL is a persistant variable."
@@ -132,9 +134,14 @@ (defun persist-save (symbol)
   (unless (persist--persistant-p symbol)
     (error (format
             "Symbol %s is not persistant" symbol)))
-  (let ((symbol-file-loc (persist--file-location symbol)))
-    (if (equal (symbol-value symbol)
-               (persist-default symbol))
+  (let* ((symbol-file-loc (persist--file-location symbol))
+         (value (symbol-value symbol))
+         (default (persist-default symbol))
+         (value-unchanged-p (if (and (hash-table-p value)
+                                     (hash-table-p default))
+                                (persist-hash-equal value default)
+                              (equal value default))))
+    (if value-unchanged-p
         (when (file-exists-p symbol-file-loc)
           (delete-file symbol-file-loc))
       (let ((dir-loc
@@ -148,7 +155,7 @@ (defun persist-save (symbol)
                 (print-escape-control-characters t)
                 (print-escape-nonascii t)
                 (print-circle t))
-            (print (symbol-value symbol) (current-buffer)))
+            (print value (current-buffer)))
           (write-region (point-min) (point-max)
                         symbol-file-loc
                         nil 'quiet))))))
diff --git a/test/persist-tests.el b/test/persist-tests.el
index 0a85b78767..8a30a24e23 100644
--- a/test/persist-tests.el
+++ b/test/persist-tests.el
@@ -61,6 +61,14 @@ (ert-deftest test-persist-save-string ()
   "Test saving string."
   (test-persist-save "foo" "foo" (set sym "bar") "bar"))
 
+(ert-deftest test-persist-save-hash ()
+  "Test saving hash table."
+  (let* ((hash (make-hash-table))
+         (default (copy-hash-table hash)))
+    (test-persist-save hash default
+                       (puthash 'foo "bar" (symbol-value sym))
+                       "#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data (foo \"bar\"))")))
+
 (ert-deftest test-persist-load ()
   (with-local-temp-persist
    (let ((sym (cl-gensym)))
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0004-Add-persist-copy-tree.patch --]
[-- Type: text/x-diff, Size: 1909 bytes --]

From 1b06fc7efb7339c390170e2bc26e298153221f2e Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 23 May 2023 13:43:02 -0700
Subject: [PATCH 4/5] Add persist-copy-tree

The behavior of copy-tree was changed in Emacs 30. This function will
ensure that persist works correctly for previous Emacs versions.
---
 persist.el | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/persist.el b/persist.el
index 9a0ee33a65..8eb0e7ba51 100644
--- a/persist.el
+++ b/persist.el
@@ -211,5 +211,33 @@ (defun persist-hash-equal (hash1 hash2)
                              hash1)
               t)))
 
+(defun persist-copy-tree (tree &optional vectors-and-records)
+  "Make a copy of TREE.
+If TREE is a cons cell, this recursively copies both its car and its cdr.
+Contrast to `copy-sequence', which copies only along the cdrs.
+With the second argument VECTORS-AND-RECORDS non-nil, this
+traverses and copies vectors and records as well as conses."
+  (declare (side-effect-free error-free))
+  (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 (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)))
+                   (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 (copy-tree (aref tree i) vectors-and-records)))
+	  tree)
+      tree)))
+
 (provide 'persist)
 ;;; persist.el ends here
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0005-Make-persist-defvar-work-with-records.patch --]
[-- Type: text/x-diff, Size: 1763 bytes --]

From afd6ea405efb1cba0ad1b1601f4af8efc796c1d7 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Tue, 23 May 2023 13:44:40 -0700
Subject: [PATCH 5/5] Make persist-defvar work with records

Previously, when persist-defvar received a record for an initial
value, updated values were not persisted.
---
 persist.el            | 2 +-
 test/persist-tests.el | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/persist.el b/persist.el
index 8eb0e7ba51..2f3885f80e 100644
--- a/persist.el
+++ b/persist.el
@@ -120,7 +120,7 @@ (defun persist-symbol (symbol &optional initvalue)
     (put symbol 'persist t)
     (if (hash-table-p initvalue)
         (put symbol 'persist-default (copy-hash-table initvalue))
-      (put symbol 'persist-default initvalue))))
+      (put symbol 'persist-default (persist-copy-tree initvalue t)))))
 
 (defun persist--persistant-p (symbol)
   "Return non-nil if SYMBOL is a persistant variable."
diff --git a/test/persist-tests.el b/test/persist-tests.el
index 8a30a24e23..18b8af2b89 100644
--- a/test/persist-tests.el
+++ b/test/persist-tests.el
@@ -69,6 +69,14 @@ (ert-deftest test-persist-save-hash ()
                        (puthash 'foo "bar" (symbol-value sym))
                        "#s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8125 data (foo \"bar\"))")))
 
+(ert-deftest test-persist-save-record ()
+  "Test saving record."
+  (let* ((rec (record 'foo 'a 'b))
+         (default (copy-sequence rec)))
+    (test-persist-save rec default
+                       (setf (aref (symbol-value sym) 2) 'quux)
+                       "#s(foo a quux)")))
+
 (ert-deftest test-persist-load ()
   (with-local-temp-persist
    (let ((sym (cl-gensym)))
-- 
2.41.0


^ permalink raw reply related	[relevance 9%]

* bug#65666: Lockfiles break package-vc-install-from-checkout
  2023-09-02 17:15 10%         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-02 17:21  0%           ` Eli Zaretskii
  2023-09-03  7:03  0%             ` Philip Kaludercic
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-09-02 17:21 UTC (permalink / raw)
  To: Joseph Turner; +Cc: adam.porter, philipk, 65666

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: philipk@posteo.net, 65666@debbugs.gnu.org, adam.porter@47ap.net
> Date: Sat, 02 Sep 2023 10:15:48 -0700
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> > Or make the REGEXP argument to directory-files-recursively more
> > specific, to reject lock files.
> >
> > But yes, the use of file-exists-p is not TRT, IMO.
> 
> See patch.

Thanks, this LGTM.





^ permalink raw reply	[relevance 0%]

* bug#65666: Lockfiles break package-vc-install-from-checkout
  2023-09-02  7:49  0%       ` Eli Zaretskii
@ 2023-09-02 17:15 10%         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-02 17:21  0%           ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-02 17:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: adam.porter, philipk, 65666

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]


Eli Zaretskii <eliz@gnu.org> writes:
> Or make the REGEXP argument to directory-files-recursively more
> specific, to reject lock files.
>
> But yes, the use of file-exists-p is not TRT, IMO.

See patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Don-t-native-compile-lock-files.patch --]
[-- Type: text/x-diff, Size: 1169 bytes --]

From 31ea77e547e333c8e216d759c1c26ad1fe6c4df0 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sat, 2 Sep 2023 10:14:22 -0700
Subject: [PATCH] Don't native compile lock files

* lisp/emacs-lisp/package.el (package--delete-directory):
Exclude lock files in regex.
---
 lisp/emacs-lisp/package.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index e1172d69bf0..8bc7936a5bf 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2484,7 +2484,9 @@ Clean-up the corresponding .eln files if Emacs is native
 compiled."
   (when (featurep 'native-compile)
     (cl-loop
-     for file in (directory-files-recursively dir "\\.el\\'")
+     for file in (directory-files-recursively dir
+                                              ;; Exclude lockfiles
+                                              (rx bos (or (and "." (not "#")) (not ".")) (* nonl) ".el" eos))
      do (comp-clean-up-stale-eln (comp-el-to-eln-filename file))))
   (if (file-symlink-p (directory-file-name dir))
       (delete-file (directory-file-name dir))
-- 
2.41.0


^ permalink raw reply related	[relevance 10%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
  2023-09-02 12:03  5%             ` Philip Kaludercic
@ 2023-09-02 16:49  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-03  7:00  5%                 ` Philip Kaludercic
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-02 16:49 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 65649


Philip Kaludercic <philipk@posteo.net> writes:

> I think it would be better to wrap only the org code in the
> `condition-case' body, ideally with a more specific error type (if that
> doesn't exist, that is something we could mention to the Org
> maintainers).

The reason I wrapped both the org-export and makeinfo logic in
condition-case is so that the makeinfo logic does not run when the
org-export logic fails. Is there a better way?

We could let-bind a flag like failed-org-export-p, then set it to t in
the condition case handler, then only run makeinfo when
failed-org-export-p is nil. Seems a bit ugly.

The only define-error in org-mode that's relevant to org-export is not
general enough:

(define-error 'org-link-broken "Unable to resolve link; aborting")






^ permalink raw reply	[relevance 5%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
  2023-09-01 23:28  9%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-02 12:03  5%             ` Philip Kaludercic
  2023-09-02 16:49  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Philip Kaludercic @ 2023-09-02 12:03 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 65649

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Yes, as soon as one is sending a message to [bugnumber]@debbugs.gnu.org,
>> everything is fine.  The issue if you Cc me directly, is that if I don't
>> watch out, I'll send my response to bug-gnu-emacs@gnu.org, and thus
>> create a new bug.
>
> Thanks, that's clear now.
>
>> I am not sure we want that behaviour at all actually.  Just because
>> there is a typo in the documentation, doesn't mean the package is
>> unusable.  The user should be able to install the package, be notified
>> about the error -- if the have the time, they can fix it and send the
>> maintainer a patch resolving the issue for everyone.  Likewise, if the
>> user updates a package, it wouldn't make sense to ignore everything or
>> worse still revert the update due to a small mistake in the
>> documentation file.
>>
>> ...
>>
>> There is no reason why we cannot already create and use the buffer
>> earlier, to log org-related bugs.  One has to be careful when emptying
>> the buffer, but it might make sense to have a separate buffer for each
>> package, especially when updating multiple packages at once...
>
> Please see attached patches.
>
>>From aa356f561ab7861f463d3024f574fc71d45cb00b Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Wed, 30 Aug 2023 23:24:16 -0700
> Subject: [PATCH 1/2] Include package name in package-vc documentation log
>  buffer name
>
> * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
> ---
>  lisp/emacs-lisp/package-vc.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index 747fe696204..ea8d9ecf488 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -423,7 +423,7 @@ otherwise it's assumed to be an Info file."
>          (let ((default-directory docs-directory))
>            (org-export-to-file 'texinfo file))
>          (setq clean-up t)))
> -    (with-current-buffer (get-buffer-create " *package-vc doc*")
> +    (with-current-buffer (get-buffer-create (format " *package-vc doc: %s*" pkg-name))
>        (erase-buffer)
>        (cond
>         ((/= 0 (call-process "makeinfo" nil t nil
> -- 
> 2.41.0

This looks good, thanks!

>
>>From 010dabfbba8ebeb7f7193482ae2ffc7ec5b694e3 Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Fri, 1 Sep 2023 16:22:45 -0700
> Subject: [PATCH 2/2] Log org export errors to package-vc doc buffer
>
> * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
> Wrap the org-export logic in condition-case, allowing package
> installation to continue while preserving error messages.
> ---
>  lisp/emacs-lisp/package-vc.el | 52 +++++++++++++++++++----------------
>  1 file changed, 29 insertions(+), 23 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index ea8d9ecf488..a8393cb7e75 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -413,30 +413,36 @@ otherwise it's assumed to be an Info file."
>           (default-directory (package-desc-dir pkg-desc))
>           (docs-directory (file-name-directory (expand-file-name file)))
>           (output (expand-file-name (format "%s.info" pkg-name)))
> +         (log-buffer (get-buffer-create (format " *package-vc doc: %s*" pkg-name)))
>           clean-up)
> -    (when (string-match-p "\\.org\\'" file)
> -      (require 'ox)
> -      (require 'ox-texinfo)
> -      (with-temp-buffer
> -        (insert-file-contents file)
> -        (setq file (make-temp-file "ox-texinfo-"))
> -        (let ((default-directory docs-directory))
> -          (org-export-to-file 'texinfo file))
> -        (setq clean-up t)))
> -    (with-current-buffer (get-buffer-create (format " *package-vc doc: %s*" pkg-name))
> -      (erase-buffer)
> -      (cond
> -       ((/= 0 (call-process "makeinfo" nil t nil
> -                            "-I" docs-directory
> -                            "--no-split" file
> -                            "-o" output))
> -        (message "Failed to build manual %s, see buffer %S"
> -                 file (buffer-name)))
> -       ((/= 0 (call-process "install-info" nil t nil
> -                            output (expand-file-name "dir")))
> -        (message "Failed to install manual %s, see buffer %S"
> -                 output (buffer-name)))
> -       ((kill-buffer))))
> +    (with-current-buffer log-buffer
> +      (erase-buffer))
> +    (condition-case err
> +        (progn
> +          (when (string-match-p "\\.org\\'" file)
> +            (require 'ox)
> +            (require 'ox-texinfo)
> +            (with-temp-buffer
> +              (insert-file-contents file)
> +              (setq file (make-temp-file "ox-texinfo-"))
> +              (let ((default-directory docs-directory))
> +                (org-export-to-file 'texinfo file))
> +              (setq clean-up t)))
> +          (cond
> +           ((/= 0 (call-process "makeinfo" nil log-buffer nil
> +                                "-I" docs-directory
> +                                "--no-split" file
> +                                "-o" output))
> +            (message "Failed to build manual %s, see buffer %S"
> +                     file (buffer-name)))
> +           ((/= 0 (call-process "install-info" nil log-buffer nil
> +                                output (expand-file-name "dir")))
> +            (message "Failed to install manual %s, see buffer %S"
> +                     output (buffer-name)))
> +           ((kill-buffer log-buffer))))
> +      (error (with-current-buffer log-buffer
> +               (insert (error-message-string err)))
> +             (message "Failed to export org manual for %s, see buffer %S" pkg-name log-buffer)))

I think it would be better to wrap only the org code in the
`condition-case' body, ideally with a more specific error type (if that
doesn't exist, that is something we could mention to the Org
maintainers).

>      (when clean-up
>        (delete-file file))))





^ permalink raw reply	[relevance 5%]

* bug#65666: Lockfiles break package-vc-install-from-checkout
  2023-09-01 23:43  5%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-02  7:49  0%       ` Eli Zaretskii
  2023-09-02 17:15 10%         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-09-02  7:49 UTC (permalink / raw)
  To: Joseph Turner; +Cc: adam.porter, philipk, 65666

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: Eli Zaretskii <eliz@gnu.org>, 65666@debbugs.gnu.org, adam.porter@47ap.net
> Date: Fri, 01 Sep 2023 16:43:27 -0700
> 
> 
> Philip Kaludercic <philipk@posteo.net> writes:
> 
> > LGTM, but I wonder if there is a better way to detect lockfiles
> > specifically?  If not, I can imagine that just using `file-exists-p'
> > would a too broad check, in the sense that it could make it difficult to
> > find other issues?
> 
> We could use a regex like
> 
> (unless (string-match-p (rx string-start ".#") file))

Or make the REGEXP argument to directory-files-recursively more
specific, to reject lock files.

But yes, the use of file-exists-p is not TRT, IMO.





^ permalink raw reply	[relevance 0%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  2023-08-26  7:32 10%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-02  7:30  0%             ` Eli Zaretskii
      0 siblings, 2 replies; 200+ results
From: Eli Zaretskii @ 2023-09-02  7:30 UTC (permalink / raw)
  To: Joseph Turner, Stefan Monnier; +Cc: jonas, 65414

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: 65414@debbugs.gnu.org, jonas@bernoul.li
> Date: Sat, 26 Aug 2023 00:32:23 -0700
> 
> 
> > In any case, not calling save-some-buffers-functions when PRED is
> > non-nil is not something we can do, as that would be an incompatible
> > behavior change.  We could perhaps add PRED to the arguments with
> > which save-some-buffers-functions are called, as an optional argument.
> > Would that be satisfactory?
> 
> Yes, that would solve the interference between Magit and hyperdrive.el.
> 
> See patch.

Hmm... but how to make this change backward-compatible?  I mean, if
there's some function out there that is used in
save-some-buffers-functions, and it was written to accept only 2
arguments, we cannot safely call it with 3 arguments, can we?

Stefan, do we have any way of doing that without causing errors?

If not, perhaps the way forward is to bind some variable around the
call to these functions, whose value will be PRED?





^ permalink raw reply	[relevance 0%]

* bug#65666: Lockfiles break package-vc-install-from-checkout
  2023-09-01 12:52  0%   ` Philip Kaludercic
@ 2023-09-01 23:43  5%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-02  7:49  0%       ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-01 23:43 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: adam.porter, Eli Zaretskii, 65666


Philip Kaludercic <philipk@posteo.net> writes:

> LGTM, but I wonder if there is a better way to detect lockfiles
> specifically?  If not, I can imagine that just using `file-exists-p'
> would a too broad check, in the sense that it could make it difficult to
> find other issues?

We could use a regex like

(unless (string-match-p (rx string-start ".#") file))






^ permalink raw reply	[relevance 5%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
  2023-09-01 13:14  7%         ` Philip Kaludercic
@ 2023-09-01 23:28  9%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-02 12:03  5%             ` Philip Kaludercic
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-01 23:28 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 65649

[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]


Philip Kaludercic <philipk@posteo.net> writes:

> Yes, as soon as one is sending a message to [bugnumber]@debbugs.gnu.org,
> everything is fine.  The issue if you Cc me directly, is that if I don't
> watch out, I'll send my response to bug-gnu-emacs@gnu.org, and thus
> create a new bug.

Thanks, that's clear now.

> I am not sure we want that behaviour at all actually.  Just because
> there is a typo in the documentation, doesn't mean the package is
> unusable.  The user should be able to install the package, be notified
> about the error -- if the have the time, they can fix it and send the
> maintainer a patch resolving the issue for everyone.  Likewise, if the
> user updates a package, it wouldn't make sense to ignore everything or
> worse still revert the update due to a small mistake in the
> documentation file.
>
> ...
>
> There is no reason why we cannot already create and use the buffer
> earlier, to log org-related bugs.  One has to be careful when emptying
> the buffer, but it might make sense to have a separate buffer for each
> package, especially when updating multiple packages at once...

Please see attached patches.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Include-package-name-in-package-vc-documentation-log.patch --]
[-- Type: text/x-diff, Size: 1031 bytes --]

From aa356f561ab7861f463d3024f574fc71d45cb00b Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Wed, 30 Aug 2023 23:24:16 -0700
Subject: [PATCH 1/2] Include package name in package-vc documentation log
 buffer name

* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
---
 lisp/emacs-lisp/package-vc.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 747fe696204..ea8d9ecf488 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -423,7 +423,7 @@ otherwise it's assumed to be an Info file."
         (let ((default-directory docs-directory))
           (org-export-to-file 'texinfo file))
         (setq clean-up t)))
-    (with-current-buffer (get-buffer-create " *package-vc doc*")
+    (with-current-buffer (get-buffer-create (format " *package-vc doc: %s*" pkg-name))
       (erase-buffer)
       (cond
        ((/= 0 (call-process "makeinfo" nil t nil
-- 
2.41.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Log-org-export-errors-to-package-vc-doc-buffer.patch --]
[-- Type: text/x-diff, Size: 3467 bytes --]

From 010dabfbba8ebeb7f7193482ae2ffc7ec5b694e3 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Fri, 1 Sep 2023 16:22:45 -0700
Subject: [PATCH 2/2] Log org export errors to package-vc doc buffer

* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Wrap the org-export logic in condition-case, allowing package
installation to continue while preserving error messages.
---
 lisp/emacs-lisp/package-vc.el | 52 +++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 23 deletions(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index ea8d9ecf488..a8393cb7e75 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -413,30 +413,36 @@ otherwise it's assumed to be an Info file."
          (default-directory (package-desc-dir pkg-desc))
          (docs-directory (file-name-directory (expand-file-name file)))
          (output (expand-file-name (format "%s.info" pkg-name)))
+         (log-buffer (get-buffer-create (format " *package-vc doc: %s*" pkg-name)))
          clean-up)
-    (when (string-match-p "\\.org\\'" file)
-      (require 'ox)
-      (require 'ox-texinfo)
-      (with-temp-buffer
-        (insert-file-contents file)
-        (setq file (make-temp-file "ox-texinfo-"))
-        (let ((default-directory docs-directory))
-          (org-export-to-file 'texinfo file))
-        (setq clean-up t)))
-    (with-current-buffer (get-buffer-create (format " *package-vc doc: %s*" pkg-name))
-      (erase-buffer)
-      (cond
-       ((/= 0 (call-process "makeinfo" nil t nil
-                            "-I" docs-directory
-                            "--no-split" file
-                            "-o" output))
-        (message "Failed to build manual %s, see buffer %S"
-                 file (buffer-name)))
-       ((/= 0 (call-process "install-info" nil t nil
-                            output (expand-file-name "dir")))
-        (message "Failed to install manual %s, see buffer %S"
-                 output (buffer-name)))
-       ((kill-buffer))))
+    (with-current-buffer log-buffer
+      (erase-buffer))
+    (condition-case err
+        (progn
+          (when (string-match-p "\\.org\\'" file)
+            (require 'ox)
+            (require 'ox-texinfo)
+            (with-temp-buffer
+              (insert-file-contents file)
+              (setq file (make-temp-file "ox-texinfo-"))
+              (let ((default-directory docs-directory))
+                (org-export-to-file 'texinfo file))
+              (setq clean-up t)))
+          (cond
+           ((/= 0 (call-process "makeinfo" nil log-buffer nil
+                                "-I" docs-directory
+                                "--no-split" file
+                                "-o" output))
+            (message "Failed to build manual %s, see buffer %S"
+                     file (buffer-name)))
+           ((/= 0 (call-process "install-info" nil log-buffer nil
+                                output (expand-file-name "dir")))
+            (message "Failed to install manual %s, see buffer %S"
+                     output (buffer-name)))
+           ((kill-buffer log-buffer))))
+      (error (with-current-buffer log-buffer
+               (insert (error-message-string err)))
+             (message "Failed to export org manual for %s, see buffer %S" pkg-name log-buffer)))
     (when clean-up
       (delete-file file))))
 
-- 
2.41.0


^ permalink raw reply related	[relevance 9%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
  2023-08-31 21:19  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-31 21:39 11%         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-01 13:14  7%         ` Philip Kaludercic
  2023-09-01 23:28  9%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 200+ results
From: Philip Kaludercic @ 2023-09-01 13:14 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 65649

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Btw, watch out when reporting a bug, you shouldn't CC people directly,
>> but add a X-Debbugs-CC header
>> (https://debbugs.gnu.org/Reporting.html#xcc), as otherwise I'd be
>> creating a new bug report when responding to your message.
>
> Good to know! Thank you! Is it okay to CC people when responding to a
> bug report email (e.g. if I CC'd Eli in this email)?

Yes, as soon as one is sending a message to [bugnumber]@debbugs.gnu.org,
everything is fine.  The issue if you Cc me directly, is that if I don't
watch out, I'll send my response to bug-gnu-emacs@gnu.org, and thus
create a new bug.

>> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>>
>>> It would be nice to report more information about the package with failed
>>> documentation, but AFAICT with-demoted-errors does not allow its FORMAT
>>> string to be a symbol whose value is a string.
>>
>> What are the main errors we are concerned with?  I am a bit concerned
>> that `with-demoted-errors' is a too coarse approach and might be applied
>> to widely in your current patch.  It might be better to use a classical
>> condition-case and handle the right errors in the right place, or if
>> practicable try to detect if an error would occur before doing anything.
>
> I don't know what kinds of errors to expect, which is why I went with
> the coarse approach.  Under what circumstances would we want to stop
> package installation entirely when documentation can't be built?

I am not sure we want that behaviour at all actually.  Just because
there is a typo in the documentation, doesn't mean the package is
unusable.  The user should be able to install the package, be notified
about the error -- if the have the time, they can fix it and send the
maintainer a patch resolving the issue for everyone.  Likewise, if the
user updates a package, it wouldn't make sense to ignore everything or
worse still revert the update due to a small mistake in the
documentation file.

>> Also, the buffer *package-vc doc* should stay persistent and would
>> include error messages, that could also be used here.
>
> Like this?
>
> (with-demoted-errors "package-vc: Could not build documentation. See *package-vc doc* for details" ... )

Yes, that is what I had in mind.

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> Philip Kaludercic <philipk@posteo.net> writes:
>>
>>> Also, the buffer *package-vc doc* should stay persistent and would
>>> include error messages, that could also be used here.
>>
>> Like this?
>>
>> (with-demoted-errors "package-vc: Could not build documentation. See *package-vc doc* for details" ... )
>
> Actually, that would not have handled the error related to relative org
> #+include statements, since that error happened above this line:
>
> (with-current-buffer (get-buffer-create " *package-vc doc*")

There is no reason why we cannot already create and use the buffer
earlier, to log org-related bugs.  One has to be careful when emptying
the buffer, but it might make sense to have a separate buffer for each
package, especially when updating multiple packages at once...





^ permalink raw reply	[relevance 7%]

* bug#65666: Lockfiles break package-vc-install-from-checkout
  2023-09-01  6:18  5% ` joseph--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-01 12:52  0%   ` Philip Kaludercic
  2023-09-01 23:43  5%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Philip Kaludercic @ 2023-09-01 12:52 UTC (permalink / raw)
  To: joseph; +Cc: adam.porter, Eli Zaretskii, 65666

joseph@breatheoutbreathe.in writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>> We should not try to native-compile lock files, obviously.  Some code
>> naïvely uses "*.el" to find all the Lisp files; it should filter out
>> lock files.
>
> Please see attached patch.
>
>> P.S. Please always say in what version of Emacs you see the problem
>> you report.  Bonus points for including all of the information
>> collected by report-emacs-bug about your system and Emacs
>> configurations.
>
> Thanks - I'm on 29.0.92. I'll include that information next time.
>
> From 7b38b0bfd8c9da08daf734f6d0062d31dd54b947 Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Thu, 31 Aug 2023 23:11:53 -0700
> Subject: [PATCH] Don't native compile lock files
>
> * lisp/emacs-lisp/package.el (package--delete-directory):
> Check that each file exists before compiling.
> ---
>  lisp/emacs-lisp/package.el | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index e1172d69bf0..52a538e0627 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -2485,6 +2485,7 @@ compiled."
>    (when (featurep 'native-compile)
>      (cl-loop
>       for file in (directory-files-recursively dir "\\.el\\'")
> +     when (file-exists-p file)
>       do (comp-clean-up-stale-eln (comp-el-to-eln-filename file))))
>    (if (file-symlink-p (directory-file-name dir))
>        (delete-file (directory-file-name dir))

LGTM, but I wonder if there is a better way to detect lockfiles
specifically?  If not, I can imagine that just using `file-exists-p'
would a too broad check, in the sense that it could make it difficult to
find other issues?





^ permalink raw reply	[relevance 0%]

* bug#65666: Lockfiles break package-vc-install-from-checkout
  2023-08-31 21:47  4% bug#65666: Lockfiles break package-vc-install-from-checkout Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-01  5:50  0% ` Eli Zaretskii
@ 2023-09-01  6:18  5% ` joseph--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-01 12:52  0%   ` Philip Kaludercic
  1 sibling, 1 reply; 200+ results
From: joseph--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-09-01  6:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: adam.porter, philipk, 65666

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:
> We should not try to native-compile lock files, obviously.  Some code
> naïvely uses "*.el" to find all the Lisp files; it should filter out
> lock files.

Please see attached patch.

> P.S. Please always say in what version of Emacs you see the problem
> you report.  Bonus points for including all of the information
> collected by report-emacs-bug about your system and Emacs
> configurations.

Thanks - I'm on 29.0.92. I'll include that information next time.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Don-t-native-compile-lock-files.patch --]
[-- Type: text/x-diff; name="0001-Don-t-native-compile-lock-files.patch", Size: 912 bytes --]

From 7b38b0bfd8c9da08daf734f6d0062d31dd54b947 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Thu, 31 Aug 2023 23:11:53 -0700
Subject: [PATCH] Don't native compile lock files

* lisp/emacs-lisp/package.el (package--delete-directory):
Check that each file exists before compiling.
---
 lisp/emacs-lisp/package.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index e1172d69bf0..52a538e0627 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2485,6 +2485,7 @@ compiled."
   (when (featurep 'native-compile)
     (cl-loop
      for file in (directory-files-recursively dir "\\.el\\'")
+     when (file-exists-p file)
      do (comp-clean-up-stale-eln (comp-el-to-eln-filename file))))
   (if (file-symlink-p (directory-file-name dir))
       (delete-file (directory-file-name dir))
-- 
2.41.0


^ permalink raw reply related	[relevance 5%]

* bug#65666: Lockfiles break package-vc-install-from-checkout
  2023-08-31 21:47  4% bug#65666: Lockfiles break package-vc-install-from-checkout Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-09-01  5:50  0% ` Eli Zaretskii
  2023-09-01  6:18  5% ` joseph--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 200+ results
From: Eli Zaretskii @ 2023-09-01  5:50 UTC (permalink / raw)
  To: Joseph Turner; +Cc: adam.porter, philipk, 65666

> Cc: Philip Kaludercic <philipk@posteo.net>, Adam Porter <adam.porter@47ap.net>
> Date: Thu, 31 Aug 2023 14:47:48 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> To reproduce: clone a repo, ensure that create-lockfiles is non-nil,
> edit a source file in the repo but do not save it, run
> package-vc-install-from-checkout on the repo.
> 
> Backtrace:
> 
> Debugger entered--Lisp error: (file-missing "/home/joseph/.emacs.d/elpa/hyperdrive/.#hyperdrive.el")
>   comp-el-to-eln-filename("/home/joseph/.emacs.d/elpa/hyperdrive/.#hyperdrive.el")

We should not try to native-compile lock files, obviously.  Some code
naïvely uses "*.el" to find all the Lisp files; it should filter out
lock files.

P.S. Please always say in what version of Emacs you see the problem
you report.  Bonus points for including all of the information
collected by report-emacs-bug about your system and Emacs
configurations.





^ permalink raw reply	[relevance 0%]

* bug#65666: Lockfiles break package-vc-install-from-checkout
@ 2023-08-31 21:47  4% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-01  5:50  0% ` Eli Zaretskii
  2023-09-01  6:18  5% ` joseph--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-31 21:47 UTC (permalink / raw)
  To: 65666; +Cc: Philip Kaludercic, Adam Porter

To reproduce: clone a repo, ensure that create-lockfiles is non-nil,
edit a source file in the repo but do not save it, run
package-vc-install-from-checkout on the repo.

Backtrace:

Debugger entered--Lisp error: (file-missing "/home/joseph/.emacs.d/elpa/hyperdrive/.#hyperdrive.el")
  comp-el-to-eln-filename("/home/joseph/.emacs.d/elpa/hyperdrive/.#hyperdrive.el")
  (comp-clean-up-stale-eln (comp-el-to-eln-filename file))
  (while (consp --cl-var--) (setq file (car --cl-var--)) (comp-clean-up-stale-eln (comp-el-to-eln-filename file)) (setq --cl-var-- (cdr --cl-var--)))
  (let* ((--cl-var-- (directory-files-recursively dir "\\.el\\'")) (file nil)) (while (consp --cl-var--) (setq file (car --cl-var--)) (comp-clean-up-stale-eln (comp-el-to-eln-filename file)) (setq --cl-var-- (cdr --cl-var--))) nil)
  (progn (let* ((--cl-var-- (directory-files-recursively dir "\\.el\\'")) (file nil)) (while (consp --cl-var--) (setq file (car --cl-var--)) (comp-clean-up-stale-eln (comp-el-to-eln-filename file)) (setq --cl-var-- (cdr --cl-var--))) nil))
  (if (featurep 'native-compile) (progn (let* ((--cl-var-- (directory-files-recursively dir "\\.el\\'")) (file nil)) (while (consp --cl-var--) (setq file (car --cl-var--)) (comp-clean-up-stale-eln (comp-el-to-eln-filename file)) (setq --cl-var-- (cdr --cl-var--))) nil)))
  package--delete-directory("/home/joseph/.emacs.d/elpa/hyperdrive")
  package-vc-install-from-checkout("~/.local/src/hyperdrive.el/" "hyperdrive")
  funcall-interactively(package-vc-install-from-checkout "~/.local/src/hyperdrive.el/" "hyperdrive")
  command-execute(package-vc-install-from-checkout record)
  execute-extended-command(nil "package-vc-install-from-checkout" nil)
  funcall-interactively(execute-extended-command nil "package-vc-install-from-checkout" nil)
  command-execute(execute-extended-command)





^ permalink raw reply	[relevance 4%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
  2023-08-31 21:19  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-31 21:39 11%         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-01 13:14  7%         ` Philip Kaludercic
  1 sibling, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-31 21:39 UTC (permalink / raw)
  To: Philip Kaludercic, 65649


Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Also, the buffer *package-vc doc* should stay persistent and would
>> include error messages, that could also be used here.
>
> Like this?
>
> (with-demoted-errors "package-vc: Could not build documentation. See *package-vc doc* for details" ... )

Actually, that would not have handled the error related to relative org
#+include statements, since that error happened above this line:

(with-current-buffer (get-buffer-create " *package-vc doc*")





^ permalink raw reply	[relevance 11%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
  2023-08-31  7:18  5%     ` Philip Kaludercic
@ 2023-08-31 21:19  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-31 21:39 11%         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-01 13:14  7%         ` Philip Kaludercic
  0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-31 21:19 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 65649


Philip Kaludercic <philipk@posteo.net> writes:

> Btw, watch out when reporting a bug, you shouldn't CC people directly,
> but add a X-Debbugs-CC header
> (https://debbugs.gnu.org/Reporting.html#xcc), as otherwise I'd be
> creating a new bug report when responding to your message.

Good to know! Thank you! Is it okay to CC people when responding to a
bug report email (e.g. if I CC'd Eli in this email)?

> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> It would be nice to report more information about the package with failed
>> documentation, but AFAICT with-demoted-errors does not allow its FORMAT
>> string to be a symbol whose value is a string.
>
> What are the main errors we are concerned with?  I am a bit concerned
> that `with-demoted-errors' is a too coarse approach and might be applied
> to widely in your current patch.  It might be better to use a classical
> condition-case and handle the right errors in the right place, or if
> practicable try to detect if an error would occur before doing anything.

I don't know what kinds of errors to expect, which is why I went with
the coarse approach.  Under what circumstances would we want to stop
package installation entirely when documentation can't be built?

> Also, the buffer *package-vc doc* should stay persistent and would
> include error messages, that could also be used here.

Like this?

(with-demoted-errors "package-vc: Could not build documentation. See *package-vc doc* for details" ... )





^ permalink raw reply	[relevance 5%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
  2023-08-31  6:34 11%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-31  7:18  5%     ` Philip Kaludercic
  2023-08-31 21:19  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Philip Kaludercic @ 2023-08-31  7:18 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 65649

Btw, watch out when reporting a bug, you shouldn't CC people directly,
but add a X-Debbugs-CC header
(https://debbugs.gnu.org/Reporting.html#xcc), as otherwise I'd be
creating a new bug report when responding to your message.

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> It would be nice to report more information about the package with failed
> documentation, but AFAICT with-demoted-errors does not allow its FORMAT
> string to be a symbol whose value is a string.

What are the main errors we are concerned with?  I am a bit concerned
that `with-demoted-errors' is a too coarse approach and might be applied
to widely in your current patch.  It might be better to use a classical
condition-case and handle the right errors in the right place, or if
practicable try to detect if an error would occur before doing anything.

Also, the buffer *package-vc doc* should stay persistent and would
include error messages, that could also be used here.

> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> Oops, the format string should be %S, not %s.
>>
>> [2. text/x-diff; 0001-Continue-installing-package-when-documentation-build.patch]
>> From 83c62d80b5199cee911e30c1f3bb03c5a585b689 Mon Sep 17 00:00:00 2001
>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Date: Wed, 30 Aug 2023 23:24:16 -0700
>> Subject: [PATCH] Continue installing package when documentation building fails
>>
>> * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
>> Demote errors to messages.
>> ---
>>  lisp/emacs-lisp/package-vc.el | 61 ++++++++++++++++++-----------------
>>  1 file changed, 31 insertions(+), 30 deletions(-)
>>
>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
>> index 747fe696204..bc1200c583f 100644
>> --- a/lisp/emacs-lisp/package-vc.el
>> +++ b/lisp/emacs-lisp/package-vc.el
>> @@ -409,36 +409,37 @@ prepared."
>>    "Build documentation for package PKG-DESC from documentation source in FILE.
>>  FILE can be an Org file, indicated by its \".org\" extension,
>>  otherwise it's assumed to be an Info file."
>> -  (let* ((pkg-name (package-desc-name pkg-desc))
>> -         (default-directory (package-desc-dir pkg-desc))
>> -         (docs-directory (file-name-directory (expand-file-name file)))
>> -         (output (expand-file-name (format "%s.info" pkg-name)))
>> -         clean-up)
>> -    (when (string-match-p "\\.org\\'" file)
>> -      (require 'ox)
>> -      (require 'ox-texinfo)
>> -      (with-temp-buffer
>> -        (insert-file-contents file)
>> -        (setq file (make-temp-file "ox-texinfo-"))
>> -        (let ((default-directory docs-directory))
>> -          (org-export-to-file 'texinfo file))
>> -        (setq clean-up t)))
>> -    (with-current-buffer (get-buffer-create " *package-vc doc*")
>> -      (erase-buffer)
>> -      (cond
>> -       ((/= 0 (call-process "makeinfo" nil t nil
>> -                            "-I" docs-directory
>> -                            "--no-split" file
>> -                            "-o" output))
>> -        (message "Failed to build manual %s, see buffer %S"
>> -                 file (buffer-name)))
>> -       ((/= 0 (call-process "install-info" nil t nil
>> -                            output (expand-file-name "dir")))
>> -        (message "Failed to install manual %s, see buffer %S"
>> -                 output (buffer-name)))
>> -       ((kill-buffer))))
>> -    (when clean-up
>> -      (delete-file file))))
>> +  (with-demoted-errors "package-vc: Could not build documentation: %S"
>> +    (let* ((pkg-name (package-desc-name pkg-desc))
>> +           (default-directory (package-desc-dir pkg-desc))
>> +           (docs-directory (file-name-directory (expand-file-name file)))
>> +           (output (expand-file-name (format "%s.info" pkg-name)))
>> +           clean-up)
>> +      (when (string-match-p "\\.org\\'" file)
>> +        (require 'ox)
>> +        (require 'ox-texinfo)
>> +        (with-temp-buffer
>> +          (insert-file-contents file)
>> +          (setq file (make-temp-file "ox-texinfo-"))
>> +          (let ((default-directory docs-directory))
>> +            (org-export-to-file 'texinfo file))
>> +          (setq clean-up t)))
>> +      (with-current-buffer (get-buffer-create " *package-vc doc*")
>> +        (erase-buffer)
>> +        (cond
>> +         ((/= 0 (call-process "makeinfo" nil t nil
>> +                              "-I" docs-directory
>> +                              "--no-split" file
>> +                              "-o" output))
>> +          (message "Failed to build manual %s, see buffer %S"
>> +                   file (buffer-name)))
>> +         ((/= 0 (call-process "install-info" nil t nil
>> +                              output (expand-file-name "dir")))
>> +          (message "Failed to install manual %s, see buffer %S"
>> +                   output (buffer-name)))
>> +         ((kill-buffer))))
>> +      (when clean-up
>> +        (delete-file file)))))
>>
>>  (defun package-vc-install-dependencies (deps)
>>    "Install missing dependencies according to DEPS.





^ permalink raw reply	[relevance 5%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
  2023-08-31  6:26  9% bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-31  6:32  9% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-31  6:50  0% ` Eli Zaretskii
  1 sibling, 0 replies; 200+ results
From: Eli Zaretskii @ 2023-08-31  6:50 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 65649, philipk

> Cc: Philip Kaludercic <philipk@posteo.net>
> Date: Wed, 30 Aug 2023 23:26:35 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> In light of the recent fix regarding building documentation from
> org-mode files, I think it makes sense to ensure that installation
> continues even without documentation.

I don't think we should do this silently.  The user should be asked
to confirm, at the very least.





^ permalink raw reply	[relevance 0%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
  2023-08-31  6:32  9% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-31  6:34 11%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-31  7:18  5%     ` Philip Kaludercic
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-31  6:34 UTC (permalink / raw)
  To: 65649, philipk

It would be nice to report more information about the package with failed
documentation, but AFAICT with-demoted-errors does not allow its FORMAT
string to be a symbol whose value is a string.

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Oops, the format string should be %S, not %s.
>
> [2. text/x-diff; 0001-Continue-installing-package-when-documentation-build.patch]
> From 83c62d80b5199cee911e30c1f3bb03c5a585b689 Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Wed, 30 Aug 2023 23:24:16 -0700
> Subject: [PATCH] Continue installing package when documentation building fails
>
> * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
> Demote errors to messages.
> ---
>  lisp/emacs-lisp/package-vc.el | 61 ++++++++++++++++++-----------------
>  1 file changed, 31 insertions(+), 30 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index 747fe696204..bc1200c583f 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -409,36 +409,37 @@ prepared."
>    "Build documentation for package PKG-DESC from documentation source in FILE.
>  FILE can be an Org file, indicated by its \".org\" extension,
>  otherwise it's assumed to be an Info file."
> -  (let* ((pkg-name (package-desc-name pkg-desc))
> -         (default-directory (package-desc-dir pkg-desc))
> -         (docs-directory (file-name-directory (expand-file-name file)))
> -         (output (expand-file-name (format "%s.info" pkg-name)))
> -         clean-up)
> -    (when (string-match-p "\\.org\\'" file)
> -      (require 'ox)
> -      (require 'ox-texinfo)
> -      (with-temp-buffer
> -        (insert-file-contents file)
> -        (setq file (make-temp-file "ox-texinfo-"))
> -        (let ((default-directory docs-directory))
> -          (org-export-to-file 'texinfo file))
> -        (setq clean-up t)))
> -    (with-current-buffer (get-buffer-create " *package-vc doc*")
> -      (erase-buffer)
> -      (cond
> -       ((/= 0 (call-process "makeinfo" nil t nil
> -                            "-I" docs-directory
> -                            "--no-split" file
> -                            "-o" output))
> -        (message "Failed to build manual %s, see buffer %S"
> -                 file (buffer-name)))
> -       ((/= 0 (call-process "install-info" nil t nil
> -                            output (expand-file-name "dir")))
> -        (message "Failed to install manual %s, see buffer %S"
> -                 output (buffer-name)))
> -       ((kill-buffer))))
> -    (when clean-up
> -      (delete-file file))))
> +  (with-demoted-errors "package-vc: Could not build documentation: %S"
> +    (let* ((pkg-name (package-desc-name pkg-desc))
> +           (default-directory (package-desc-dir pkg-desc))
> +           (docs-directory (file-name-directory (expand-file-name file)))
> +           (output (expand-file-name (format "%s.info" pkg-name)))
> +           clean-up)
> +      (when (string-match-p "\\.org\\'" file)
> +        (require 'ox)
> +        (require 'ox-texinfo)
> +        (with-temp-buffer
> +          (insert-file-contents file)
> +          (setq file (make-temp-file "ox-texinfo-"))
> +          (let ((default-directory docs-directory))
> +            (org-export-to-file 'texinfo file))
> +          (setq clean-up t)))
> +      (with-current-buffer (get-buffer-create " *package-vc doc*")
> +        (erase-buffer)
> +        (cond
> +         ((/= 0 (call-process "makeinfo" nil t nil
> +                              "-I" docs-directory
> +                              "--no-split" file
> +                              "-o" output))
> +          (message "Failed to build manual %s, see buffer %S"
> +                   file (buffer-name)))
> +         ((/= 0 (call-process "install-info" nil t nil
> +                              output (expand-file-name "dir")))
> +          (message "Failed to install manual %s, see buffer %S"
> +                   output (buffer-name)))
> +         ((kill-buffer))))
> +      (when clean-up
> +        (delete-file file)))))
>
>  (defun package-vc-install-dependencies (deps)
>    "Install missing dependencies according to DEPS.






^ permalink raw reply	[relevance 11%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
  2023-08-31  6:26  9% bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-31  6:32  9% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-31  6:34 11%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-31  6:50  0% ` Eli Zaretskii
  1 sibling, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-31  6:32 UTC (permalink / raw)
  To: 65649, philipk

[-- Attachment #1: Type: text/plain, Size: 46 bytes --]

Oops, the format string should be %S, not %s.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Continue-installing-package-when-documentation-build.patch --]
[-- Type: text/x-diff, Size: 3691 bytes --]

From 83c62d80b5199cee911e30c1f3bb03c5a585b689 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Wed, 30 Aug 2023 23:24:16 -0700
Subject: [PATCH] Continue installing package when documentation building fails

* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Demote errors to messages.
---
 lisp/emacs-lisp/package-vc.el | 61 ++++++++++++++++++-----------------
 1 file changed, 31 insertions(+), 30 deletions(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 747fe696204..bc1200c583f 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -409,36 +409,37 @@ prepared."
   "Build documentation for package PKG-DESC from documentation source in FILE.
 FILE can be an Org file, indicated by its \".org\" extension,
 otherwise it's assumed to be an Info file."
-  (let* ((pkg-name (package-desc-name pkg-desc))
-         (default-directory (package-desc-dir pkg-desc))
-         (docs-directory (file-name-directory (expand-file-name file)))
-         (output (expand-file-name (format "%s.info" pkg-name)))
-         clean-up)
-    (when (string-match-p "\\.org\\'" file)
-      (require 'ox)
-      (require 'ox-texinfo)
-      (with-temp-buffer
-        (insert-file-contents file)
-        (setq file (make-temp-file "ox-texinfo-"))
-        (let ((default-directory docs-directory))
-          (org-export-to-file 'texinfo file))
-        (setq clean-up t)))
-    (with-current-buffer (get-buffer-create " *package-vc doc*")
-      (erase-buffer)
-      (cond
-       ((/= 0 (call-process "makeinfo" nil t nil
-                            "-I" docs-directory
-                            "--no-split" file
-                            "-o" output))
-        (message "Failed to build manual %s, see buffer %S"
-                 file (buffer-name)))
-       ((/= 0 (call-process "install-info" nil t nil
-                            output (expand-file-name "dir")))
-        (message "Failed to install manual %s, see buffer %S"
-                 output (buffer-name)))
-       ((kill-buffer))))
-    (when clean-up
-      (delete-file file))))
+  (with-demoted-errors "package-vc: Could not build documentation: %S"
+    (let* ((pkg-name (package-desc-name pkg-desc))
+           (default-directory (package-desc-dir pkg-desc))
+           (docs-directory (file-name-directory (expand-file-name file)))
+           (output (expand-file-name (format "%s.info" pkg-name)))
+           clean-up)
+      (when (string-match-p "\\.org\\'" file)
+        (require 'ox)
+        (require 'ox-texinfo)
+        (with-temp-buffer
+          (insert-file-contents file)
+          (setq file (make-temp-file "ox-texinfo-"))
+          (let ((default-directory docs-directory))
+            (org-export-to-file 'texinfo file))
+          (setq clean-up t)))
+      (with-current-buffer (get-buffer-create " *package-vc doc*")
+        (erase-buffer)
+        (cond
+         ((/= 0 (call-process "makeinfo" nil t nil
+                              "-I" docs-directory
+                              "--no-split" file
+                              "-o" output))
+          (message "Failed to build manual %s, see buffer %S"
+                   file (buffer-name)))
+         ((/= 0 (call-process "install-info" nil t nil
+                              output (expand-file-name "dir")))
+          (message "Failed to install manual %s, see buffer %S"
+                   output (buffer-name)))
+         ((kill-buffer))))
+      (when clean-up
+        (delete-file file)))))
 
 (defun package-vc-install-dependencies (deps)
   "Install missing dependencies according to DEPS.
-- 
2.41.0


^ permalink raw reply related	[relevance 9%]

* bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails
@ 2023-08-31  6:26  9% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-31  6:32  9% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-31  6:50  0% ` Eli Zaretskii
  0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-31  6:26 UTC (permalink / raw)
  To: 65649; +Cc: Philip Kaludercic

[-- Attachment #1: Type: text/plain, Size: 180 bytes --]

In light of the recent fix regarding building documentation from
org-mode files, I think it makes sense to ensure that installation
continues even without documentation.

Joseph



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Continue-installing-package-when-documentation-build.patch --]
[-- Type: text/x-diff, Size: 3691 bytes --]

From 83c62d80b5199cee911e30c1f3bb03c5a585b689 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Wed, 30 Aug 2023 23:24:16 -0700
Subject: [PATCH] Continue installing package when documentation building fails

* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Demote errors to messages.
---
 lisp/emacs-lisp/package-vc.el | 61 ++++++++++++++++++-----------------
 1 file changed, 31 insertions(+), 30 deletions(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 747fe696204..bc1200c583f 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -409,36 +409,37 @@ prepared."
   "Build documentation for package PKG-DESC from documentation source in FILE.
 FILE can be an Org file, indicated by its \".org\" extension,
 otherwise it's assumed to be an Info file."
-  (let* ((pkg-name (package-desc-name pkg-desc))
-         (default-directory (package-desc-dir pkg-desc))
-         (docs-directory (file-name-directory (expand-file-name file)))
-         (output (expand-file-name (format "%s.info" pkg-name)))
-         clean-up)
-    (when (string-match-p "\\.org\\'" file)
-      (require 'ox)
-      (require 'ox-texinfo)
-      (with-temp-buffer
-        (insert-file-contents file)
-        (setq file (make-temp-file "ox-texinfo-"))
-        (let ((default-directory docs-directory))
-          (org-export-to-file 'texinfo file))
-        (setq clean-up t)))
-    (with-current-buffer (get-buffer-create " *package-vc doc*")
-      (erase-buffer)
-      (cond
-       ((/= 0 (call-process "makeinfo" nil t nil
-                            "-I" docs-directory
-                            "--no-split" file
-                            "-o" output))
-        (message "Failed to build manual %s, see buffer %S"
-                 file (buffer-name)))
-       ((/= 0 (call-process "install-info" nil t nil
-                            output (expand-file-name "dir")))
-        (message "Failed to install manual %s, see buffer %S"
-                 output (buffer-name)))
-       ((kill-buffer))))
-    (when clean-up
-      (delete-file file))))
+  (with-demoted-errors "package-vc: Could not build documentation: %s"
+    (let* ((pkg-name (package-desc-name pkg-desc))
+           (default-directory (package-desc-dir pkg-desc))
+           (docs-directory (file-name-directory (expand-file-name file)))
+           (output (expand-file-name (format "%s.info" pkg-name)))
+           clean-up)
+      (when (string-match-p "\\.org\\'" file)
+        (require 'ox)
+        (require 'ox-texinfo)
+        (with-temp-buffer
+          (insert-file-contents file)
+          (setq file (make-temp-file "ox-texinfo-"))
+          (let ((default-directory docs-directory))
+            (org-export-to-file 'texinfo file))
+          (setq clean-up t)))
+      (with-current-buffer (get-buffer-create " *package-vc doc*")
+        (erase-buffer)
+        (cond
+         ((/= 0 (call-process "makeinfo" nil t nil
+                              "-I" docs-directory
+                              "--no-split" file
+                              "-o" output))
+          (message "Failed to build manual %s, see buffer %S"
+                   file (buffer-name)))
+         ((/= 0 (call-process "install-info" nil t nil
+                              output (expand-file-name "dir")))
+          (message "Failed to install manual %s, see buffer %S"
+                   output (buffer-name)))
+         ((kill-buffer))))
+      (when clean-up
+        (delete-file file)))))
 
 (defun package-vc-install-dependencies (deps)
   "Install missing dependencies according to DEPS.
-- 
2.41.0


^ permalink raw reply related	[relevance 9%]

* bug#65608: Fwd: [PATCH] project.el: Use list of strings p for safe local variable
  2023-08-30 11:22  5%   ` Dmitry Gutov
@ 2023-08-30 17:54  0%     ` Stefan Kangas
  0 siblings, 0 replies; 200+ results
From: Stefan Kangas @ 2023-08-30 17:54 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: 65608-done, Joseph Turner

Version: 30.1

Dmitry Gutov <dmitry@gutov.dev> writes:

> On 30/08/2023 10:10, Joseph Turner via Bug reports for GNU Emacs, the
> Swiss army knife of text editors wrote:
> > Stefan Kangas suggested I resend this patch to this mailing list so that
> > it's not lost even though it can't be applied yet.
>
> Just to clarify for posterity: it can't be applied yet because
> list-of-string-p is not in Emacs 26. Or 27 (which we might bump the
> requirement to in not-too-distant future).

Right.  Note that `list-of-strings-p' was added in Emacs 28, though.
So I added a comment to that effect in commit 9647ddb2993, and I'm
closing the bug.





^ permalink raw reply	[relevance 0%]

* bug#65608: Fwd: [PATCH] project.el: Use list of strings p for safe local variable
  2023-08-30  7:10 11% ` bug#65608: Fwd: [PATCH] project.el: Use list of strings p for safe local variable Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-30 11:22  5%   ` Dmitry Gutov
  2023-08-30 17:54  0%     ` Stefan Kangas
  0 siblings, 1 reply; 200+ results
From: Dmitry Gutov @ 2023-08-30 11:22 UTC (permalink / raw)
  To: Joseph Turner, 65608; +Cc: stefankangas

On 30/08/2023 10:10, Joseph Turner via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Stefan Kangas suggested I resend this patch to this mailing list so that
> it's not lost even though it can't be applied yet.

Just to clarify for posterity: it can't be applied yet because 
list-of-string-p is not in Emacs 26. Or 27 (which we might bump the 
requirement to in not-too-distant future).





^ permalink raw reply	[relevance 5%]

* bug#65608: Fwd: [PATCH] project.el: Use list of strings p for safe local variable
       [not found]     <87r0nqct63.fsf@breatheoutbreathe.in>
@ 2023-08-30  7:10 11% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-30 11:22  5%   ` Dmitry Gutov
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-30  7:10 UTC (permalink / raw)
  To: 65608; +Cc: dmitry, stefankangas

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

Stefan Kangas suggested I resend this patch to this mailing list so that
it's not lost even though it can't be applied yet.

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Might make sense to merge this into 29.2?
>
> [2. text/x-diff; 0001-project.el-Use-list-of-strings-p-for-safe-local-vari.patch]...


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-project.el-Use-list-of-strings-p-for-safe-local-vari.patch --]
[-- Type: text/x-diff, Size: 1587 bytes --]

From 8237eb21c81b3e5ededd42a3a2d5b9770d45ca92 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Fri, 25 Aug 2023 21:31:06 -0700
Subject: [PATCH] project.el: Use list-of-strings-p for safe-local-variable
 predicate

* lisp/progmodes/project.el (project-vc-ignores)
(project-vc-extra-root-markers)
---
 lisp/progmodes/project.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 8d8bf594628..882173a65d0 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -397,7 +397,7 @@ the buffer's value of `default-directory'."
 (defcustom project-vc-ignores nil
   "List of patterns to add to `project-ignores'."
   :type '(repeat string))
-;;;###autoload(put 'project-vc-ignores 'safe-local-variable #'listp)
+;;;###autoload(put 'project-vc-ignores 'safe-local-variable #'list-of-strings-p)
 
 (defcustom project-vc-merge-submodules t
   "Non-nil to consider submodules part of the parent project.
@@ -452,7 +452,7 @@ variables, such as `project-vc-ignores' or `project-vc-name'."
   :type '(repeat string)
   :version "29.1"
   :package-version '(project . "0.9.0"))
-;;;###autoload(put 'project-vc-extra-root-markers 'safe-local-variable (lambda (val) (and (listp val) (not (memq nil (mapcar #'stringp val))))))
+;;;###autoload(put 'project-vc-extra-root-markers 'safe-local-variable #'list-of-strings-p)
 
 ;; FIXME: Using the current approach, major modes are supposed to set
 ;; this variable to a buffer-local value.  So we don't have access to
-- 
2.41.0


^ permalink raw reply related	[relevance 11%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  2023-08-26  7:26  0%         ` Eli Zaretskii
@ 2023-08-26  7:32 10%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-09-02  7:30  0%             ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-26  7:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: jonas, 65414

[-- Attachment #1: Type: text/plain, Size: 940 bytes --]


Eli Zaretskii <eliz@gnu.org> writes:
> So your problem is with Lisp programs that add functions to
> save-some-buffers-functions, but don't expect or don't want those
> functions to be called each time save-some-buffers is invoked?

Yes.

> I'm not sure how did those Lisp programs get the idea that
> save-some-buffers-functions will not be called always -- is it hinted
> by some documentation somewhere?  If not, I'd say that those Lisp
> programs have a bug that needs to be fixed in those programs.  Right?

I agree.

> In any case, not calling save-some-buffers-functions when PRED is
> non-nil is not something we can do, as that would be an incompatible
> behavior change.  We could perhaps add PRED to the arguments with
> which save-some-buffers-functions are called, as an optional argument.
> Would that be satisfactory?

Yes, that would solve the interference between Magit and hyperdrive.el.

See patch.

Thank you!

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Pass-PRED-to-each-of-save-some-buffers-functions.patch --]
[-- Type: text/x-diff, Size: 2175 bytes --]

From 28e8745b579da5f83afc7f9eb5b5ed2df2f3204e Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sat, 26 Aug 2023 00:50:28 -0700
Subject: [PATCH] Pass PRED to each of save-some-buffers-functions

* lisp/abbrev.el (abbrev--possibly-save): Ignore PRED
* lisp/files.el (save-some-buffers-functions): Fix documentation
(save-some-buffers): Pass PRED to each of save-some-buffers-functions
---
 lisp/abbrev.el | 2 +-
 lisp/files.el  | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index e1311dbc83b..43e7c7e5e5d 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -1242,7 +1242,7 @@ which see."
               '(edit-abbrevs-mode-font-lock-keywords nil nil ((?_ . "w"))))
   (setq font-lock-multiline nil))
 
-(defun abbrev--possibly-save (query &optional arg)
+(defun abbrev--possibly-save (query &optional arg _pred)
   ;; Query mode.
   (if (eq query 'query)
       (and save-abbrevs abbrevs-changed)
diff --git a/lisp/files.el b/lisp/files.el
index 29d109ab385..6ab10cc3310 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -6003,8 +6003,8 @@ function should return non-nil if there is something to be
 saved (but it should not actually save anything).
 
 If the first argument is something else, then the function should
-save according to the value of the second argument, which is the
-ARG argument from `save-some-buffers'.")
+save according to the values of the second and third arguments,
+which are the ARG and PRED arguments from `save-some-buffers'.")
 
 (defun save-some-buffers (&optional arg pred)
   "Save some modified file-visiting buffers.  Asks user about each one.
@@ -6099,7 +6099,7 @@ after saving the buffers."
 	         save-some-buffers-action-alist))
           ;; Allow other things to be saved at this time, like abbrevs.
           (dolist (func save-some-buffers-functions)
-            (setq inhibit-message (or (funcall func nil arg) inhibit-message)))
+            (setq inhibit-message (or (funcall func nil arg pred) inhibit-message)))
           (or queried (> files-done 0) inhibit-message
 	      (cond
 	       ((null autosaved-buffers)
-- 
2.41.0


^ permalink raw reply related	[relevance 10%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  2023-08-26  6:38  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-26  7:26  0%         ` Eli Zaretskii
  2023-08-26  7:32 10%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-08-26  7:26 UTC (permalink / raw)
  To: Joseph Turner; +Cc: jonas, 65414

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: 65414@debbugs.gnu.org, jonas@bernoul.li
> Date: Fri, 25 Aug 2023 23:38:18 -0700
> 
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Why is it undesirable?  save-some-buffers always saved abbrevs, didn't
> > it?  And it did so independently of PRED, right?  So how did this
> > problem suddenly started affecting Magit?
> >
> > IOW, I still don't have a clear idea what caused this problem, if
> > (AFAIU) it is a problem that started happening recently.
> 
> This problem is not new. However, now that save-some-buffers-functions
> has been added, the problem goes beyond abbrevs.
> 
> >> Another example: hyperdrive.el adds to save-some-buffers-functions for
> >> saving hyperdrive file buffers:
> >>
> >> https://git.sr.ht/~ushin/hyperdrive.el/tree/d7dc7a08ba47761108cf98e21ffa2d8dad28f34a/item/hyperdrive.el#L99
> >>
> >> After this change, magit-save-repository-buffers now prompts to save
> >> irrelevant hyperdrive file buffers. I would like some way to tell
> >> hyperdrive--save-some-buffers not to prompt the user to save hyperdrive
> >> buffers from inside magit-save-repository-buffers.
> >
> > Why do you want to do that?  Whether or not to prompt the user abides
> > by the common protocol defined by save-some-buffers: if it's called
> > with the argument ARG non-nil (which should happen interactively when
> > the user invokes the command with a prefix argument), there's no
> > prompt, otherwise Emacs prompts.  Why magit-save-repository-buffers
> > wants to break this common protocol?
> 
> I think magit-save-repository-buffers follows the common protocol
> correctly.
> 
> > I feel that I'm still missing something important, which causes you to
> > want a different behavior from magit-save-repository-buffers.  For
> > starters, can you describe how magit-save-repository-buffers ends up
> > calling save-some-buffers-functions in enough detail for me to
> > understand why you think saving these buffers is deemed "undesirable"?
> 
> The issue is not that save-some-buffers prompts instead of saving
> without questions.
> 
> What is undesirable to me is that save-some-buffers unconditionally
> calls each one of save-some-buffers-functions, regardless of PRED. This
> means that when save-some-buffers is used with the intention to save
> only a handful of files (as with magit-save-repository-buffers),
> save-some-buffers-functions are all called, even when irrelevant.

So your problem is with Lisp programs that add functions to
save-some-buffers-functions, but don't expect or don't want those
functions to be called each time save-some-buffers is invoked?

I'm not sure how did those Lisp programs get the idea that
save-some-buffers-functions will not be called always -- is it hinted
by some documentation somewhere?  If not, I'd say that those Lisp
programs have a bug that needs to be fixed in those programs.  Right?

In any case, not calling save-some-buffers-functions when PRED is
non-nil is not something we can do, as that would be an incompatible
behavior change.  We could perhaps add PRED to the arguments with
which save-some-buffers-functions are called, as an optional argument.
Would that be satisfactory?





^ permalink raw reply	[relevance 0%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  2023-08-24  5:16  0%     ` Eli Zaretskii
@ 2023-08-26  6:38  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-26  7:26  0%         ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-26  6:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: jonas, 65414


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: 65414@debbugs.gnu.org, jonas@bernoul.li
>> Date: Wed, 23 Aug 2023 16:57:06 -0700
>>
>> magit-save-repository-buffers docstring reads "Save file-visiting
>> buffers belonging to the current repository." IIUC, prompting to save
>> abbrevs here is an undesirable implementation side-effect.
>
> Why is it undesirable?  save-some-buffers always saved abbrevs, didn't
> it?  And it did so independently of PRED, right?  So how did this
> problem suddenly started affecting Magit?
>
> IOW, I still don't have a clear idea what caused this problem, if
> (AFAIU) it is a problem that started happening recently.

This problem is not new. However, now that save-some-buffers-functions
has been added, the problem goes beyond abbrevs.

>> Another example: hyperdrive.el adds to save-some-buffers-functions for
>> saving hyperdrive file buffers:
>>
>> https://git.sr.ht/~ushin/hyperdrive.el/tree/d7dc7a08ba47761108cf98e21ffa2d8dad28f34a/item/hyperdrive.el#L99
>>
>> After this change, magit-save-repository-buffers now prompts to save
>> irrelevant hyperdrive file buffers. I would like some way to tell
>> hyperdrive--save-some-buffers not to prompt the user to save hyperdrive
>> buffers from inside magit-save-repository-buffers.
>
> Why do you want to do that?  Whether or not to prompt the user abides
> by the common protocol defined by save-some-buffers: if it's called
> with the argument ARG non-nil (which should happen interactively when
> the user invokes the command with a prefix argument), there's no
> prompt, otherwise Emacs prompts.  Why magit-save-repository-buffers
> wants to break this common protocol?

I think magit-save-repository-buffers follows the common protocol
correctly.

> I feel that I'm still missing something important, which causes you to
> want a different behavior from magit-save-repository-buffers.  For
> starters, can you describe how magit-save-repository-buffers ends up
> calling save-some-buffers-functions in enough detail for me to
> understand why you think saving these buffers is deemed "undesirable"?

The issue is not that save-some-buffers prompts instead of saving
without questions.

What is undesirable to me is that save-some-buffers unconditionally
calls each one of save-some-buffers-functions, regardless of PRED. This
means that when save-some-buffers is used with the intention to save
only a handful of files (as with magit-save-repository-buffers),
save-some-buffers-functions are all called, even when irrelevant.

Thanks again for your patience :)

Joseph





^ permalink raw reply	[relevance 5%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  2023-08-23 23:57  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-24  5:16  0%     ` Eli Zaretskii
  2023-08-26  6:38  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-08-24  5:16 UTC (permalink / raw)
  To: Joseph Turner; +Cc: jonas, 65414

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: 65414@debbugs.gnu.org, jonas@bernoul.li
> Date: Wed, 23 Aug 2023 16:57:06 -0700
> 
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Why is asking whether to save the abbrevs a problem in the case of
> > magit-save-repository-buffers?
> 
> magit-save-repository-buffers docstring reads "Save file-visiting
> buffers belonging to the current repository." IIUC, prompting to save
> abbrevs here is an undesirable implementation side-effect.

Why is it undesirable?  save-some-buffers always saved abbrevs, didn't
it?  And it did so independently of PRED, right?  So how did this
problem suddenly started affecting Magit?

IOW, I still don't have a clear idea what caused this problem, if
(AFAIU) it is a problem that started happening recently.

> Another example: hyperdrive.el adds to save-some-buffers-functions for
> saving hyperdrive file buffers:
> 
> https://git.sr.ht/~ushin/hyperdrive.el/tree/d7dc7a08ba47761108cf98e21ffa2d8dad28f34a/item/hyperdrive.el#L99
> 
> After this change, magit-save-repository-buffers now prompts to save
> irrelevant hyperdrive file buffers. I would like some way to tell
> hyperdrive--save-some-buffers not to prompt the user to save hyperdrive
> buffers from inside magit-save-repository-buffers.

Why do you want to do that?  Whether or not to prompt the user abides
by the common protocol defined by save-some-buffers: if it's called
with the argument ARG non-nil (which should happen interactively when
the user invokes the command with a prefix argument), there's no
prompt, otherwise Emacs prompts.  Why magit-save-repository-buffers
wants to break this common protocol?

I feel that I'm still missing something important, which causes you to
want a different behavior from magit-save-repository-buffers.  For
starters, can you describe how magit-save-repository-buffers ends up
calling save-some-buffers-functions in enough detail for me to
understand why you think saving these buffers is deemed "undesirable"?

> > And are you saying that before the change which added
> > save-some-buffers-functions, Emacs was not saving the abbrevs when
> > save-some-buffers was called?  If so, in what Emacs version was this
> > so?
> 
> The behavior of saving abbrevs when a PRED function is passed to
> save-some-buffers has not changed in Emacs 29. I just think that there
> may be room for improvement now that save-some-buffers-functions allows
> any package to add to save-some-buffers-functions.

We could try thinking about some backward-compatible change to the
save-some-buffers-functions feature, but a better understanding of the
issue is still needed.

Thanks.





^ permalink raw reply	[relevance 0%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  2023-08-21 11:56  0% ` Eli Zaretskii
@ 2023-08-23 23:57  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-24  5:16  0%     ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-23 23:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: jonas, 65414


Eli Zaretskii <eliz@gnu.org> writes:

> Why is asking whether to save the abbrevs a problem in the case of
> magit-save-repository-buffers?

magit-save-repository-buffers docstring reads "Save file-visiting
buffers belonging to the current repository." IIUC, prompting to save
abbrevs here is an undesirable implementation side-effect.

Another example: hyperdrive.el adds to save-some-buffers-functions for
saving hyperdrive file buffers:

https://git.sr.ht/~ushin/hyperdrive.el/tree/d7dc7a08ba47761108cf98e21ffa2d8dad28f34a/item/hyperdrive.el#L99

After this change, magit-save-repository-buffers now prompts to save
irrelevant hyperdrive file buffers. I would like some way to tell
hyperdrive--save-some-buffers not to prompt the user to save hyperdrive
buffers from inside magit-save-repository-buffers.

> And are you saying that before the change which added
> save-some-buffers-functions, Emacs was not saving the abbrevs when
> save-some-buffers was called?  If so, in what Emacs version was this
> so?

The behavior of saving abbrevs when a PRED function is passed to
save-some-buffers has not changed in Emacs 29. I just think that there
may be room for improvement now that save-some-buffers-functions allows
any package to add to save-some-buffers-functions.

> We need a better understanding of the situation before we can discuss
> solutions, so please fill-in the blanks outlined above.

I hope the explanation above is clear. Sorry for starting off on the
wrong foot with an XY problem!

Thank you!

Joseph





^ permalink raw reply	[relevance 5%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
  2023-08-21  4:06  5% bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-21 11:56  0% ` Eli Zaretskii
  2023-08-23 23:57  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-08-21 11:56 UTC (permalink / raw)
  To: Joseph Turner; +Cc: jonas, 65414

> Cc: jonas@bernoul.li
> Date: Sun, 20 Aug 2023 21:06:54 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Functions which are added to save-some-buffers-functions are always
> called when save-some-buffers runs, even when a PRED argument is
> specified. This leads to unexpected behavior when PRED is intended to
> limit saving buffers to a specific set of file buffers, as in Magit's
> magit-save-repository-buffers function.
> 
> abbrev--possibly-save is added to save-some-buffers-functions by default
> now, so whenever magit-save-repository-buffers runs, Emacs prompts to
> save unsaved abbrevs (as well any other functions in the list).

Why is asking whether to save the abbrevs a problem in the case of
magit-save-repository-buffers?

And are you saying that before the change which added
save-some-buffers-functions, Emacs was not saving the abbrevs when
save-some-buffers was called?  If so, in what Emacs version was this
so?

> I propose that we pass along the PRED argument of save-some-buffers to
> each of save-some-buffers-functions, allowing them to determine what is
> appropriate to do. Alternatively, we could pass along the return value
> of files--buffers-needing-to-be-saved, which is a list of buffers.

We need a better understanding of the situation before we can discuss
solutions, so please fill-in the blanks outlined above.  (The solution
you propose is not very backward-compatible, so probably not
acceptable anyway, as Emacs 29 was already released with the current
code.  But let's defer this discussion until the issue is more clear.)





^ permalink raw reply	[relevance 0%]

* bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil
@ 2023-08-21  4:06  5% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-21 11:56  0% ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-21  4:06 UTC (permalink / raw)
  To: 65414; +Cc: jonas

Functions which are added to save-some-buffers-functions are always
called when save-some-buffers runs, even when a PRED argument is
specified. This leads to unexpected behavior when PRED is intended to
limit saving buffers to a specific set of file buffers, as in Magit's
magit-save-repository-buffers function.

abbrev--possibly-save is added to save-some-buffers-functions by default
now, so whenever magit-save-repository-buffers runs, Emacs prompts to
save unsaved abbrevs (as well any other functions in the list).

I propose that we pass along the PRED argument of save-some-buffers to
each of save-some-buffers-functions, allowing them to determine what is
appropriate to do. Alternatively, we could pass along the return value
of files--buffers-needing-to-be-saved, which is a list of buffers.

Thoughts?

Joseph





^ permalink raw reply	[relevance 5%]

* bug#65243: [PATCH] Fix building of VC package manuals with relative org links/includes
  2023-08-12  8:43 10% bug#65243: [PATCH] Fix building of VC package manuals with relative org links/includes Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-14  8:14  5% ` Philip Kaludercic
@ 2023-08-19  9:46  5% ` Philip Kaludercic
  1 sibling, 0 replies; 200+ results
From: Philip Kaludercic @ 2023-08-19  9:46 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 65243-done

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Hello,
>
> This patch allows for relative includes and link in org files compiled
> to texinfo.
>
> Unfortunately, I missed this back in May
> (commit 1e6a7594 ), when we fixed relative texi @include links.
>
> I'm not sure how the Emacs release cycle works. Would it be possible to
> include this fix in 29.2?

I have applies the patch to emacs-29, and will close the report.  Thanks!

> Best,
>
> Joseph





^ permalink raw reply	[relevance 5%]

* bug#65243: [PATCH] Fix building of VC package manuals with relative org links/includes
  2023-08-14  8:14  5% ` Philip Kaludercic
  2023-08-14 12:11  0%   ` Eli Zaretskii
@ 2023-08-15  1:57  4%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-15  1:57 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 65243


Philip Kaludercic <philipk@posteo.net> writes:

> Joseph Turner <joseph@breatheoutbreathe.in> writes:
>
>> Hello,
>>
>> This patch allows for relative includes and link in org files compiled
>> to texinfo.
>
> BTW, what package is this related to?

On my machine,

(package-vc-install '(hyperdrive
                      :url "https://git.sr.ht/~ushin/hyperdrive.el"
                      :doc "doc/hyperdrive-manual.org"))

gives the following backtrace:

Debugger entered--Lisp error: (error "Cannot include file /home/joseph/.emacs.d/elpa/hyperdrive/fdl.org")
  error("Cannot include file %s" "/home/joseph/.emacs.d/elpa/hyperdrive/fdl.org")
  org-export-expand-include-keyword()
  org-export-as(texinfo nil nil nil (:output-file "/tmp/ox-texinfo-hqSZfl"))
  org-export-to-file(texinfo "/tmp/ox-texinfo-hqSZfl")
  package-vc--build-documentation(#s(package-desc :name hyperdrive :version nil :summary "No description available." :reqs nil :kind vc :archive nil :dir "/home/joseph/.emacs.d/elpa/hyperdrive/" :extras nil :signed nil) "doc/hyperdrive-manual.org")
  package-vc--unpack-1(#s(package-desc :name hyperdrive :version nil :summary "No description available." :reqs nil :kind vc :archive nil :dir "/home/joseph/.emacs.d/elpa/hyperdrive/" :extras nil :signed nil) "/home/joseph/.emacs.d/elpa/hyperdrive/")
  package-vc--unpack(#s(package-desc :name hyperdrive :version nil :summary "No description available." :reqs nil :kind vc :archive nil :dir "/home/joseph/.emacs.d/elpa/hyperdrive/" :extras nil :signed nil) (:url "https://git.sr.ht/~ushin/hyperdrive.el" :doc "doc/hyperdrive-manual.org") nil)
  package-vc-install((hyperdrive :url "https://git.sr.ht/~ushin/hyperdrive.el" :doc "doc/hyperdrive-manual.org"))

"/home/joseph/.emacs.d/elpa/hyperdrive/fdl.org" does not exist, but
"/home/joseph/.emacs.d/elpa/hyperdrive/doc/fdl.org" does.

Hope this helps!

Joseph





^ permalink raw reply	[relevance 4%]

* bug#65243: [PATCH] Fix building of VC package manuals with relative org links/includes
  2023-08-14  8:14  5% ` Philip Kaludercic
@ 2023-08-14 12:11  0%   ` Eli Zaretskii
  2023-08-15  1:57  4%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 200+ results
From: Eli Zaretskii @ 2023-08-14 12:11 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 65243, joseph

> Cc: 65243@debbugs.gnu.org
> From: Philip Kaludercic <philipk@posteo.net>
> Date: Mon, 14 Aug 2023 08:14:31 +0000
> 
> Joseph Turner <joseph@breatheoutbreathe.in> writes:
> 
> > I'm not sure how the Emacs release cycle works. Would it be possible to
> > include this fix in 29.2?
> 
> I wouldn't have any issue with that, and AFAIU now that the release has
> been cut, this should be fine, as this is just a bug fix.

Fine by me, thanks.





^ permalink raw reply	[relevance 0%]

* bug#65243: [PATCH] Fix building of VC package manuals with relative org links/includes
  2023-08-12  8:43 10% bug#65243: [PATCH] Fix building of VC package manuals with relative org links/includes Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-14  8:14  5% ` Philip Kaludercic
  2023-08-14 12:11  0%   ` Eli Zaretskii
  2023-08-15  1:57  4%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-19  9:46  5% ` Philip Kaludercic
  1 sibling, 2 replies; 200+ results
From: Philip Kaludercic @ 2023-08-14  8:14 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 65243

Joseph Turner <joseph@breatheoutbreathe.in> writes:

> Hello,
>
> This patch allows for relative includes and link in org files compiled
> to texinfo.
>
> Unfortunately, I missed this back in May
> (commit 1e6a7594 ), when we fixed relative texi @include links.
>
> I'm not sure how the Emacs release cycle works. Would it be possible to
> include this fix in 29.2?

I wouldn't have any issue with that, and AFAIU now that the release has
been cut, this should be fine, as this is just a bug fix.

BTW, what package is this related to?

> Best,
>
> Joseph
>
>>From e951b0ea4ffa90202ecee934eddd895b706c6794 Mon Sep 17 00:00:00 2001
> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Date: Sat, 12 Aug 2023 01:40:07 -0700
> Subject: [PATCH] Fix building of VC package manuals with relative org
>  links/includes
>
> * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
> Ensure that default-default is the docs-directory around
> org-export-to-file to ensure that links to relative files work correctly.
> ---
>  lisp/emacs-lisp/package-vc.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index b4c911015b5..ffc7afeb2ee 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -356,7 +356,8 @@ otherwise it's assumed to be an Info file."
>        (with-temp-buffer
>          (insert-file-contents file)
>          (setq file (make-temp-file "ox-texinfo-"))
> -        (org-export-to-file 'texinfo file)
> +        (let ((default-directory docs-directory))
> +          (org-export-to-file 'texinfo file))
>          (setq clean-up t)))
>      (with-current-buffer (get-buffer-create " *package-vc doc*")
>        (erase-buffer)





^ permalink raw reply	[relevance 5%]

* bug#65243: [PATCH] Fix building of VC package manuals with relative org links/includes
@ 2023-08-12  8:43 10% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-14  8:14  5% ` Philip Kaludercic
  2023-08-19  9:46  5% ` Philip Kaludercic
  0 siblings, 2 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-12  8:43 UTC (permalink / raw)
  To: 65243; +Cc: philipk

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

Hello,

This patch allows for relative includes and link in org files compiled
to texinfo.

Unfortunately, I missed this back in May
(commit 1e6a7594 ), when we fixed relative texi @include links.

I'm not sure how the Emacs release cycle works. Would it be possible to
include this fix in 29.2?

Best,

Joseph


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-building-of-VC-package-manuals-with-relative-org.patch --]
[-- Type: text/x-diff, Size: 1170 bytes --]

From e951b0ea4ffa90202ecee934eddd895b706c6794 Mon Sep 17 00:00:00 2001
From: Joseph Turner <joseph@breatheoutbreathe.in>
Date: Sat, 12 Aug 2023 01:40:07 -0700
Subject: [PATCH] Fix building of VC package manuals with relative org
 links/includes

* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Ensure that default-default is the docs-directory around
org-export-to-file to ensure that links to relative files work correctly.
---
 lisp/emacs-lisp/package-vc.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index b4c911015b5..ffc7afeb2ee 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -356,7 +356,8 @@ otherwise it's assumed to be an Info file."
       (with-temp-buffer
         (insert-file-contents file)
         (setq file (make-temp-file "ox-texinfo-"))
-        (org-export-to-file 'texinfo file)
+        (let ((default-directory docs-directory))
+          (org-export-to-file 'texinfo file))
         (setq clean-up t)))
     (with-current-buffer (get-buffer-create " *package-vc doc*")
       (erase-buffer)
-- 
2.41.0


^ permalink raw reply related	[relevance 10%]

* bug#64739: (forward-thing 'number) doesn't work with decimal numbers
  @ 2023-07-29 23:01  5%                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-29 23:01 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Eli Zaretskii, 64739, winkler

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> FWIW, I've always found the `thingatpt.el` library to be ..hmm.. wobbly?
> I'd welcome someone investing time to straighten it up (maybe
> starting by extending it so it can return "thing around region" and use
> that as the basis for "at point").

Would you elaborate on this design idea?





^ permalink raw reply	[relevance 5%]

* bug#64739: (forward-thing 'number) doesn't work with decimal numbers
  2023-07-23 19:03  4%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-24 11:25  0%                   ` Eli Zaretskii
    0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-07-24 11:25 UTC (permalink / raw)
  To: Joseph Turner, Stefan Monnier; +Cc: 64739, winkler

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: winkler@gnu.org, 64739@debbugs.gnu.org
> Date: Sun, 23 Jul 2023 12:03:50 -0700
> 
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > That's probably one idea, yes.  (But note that those regexps don't
> > support numbers like "1.0e2".)
> 
> I agree that the regexp solution is not ideal.
> 
> > Another idea is to define a special-purpose syntax table and use that
> > with forward-word.
> 
> Did you have something like this in mind?

More or less.  TBH, I didn't think about this too much, so maybe this
idea doesn't "hold water".

> > Yet another idea is to use 'read', since the Lisp reader already knows
> > how to read numbers.
> 
> Sounds interesting! I'm not sure how to approach a solution like that.
> How would you let the Lisp reader know where to start and stop reading?

Start is easy: 'read' always starts at point.  End might give us
trouble, but in general 'read' reads one expression, so it should stop
at the end of the number, no?

Anyway, I was just brain-storming.  A real solution will need more
thought and more testing.  Perhaps Stefan (CC'ed) has some ideas or
inputs.





^ permalink raw reply	[relevance 0%]

* bug#64739: (forward-thing 'number) doesn't work with decimal numbers
  2023-07-23  5:33  0%               ` Eli Zaretskii
@ 2023-07-23 19:03  4%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-24 11:25  0%                   ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-23 19:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64739, winkler


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@breatheoutbreathe.in>
>> Cc: Roland Winkler <winkler@gnu.org>, 64739@debbugs.gnu.org
>> Date: Sat, 22 Jul 2023 20:36:16 -0700
>>
>> > By "its own function" I meant that we implement it in Emacs, not that
>> > you implement it in your personal customizations.
>>
>> I see that the definition of number-at-point includes two magic regexps,
>> one matching hex numbers and another matching decimal numbers. Would it
>> make sense to move those regexps into defconsts, and then create a new
>> function forward-number which uses those new constants?
>
> That's probably one idea, yes.  (But note that those regexps don't
> support numbers like "1.0e2".)

I agree that the regexp solution is not ideal.

> Another idea is to define a special-purpose syntax table and use that
> with forward-word.

Did you have something like this in mind?

(defvar number-syntax-table
  (let ((st (make-syntax-table)))
    (modify-syntax-entry ?. "w " st)
    ;; ?- and ?+ could indicate the sign at the beginning of a number or
    ;; they could indicate the sign of an exponent like 1.5e-6
    (modify-syntax-entry ?- "w " st)
    (modify-syntax-entry ?+ "w " st)
    ;; ?# acts as a prefix for integers in bases other than 10.
    (modify-syntax-entry ?# "w " st)
    st)
  "Syntax table used to detect word boundaries for numbers.")

(defun forward-number (&optional n)
  (interactive)
  (with-syntax-table number-syntax-table
    (forward-word-strictly n)))

(defun backward-number (&optional n)
  (interactive)
  (with-syntax-table number-syntax-table
    (forward-word-strictly n)))

;; We don't need the following two lines, since forward-thing uses
;; intern-soft to get these function names anyway.

(put 'number 'forward-op 'forward-number)
(put 'number 'beginning-op 'backward-number)

What would we use for end-op? Is it necessary?

Also I notice that the current implementation of number-at-point fails
to recognize the following as a single number:

-1.5e+6

Could we do something like:

(defun number-at-point (&optional no-properties)
  (with-syntax-table number-syntax-table
    (word-at-point no-properties)))

(put 'number 'thing-at-point 'number-at-point)

I'd appreciate feedback on the syntax table above. It incorrectly
recognizes some non-number strings as numbers:

a-a+a-
#abc#abc

> Yet another idea is to use 'read', since the Lisp reader already knows
> how to read numbers.

Sounds interesting! I'm not sure how to approach a solution like that.
How would you let the Lisp reader know where to start and stop reading?

Joseph





^ permalink raw reply	[relevance 4%]

* bug#64739: (forward-thing 'number) doesn't work with decimal numbers
  2023-07-23  3:36  5%             ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-23  5:33  0%               ` Eli Zaretskii
  2023-07-23 19:03  4%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-07-23  5:33 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 64739, winkler

> From: Joseph Turner <joseph@breatheoutbreathe.in>
> Cc: Roland Winkler <winkler@gnu.org>, 64739@debbugs.gnu.org
> Date: Sat, 22 Jul 2023 20:36:16 -0700
> 
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > By "its own function" I meant that we implement it in Emacs, not that
> > you implement it in your personal customizations.
> 
> I see that the definition of number-at-point includes two magic regexps,
> one matching hex numbers and another matching decimal numbers. Would it
> make sense to move those regexps into defconsts, and then create a new
> function forward-number which uses those new constants?

That's probably one idea, yes.  (But note that those regexps don't
support numbers like "1.0e2".)

Another idea is to define a special-purpose syntax table and use that
with forward-word.

Yet another idea is to use 'read', since the Lisp reader already knows
how to read numbers.

And there probably are other ideas as well.





^ permalink raw reply	[relevance 0%]

* bug#64739: (forward-thing 'number) doesn't work with decimal numbers
  @ 2023-07-23  3:36  5%             ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-23  5:33  0%               ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-23  3:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64739, Roland Winkler


Eli Zaretskii <eliz@gnu.org> writes:

> By "its own function" I meant that we implement it in Emacs, not that
> you implement it in your personal customizations.

I see that the definition of number-at-point includes two magic regexps,
one matching hex numbers and another matching decimal numbers. Would it
make sense to move those regexps into defconsts, and then create a new
function forward-number which uses those new constants?

Joseph





^ permalink raw reply	[relevance 5%]

* bug#64739: (forward-thing 'number) doesn't work with decimal numbers
  2023-07-21 12:48  0%     ` Eli Zaretskii
@ 2023-07-21 12:52  0%       ` Eli Zaretskii
    0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-07-21 12:52 UTC (permalink / raw)
  To: winkler; +Cc: 64739, joseph

> Cc: 64739@debbugs.gnu.org, joseph@breatheoutbreathe.in
> Date: Fri, 21 Jul 2023 15:48:07 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > From: Roland Winkler <winkler@gnu.org>
> > Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  64739@debbugs.gnu.org
> > Date: Fri, 21 Jul 2023 07:28:29 -0500
> > 
> > On Thu, Jul 20 2023, Eli Zaretskii wrote:
> > >> forward-word doesn't seem to be the correct forward-op for numbers.
> > >
> > > That depends on the buffer's syntax table, though.
> > 
> > I am frequently running into similar problems when I deal with numbers,
> > but the syntax table is not designed for this.  Would it make sense if
> > (forward-thing 'number) temporarily used a customized synatx table?
> 
> It should use its own function, if you ask me.  forward-word is a
> kludge.

To clarify: I meant that using forward-word in this case is a kludge.





^ permalink raw reply	[relevance 0%]

* bug#64739: (forward-thing 'number) doesn't work with decimal numbers
  @ 2023-07-21 12:48  0%     ` Eli Zaretskii
  2023-07-21 12:52  0%       ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-07-21 12:48 UTC (permalink / raw)
  To: Roland Winkler; +Cc: 64739, joseph

> From: Roland Winkler <winkler@gnu.org>
> Cc: Joseph Turner <joseph@breatheoutbreathe.in>,  64739@debbugs.gnu.org
> Date: Fri, 21 Jul 2023 07:28:29 -0500
> 
> On Thu, Jul 20 2023, Eli Zaretskii wrote:
> >> forward-word doesn't seem to be the correct forward-op for numbers.
> >
> > That depends on the buffer's syntax table, though.
> 
> I am frequently running into similar problems when I deal with numbers,
> but the syntax table is not designed for this.  Would it make sense if
> (forward-thing 'number) temporarily used a customized synatx table?

It should use its own function, if you ask me.  forward-word is a
kludge.





^ permalink raw reply	[relevance 0%]

* bug#64739: (forward-thing 'number) doesn't work with decimal numbers
  2023-07-20  6:19  5% bug#64739: (forward-thing 'number) doesn't work with decimal numbers Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-07-20  6:39  0% ` Eli Zaretskii
    0 siblings, 1 reply; 200+ results
From: Eli Zaretskii @ 2023-07-20  6:39 UTC (permalink / raw)
  To: Joseph Turner; +Cc: 64739

> Date: Wed, 19 Jul 2023 23:19:27 -0700
> From:  Joseph Turner via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Hello,
> 
> Given the following number with point at ★:
> 
> ★12.34
> 
> number-at-point correctly returns "12.34".
> 
> However,(forward-thing 'number) puts point just before the period:
> 
> 12★.34
> 
> while I'd expect:
> 
> 12.34★
> 
> (get 'number 'forward-op)
>      ⇒ forward-word
> 
> forward-word doesn't seem to be the correct forward-op for numbers.

That depends on the buffer's syntax table, though.





^ permalink raw reply	[relevance 0%]

* bug#64739: (forward-thing 'number) doesn't work with decimal numbers
@ 2023-07-20  6:19  5% Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-07-20  6:39  0% ` Eli Zaretskii
  0 siblings, 1 reply; 200+ results
From: Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-20  6:19 UTC (permalink / raw)
  To: 64739

Hello,

Given the following number with point at ★:

★12.34

number-at-point correctly returns "12.34".

However,(forward-thing 'number) puts point just before the period:

12★.34

while I'd expect:

12.34★

(get 'number 'forward-op)
     ⇒ forward-word

forward-word doesn't seem to be the correct forward-op for numbers.

Joseph





^ permalink raw reply	[relevance 5%]

Results 201-400 of ~500   |  | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-11-26 13:44     bug#59609: 29.0.50; [PATCH] Better advertise (Non-)GNU ELPA in emacs manual Stefan Kangas
2022-11-26 14:20     ` Eli Zaretskii
2023-09-08 11:25       ` Stefan Kangas
2023-09-08 11:56         ` Eli Zaretskii
2023-09-08 16:43           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08 18:29             ` Eli Zaretskii
2023-09-08 20:10  5%           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-13  5:27     bug#63480: 30.0.50; [BUG] unimplemented logic regarding read-symbol-shorthands Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-06 20:17     ` Stefan Kangas
2023-11-29  7:45  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-29  8:12  5%     ` João Távora
2023-11-23 21:38  5% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-20  6:19  5% bug#64739: (forward-thing 'number) doesn't work with decimal numbers Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-20  6:39  0% ` Eli Zaretskii
2023-07-21 12:28       ` Roland Winkler
2023-07-21 12:48  0%     ` Eli Zaretskii
2023-07-21 12:52  0%       ` Eli Zaretskii
2023-07-21 14:14             ` Roland Winkler
2023-07-21 14:29               ` Eli Zaretskii
2023-07-23  3:36  5%             ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-23  5:33  0%               ` Eli Zaretskii
2023-07-23 19:03  4%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-24 11:25  0%                   ` Eli Zaretskii
2023-07-26 12:21                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-29 23:01  5%                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-12  8:43 10% bug#65243: [PATCH] Fix building of VC package manuals with relative org links/includes Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-14  8:14  5% ` Philip Kaludercic
2023-08-14 12:11  0%   ` Eli Zaretskii
2023-08-15  1:57  4%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-19  9:46  5% ` Philip Kaludercic
2023-08-21  4:06  5% bug#65414: save-some-buffers-functions are unexpectedly called when save-some-buffers pred is non-nil Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-21 11:56  0% ` Eli Zaretskii
2023-08-23 23:57  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-24  5:16  0%     ` Eli Zaretskii
2023-08-26  6:38  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-26  7:26  0%         ` Eli Zaretskii
2023-08-26  7:32 10%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-02  7:30  0%             ` Eli Zaretskii
2023-09-03 17:06                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 17:29  0%                 ` Eli Zaretskii
2023-09-03 17:52  5%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 19:03                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03 19:04  5%                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 10:53  0%                   ` Eli Zaretskii
2023-09-04 15:54  5%                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 15:59  0%                       ` Eli Zaretskii
2023-09-03 17:22                   ` Juri Linkov
2023-09-03 17:44  0%                 ` Eli Zaretskii
     [not found]     <87r0nqct63.fsf@breatheoutbreathe.in>
2023-08-30  7:10 11% ` bug#65608: Fwd: [PATCH] project.el: Use list of strings p for safe local variable Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-30 11:22  5%   ` Dmitry Gutov
2023-08-30 17:54  0%     ` Stefan Kangas
2023-08-31  6:26  9% bug#65649: [PATCH] package-vc: Continue installing package when documentation build fails Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-31  6:32  9% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-31  6:34 11%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-31  7:18  5%     ` Philip Kaludercic
2023-08-31 21:19  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-31 21:39 11%         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-01 13:14  7%         ` Philip Kaludercic
2023-09-01 23:28  9%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-02 12:03  5%             ` Philip Kaludercic
2023-09-02 16:49  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03  7:00  5%                 ` Philip Kaludercic
2023-08-31  6:50  0% ` Eli Zaretskii
2023-08-31 21:47  4% bug#65666: Lockfiles break package-vc-install-from-checkout Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-01  5:50  0% ` Eli Zaretskii
2023-09-01  6:18  5% ` joseph--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-01 12:52  0%   ` Philip Kaludercic
2023-09-01 23:43  5%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-02  7:49  0%       ` Eli Zaretskii
2023-09-02 17:15 10%         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-02 17:21  0%           ` Eli Zaretskii
2023-09-03  7:03  0%             ` Philip Kaludercic
     [not found]     <871qvz4kdw.fsf@localhost>
2023-05-15  5:56     ` bug#63513: [PATCH] Make persist-defvar work with records and hash tables Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-15 11:31       ` Eli Zaretskii
2023-05-23 20:14         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-02 23:54  9%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-03  6:08  0%         ` Eli Zaretskii
2023-09-04  0:29  8%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 11:33  0%             ` Eli Zaretskii
2023-09-04 15:57  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 17:05  5%                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 22:28  8%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-05 21:06                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08 11:30                           ` Ihor Radchenko
2023-09-08 11:58  0%                         ` Eli Zaretskii
2023-09-08 16:36                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08 17:06                               ` Ihor Radchenko
2023-09-08 17:10  5%                             ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-09 10:01  5%                               ` Ihor Radchenko
2023-09-09 10:15  0%                                 ` Daniel Mendler
2023-09-05 15:08  0%                   ` phillip.lord
2023-09-05 19:35 11% bug#65764: Fix typo in backward-word-strictly Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-05 19:50  5% ` Stefan Kangas
2023-09-06  2:13 11% bug#65768: Bump persist.el version Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-06 16:39  5% ` Stefan Kangas
2023-09-16 22:28  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-30 14:30 11%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-30 20:54  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-31 12:07  5%     ` phillip.lord
2023-10-31 15:41  7%       ` Joseph Turner
2023-10-31 16:43  0%         ` Eli Zaretskii
2023-10-31 17:05  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-01  0:34  5%             ` Stefan Kangas
2023-11-12  4:26 28%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-06 20:38  5%             ` phillip.lord
2023-11-12  4:27  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-07  7:53  1% bug#65797: 29.0.92; func-arity should not return (0 . many) with apply-partially Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-07 15:50     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08  4:40  7%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08  6:46  0%     ` Eli Zaretskii
2023-09-08 15:52           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08 16:37  5%         ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08 17:18               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08 18:16  5%             ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-08 18:20  0%         ` Eli Zaretskii
2023-09-11 16:57  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-11 18:58  0%             ` Eli Zaretskii
2023-09-08 17:01       ` bug#65797: `buffer-match-p` should not use `func-arity` Philip Kaludercic
2023-09-12 18:28         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-13 21:50           ` Philip Kaludercic
2023-09-14 13:47             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-18  9:12               ` Philip Kaludercic
2023-09-18 11:55                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-18 17:23                   ` Philip Kaludercic
2023-09-18 18:05                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-19  8:34                       ` Philip Kaludercic
2023-09-19 10:06                         ` Dmitry Gutov
2023-09-19 13:56                           ` Philip Kaludercic
2023-09-19 16:13                             ` Dmitry Gutov
2023-10-08  9:10  5%                           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08 10:25  5%                             ` Dmitry Gutov
2023-10-09 21:40                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-12  4:53  5%                               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-12 11:34                                   ` Dmitry Gutov
2023-10-13 15:57                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-14  6:13  0%                                   ` Eli Zaretskii
2023-10-14 14:31                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-15  6:13                                           ` Eli Zaretskii
2023-10-16 16:33                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-16 20:16  5%                                           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-15  0:45         ` Dmitry Gutov
2023-09-15  1:38           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-15 16:38             ` Dmitry Gutov
2023-09-15 17:54  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-15 18:00  5%             ` Dmitry Gutov
2023-09-20  7:02  9% bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]     ` <handler.66114.B.16951935749180.ack@debbugs.gnu.org>
2023-09-20  7:24  9%   ` bug#66114: Acknowledgement ([PATCH] Fix interactive prompt for selecting checkout directory) Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-20  7:31  9%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-22  8:21  5% ` bug#66114: [PATCH] Fix interactive prompt for selecting checkout directory Philip Kaludercic
2023-09-24  5:06  4%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-24 14:37  5%     ` Philip Kaludercic
2023-09-24 21:27  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-20  7:14 10% bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-22  8:17  5% ` Philip Kaludercic
2023-09-22  8:33  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-22 10:51  5%     ` Philip Kaludercic
2023-09-24  5:34  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-24  6:54  0%         ` Eli Zaretskii
     [not found]               ` <87msviogui.fsf@breatheoutbreathe.in>
2023-11-16  6:44  5%             ` Philip Kaludercic
2023-11-19 22:16 11%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-25 10:17  0%                 ` Eli Zaretskii
2023-11-25 22:59 11%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-26 10:41  0%                     ` Eli Zaretskii
2023-11-26 20:39  5%                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-27 12:01  0%                         ` Eli Zaretskii
2023-12-08 10:25  5%                           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-24 21:31  5% bug#66187: read-file-name unexpected behavior when MUSTMATCH is a function Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-25  3:58  5% ` Michael Heerdegen
2023-09-25  5:12  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-25 21:33  5%     ` Michael Heerdegen
2023-09-26  8:37  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-27  0:26  5%         ` Michael Heerdegen
2023-09-27  0:55 10%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-27  1:43  4%             ` Michael Heerdegen
2023-10-03 21:18  9%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-04  3:35  5%                 ` Michael Heerdegen
2023-10-04  5:22  5%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-05  1:12  5%                     ` Michael Heerdegen
2023-10-04  7:03  0%                 ` Eli Zaretskii
2023-10-05 19:34                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-05 20:20                         ` Drew Adams
2023-10-06  4:47  0%                       ` Eli Zaretskii
2023-10-06  4:45  0%                     ` Eli Zaretskii
2023-10-06 13:01                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-06 13:46                             ` Eli Zaretskii
2023-10-06 16:43                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-07  5:23                                 ` Eli Zaretskii
2023-10-07 14:25                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-07 15:09                                     ` Eli Zaretskii
2023-10-07 15:12                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-12 21:26 10%                                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-26  6:49 11%                                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-06  5:55  5%                     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-29 12:00  0%             ` Eli Zaretskii
2023-10-03 20:43  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-04  6:05  0%                 ` Eli Zaretskii
2023-10-04  6:25 10%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-27  1:16  8% bug#66224: [PATCH] Add optional PREDICATE argument to read-directory-name Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-28  9:05  5% ` Philip Kaludercic
2023-09-29  3:28  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-29  3:28  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-29  3:54  5%     ` Michael Heerdegen
2023-09-29  4:19  8%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-03  3:30  5%         ` Michael Heerdegen
2023-10-03 23:20  5%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-05  1:23  5%             ` Michael Heerdegen
2023-10-05  1:34  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-12 20:42 11%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-29 12:05  0% ` Eli Zaretskii
2023-10-03 23:08  8%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-07 18:40 10% bug#66393: [PATCH] Make package-vc-install-from-checkout NAME argument optional Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08 15:43  5% ` Philip Kaludercic
2023-10-08 20:50  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08 21:35  5% ` Philip Kaludercic
2023-10-08  9:57 11% bug#66403: [PATCH] Use delete-all-overlays in clean-mode Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08 10:25  0% ` Eli Zaretskii
2023-10-08 21:21  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08 21:24  5% ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08  9:58 11% bug#66404: " Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08 10:26  0% ` Eli Zaretskii
2023-10-08 10:32  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-08 11:40  0%     ` Eli Zaretskii
2023-10-08 20:54  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-19  5:45 11% bug#66626: [PATCH] elpa-packages (hyperdrive): Update ':doc' property Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-20 20:04  5% ` Stefan Kangas
2023-10-23 21:23 10% bug#66716: Reconcile display-fill-column-indicator-character behavior and customization description Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-24 12:31  0% ` Eli Zaretskii
2023-10-24 19:46  5%   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25  2:29  0%     ` Eli Zaretskii
2023-10-25  3:11  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-20 19:50  5% bug#67325: shorthands: Incorrect autoloaded register-definition-prefixes Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-24  8:06  0% ` Eli Zaretskii
2023-11-24  9:24  0%   ` João Távora
2023-11-25  4:18  5%     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-25 12:44  5%       ` João Távora
2023-11-22 22:18     bug#67390: 28; shorthands-font-lock-shorthands assumes shorthand uses same separator Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-23 12:57     ` João Távora
2023-11-24 21:51       ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-25  0:03         ` João Távora
2023-11-25  3:26  9%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-25 16:01  5%         ` Jonas Bernoulli via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-25 22:42  9%           ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-26 13:52  4%             ` João Távora
2023-11-26 20:35  5%               ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-26 22:02  5%                 ` João Távora
2023-11-27  3:48  5%                   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-27 12:10  0%                   ` Eli Zaretskii
2023-11-29  8:21  0%                     ` João Távora
2023-11-29  9:12  4%                       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-29 13:56  5%                         ` João Távora
2023-11-29 13:30  0%           ` João Távora
2023-11-29 23:27  0%             ` João Távora
2023-11-30 14:16                   ` João Távora
2023-11-30 15:23  0%                 ` Eli Zaretskii
2023-12-09 18:50  8%                 ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-29  8:03  4% bug#67523: check-declare doesn't account for shorthands Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-29  9:56  5% ` João Távora
2023-11-29 10:35  0%   ` João Távora
2023-11-29 11:12  0%     ` João Távora
2023-12-10 10:57  5%       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).