all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* find-file annoyance
@ 2007-10-17  1:10 Katsumi Yamaoka
  2007-10-17  2:27 ` Miles Bader
  2007-10-17  9:31 ` Johan Bockgård
  0 siblings, 2 replies; 6+ messages in thread
From: Katsumi Yamaoka @ 2007-10-17  1:10 UTC (permalink / raw)
  To: emacs-devel

Hi,

When I invoke C-x C-f, clear the minibuffer, enter a remote file
name like "/frp.example.com:~/foo", and type C-a or C-b in order
to correct the host name to "ftp.example.com", I cannot move the
point to the place before "~" or ":".  Only <backspace> does it
but I have to retype the whole host name.  In addition, I usually
did `C-x C-f C-a C-k C-g' in order to copy the directory name of
the dired buffer to the kill-ring.  Is there a way to make it
behave like Emacs 22.1?

Thanks in advance.

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

* Re: find-file annoyance
  2007-10-17  1:10 find-file annoyance Katsumi Yamaoka
@ 2007-10-17  2:27 ` Miles Bader
  2007-10-17  9:31 ` Johan Bockgård
  1 sibling, 0 replies; 6+ messages in thread
From: Miles Bader @ 2007-10-17  2:27 UTC (permalink / raw)
  To: emacs-devel

Katsumi Yamaoka <yamaoka@jpl.org> writes:
> name like "/frp.example.com:~/foo", and type C-a or C-b in order
> to correct the host name to "ftp.example.com", I cannot move the
> point to the place before "~" or ":".  Only <backspace> does it
> but I have to retype the whole host name.  In addition, I usually
> did `C-x C-f C-a C-k C-g' in order to copy the directory name of
> the dired buffer to the kill-ring.  Is there a way to make it
> behave like Emacs 22.1?

No idea what's actually going on, but this is clearly a bug (not just an
annoyance, though it's certainly an annoying bug :-).

-Miles

-- 
`...the Soviet Union was sliding in to an economic collapse so comprehensive
 that in the end its factories produced not goods but bads: finished products
 less valuable than the raw materials they were made from.'  [The Economist]

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

* Re: find-file annoyance
  2007-10-17  1:10 find-file annoyance Katsumi Yamaoka
  2007-10-17  2:27 ` Miles Bader
@ 2007-10-17  9:31 ` Johan Bockgård
  2007-10-17 18:50   ` Michael Albinus
  1 sibling, 1 reply; 6+ messages in thread
From: Johan Bockgård @ 2007-10-17  9:31 UTC (permalink / raw)
  To: emacs-devel

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> When I invoke C-x C-f, clear the minibuffer, enter a remote file name
> like "/frp.example.com:~/foo", and type C-a or C-b in order to correct
> the host name to "ftp.example.com", I cannot move the point to the
> place before "~" or ":". Only <backspace> does it but I have to retype
> the whole host name. In addition, I usually did `C-x C-f C-a C-k C-g'
> in order to copy the directory name of the dired buffer to the
> kill-ring. Is there a way to make it behave like Emacs 22.1?

tramp-rfn-eshadow-update-overlay uses narrowing in a way that moves
point (the old point was outside the limits). It needs to save-excursion.
(This patch also replaces a call to `widen' with save-restriction.)


2007-10-17  Johan Bockgård  <bojohan@gnu.org>

	* net/tramp.el (tramp-rfn-eshadow-update-overlay): Save excursion.
	Use `save-restriction' rather than `widen'.


