unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19197: 25.0.50; vc.el with RCS: `vc-master-name' returns nil where it shouldn't
@ 2014-11-26 17:50 Simon Leinen
  2019-08-03 14:06 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Leinen @ 2014-11-26 17:50 UTC (permalink / raw)
  To: 19197; +Cc: Eric S. Raymond

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)





^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#19197: 25.0.50; vc.el with RCS: `vc-master-name' returns nil where it shouldn't
  2014-11-26 17:50 bug#19197: 25.0.50; vc.el with RCS: `vc-master-name' returns nil where it shouldn't Simon Leinen
@ 2019-08-03 14:06 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-03 14:06 UTC (permalink / raw)
  To: Simon Leinen; +Cc: Eric S. Raymond, 19197

Simon Leinen <simon.leinen@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@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-03 14:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-26 17:50 bug#19197: 25.0.50; vc.el with RCS: `vc-master-name' returns nil where it shouldn't Simon Leinen
2019-08-03 14:06 ` Lars Ingebrigtsen

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).