GNU bug report logs -
#79319
[PATCH] * lisp/vc/vc-dispatcher.el (vc-buffer-sync): Check buffer-file-name
Previous Next
Full log
Message #14 received at 79319 <at> debbugs.gnu.org (full text, mbox):
Hello,
On Sat 30 Aug 2025 at 03:46am GMT, Lin Sun wrote:
> From: Sean Whitton <spwhitton <at> spwhitton.name>
> Sent: Thursday, August 28, 2025 01:57 AM
>>> Hi,
>>>
>>> I got an error when try to revert a buffer:
>>> vc-revert: Wrong type argument: stringp, nil
>>>
>>> Here is the backtrace:
>>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>> vc-buffer-sync(nil)
>>> vc-revert()
>>> funcall-interactively(vc-revert)
>>> command-execute(vc-revert)
>>>
>>>
>>> It caused by reverting a buffer which has no file name (like create a
>>> buffer but not saving it).
>>>
>>> This patch will check the `` bebuffer-file-name` before call subsequent function.
>>> Please help review the patch, thanks
>>
>>I think that vc-revert should probably error out sooner for
>>non-file-visiting buffers, before it gets to calling vc-buffer-sync.
>
> With this patch, emacs will give user friendly message: "File is not under version control".
>
> Without the patch, it gives an unexpected error message "Wrong type argument: stringp, nil".
I just installed a couple of fixes to vc-revert. Do you think this
solves the original problem, or are further changes needed? Thanks.
--
Sean Whitton
This bug report was last modified 6 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.