unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Strange loading of vc-bzr with additional file-handler
@ 2008-07-19 13:30 Lennart Borgman (gmail)
  2008-07-19 13:41 ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-19 13:30 UTC (permalink / raw)
  To: Emacs Devel

I am testing a file handler for sending files to the shell when opening 
them. I do not understand all the bits and pieces there. Though I have 
only defined operation 'insert-file-contents it works well most of the 
time, but suddenly I got the strange traceback below.

Debugger entered--Lisp error: (void-function vc-bzr-state-heuristic)
   vc-bzr-state-heuristic("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
   vc-bzr-registered("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
   apply(vc-bzr-registered "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
   vc-call-backend(Bzr registered 
"c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
   #[(b) " \b 	# \x14... (some byte code here)
   vc-registered("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
   apply(vc-registered "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
   (let ((inhibit-file-name-handlers ...) (inhibit-file-name-operation 
operation)) (apply operation args))
   (if done nil (let (... ...) (apply operation args)))
   (unless done (let (... ...) (apply operation args)))
   (let ((done nil) ftype) (when (eq operation ...) (when ... ...) 
(unless ... ... ...)) (unless done (let ... ...)))
   sex-file-handler(vc-registered 
"c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
   vc-registered("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
   vc-backend("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
   #[nil " \b! " [buffer-file-name vc-backend] 2]()
   vc-find-file-hook()
   run-hooks(find-file-hook)
   after-find-file(nil t)
   find-file-noselect-1(#<buffer gimpmode.pdf<2>> 
"c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" nil nil 
"c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" (0 203134463))
   find-file-noselect("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" nil 
nil t)
   ad-Orig-find-file("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" t)
   (setq ad-return-value (ad-Orig-find-file filename wildcards))
   (let (ad-return-value) (setq ad-return-value (ad-Orig-find-file 
filename wildcards)) ad-return-value)
   find-file("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" t)
   call-interactively(find-file nil nil)




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

* Re: Strange loading of vc-bzr with additional file-handler
  2008-07-19 13:30 Strange loading of vc-bzr with additional file-handler Lennart Borgman (gmail)
@ 2008-07-19 13:41 ` Lennart Borgman (gmail)
  2008-07-19 13:46   ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-19 13:41 UTC (permalink / raw)
  To: Emacs Devel

Lennart Borgman (gmail) wrote:
> I am testing a file handler for sending files to the shell when opening 
> them. I do not understand all the bits and pieces there. Though I have 
> only defined operation 'insert-file-contents it works well most of the 
> time, but suddenly I got the strange traceback below.
> 
> Debugger entered--Lisp error: (void-function vc-bzr-state-heuristic)
>   vc-bzr-state-heuristic("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>   vc-bzr-registered("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>   apply(vc-bzr-registered "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>   vc-call-backend(Bzr registered 
> "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>   #[(b) " \b     # \x14... (some byte code here)
>   vc-registered("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>   apply(vc-registered "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>   (let ((inhibit-file-name-handlers ...) (inhibit-file-name-operation 
> operation)) (apply operation args))
>   (if done nil (let (... ...) (apply operation args)))
>   (unless done (let (... ...) (apply operation args)))
>   (let ((done nil) ftype) (when (eq operation ...) (when ... ...) 
> (unless ... ... ...)) (unless done (let ... ...)))
>   sex-file-handler(vc-registered 
> "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>   vc-registered("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>   vc-backend("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>   #[nil " \b! " [buffer-file-name vc-backend] 2]()
>   vc-find-file-hook()
>   run-hooks(find-file-hook)
>   after-find-file(nil t)
>   find-file-noselect-1(#<buffer gimpmode.pdf<2>> 
> "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" nil nil 
> "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" (0 203134463))
>   find-file-noselect("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" nil 
> nil t)
>   ad-Orig-find-file("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" t)
>   (setq ad-return-value (ad-Orig-find-file filename wildcards))
>   (let (ad-return-value) (setq ad-return-value (ad-Orig-find-file 
> filename wildcards)) ad-return-value)
>   find-file("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" t)
>   call-interactively(find-file nil nil)

Here is more info. When trying to exit Emacs after the above error I got 
another error

  Debugger entered--Lisp error: (invalid-read-syntax "#")
   load("c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" nil t t nil)
   apply(load ("c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" 
nil t t))
   (let ((inhibit-file-name-handlers ...) (inhibit-file-name-operation 
operation)) (apply operation args))
   (if done nil (let (... ...) (apply operation args)))
   (unless done (let (... ...) (apply operation args)))
   (let ((done nil) ftype) (when (eq operation ...) (when ... ...) 
(unless ... ... ...)) (unless done (let ... ...)))
   sex-file-handler(load 
"c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" nil t t)
   warn("recentf mode: %s" "Symbol's function definition is void: 
vc-bzr-state-heuristic")
   byte-code("   \b!\" " [error warn "recentf mode: %s" 
error-message-string] 4)
   recentf-save-list()
   run-hooks(kill-emacs-hook)
   kill-emacs()
   save-buffers-kill-emacs()
   save-buffers-kill-terminal(nil)
   call-interactively(save-buffers-kill-terminal nil nil)

This comes when executing code similar to that in

   (info "(elisp) Magic File Names")





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

* Re: Strange loading of vc-bzr with additional file-handler
  2008-07-19 13:41 ` Lennart Borgman (gmail)
@ 2008-07-19 13:46   ` Lennart Borgman (gmail)
  2008-07-19 13:53     ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-19 13:46 UTC (permalink / raw)
  To: Emacs Devel

Lennart Borgman (gmail) wrote:
> Lennart Borgman (gmail) wrote:
>> I am testing a file handler for sending files to the shell when 
>> opening them. I do not understand all the bits and pieces there. 
>> Though I have only defined operation 'insert-file-contents it works 
>> well most of the time, but suddenly I got the strange traceback below.
>>
>> Debugger entered--Lisp error: (void-function vc-bzr-state-heuristic)
>>   vc-bzr-state-heuristic("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>>   vc-bzr-registered("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>>   apply(vc-bzr-registered "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>>   vc-call-backend(Bzr registered 
>> "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>>   #[(b) " \b     # \x14... (some byte code here)
>>   vc-registered("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>>   apply(vc-registered "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>>   (let ((inhibit-file-name-handlers ...) (inhibit-file-name-operation 
>> operation)) (apply operation args))
>>   (if done nil (let (... ...) (apply operation args)))
>>   (unless done (let (... ...) (apply operation args)))
>>   (let ((done nil) ftype) (when (eq operation ...) (when ... ...) 
>> (unless ... ... ...)) (unless done (let ... ...)))
>>   sex-file-handler(vc-registered 
>> "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>>   vc-registered("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>>   vc-backend("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf")
>>   #[nil " \b! " [buffer-file-name vc-backend] 2]()
>>   vc-find-file-hook()
>>   run-hooks(find-file-hook)
>>   after-find-file(nil t)
>>   find-file-noselect-1(#<buffer gimpmode.pdf<2>> 
>> "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" nil nil 
>> "c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" (0 203134463))
>>   find-file-noselect("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" nil 
>> nil t)
>>   ad-Orig-find-file("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" t)
>>   (setq ad-return-value (ad-Orig-find-file filename wildcards))
>>   (let (ad-return-value) (setq ad-return-value (ad-Orig-find-file 
>> filename wildcards)) ad-return-value)
>>   find-file("c:/emacs-lisp/gimp-mode-v1.40/gimpmode.pdf" t)
>>   call-interactively(find-file nil nil)
> 
> Here is more info. When trying to exit Emacs after the above error I got 
> another error
> 
>  Debugger entered--Lisp error: (invalid-read-syntax "#")
>   load("c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" nil t t nil)
>   apply(load ("c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" nil 
> t t))
>   (let ((inhibit-file-name-handlers ...) (inhibit-file-name-operation 
> operation)) (apply operation args))
>   (if done nil (let (... ...) (apply operation args)))
>   (unless done (let (... ...) (apply operation args)))
>   (let ((done nil) ftype) (when (eq operation ...) (when ... ...) 
> (unless ... ... ...)) (unless done (let ... ...)))
>   sex-file-handler(load 
> "c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" nil t t)
>   warn("recentf mode: %s" "Symbol's function definition is void: 
> vc-bzr-state-heuristic")
>   byte-code("   \b!\" " [error warn "recentf mode: %s" 
> error-message-string] 4)
>   recentf-save-list()
>   run-hooks(kill-emacs-hook)
>   kill-emacs()
>   save-buffers-kill-emacs()
>   save-buffers-kill-terminal(nil)
>   call-interactively(save-buffers-kill-terminal nil nil)
> 
> This comes when executing code similar to that in
> 
>   (info "(elisp) Magic File Names")

Some more errors, now after restarting

  apply: End of file during parsing: 
c:/emacs/p/080718/emacs/lisp/url/url-handlers.elc
  completion--some: End of file during parsing: 
c:/emacs/p/080718/emacs/lisp/net/trampver.elc
  apply: End of file during parsing: c:/emacs/p/080718/emacs/lisp/dired.elc




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

* Re: Strange loading of vc-bzr with additional file-handler
  2008-07-19 13:46   ` Lennart Borgman (gmail)
@ 2008-07-19 13:53     ` Lennart Borgman (gmail)
  2008-07-19 14:14       ` Lennart Borgman (gmail)
  2008-07-19 15:49       ` Jason Rumney
  0 siblings, 2 replies; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-19 13:53 UTC (permalink / raw)
  To: Emacs Devel, Michael Albinus

Lennart Borgman (gmail) wrote:
>> Here is more info. When trying to exit Emacs after the above error I 
>> got another error
>>
>>  Debugger entered--Lisp error: (invalid-read-syntax "#")
>>   load("c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" nil t t 
>> nil)
>>   apply(load ("c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" 
>> nil t t))
>>   (let ((inhibit-file-name-handlers ...) (inhibit-file-name-operation 
>> operation)) (apply operation args))
>>   (if done nil (let (... ...) (apply operation args)))
>>   (unless done (let (... ...) (apply operation args)))
>>   (let ((done nil) ftype) (when (eq operation ...) (when ... ...) 
>> (unless ... ... ...)) (unless done (let ... ...)))
>>   sex-file-handler(load 
>> "c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" nil t t)
>>   warn("recentf mode: %s" "Symbol's function definition is void: 
>> vc-bzr-state-heuristic")
>>   byte-code("   \b!\" " [error warn "recentf mode: %s" 
>> error-message-string] 4)
>>   recentf-save-list()
>>   run-hooks(kill-emacs-hook)
>>   kill-emacs()
>>   save-buffers-kill-emacs()
>>   save-buffers-kill-terminal(nil)
>>   call-interactively(save-buffers-kill-terminal nil nil)
>>
>> This comes when executing code similar to that in
>>
>>   (info "(elisp) Magic File Names")
> 
> Some more errors, now after restarting
> 
>  apply: End of file during parsing: 
> c:/emacs/p/080718/emacs/lisp/url/url-handlers.elc
>  completion--some: End of file during parsing: 
> c:/emacs/p/080718/emacs/lisp/net/trampver.elc
>  apply: End of file during parsing: c:/emacs/p/080718/emacs/lisp/dired.elc

Sorry for sending this in small pieces, but here is where I believe the 
error is. Just before the code mentioned above I have put a call to

   (message "operation=%s, args=%s" operation args)

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




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

* Re: Strange loading of vc-bzr with additional file-handler
  2008-07-19 13:53     ` Lennart Borgman (gmail)
@ 2008-07-19 14:14       ` Lennart Borgman (gmail)
  2008-07-19 15:49       ` Jason Rumney
  1 sibling, 0 replies; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-19 14:14 UTC (permalink / raw)
  To: Emacs Devel, Michael Albinus

Lennart Borgman (gmail) wrote:
> Lennart Borgman (gmail) wrote:
>>> Here is more info. When trying to exit Emacs after the above error I 
>>> got another error
>>>
>>>  Debugger entered--Lisp error: (invalid-read-syntax "#")
>>>   load("c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" nil t t 
>>> nil)
>>>   apply(load ("c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" 
>>> nil t t))
>>>   (let ((inhibit-file-name-handlers ...) (inhibit-file-name-operation 
>>> operation)) (apply operation args))
>>>   (if done nil (let (... ...) (apply operation args)))
>>>   (unless done (let (... ...) (apply operation args)))
>>>   (let ((done nil) ftype) (when (eq operation ...) (when ... ...) 
>>> (unless ... ... ...)) (unless done (let ... ...)))
>>>   sex-file-handler(load 
>>> "c:/emacs/p/080718/emacs/lisp/emacs-lisp/warnings.elc" nil t t)
>>>   warn("recentf mode: %s" "Symbol's function definition is void: 
>>> vc-bzr-state-heuristic")
>>>   byte-code("   \b!\" " [error warn "recentf mode: %s" 
>>> error-message-string] 4)
>>>   recentf-save-list()
>>>   run-hooks(kill-emacs-hook)
>>>   kill-emacs()
>>>   save-buffers-kill-emacs()
>>>   save-buffers-kill-terminal(nil)
>>>   call-interactively(save-buffers-kill-terminal nil nil)
>>>
>>> This comes when executing code similar to that in
>>>
>>>   (info "(elisp) Magic File Names")
>>
>> Some more errors, now after restarting
>>
>>  apply: End of file during parsing: 
>> c:/emacs/p/080718/emacs/lisp/url/url-handlers.elc
>>  completion--some: End of file during parsing: 
>> c:/emacs/p/080718/emacs/lisp/net/trampver.elc
>>  apply: End of file during parsing: 
>> c:/emacs/p/080718/emacs/lisp/dired.elc
> 
> Sorry for sending this in small pieces, but here is where I believe the 
> error is. Just before the code mentioned above I have put a call to
> 
>   (message "operation=%s, args=%s" operation args)
> 
> 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)?

Since this looks very strang I give some more output here. After it have 
gone through load-path and found image-mode.elc and calls load it goes 
back to the first entry in load path (which is the directory where I 
have predictive) and tries to expand the file name again against that 
entry. Why?

And then there are several expand-file-name against nil with the found 
file. Only the last one fails. Why?



operation=expand-file-name,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc nil)
operation=file-readable-p,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc)
operation=expand-file-name,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc nil)
operation=expand-file-name,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc
   c:/EmacsW32/nxml/nxhtml/doc/img/)
operation=file-directory-p,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc)
operation=expand-file-name,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc
   c:/EmacsW32/nxml/nxhtml/doc/img/)

operation=load, args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc nil t
   t)
operation=substitute-in-file-name,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc)
operation=expand-file-name,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc
   c:/dl/emacs/predictive/html/)
