unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Tom Gillespie <tgbugs@gmail.com>
Cc: 43192@debbugs.gnu.org
Subject: bug#43192: lisp/files.el; 6d10b607d0 introduced bug that breaks C-x C-c
Date: Fri, 04 Sep 2020 04:58:54 +0200	[thread overview]
Message-ID: <87pn72fdsh.fsf@gnus.org> (raw)
In-Reply-To: <CA+G3_PNEt5949RHZxrcy7yg3JjcJ5bvc8sr5hpLwrsaeL86Y0Q@mail.gmail.com> (Tom Gillespie's message of "Thu, 3 Sep 2020 19:49:33 -0700")

Tom Gillespie <tgbugs@gmail.com> 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





  reply	other threads:[~2020-09-04  2:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04  2:49 bug#43192: lisp/files.el; 6d10b607d0 introduced bug that breaks C-x C-c Tom Gillespie
2020-09-04  2:58 ` Lars Ingebrigtsen [this message]
2020-09-04  3:16   ` Tom Gillespie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn72fdsh.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=43192@debbugs.gnu.org \
    --cc=tgbugs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).