GNU bug report logs - #19197
25.0.50; vc.el with RCS: `vc-master-name' returns nil where it shouldn't

Previous Next

Package: emacs;

Reported by: Simon Leinen <simon.leinen <at> switch.ch>

Date: Wed, 26 Nov 2014 17:57:01 UTC

Severity: normal

Found in version 25.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19197 in the body.
You can then email your comments to 19197 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19197; Package emacs. (Wed, 26 Nov 2014 17:57:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simon Leinen <simon.leinen <at> switch.ch>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 26 Nov 2014 17:57:02 GMT) Full text and rfc822 format available.

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

From: Simon Leinen <simon.leinen <at> switch.ch>
To: bug-gnu-emacs <at> gnu.org
Cc: "Eric S. Raymond" <esr <at> thyrsus.com>
Subject: 25.0.50;
 vc.el with RCS: `vc-master-name' returns nil where it shouldn't
Date: Wed, 26 Nov 2014 18:50:16 +0100
When I start ./src/emacs -Q freshly compiled from the Git source (with
the vc-filewise autoload patches included in my last report) and try to
open a file under RCS, I get an error

  Wrong type argument: stringp, nil

with a backtrace such as this:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-exists-p(nil)
  vc-insert-file(nil "^[0-9]")
  vc-rcs-fetch-master-state("/Users/leinen/public_html/private/log.html" nil)
  vc-rcs-state("/Users/leinen/public_html/private/log.html")
  vc-rcs-state-heuristic("/Users/leinen/public_html/private/log.html")
  apply(vc-rcs-state-heuristic "/Users/leinen/public_html/private/log.html")
  vc-call-backend(RCS state-heuristic "/Users/leinen/public_html/private/log.html")
  vc-state-refresh("/Users/leinen/public_html/private/log.html" RCS)
  vc-state("/Users/leinen/public_html/private/log.html" RCS)
  vc-default-mode-line-string(RCS "/Users/leinen/public_html/private/log.html")
  apply(vc-default-mode-line-string RCS "/Users/leinen/public_html/private/log.html")
  vc-call-backend(RCS mode-line-string "/Users/leinen/public_html/private/log.html")
  vc-mode-line("/Users/leinen/public_html/private/log.html" RCS)
  vc-find-file-hook()
  run-hooks(find-file-hook)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer log.html> "~/public_html/private/log.html" nil nil "~/www/html/misc/leinen/private/log.html" (18988536 16777220))
  find-file-noselect("~/public_html/private/log.html" nil nil t)
  find-file("~/public_html/private/log.html" t)

`vc-rcs-fetch-master-state' uses `vc-master-name' (in vc-filewise.el) to
find the master filename for the visited file.

`vc-master-name' calls the 'registered method for the file's backend
(the symbol `RCS' in this case), which is successful, and then returns
the file's `vc-name' property.  But that property isn't set anywhere.

I found that the function `vc-filewise-registered' also claims to check
whether a file is registered, and it sets the `vc-name' property on the
file.  So that looks more suitable to use.  It also does other things
that I don't quite understand.  Anyway, the following patch prevents the
error for me, and lets me edit and check in/out RCS-managed files again.
-- 
Simon.

diff --git a/lisp/vc/vc-filewise.el b/lisp/vc/vc-filewise.el
index bc8a8de..4a05c98 100644
--- a/lisp/vc/vc-filewise.el
+++ b/lisp/vc/vc-filewise.el
@@ -41,7 +41,7 @@ If the file is not registered, or the master name is not known, return nil."
       ;; vc-BACKEND-registered explicitly
       (let ((backend (vc-backend file)))
 	(if (and backend
-		 (vc-call-backend backend 'registered file))
+		 (vc-filewise-registered backend file))
 	    (vc-file-getprop file 'vc-name)))))
 
 (defun vc-rename-master (oldmaster newfile templates)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19197; Package emacs. (Sat, 03 Aug 2019 14:07:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Simon Leinen <simon.leinen <at> switch.ch>
Cc: "Eric S. Raymond" <esr <at> thyrsus.com>, 19197 <at> debbugs.gnu.org
Subject: Re: bug#19197: 25.0.50; vc.el with RCS: `vc-master-name' returns
 nil where it shouldn't
Date: Sat, 03 Aug 2019 16:06:01 +0200
Simon Leinen <simon.leinen <at> switch.ch> writes:

> When I start ./src/emacs -Q freshly compiled from the Git source (with
> the vc-filewise autoload patches included in my last report) and try to
> open a file under RCS, I get an error
>
>   Wrong type argument: stringp, nil
>
> with a backtrace such as this:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   file-exists-p(nil)
>   vc-insert-file(nil "^[0-9]")

Looks like the patch was applied at the time, but I guess closing the
bug report was forgotten, so I'm doing that now.

commit 4e0f8f7b2da47a59da317ebcc5c85ef9d3ee3b68
Author: Simon Leinen <simon.leinen <at> switch.ch>
Date:   Wed Nov 26 13:22:35 2014 -0500

    Fix for vc-filewise.el unresolved-call glitch.


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 19197 <at> debbugs.gnu.org and Simon Leinen <simon.leinen <at> switch.ch> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 03 Aug 2019 14:07:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 01 Sep 2019 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 297 days ago.

Previous Next


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