unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* patch: fix wrong-type-argument error in vc-registered
@ 2004-10-12 14:48 Yoichi NAKAYAMA
  2004-10-12 16:14 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Yoichi NAKAYAMA @ 2004-10-12 14:48 UTC (permalink / raw)


The change
2004-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>

        * vc-hooks.el (vc-ignore-dir-regexp): New var.

overlooked that (file-name-directory file) may return nil.
Following is the patch against it.

Regards,
-- 
Yoichi NAKAYAMA
\f
Index: vc-hooks.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-hooks.el,v
retrieving revision 1.169
diff -u -r1.169 vc-hooks.el
--- vc-hooks.el	13 Sep 2004 03:36:11 -0000	1.169
+++ vc-hooks.el	12 Oct 2004 14:38:39 -0000
@@ -336,7 +336,9 @@
 backend is tried first."
   (let (handler)
     (cond
-     ((string-match vc-ignore-dir-regexp (file-name-directory file)) nil)
+     ((and (file-name-directory file)
+	   (string-match vc-ignore-dir-regexp (file-name-directory file)))
+      nil)
      ((and (boundp 'file-name-handler-alist)
           (setq handler (find-file-name-handler file 'vc-registered)))
       ;; handler should set vc-backend and return t if registered

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

* Re: patch: fix wrong-type-argument error in vc-registered
  2004-10-12 14:48 patch: fix wrong-type-argument error in vc-registered Yoichi NAKAYAMA
@ 2004-10-12 16:14 ` Stefan Monnier
  2004-10-12 20:51   ` Romain Francoise
  2004-10-13  0:20   ` Yoichi NAKAYAMA
  0 siblings, 2 replies; 8+ messages in thread
From: Stefan Monnier @ 2004-10-12 16:14 UTC (permalink / raw)
  Cc: emacs-devel

> 2004-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>

>         * vc-hooks.el (vc-ignore-dir-regexp): New var.

> overlooked that (file-name-directory file) may return nil.
> Following is the patch against it.

Hmm... your patch looks fine, except that I don't understand why it's
needed: I thought vc-registered is only ever called with an absolute file
name, and (file-name-directory file) never returns nil if file is an
absolute file name.

In which cases does it return nil on an absolute file name, or in which
cases is vc-registered called with a non-absolute file name?


        Stefan

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

* Re: patch: fix wrong-type-argument error in vc-registered
  2004-10-12 16:14 ` Stefan Monnier
@ 2004-10-12 20:51   ` Romain Francoise
  2004-10-12 23:00     ` Stefan
  2004-10-13  0:20   ` Yoichi NAKAYAMA
  1 sibling, 1 reply; 8+ messages in thread
From: Romain Francoise @ 2004-10-12 20:51 UTC (permalink / raw)


Stefan Monnier <monnier@iro.umontreal.ca> writes:

> In which cases does it return nil on an absolute file name, or in which
> cases is vc-registered called with a non-absolute file name?

Let me guess.. when buffer-file-name is "", like in ERC buffers?

I sent the exact same patch on Sep 18th.

-- 
Romain Francoise <romain@orebokech.com> | It was fourteen degrees below
it's a miracle -- http://orebokech.com/ | on a screeching march 23.

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

* Re: patch: fix wrong-type-argument error in vc-registered
  2004-10-12 20:51   ` Romain Francoise
@ 2004-10-12 23:00     ` Stefan
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan @ 2004-10-12 23:00 UTC (permalink / raw)


>> In which cases does it return nil on an absolute file name, or in which
>> cases is vc-registered called with a non-absolute file name?

> Let me guess.. when buffer-file-name is "", like in ERC buffers?

> I sent the exact same patch on Sep 18th.

But as mentioned at that time, "" is not a valid buffer-file-name.


        Stefan

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

* Re: patch: fix wrong-type-argument error in vc-registered
  2004-10-12 16:14 ` Stefan Monnier
  2004-10-12 20:51   ` Romain Francoise
@ 2004-10-13  0:20   ` Yoichi NAKAYAMA
  2004-10-13  1:19     ` Stefan
  1 sibling, 1 reply; 8+ messages in thread
From: Yoichi NAKAYAMA @ 2004-10-13  0:20 UTC (permalink / raw)


At Tue, 12 Oct 2004 12:14:39 -0400,
Stefan Monnier wrote:
> 
> > 2004-09-12  Stefan Monnier  <monnier@iro.umontreal.ca>
> 
> >         * vc-hooks.el (vc-ignore-dir-regexp): New var.
> 
> > overlooked that (file-name-directory file) may return nil.
> > Following is the patch against it.
> 
> Hmm... your patch looks fine, except that I don't understand why it's
> needed: I thought vc-registered is only ever called with an absolute file
> name, and (file-name-directory file) never returns nil if file is an
> absolute file name.
> 
> In which cases does it return nil on an absolute file name, or in which
> cases is vc-registered called with a non-absolute file name?

For example, mime-view.el in EMIKO module
http://cvs.m17n.org/cgi-bin/viewcvs/semi/mime-view.el?rev=1.150.2.33.2.38&only_with_tag=emiko-1_14&content-type=text/vnd.viewcvs-markup
calles set-auto-mode after setting buffer-file-name to non-absolute path
for highlighting.
-- 
Yoichi NAKAYAMA

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

* Re: patch: fix wrong-type-argument error in vc-registered
  2004-10-13  0:20   ` Yoichi NAKAYAMA
@ 2004-10-13  1:19     ` Stefan
  2004-10-13  1:37       ` Yoichi NAKAYAMA
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan @ 2004-10-13  1:19 UTC (permalink / raw)
  Cc: emacs-devel

> For example, mime-view.el in EMIKO module
> http://cvs.m17n.org/cgi-bin/viewcvs/semi/mime-view.el?rev=1.150.2.33.2.38&only_with_tag=emiko-1_14&content-type=text/vnd.viewcvs-markup
> calles set-auto-mode after setting buffer-file-name to non-absolute path
> for highlighting.

mime-view.el should be fixed then: buffer-file-name needs to have an
absolute path.  Several other packages rely on this.  Admittedly, it seems
that vc-registered is the only function that's always used that relies on
this, so fixing it will provide the illusion that things work, but in
reality, they'll break with things like uniquify as well (to name one other
case I happen to know of).


        Stefan

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

* Re: patch: fix wrong-type-argument error in vc-registered
  2004-10-13  1:19     ` Stefan
@ 2004-10-13  1:37       ` Yoichi NAKAYAMA
  2004-10-13  2:39         ` Yoichi NAKAYAMA
  0 siblings, 1 reply; 8+ messages in thread
From: Yoichi NAKAYAMA @ 2004-10-13  1:37 UTC (permalink / raw)


At Tue, 12 Oct 2004 21:19:42 -0400,
Stefan wrote:
> 
> > For example, mime-view.el in EMIKO module
> > http://cvs.m17n.org/cgi-bin/viewcvs/semi/mime-view.el?rev=1.150.2.33.2.38&only_with_tag=emiko-1_14&content-type=text/vnd.viewcvs-markup
> > calles set-auto-mode after setting buffer-file-name to non-absolute path
> > for highlighting.
> 
> mime-view.el should be fixed then: buffer-file-name needs to have an
> absolute path.  Several other packages rely on this.  Admittedly, it seems
> that vc-registered is the only function that's always used that relies on
> this, so fixing it will provide the illusion that things work, but in
> reality, they'll break with things like uniquify as well (to name one other
> case I happen to know of).

OK, I'll write to developers of mime-view.el.
By the way, the restriction should be documented on buffer-file-name<v>?
I found description for buffer-file-name<v> but not for the variable.

Regards,
-- 
Yoichi NAKAYAMA

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

* Re: patch: fix wrong-type-argument error in vc-registered
  2004-10-13  1:37       ` Yoichi NAKAYAMA
@ 2004-10-13  2:39         ` Yoichi NAKAYAMA
  0 siblings, 0 replies; 8+ messages in thread
From: Yoichi NAKAYAMA @ 2004-10-13  2:39 UTC (permalink / raw)


At Wed, 13 Oct 2004 10:37:16 +0900,
Yoichi NAKAYAMA wrote:
> By the way, the restriction should be documented on buffer-file-name<v>?
> I found description for buffer-file-name<v> but not for the variable.

Oops, it was to be:
I found description for buffer-file-name<f> but not for the variable.

Regards,
-- 
Yoichi NAKAYAMA

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

end of thread, other threads:[~2004-10-13  2:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-12 14:48 patch: fix wrong-type-argument error in vc-registered Yoichi NAKAYAMA
2004-10-12 16:14 ` Stefan Monnier
2004-10-12 20:51   ` Romain Francoise
2004-10-12 23:00     ` Stefan
2004-10-13  0:20   ` Yoichi NAKAYAMA
2004-10-13  1:19     ` Stefan
2004-10-13  1:37       ` Yoichi NAKAYAMA
2004-10-13  2:39         ` Yoichi NAKAYAMA

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