Index: tramp.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/net/tramp.el,v
retrieving revision 1.146
diff -c -r1.146 tramp.el
*** tramp.el	10 Oct 2007 04:55:30 -0000	1.146
--- tramp.el	17 Oct 2007 09:17:42 -0000
***************
*** 2092,2103 ****
  			  (symbol-value 'rfn-eshadow-overlay))
  		 (funcall (symbol-function 'minibuffer-prompt-end)))))
      (when (file-remote-p (buffer-substring-no-properties end (point-max)))
!       (narrow-to-region
!        (1+ (or (string-match "/" (buffer-string) end) end)) (point-max))
!       (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
! 	    (rfn-eshadow-update-overlay-hook nil))
! 	(funcall (symbol-function 'rfn-eshadow-update-overlay)))
!       (widen))))
  
  (when (boundp 'rfn-eshadow-update-overlay-hook)
    (add-hook 'rfn-eshadow-update-overlay-hook
--- 2092,2104 ----
  			  (symbol-value 'rfn-eshadow-overlay))
  		 (funcall (symbol-function 'minibuffer-prompt-end)))))
      (when (file-remote-p (buffer-substring-no-properties end (point-max)))
!       (save-excursion
! 	(save-restriction
! 	  (narrow-to-region
! 	   (1+ (or (string-match "/" (buffer-string) end) end)) (point-max))
! 	  (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
! 		(rfn-eshadow-update-overlay-hook nil))
! 	    (funcall (symbol-function 'rfn-eshadow-update-overlay))))))))
  
  (when (boundp 'rfn-eshadow-update-overlay-hook)
    (add-hook 'rfn-eshadow-update-overlay-hook


-- 
Johan Bockgård

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

* Re: find-file annoyance
  2007-10-17  9:31 ` Johan Bockgård
@ 2007-10-17 18:50   ` Michael Albinus
  2007-10-17 23:54     ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Albinus @ 2007-10-17 18:50 UTC (permalink / raw)
  To: emacs-devel

bojohan+news@dd.chalmers.se (Johan Bockgård) writes:

Hi Johan,

> tramp-rfn-eshadow-update-overlay uses narrowing in a way that moves
> point (the old point was outside the limits). It needs to save-excursion.
> (This patch also replaces a call to `widen' with save-restriction.)

Your patch looks OK to me. Please install it (or tell me when I shall do).

Best regards, Michael.

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

* Re: find-file annoyance
  2007-10-17 18:50   ` Michael Albinus
@ 2007-10-17 23:54     ` Katsumi Yamaoka
  2007-10-18 22:50       ` Katsumi Yamaoka
  0 siblings, 1 reply; 6+ messages in thread
From: Katsumi Yamaoka @ 2007-10-17 23:54 UTC (permalink / raw)
  To: emacs-devel

>>>>> Michael Albinus wrote:
> bojohan+news@dd.chalmers.se (Johan Bockgård) writes:

> Hi Johan,

>> tramp-rfn-eshadow-update-overlay uses narrowing in a way that moves
>> point (the old point was outside the limits). It needs to save-excursion.
>> (This patch also replaces a call to `widen' with save-restriction.)

> Your patch looks OK to me. Please install it (or tell me when I shall do).

> Best regards, Michael.

I confirmed the patch solves the problem.  Thanks a lot.

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

* Re: find-file annoyance
  2007-10-17 23:54     ` Katsumi Yamaoka
@ 2007-10-18 22:50       ` Katsumi Yamaoka
  0 siblings, 0 replies; 6+ messages in thread
From: Katsumi Yamaoka @ 2007-10-18 22:50 UTC (permalink / raw)
  To: emacs-devel

>>>>>> Michael Albinus wrote:

>> Your patch looks OK to me. Please install it (or tell me when I shall do).

>>>>> Katsumi Yamaoka wrote:

> I confirmed the patch solves the problem.  Thanks a lot.

I've installed Johan Bockgård's patch in the trunk.  Thanks.

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

end of thread, other threads:[~2007-10-18 22:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-17  1:10 find-file annoyance Katsumi Yamaoka
2007-10-17  2:27 ` Miles Bader
2007-10-17  9:31 ` Johan Bockgård
2007-10-17 18:50   ` Michael Albinus
2007-10-17 23:54     ` Katsumi Yamaoka
2007-10-18 22:50       ` Katsumi Yamaoka

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.