unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
@ 2009-05-09 17:37 ` Chris Withers
  2009-05-09 22:37   ` Stefan Monnier
  2009-05-11 15:40   ` bug#3250: marked as done (23.0.93; tab completion flakey with tramp when insert-default-directory is nil) Emacs bug Tracking System
  0 siblings, 2 replies; 12+ messages in thread
From: Chris Withers @ 2009-05-09 17:37 UTC (permalink / raw)
  To: emacs-pretest-bug

With the following in my .emacs:

(setq insert-default-directory nil)

tab completion when using tramp to access a remote file becomes flakey.
It seems that the notion of the current working directory becomes lost,
so tab completion ends up with doubled up directories, eg:

/home/chris/afolder/afolder

...where afolder doesn't exist, resulting in errors such as the following:

File error: tramp-handle-file-name-all-completions: Couldn't `cd 
/home/chris/afolder/afolder/'

This doesn't happen right away, but I usually end up bumping into it 
when navigating
around a folder structure by inserting .. a number of times in the 
minibuffer window.

In GNU Emacs 23.0.93.1 (i386-mingw-nt5.1.2600)
  of 2009-05-02 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: nil
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: ENG
   value of $XMODIFIERS: nil
   locale-coding-system: cp1252
   default-enable-multibyte-characters: t

Major mode: GNUmakefile

Minor modes in effect:
   shell-dirtrack-mode: t
   cua-mode: t
   tooltip-mode: t
   mouse-wheel-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   global-auto-composition-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk






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

* bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
  2009-05-09 17:37 ` bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil Chris Withers
@ 2009-05-09 22:37   ` Stefan Monnier
  2009-05-09 22:51     ` Chris Withers
  2009-05-11 15:40   ` bug#3250: marked as done (23.0.93; tab completion flakey with tramp when insert-default-directory is nil) Emacs bug Tracking System
  1 sibling, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2009-05-09 22:37 UTC (permalink / raw)
  To: Chris Withers; +Cc: 3250

> (setq insert-default-directory nil)

> tab completion when using tramp to access a remote file becomes flakey.
> It seems that the notion of the current working directory becomes lost,
> so tab completion ends up with doubled up directories, eg:

> /home/chris/afolder/afolder

> ...where afolder doesn't exist, resulting in errors such as the following:

> File error: tramp-handle-file-name-all-completions: Couldn't `cd
> /home/chris/afolder/afolder/'

> This doesn't happen right away, but I usually end up bumping into it when
> navigating
> around a folder structure by inserting .. a number of times in the
> minibuffer window.

I don't know if Michael can fix it based on the above report, but
I expect that a reproducible test case starting from "emacs -Q"
would help.


        Stefan






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

* bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
  2009-05-09 22:37   ` Stefan Monnier
@ 2009-05-09 22:51     ` Chris Withers
  0 siblings, 0 replies; 12+ messages in thread
From: Chris Withers @ 2009-05-09 22:51 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 3250

Stefan Monnier wrote:
> I don't know if Michael can fix it based on the above report, but
> I expect that a reproducible test case starting from "emacs -Q"
> would help.

really not sure how to go about doing that, is there a how-to anywhere?

fwiw, not sure this is tramp related, I've had similar weirdity when 
just opening local files with (setq insert-default-directory nil).
The minibuffer just seems to get lost as to which directory it's in...

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk






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

* bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
  2009-05-10 21:50 bug#3250: Re: bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil Chong Yidong
@ 2009-05-10 21:53 ` Chris Withers
  2009-05-10 22:04   ` Chong Yidong
  0 siblings, 1 reply; 12+ messages in thread
From: Chris Withers @ 2009-05-10 21:53 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 3250

Chong Yidong wrote:
>> fwiw, not sure this is tramp related, I've had similar weirdity when
>> just opening local files with (setq insert-default-directory nil).
>> The minibuffer just seems to get lost as to which directory it's in...
> 
> Your description is too vague.  Please give exact, step by step
> instructions about how to see this bug.

It's a pretty vague bug :-S

