Subject: bug#43192: lisp/files.el; 6d10b607d0 introduced bug that breaks C-x C-c

From: Tom Gillespie <[email-masked]>
Date: Thu, 3 Sep 2020 20:16:09 -0700

Ah, I wondered if that might be the case, everything else was so
consistent, but I thought there might be some reason to use the
variable directly. Since it is not the case my other concerns don't
matter. Confirming fixed on my end. Thanks!
Tom

On Thu, Sep 3, 2020 at 7:59 PM Lars Ingebrigtsen <[email-masked]> wrote:
>
> Tom Gillespie <[email-masked]> writes:
>
> > #+begin_src diff
> > +                                   (string-match
> > +                                    (concat "\\<"
> > +                                            (regexp-quote
> > +                                             (file-name-nondirectory
> > +                                              buffer-file-name))
> > +                                            "<[0-9]+>\\'")
> > +                                    (buffer-name buffer)))
> > #+end_src
> >
> > This is the second statement in a call to `or'. buffer-file-name is
> > not guaranteed to be non-nil because buffers like *scratch* and
> > *Messages* exist. In many workflows for emacsclient opening to scratch
> > and closing again from scratch are common.
>
> I think it's just a typo -- the code should be:
>
> diff --git a/lisp/files.el b/lisp/files.el
> index 3403e257a1..5f5902d0cb 100644
> --- a/lisp/files.el
> +++ b/lisp/files.el
> @@ -5574,7 +5574,7 @@ save-some-buffers
>                                      (concat "\\<"
>                                              (regexp-quote
>                                               (file-name-nondirectory
> -                                              buffer-file-name))
> +                                              (buffer-file-name buffer)))
>                                              "<[^>]*>\\'")
>                                      (buffer-name buffer)))
>                                    ;; The buffer name is similar to the
>
> I've now applied this to Emacs 28, and that fixes the test case in this
> bug report.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no