GNU bug report logs - #55149
29.0.50; Commit f30625943e broke magit/with-editor

Previous Next

Package: emacs;

Reported by: Tassilo Horn <thorn <at> fastmail.fm>

Date: Wed, 27 Apr 2022 12:59:01 UTC

Severity: normal

Tags: patch

Merged with 55160, 55161

Found in version 29.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 55149 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <thorn <at> fastmail.fm>
To: "M. Ian Graham" <hello <at> miangraham.com>
Cc: "55149 <at> debbugs.gnu.org" <55149 <at> debbugs.gnu.org>,
 "monnier <at> iro.umontreal.ca" <monnier <at> iro.umontreal.ca>
Subject: Re: bug#55149: 29.0.50; Commit f30625943e broke magit/with-editor
Date: Thu, 28 Apr 2022 06:47:50 +0200
"M. Ian Graham" <hello <at> miangraham.com> writes:

>> With stock-emacs when doing "emacsclient foo.txt", it just prints
>> "Waiting for Emacs..." but finishes immediately.
>
> Hi, quick clarification on this: As far as I can tell from my own
> observations, all emacsclient breakage here is a downstream
> side-effect of magit/with-editor's advice calls somehow getting messed
> up.

Oh, you are right.  But I was able to extract (at least one of) the
problematic with-editor advice(s) which cause the breakage.

Save the below as bug-recipe.el:

--8<---------------cut here---------------start------------->8---
(advice-add 'server-visit-files :after
            #'server-visit-files--with-editor-file-name-history-exclude)

(defun server-visit-files--with-editor-file-name-history-exclude
    (files _proc &optional _nowait)
  (pcase-dolist (`(,file . ,_) files)
    (when (cl-find-if (lambda (regexp)
                        (string-match-p regexp file))
                      '("don't care"))
      (setq file-name-history (delete file file-name-history)))))

(server-start)
--8<---------------cut here---------------end--------------->8---

Then start emacs as "emacs -Q -l bug-recipe.el" and you'll be able to
perform my "stock emacs" recipe, i.e.,

  emacsclient foo.txt => finishes immediately
  emacsclient -c foo.txt => doesn't display the foo.txt buffer

Bye,
Tassilo




This bug report was last modified 3 years and 24 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.