Try:

-(setq insert-default-directory nil) in .emacs
-restart
C-x C-f
..
- then try using tab completion

Trying to get into a parent or the current directory and then using tab 
completion seems to be the root of the problem. I don't know any way of 
doing that other than using '../' as a path, and that seems to be what 
causes the problem.

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk






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

* bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
  2009-05-10 21:53 ` Chris Withers
@ 2009-05-10 22:04   ` Chong Yidong
  2009-05-10 22:05     ` Chris Withers
  0 siblings, 1 reply; 12+ messages in thread
From: Chong Yidong @ 2009-05-10 22:04 UTC (permalink / raw)
  To: Chris Withers; +Cc: 3250

Chris Withers <chris@simplistix.co.uk> writes:

> -(setq insert-default-directory nil) in .emacs
> -restart
> C-x C-f
> ..
> - then try using tab completion

Pressing TAB shows the contents of my home directory.  This is expected
behavior.  What behavior do you observe?






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

* bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
  2009-05-10 22:04   ` Chong Yidong
@ 2009-05-10 22:05     ` Chris Withers
  2009-05-10 22:24       ` Chong Yidong
  0 siblings, 1 reply; 12+ messages in thread
From: Chris Withers @ 2009-05-10 22:05 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 3250

Chong Yidong wrote:
> Chris Withers <chris@simplistix.co.uk> writes:
> 
>> -(setq insert-default-directory nil) in .emacs
>> -restart
>> C-x C-f
>> ..
>> - then try using tab completion
> 
> Pressing TAB shows the contents of my home directory.  This is expected
> behavior.  What behavior do you observe?

Did you do the all important '..' to go to a parent directory?
Did you then try and tab-complete into a sub-directory?
Did you have (setq insert-default-directory nil) set in your .emacs file?

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk






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

* bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
  2009-05-10 22:05     ` Chris Withers
@ 2009-05-10 22:24       ` Chong Yidong
  2009-05-10 22:42         ` Chris Withers
  0 siblings, 1 reply; 12+ messages in thread
From: Chong Yidong @ 2009-05-10 22:24 UTC (permalink / raw)
  To: Chris Withers; +Cc: 3250

Chris Withers <chris@simplistix.co.uk> writes:

>>> -(setq insert-default-directory nil) in .emacs
>>> -restart
>>> C-x C-f
>>> ..
>>> - then try using tab completion
>>
>> Pressing TAB shows the contents of my home directory.  This is expected
>> behavior.  What behavior do you observe?
>
> Did you do the all important '..' to go to a parent directory?

After typing `..', I type TAB.  The text in the minibuffer completes to

  ../

After typing TAB again, Emacs offers a completions list showing the
directories in /home.  This is expected.






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

* bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
  2009-05-10 22:24       ` Chong Yidong
@ 2009-05-10 22:42         ` Chris Withers
  2009-05-11  3:30           ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Chris Withers @ 2009-05-10 22:42 UTC (permalink / raw)
  To: Chong Yidong; +Cc: 3250

Chong Yidong wrote:
>> Did you do the all important '..' to go to a parent directory?
> 
> After typing `..', I type TAB.  The text in the minibuffer completes to
> 
>   ../
> 
> After typing TAB again, Emacs offers a completions list showing the
> directories in /home.  This is expected.

Okay, here's what I did:

- open a file in a folder
- C-x C-f
- .. TAB to go to parent folder of the folder containing the file you opened
- type 'so' and hit TAB
- minibuffer now shows "../something/", *Completions* shows contents of 
'something' folder
- now delete all characters in the minibuffer with backspace
- hit TAB, *Completions* still shows contents of 'something' folder
- type first two characters of a name in *Completions*, no completion 
happens [1]
- delete those two characters
- type 'so' and hit TAB
- minibuffer now shows "something/"
- hitting TAB one or two more times and *Completions* once more shows 
the contents of 'something' folder
- type first two characters of a name in *Completions*, no completion 
happens and current working directory in minibuffer seems very confused [1]

[1] these bullet points feel like bugs to me...

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk






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

* bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
  2009-05-10 22:42         ` Chris Withers
