all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tramp+recentf: persistent errors due to expand-file-name
@ 2008-08-10 17:08 David Reitter
  2008-08-11 19:18 ` Michael Albinus
  0 siblings, 1 reply; 9+ messages in thread
From: David Reitter @ 2008-08-10 17:08 UTC (permalink / raw)
  To: Emacs-Devel devel

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

I've been playing around with tramp, which does not recognize a  
location such as /dr@localhost:/tmp/123123//bar  as a local /bar file.

Worse than that, the error that ensues (in combination with recentf- 
mode) prevents users from saving or openeing other files in the future:

Debugger entered--Lisp error: (error "Not a tramp file name: /qweqwe")
   signal(error ("Not a tramp file name: /qweqwe"))
   ad-Orig-error("Not a tramp file name: %s" "/qweqwe")
   apply(ad-Orig-error ("Not a tramp file name: %s" "/qweqwe"))
   error("Not a tramp file name: %s" "/qweqwe")
   tramp-dissect-file-name("/qweqwe")
   tramp-file-name-handler(expand-file-name "/dr@localhost:/tmp/ 
123123//qweqwe" nil)
   expand-file-name("/dr@localhost:/tmp/123123//qweqwe")
   recentf-expand-file-name("/dr@localhost:/tmp/123123//qweqwe")
   recentf-track-opened-file()
   run-hook-with-args-until-success(recentf-track-opened-file)
   basic-save-buffer()
   save-buffer()
   mac-key-save-file()
   call-interactively(mac-key-save-file)

when opening:

Debugger entered--Lisp error: (error "Not a tramp file name: /qweqwe")
   signal(error ("Not a tramp file name: /qweqwe"))
   ad-Orig-error("Not a tramp file name: %s" "/qweqwe")
   apply(ad-Orig-error ("Not a tramp file name: %s" "/qweqwe"))
   error("Not a tramp file name: %s" "/qweqwe")
   tramp-dissect-file-name("/qweqwe")
   tramp-file-name-handler(expand-file-name "/dr@localhost:/tmp/ 
123123//qweqwe" nil)
   expand-file-name("/dr@localhost:/tmp/123123//qweqwe")
   recentf-expand-file-name("/dr@localhost:/tmp/123123//qweqwe")
   recentf-track-opened-file()
   run-hooks(find-file-hook)
   after-find-file(nil t)
   find-file-noselect-1(#<buffer recentf.el.gz> "/Applications/ 
Aquamacs Emacs.app/Contents/Resources/lisp/recentf.el.gz" nil nil "/ 
Applications/Aquamacs Emacs.app/Contents/Resources/lisp/ 
recentf.el.gz" (21798801 234881026))
   find-file-noselect("/Applications/Aquamacs Emacs.app/Contents/ 
Resources/lisp/recentf.el.gz")
   find-function-search-for-symbol(recentf-track-opened-file nil  
"recentf.el")
   #[(fun file) "⇄蠀ࠀ씀=ƒ\x11\0ই℀섀\"\x10ৈ준\b#\x1a峊渀䀀℀蠀 
尀渀䄀茀✀\0尀渀䄀戀舀⨀\0찀!)‡" [file fun location require  
find-func C-source help-C-file-name indirect-function find-function- 
search-for-symbol nil pop-to-buffer message "Unable to find location  
in file"] 4](recentf-track-opened-file "recentf.el")
   apply(#[(fun file) "⇄蠀ࠀ씀=ƒ\x11\0ই℀섀\"\x10ৈ준\b#\x1a峊渀䀀 
℀蠀尀渀䄀茀✀\0尀渀䄀戀舀⨀\0찀!)‡" [file fun location  
require find-func C-source help-C-file-name indirect-function find- 
function-search-for-symbol nil pop-to-buffer message "Unable to find  
location in file"] 4] (recentf-track-opened-file "recentf.el"))
   help-do-xref(59 #[(fun file) "⇄蠀ࠀ씀=ƒ\x11\0ই℀섀\"\x10ৈ준\b#\x1a 
峊渀䀀℀蠀尀渀䄀茀✀\0尀渀䄀戀舀⨀\0찀!)‡" [file fun  
location require find-func C-source help-C-file-name indirect-function  
find-function-search-for-symbol nil pop-to-buffer message "Unable to  
find location in file"] 4] (recentf-track-opened-file "recentf.el"))
   help-button-action(#<marker (moves after insertion) at 63 in *Help*>)
   push-button(63 t)
   push-button((mouse-2 (#<window 15 on *Help*> 63 (439 . 10) 71778152  
nil 63 (62 . 0) nil (5 . 10) (7 . 15))))
   call-interactively(push-button)


The patch below fixes this - comments appreciated.

The alternative would be to fix tramp so it doesn't throw an error  
when expand-file-name is called, but this might prevent it from giving  
proper feedback to the user.



*** lisp/recentf.el	06 Apr 2008 13:51:37 +0200	1.56.2.2
--- lisp/recentf.el	10 Aug 2008 19:04:41 +0200	
***************
*** 394,400 ****
     "Convert file NAME to absolute, and canonicalize it.
   NAME is first passed to the function `expand-file-name', then to
   `recentf-filename-handlers' to post process it."
!   (recentf-apply-filename-handlers (expand-file-name name)))

   (defun recentf-include-p (filename)
     "Return non-nil if FILENAME should be included in the recent list.
--- 394,402 ----
     "Convert file NAME to absolute, and canonicalize it.
   NAME is first passed to the function `expand-file-name', then to
   `recentf-filename-handlers' to post process it."
!   (condition-case nil
!       (recentf-apply-filename-handlers (expand-file-name name))
!     (error name)))

   (defun recentf-include-p (filename)
     "Return non-nil if FILENAME should be included in the recent list.


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

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

end of thread, other threads:[~2008-08-14 18:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-10 17:08 tramp+recentf: persistent errors due to expand-file-name David Reitter
2008-08-11 19:18 ` Michael Albinus
2008-08-12  7:01   ` David Reitter
2008-08-12 12:57     ` Michael Albinus
2008-08-12 13:04       ` Lennart Borgman
2008-08-12 14:41         ` David Reitter
2008-08-12 15:06           ` Lennart Borgman (gmail)
2008-08-12 19:27             ` Stefan Monnier
2008-08-14 18:35               ` Lennart Borgman (gmail)

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.