operation=expand-file-name,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc nil)
operation=file-readable-p,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc)
operation=expand-file-name,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc nil)
operation=expand-file-name,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc
   c:/EmacsW32/nxml/nxhtml/doc/img/)
operation=file-directory-p,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc)
operation=expand-file-name,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc
   c:/EmacsW32/nxml/nxhtml/doc/img/)
operation=file-truename,
   args=(c:/emacs/p/080718/emacs/lisp/image-mode.elc)
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




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

* Re: Strange loading of vc-bzr with additional file-handler
  2008-07-19 13:53     ` Lennart Borgman (gmail)
  2008-07-19 14:14       ` Lennart Borgman (gmail)
@ 2008-07-19 15:49       ` Jason Rumney
  2008-07-19 16:28         ` Lennart Borgman (gmail)
  1 sibling, 1 reply; 10+ messages in thread
From: Jason Rumney @ 2008-07-19 15:49 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Michael Albinus, Emacs Devel

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.






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

* Re: Strange loading of vc-bzr with additional file-handler
  2008-07-19 15:49       ` Jason Rumney
@ 2008-07-19 16:28         ` Lennart Borgman (gmail)
  2008-07-19 16:42           ` Lennart Borgman (gmail)
  2008-07-19 16:45           ` Johan Bockgård
  0 siblings, 2 replies; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-19 16:28 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Michael Albinus, Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

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