@ 2009-05-11  3:30           ` Stefan Monnier
  2009-05-11  8:13             ` Chris Withers
  0 siblings, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2009-05-11  3:30 UTC (permalink / raw)
  To: Chris Withers; +Cc: 3250, Chong Yidong

> Okay, here's what I did:

> - open a file in a folder
> - C-x C-f
> - .. TAB to go to parent folder of the folder containing the file you opened
> - type 'so' and hit TAB
> - minibuffer now shows "../something/", *Completions* shows contents of
> something' folder
> - now delete all characters in the minibuffer with backspace
> - hit TAB, *Completions* still shows contents of 'something' folder
> - type first two characters of a name in *Completions*, no completion
> happens [1]
> - delete those two characters
> - type 'so' and hit TAB
> - minibuffer now shows "something/"
> - hitting TAB one or two more times and *Completions* once more shows the
> contents of 'something' folder
> - type first two characters of a name in *Completions*, no completion
> happens and current working directory in minibuffer seems very confused [1]

> [1] these bullet points feel like bugs to me...

Thank you.  This should be enough for me (or whoever else gets to it
first, but it looks like a bug in my new completion code) to find
the problem.


        Stefan






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

* bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
  2009-05-11  3:30           ` Stefan Monnier
@ 2009-05-11  8:13             ` Chris Withers
  2009-05-11 14:13               ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Chris Withers @ 2009-05-11  8:13 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 3250, Chong Yidong

Stefan Monnier wrote:
> Thank you.  This should be enough for me (or whoever else gets to it
> first, but it looks like a bug in my new completion code) to find
> the problem.

Does this mean you can reproduce the problem(s)?

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk






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

* bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
  2009-05-11  8:13             ` Chris Withers
@ 2009-05-11 14:13               ` Stefan Monnier
  0 siblings, 0 replies; 12+ messages in thread
From: Stefan Monnier @ 2009-05-11 14:13 UTC (permalink / raw)
  To: Chris Withers; +Cc: 3250, Chong Yidong

>> Thank you.  This should be enough for me (or whoever else gets to it
>> first, but it looks like a bug in my new completion code) to find
>> the problem.
> Does this mean you can reproduce the problem(s)?

Yes,


        Stefan






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

* bug#3250: marked as done (23.0.93; tab completion flakey with  tramp when insert-default-directory is nil)
  2009-05-09 17:37 ` bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil Chris Withers
  2009-05-09 22:37   ` Stefan Monnier
@ 2009-05-11 15:40   ` Emacs bug Tracking System
  1 sibling, 0 replies; 12+ messages in thread
From: Emacs bug Tracking System @ 2009-05-11 15:40 UTC (permalink / raw)
  To: Stefan Monnier

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


Your message dated Mon, 11 May 2009 11:33:21 -0400
with message-id <jwvd4afirll.fsf-monnier+emacsbugreports@gnu.org>
and subject line Re: bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
has caused the Emacs bug report #3250,
regarding 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
3250: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3250
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3721 bytes --]

From: Chris Withers <chris@simplistix.co.uk>
To: emacs-pretest-bug@gnu.org
Subject: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
Date: Sat, 09 May 2009 18:37:00 +0100
Message-ID: <4A05BF3C.3060606@simplistix.co.uk>

With the following in my .emacs:

(setq insert-default-directory nil)

tab completion when using tramp to access a remote file becomes flakey.
It seems that the notion of the current working directory becomes lost,
so tab completion ends up with doubled up directories, eg:

/home/chris/afolder/afolder

...where afolder doesn't exist, resulting in errors such as the following:

File error: tramp-handle-file-name-all-completions: Couldn't `cd 
/home/chris/afolder/afolder/'

This doesn't happen right away, but I usually end up bumping into it 
when navigating
around a folder structure by inserting .. a number of times in the 
minibuffer window.

In GNU Emacs 23.0.93.1 (i386-mingw-nt5.1.2600)
  of 2009-05-02 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'

