emacs-devel
[Top][All Lists]
Advanced

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

Re: Strange loading of vc-bzr with additional file-handler


From: Lennart Borgman (gmail)
Subject: Re: Strange loading of vc-bzr with additional file-handler
Date: Sat, 19 Jul 2008 18:28:25 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666

Jason Rumney wrote:
Lennart Borgman (gmail) wrote:

Before the error I get

  operation=expand-file-name,
     args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc nil)
  apply: End of file during parsing:
     c:/emacs/p/080718/emacs/lisp/image-mode.elc

So I guess there is an error in expand-file-name. Could tramp be
involved (since there are special problems with the w32 file names)?

Given that you said at the start of this thread that you were testing
your own file-handler when you first came across this, I would first
suspect a bug in your code rather than in the Emacs that everyone else
is using without such problems.

Please try the handler in the attached file. It should just fall back to the default handlers, but at least for me it gets in the way for example during file completion. (Tested with CVS Emacs 23 from 2008-07-16.)
(defun mytemp-file-handler (operation &rest args)
  "Bug test. Fall back to default handler."
  (let ((inhibit-file-name-handlers
         (cons 'mytemp-file-handler
               (and (eq inhibit-file-name-operation operation)
                    inhibit-file-name-handlers)))
        (inhibit-file-name-operation operation))
    (apply operation args)))
(put 'mytemp-file-handler 'operation '(insert-file-contents))

(defun mytemp-enable-handler ()
  (interactive)
  (add-to-list 'file-name-handler-alist
               (cons "\\.[a-z]+\\'" 'mytemp-file-handler) t))

(defun mytemp-disable-handler ()
  (interactive)
  (setq file-name-handler-alist
        (delete (cons "\\.[a-z]+\\'" 'mytemp-file-handler)
                file-name-handler-alist)))

reply via email to

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