[-- Attachment #2: non-file-handler.el --]
[-- Type: text/plain, Size: 755 bytes --]


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

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

* Re: Strange loading of vc-bzr with additional file-handler
  2008-07-19 16:28         ` Lennart Borgman (gmail)
@ 2008-07-19 16:42           ` Lennart Borgman (gmail)
  2008-07-19 16:45           ` Johan Bockgård
  1 sibling, 0 replies; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-19 16:42 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Michael Albinus, Emacs Devel

Lennart Borgman (gmail) wrote:
> 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.)

I think a more exact recipe to reproduce the problem is needed.

   emacs -Q

then load and eval the file I sent. Do

   M-x mytemp-enable-handler
   C-x C-f Tab

gives me (on w32)

   Making completion list...
   apply: End of file during parsing:
     c:/emacs/u/080716/emacs/lisp/view.elc

The same type of problem showsd up for all elisp libraries that Emacs 
tries to load. It seems like Emacs tries to eval the files (as if they 
had extension .el).




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

* Re: Strange loading of vc-bzr with additional file-handler
  2008-07-19 16:28         ` Lennart Borgman (gmail)
  2008-07-19 16:42           ` Lennart Borgman (gmail)
@ 2008-07-19 16:45           ` Johan Bockgård
  2008-07-19 16:50             ` Lennart Borgman (gmail)
  1 sibling, 1 reply; 10+ messages in thread
From: Johan Bockgård @ 2008-07-19 16:45 UTC (permalink / raw)
  To: emacs-devel

"Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:

> (put 'mytemp-file-handler 'operation '(insert-file-contents))
                             ^^^^^^^^^
operations





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

* Re: Strange loading of vc-bzr with additional file-handler
  2008-07-19 16:45           ` Johan Bockgård
@ 2008-07-19 16:50             ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2008-07-19 16:50 UTC (permalink / raw)
  To: emacs-devel

Johan Bockgård wrote:
> "Lennart Borgman (gmail)" <lennart.borgman@gmail.com> writes:
> 
>> (put 'mytemp-file-handler 'operation '(insert-file-contents))
>                              ^^^^^^^^^
> operations

Thanks. I thought that was a bug too ;-)

Can you reproduce the bug I saw?




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

end of thread, other threads:[~2008-07-19 16:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-19 13:30 Strange loading of vc-bzr with additional file-handler Lennart Borgman (gmail)
2008-07-19 13:41 ` Lennart Borgman (gmail)
2008-07-19 13:46   ` Lennart Borgman (gmail)
2008-07-19 13:53     ` Lennart Borgman (gmail)
2008-07-19 14:14       ` Lennart Borgman (gmail)
2008-07-19 15:49       ` Jason Rumney
2008-07-19 16:28         ` Lennart Borgman (gmail)
2008-07-19 16:42           ` Lennart Borgman (gmail)
2008-07-19 16:45           ` Johan Bockgård
2008-07-19 16:50             ` Lennart Borgman (gmail)

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