Important settings:
   value of $LC_ALL: nil
   value of $LC_COLLATE: nil
   value of $LC_CTYPE: nil
   value of $LC_MESSAGES: nil
   value of $LC_MONETARY: nil
   value of $LC_NUMERIC: nil
   value of $LC_TIME: nil
   value of $LANG: ENG
   value of $XMODIFIERS: nil
   locale-coding-system: cp1252
   default-enable-multibyte-characters: t

Major mode: GNUmakefile

Minor modes in effect:
   shell-dirtrack-mode: t
   cua-mode: t
   tooltip-mode: t
   mouse-wheel-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   global-auto-composition-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   line-number-mode: t
   transient-mark-mode: t

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



[-- Attachment #3: Type: message/rfc822, Size: 3870 bytes --]

From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Chris Withers <chris@simplistix.co.uk>
Cc: 3250-done@emacsbugs.donarmstrong.com, Chong Yidong <cyd@stupidchicken.com>
Subject: Re: bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil
Date: Mon, 11 May 2009 11:33:21 -0400
Message-ID: <jwvd4afirll.fsf-monnier+emacsbugreports@gnu.org>

> Okay, here's what I did:

The recipe I used was:

   > emacs -Q
   C-x C-f
   C-a C-k
   TAB
   left right
   TAB
   left right
   TAB

where you see that default-directory moves up one level each time the
*Completions* buffer is refreshed.

The patch below fixes the problem,


        Stefan


--- simple.el.~1.986.~	2009-05-03 21:41:00.000000000 -0400
+++ simple.el	2009-05-11 11:30:20.000000000 -0400
@@ -5851,20 +5851,23 @@
 ;; after the text of the completion list buffer is written.
 (defun completion-setup-function ()
   (let* ((mainbuf (current-buffer))
-         (mbuf-contents (minibuffer-completion-contents))
-         common-string-length)
+         (base-dir
     ;; When reading a file name in the minibuffer,
-    ;; set default-directory in the minibuffer
-    ;; so it will get copied into the completion list buffer.
+          ;; try and find the right default-directory to set in the
+          ;; completion list buffer.
+          ;; FIXME: Why do we do that, actually?  --Stef
     (if minibuffer-completing-file-name
-	(with-current-buffer mainbuf
-	  (setq default-directory
-                (file-name-directory (expand-file-name mbuf-contents)))))
+              (file-name-as-directory
+               (expand-file-name
+                (substring (minibuffer-completion-contents)
+                           0 (or completion-base-size 0))))))
+         common-string-length)
     (with-current-buffer standard-output
       (let ((base-size completion-base-size)) ;Read before killing localvars.
         (completion-list-mode)
         (set (make-local-variable 'completion-base-size) base-size))
       (set (make-local-variable 'completion-reference-buffer) mainbuf)
+      (if base-dir (setq default-directory base-dir))
       (unless completion-base-size
         ;; This shouldn't be needed any more, but further analysis is needed
         ;; to make sure it's the case.


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

end of thread, other threads:[~2009-05-11 15:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <jwvd4afirll.fsf-monnier+emacsbugreports@gnu.org>
2009-05-09 17:37 ` bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil Chris Withers
2009-05-09 22:37   ` Stefan Monnier
2009-05-09 22:51     ` Chris Withers
2009-05-11 15:40   ` bug#3250: marked as done (23.0.93; tab completion flakey with tramp when insert-default-directory is nil) Emacs bug Tracking System
2009-05-10 21:50 bug#3250: Re: bug#3250: 23.0.93; tab completion flakey with tramp when insert-default-directory is nil Chong Yidong
2009-05-10 21:53 ` Chris Withers
2009-05-10 22:04   ` Chong Yidong
2009-05-10 22:05     ` Chris Withers
2009-05-10 22:24       ` Chong Yidong
2009-05-10 22:42         ` Chris Withers
2009-05-11  3:30           ` Stefan Monnier
2009-05-11  8:13             ` Chris Withers
2009-05-11 14:13               ` Stefan Monnier

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