emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slow access to files using UNC path


From: Romain Francoise
Subject: Re: Slow access to files using UNC path
Date: Sat, 18 Sep 2004 13:53:27 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> 2004-09-12  Stefan Monnier  <address@hidden>

>       * vc-hooks.el (vc-ignore-dir-regexp): New var.
>       (vc-registered): Use it.
>       (vc-find-root): New fun.

> ***************
> *** 315,325 ****
>   file was previously registered under a certain backend, then that
>   backend is tried first."
>     (let (handler)
> !     (if (boundp 'file-name-handler-alist)
> !     (setq handler (find-file-name-handler file 'vc-registered)))
> !     (if handler
> !         ;; handler should set vc-backend and return t if registered
> !     (funcall handler 'vc-registered file)
>         ;; There is no file name handler.
>         ;; Try vc-BACKEND-registered for each handled BACKEND.
>         (catch 'found
> --- 335,347 ----
>   file was previously registered under a certain backend, then that
>   backend is tried first."
>     (let (handler)
> !     (cond
> !      ((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
> !       (funcall handler 'vc-registered file))
> !      (t
>         ;; There is no file name handler.
>         ;; Try vc-BACKEND-registered for each handled BACKEND.
>         (catch 'found

This change is problematic for buffers where buffer-file-name is ""
(like ERC server buffers in my case), file-name-directory returns nil so
string-match signals an error.  It makes it impossible to quit Emacs
(you need to kill all such buffers manually).

How about the following fix?

--- orig/lisp/vc-hooks.el
+++ mod/lisp/vc-hooks.el
@@ -336,7 +336,10 @@
 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

-- 
Romain Francoise <address@hidden> | I've become someone else's
it's a miracle -- http://orebokech.com/ | nightmare...




reply via email to

[Prev in Thread] Current Thread [Next in Thread]