From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.devel Subject: Re: find-file annoyance Date: Wed, 17 Oct 2007 11:31:01 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1192613496 27329 80.91.229.12 (17 Oct 2007 09:31:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Oct 2007 09:31:36 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 17 11:31:36 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ii5FV-0004mK-UZ for ged-emacs-devel@m.gmane.org; Wed, 17 Oct 2007 11:31:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ii5FO-0002T6-NM for ged-emacs-devel@m.gmane.org; Wed, 17 Oct 2007 05:31:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ii5FK-0002RH-TQ for emacs-devel@gnu.org; Wed, 17 Oct 2007 05:31:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ii5FJ-0002Qt-AZ for emacs-devel@gnu.org; Wed, 17 Oct 2007 05:31:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ii5FJ-0002Qq-5L for emacs-devel@gnu.org; Wed, 17 Oct 2007 05:31:21 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ii5FI-0002Hq-PL for emacs-devel@gnu.org; Wed, 17 Oct 2007 05:31:21 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Ii5F7-0001XR-1n for emacs-devel@gnu.org; Wed, 17 Oct 2007 09:31:09 +0000 Original-Received: from remote4.student.chalmers.se ([129.16.29.77]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 Oct 2007 09:31:09 +0000 Original-Received: from bojohan+news by remote4.student.chalmers.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 17 Oct 2007 09:31:09 +0000 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 60 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: remote4.student.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux) Cancel-Lock: sha1:xKlq55DKdp4Dyr7q1IbTbaxzr3M= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:81056 Archived-At: Katsumi Yamaoka 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 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 * 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