unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
@ 2006-03-05  0:59 Richard Stallman
  2006-03-05  4:36 ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Richard Stallman @ 2006-03-05  0:59 UTC (permalink / raw)


Would someone like to work on this, please,
and then ack this message?

------- Start of forwarded message -------
From: Michael Cadilhac <michael.cadilhac@lrde.org>
To: emacs-pretest-bug@gnu.org
Date: Fri, 03 Mar 2006 15:35:12 +0100
MIME-Version: 1.0
Subject: PC-do-completion with directories adding stars.
Content-Type: multipart/mixed; boundary="===============0608803208=="

- --===============0608803208==
Content-Type: multipart/signed; boundary="=-=-=";
	micalg=pgp-sha1; protocol="application/pgp-signature"

- --=-=-=
Content-Transfer-Encoding: quoted-printable


  Hi!

  When I do C-x C-f and enter `/a/b/c' then do <TAB>, it results in
=20=20
read-file-name-internal: Opening directory: no such file or directory, /a*/=
b*/c*/

  rather than in a `[No match]'.

  If I continue hitting <TAB>, `*' are added :

read-file-name-internal: Opening directory: no such file or directory, /a**=
/b**/c**/
read-file-name-internal: Opening directory: no such file or directory, /a**=
*/b***/c***/

  Regards.

Configuration follows:
=2D--
In GNU Emacs 22.0.50.34 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2006-03-02 on mahaena
X server distributor `Gentoo (The X.Org Foundation 6.8.2, revision r6-0.1.1=
3)', version 11.0.60802000
configured using `configure '--prefi=3D/usr''

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: en_US
  locale-coding-system: iso-8859-1
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  display-time-mode: t
  savehist-mode: t
  show-paren-mode: t
  partial-completion-mode: t
  iswitchb-mode: t
  jabber-activity-mode: t
  tooltip-mode: t
  auto-compression-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  column-number-mode: t
  line-number-mode: t

=2D-=20
    Michael Cadilhac, a.k.a. Micha [mika] |
                    Epita/LRDE promo 2007 |   )\._.,--....,'``.
123 av. de Fontainebleau | 08.70.65.13.14 |  /.  _.. \   _\  (` ._,.
94270 Le Kremlin Bicetre | 06.23.20.31.30 | '._.-(,_..'--(,_...`-..'

- --=-=-=
Content-Type: application/pgp-signature

- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQBECFQiZYNf4qobZ7kRAiyaAKC8H6lN0UhWnymUCmanJ85QXbkZ7wCeOAtN
i0M9kSTykn+AR5kDWk2LV4w=
=yvoW
- -----END PGP SIGNATURE-----
- --=-=-=--



- --===============0608803208==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

- --===============0608803208==--
------- End of forwarded message -------

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-05  0:59 [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.] Richard Stallman
@ 2006-03-05  4:36 ` Eli Zaretskii
  2006-03-05 14:00   ` Michael Cadilhac
  2006-03-06  0:49   ` Richard Stallman
  0 siblings, 2 replies; 19+ messages in thread
From: Eli Zaretskii @ 2006-03-05  4:36 UTC (permalink / raw)
  Cc: Michael Cadilhac, emacs-devel

> From: Richard Stallman <rms@gnu.org>
> Date: Sat, 04 Mar 2006 19:59:34 -0500
> 
> Would someone like to work on this, please,
> and then ack this message?

It's a feature, not a bug.

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-05  4:36 ` Eli Zaretskii
@ 2006-03-05 14:00   ` Michael Cadilhac
  2006-03-05 19:59     ` Eli Zaretskii
  2006-03-06  0:49   ` Richard Stallman
  1 sibling, 1 reply; 19+ messages in thread
From: Michael Cadilhac @ 2006-03-05 14:00 UTC (permalink / raw)
  Cc: rms, emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 1089 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Richard Stallman <rms@gnu.org>
>> Date: Sat, 04 Mar 2006 19:59:34 -0500
>> 
>> Would someone like to work on this, please,
>> and then ack this message?
>
> It's a feature, not a bug.

  Oh. I thought the feature was :
  /a/b/c is replaced by /at/ba/ca if such a directory exists (done by
  replacing `/' by `*/'), and that's a neat thing.

  but I didn't expect :
  - The stars to appear in the field ; but the field processed like if they
    were here,
  - The stars to be repeated (/a/b/c -> /a*/b*/c* -> /a**/b**/c**)
  - An error message instead of a `[No match]' :
    I don't see why /tmp/this-file-doesnt-exist <TAB> triggers [No match]
    and /a/b/c an error that can raise up the debugger on debug-on-error.

  Is it _really_ the expected behavior ?

-- 
    Michael Cadilhac, a.k.a. Micha [mika] |
                    Epita/LRDE promo 2007 |   )\._.,--....,'``.
123 av. de Fontainebleau | 08.70.65.13.14 |  /.  _.. \   _\  (` ._,.
94270 Le Kremlin Bicetre | 06.23.20.31.30 | '._.-(,_..'--(,_...`-..'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-05 14:00   ` Michael Cadilhac
@ 2006-03-05 19:59     ` Eli Zaretskii
  2006-03-05 20:53       ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2006-03-05 19:59 UTC (permalink / raw)
  Cc: rms, emacs-devel

> From: Michael Cadilhac <michael.cadilhac@lrde.org>
> Cc: rms@gnu.org,  emacs-devel@gnu.org
> Date: Sun, 05 Mar 2006 15:00:39 +0100
> 
> > It's a feature, not a bug.
> 
>   Oh. I thought the feature was :
>   /a/b/c is replaced by /at/ba/ca if such a directory exists (done by
>   replacing `/' by `*/'), and that's a neat thing.

Yes, that too.

>   but I didn't expect :
>   - The stars to appear in the field ; but the field processed like if they
>     were here,
>   - The stars to be repeated (/a/b/c -> /a*/b*/c* -> /a**/b**/c**)
>   - An error message instead of a `[No match]' :
>     I don't see why /tmp/this-file-doesnt-exist <TAB> triggers [No match]
>     and /a/b/c an error that can raise up the debugger on debug-on-error.
> 
>   Is it _really_ the expected behavior ?

Yes, I think so.  I'll let Stefan explain why this is a Good Thing (or
why I don't know what I'm talking about).

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-05 19:59     ` Eli Zaretskii
@ 2006-03-05 20:53       ` Stefan Monnier
  2006-03-05 21:05         ` Luc Teirlinck
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2006-03-05 20:53 UTC (permalink / raw)
  Cc: Michael Cadilhac, rms, emacs-devel

>> > It's a feature, not a bug.
>> Oh. I thought the feature was :
>> /a/b/c is replaced by /at/ba/ca if such a directory exists (done by
>> replacing `/' by `*/'), and that's a neat thing.
> Yes, that too.

That's the main feature.

>> but I didn't expect :
>> - The stars to appear in the field ; but the field processed like if they
>> were here,

I'm not sure what this refers to.  It sounds like a bug.

>> - The stars to be repeated (/a/b/c -> /a*/b*/c* -> /a**/b**/c**)

That's a bug.

>> - An error message instead of a `[No match]' :
>> I don't see why /tmp/this-file-doesnt-exist <TAB> triggers [No match]
>> and /a/b/c an error that can raise up the debugger on debug-on-error.

Sounds like a bug as well.  Of course, this part of the code is difficult to
get right because it uses an underlying shell to do the globbing, so maybe
it's a bug we won't fix.

I don't have you original email and the info you provide above about the
various problems isn't detailed enough for me to know where to look and how
to fix it.  Please give me more details.


        Stefan

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-05 20:53       ` Stefan Monnier
@ 2006-03-05 21:05         ` Luc Teirlinck
  2006-03-06  3:31           ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Luc Teirlinck @ 2006-03-05 21:05 UTC (permalink / raw)
  Cc: eliz, michael.cadilhac, rms, emacs-devel

I am not the OP, but here are the details.

If you do `emacs -q -nbc' and then "C-x C-f" then put "~/a/b/c" in the
minibuffer, while there is no directory ~/a, and then type <tab> you get
the error message:

minibuffer-complete: Opening directory: no such file or directory,
/home/teirllm/a/b/

If now you do `M-x partial-completion-mode' and repeat the experiment,
you get:

read-file-name-internal: Opening directory: no such file or directory,
/home/teirllm/a*/b*/

If you keep repeating the <tab>, the number of stars after a and b
keeps growing.

Sincerely,

Luc.

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-05  4:36 ` Eli Zaretskii
  2006-03-05 14:00   ` Michael Cadilhac
@ 2006-03-06  0:49   ` Richard Stallman
  1 sibling, 0 replies; 19+ messages in thread
From: Richard Stallman @ 2006-03-06  0:49 UTC (permalink / raw)
  Cc: michael.cadilhac, emacs-devel

    > Would someone like to work on this, please,
    > and then ack this message?

    It's a feature, not a bug.

Thanks for working on it.

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-06  3:31           ` Stefan Monnier
@ 2006-03-06  3:31             ` Luc Teirlinck
  2006-03-06  7:43               ` Stefan Monnier
  2006-03-06 14:09             ` Luc Teirlinck
  1 sibling, 1 reply; 19+ messages in thread
From: Luc Teirlinck @ 2006-03-06  3:31 UTC (permalink / raw)
  Cc: eliz, michael.cadilhac, rms, emacs-devel

Stefan Monnier wrote:

   When I try it, I don't get that.  Instead I just see "[Ambiguous dir name]"
   appended to the minibuffer for 2 seconds.

Are you sure that you have no local uninstalled changes?

Sincerely,

Luc.

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-05 21:05         ` Luc Teirlinck
@ 2006-03-06  3:31           ` Stefan Monnier
  2006-03-06  3:31             ` Luc Teirlinck
  2006-03-06 14:09             ` Luc Teirlinck
  0 siblings, 2 replies; 19+ messages in thread
From: Stefan Monnier @ 2006-03-06  3:31 UTC (permalink / raw)
  Cc: eliz, michael.cadilhac, rms, emacs-devel

> I am not the OP, but here are the details.
> If you do `emacs -q -nbc' and then "C-x C-f" then put "~/a/b/c" in the
> minibuffer, while there is no directory ~/a, and then type <tab> you get
> the error message:

> minibuffer-complete: Opening directory: no such file or directory,
> /home/teirllm/a/b/

> If now you do `M-x partial-completion-mode' and repeat the experiment,
> you get:

> read-file-name-internal: Opening directory: no such file or directory,
> /home/teirllm/a*/b*/

When I try it, I don't get that.  Instead I just see "[Ambiguous dir name]"
appended to the minibuffer for 2 seconds.


        Stefan

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-06  3:31             ` Luc Teirlinck
@ 2006-03-06  7:43               ` Stefan Monnier
  0 siblings, 0 replies; 19+ messages in thread
From: Stefan Monnier @ 2006-03-06  7:43 UTC (permalink / raw)
  Cc: eliz, michael.cadilhac, rms, emacs-devel

>    When I try it, I don't get that.  Instead I just see "[Ambiguous dir
>    name]" appended to the minibuffer for 2 seconds.

> Are you sure that you have no local uninstalled changes?

I'm sure I *do* have some local uninstalled changes ;-)
But none that seem relevant.

Also I don't originally get:

> minibuffer-complete: Opening directory: no such file or directory,
> /home/teirllm/a/b/

but only

> Opening directory: no such file or directory, /home/teirllm/a/b/

BTW, this is on a Debian testing GNU/Linux system.


-- Stefan

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-06  3:31           ` Stefan Monnier
  2006-03-06  3:31             ` Luc Teirlinck
@ 2006-03-06 14:09             ` Luc Teirlinck
  2006-03-06 18:38               ` Stefan Monnier
  1 sibling, 1 reply; 19+ messages in thread
From: Luc Teirlinck @ 2006-03-06 14:09 UTC (permalink / raw)
  Cc: eliz, michael.cadilhac, rms, emacs-devel

Stefan Monnier wrote:

   > If now you do `M-x partial-completion-mode' and repeat the experiment,
   > you get:

   > read-file-name-internal: Opening directory: no such file or directory,
   > /home/teirllm/a*/b*/

   When I try it, I don't get that.  Instead I just see "[Ambiguous dir name]"
   appended to the minibuffer for 2 seconds.

Then you must have a subdirectory of ~/ starting with `a'.  If I
create a directory, say ~/amelia, I also get the [Ambiguous dir name].
(If partial completion mode is enabled.)  But if you have no
subdirectory of ~/ starting with `a', you get the *'s.

   Also I don't originally get:

   > minibuffer-complete: Opening directory: no such file or directory,
   > /home/teirllm/a/b/

   but only

   > Opening directory: no such file or directory, /home/teirllm/a/b/

I killed and yanked the message from *Messages*, which adds the
"minibuffer-complete: "

Sincerely,

Luc.

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-06 14:09             ` Luc Teirlinck
@ 2006-03-06 18:38               ` Stefan Monnier
  2006-03-06 20:18                 ` Michael Cadilhac
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2006-03-06 18:38 UTC (permalink / raw)
  Cc: eliz, michael.cadilhac, rms, emacs-devel

>    When I try it, I don't get that.  Instead I just see "[Ambiguous dir name]"
>    appended to the minibuffer for 2 seconds.

> Then you must have a subdirectory of ~/ starting with `a'.

No, that wasn't it.  It turns out the difference is that my shell is zsh.
If I set SHELL to bash I can now reproduce your description.

This happens to illustrate what I said earlier:
> ... Of course, this part of the code is difficult to get right because it
> uses an underlying shell to do the globbing ...

I'll see if I can find a good fix for it,


        Stefan

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-06 18:38               ` Stefan Monnier
@ 2006-03-06 20:18                 ` Michael Cadilhac
  2006-03-06 20:52                   ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Cadilhac @ 2006-03-06 20:18 UTC (permalink / raw)
  Cc: eliz, Luc Teirlinck, rms, emacs-devel


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

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>    When I try it, I don't get that.  Instead I just see "[Ambiguous dir name]"
>>    appended to the minibuffer for 2 seconds.
>
>> Then you must have a subdirectory of ~/ starting with `a'.
>
> No, that wasn't it.  It turns out the difference is that my shell is zsh.
> If I set SHELL to bash I can now reproduce your description.
>
> This happens to illustrate what I said earlier:
>> ... Of course, this part of the code is difficult to get right because it
>> uses an underlying shell to do the globbing ...
>
> I'll see if I can find a good fix for it,

  What about the following for PC-do-completion ?

  This patch fixes a minor issue with files containing spaces in their
  name, too. [1]

  However, I don't see what would be a « good fix » for the general
  completion function (not the PC one).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: Patch --]
[-- Type: text/x-patch, Size: 1940 bytes --]

*** complete.el	2006-03-06 21:07:38.000000000 +0100
--- complete.el	2006-03-06 21:06:33.000000000 +0100
***************
*** 1,7 ****
  ;;; complete.el --- partial completion mechanism plus other goodies
  
  ;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000, 2002, 2003, 2004,
! ;;   2005 Free Software Foundation, Inc.
  
  ;; Author: Dave Gillespie <daveg@synaptics.com>
  ;; Keywords: abbrev convenience
--- 1,7 ----
  ;;; complete.el --- partial completion mechanism plus other goodies
  
  ;; Copyright (C) 1990, 1991, 1992, 1993, 1999, 2000, 2002, 2003, 2004,
! ;;   2005, 2006 Free Software Foundation, Inc.
  
  ;; Author: Dave Gillespie <daveg@synaptics.com>
  ;; Keywords: abbrev convenience
***************
*** 767,783 ****
    (save-excursion
      (set-buffer (generate-new-buffer " *Glob Output*"))
      (erase-buffer)
!     (shell-command (concat "echo " name) t)
      (goto-char (point-min))
!     (if (looking-at ".*No match")
  	nil
        (insert "(\"")
!       (while (search-forward " " nil t)
  	(delete-backward-char 1)
  	(insert "\" \""))
!       (goto-char (point-max))
!       (delete-backward-char 1)
!       (insert "\")")
        (goto-char (point-min))
        (let ((files (read (current-buffer))) (p nil))
  	(kill-buffer (current-buffer))
--- 767,783 ----
    (save-excursion
      (set-buffer (generate-new-buffer " *Glob Output*"))
      (erase-buffer)
!     (shell-command (concat "for f in " name "; do test -e \"$f\" && echo \"$f\"; done") t)
      (goto-char (point-min))
!     (if (looking-at "\\($\\|.*No match\\)")
  	nil
        (insert "(\"")
!       (setq goal-column 0)
!       (while (= (forward-line 1) 0)
  	(delete-backward-char 1)
  	(insert "\" \""))
!       (delete-backward-char 2)
!       (insert ")")
        (goto-char (point-min))
        (let ((files (read (current-buffer))) (p nil))
  	(kill-buffer (current-buffer))

[-- Attachment #1.1.3: Type: text/plain, Size: 657 bytes --]



  Note that  the for loop  has to  check « test  -e » because  of this
  standard sh behavior :

  $ for f in /a*/b*/c*/d*; echo $f; done
  /a*/b*/c*/d*
  $ 


Footnotes: 
[1]  Example :

cd /tmp ; mkdir test; touch test/'this is a test'
C-x C-f /tmp/tes/this <TAB> : Ambigous dir name

with the patch

C-x C-f /tmp/tes/this <TAB> rightly turns into « /tmp/test/this is a test »

-- 
    Michael Cadilhac, a.k.a. Micha [mika] |
                    Epita/LRDE promo 2007 |   )\._.,--....,'``.
123 av. de Fontainebleau | 08.70.65.13.14 |  /.  _.. \   _\  (` ._,.
94270 Le Kremlin Bicetre | 06.23.20.31.30 | '._.-(,_..'--(,_...`-..'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-06 20:18                 ` Michael Cadilhac
@ 2006-03-06 20:52                   ` Stefan Monnier
  2006-03-06 21:01                     ` Michael Cadilhac
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Monnier @ 2006-03-06 20:52 UTC (permalink / raw)
  Cc: eliz, Luc Teirlinck, rms, emacs-devel

>>> When I try it, I don't get that.  Instead I just see "[Ambiguous dir name]"
>>> appended to the minibuffer for 2 seconds.
>> 
>>> Then you must have a subdirectory of ~/ starting with `a'.
>> 
>> No, that wasn't it.  It turns out the difference is that my shell is zsh.
>> If I set SHELL to bash I can now reproduce your description.
>> 
>> This happens to illustrate what I said earlier:
>>> ... Of course, this part of the code is difficult to get right because it
>>> uses an underlying shell to do the globbing ...
>> 
>> I'll see if I can find a good fix for it,

I installed a fix for it.

>   This patch fixes a minor issue with files containing spaces in their
>   name, too. [1]

Yes, my patch doesn't try to address it.

>   However, I don't see what would be a « good fix » for the general
>   completion function (not the PC one).

I'm not sure what needs fixing there.

> !     (shell-command (concat "for f in " name "; do test -e \"$f\" && echo \"$f\"; done") t)

Problem is that this will fail depending on the user's shell (zsh vs tcsh
vs bash vs rc vs ...).
We could maybe use (concat "ls " name) which would do something mostly
equivalent but slightly more portable.  But really we should just use
shell's globbing commands instead.


        Stefan

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-06 20:52                   ` Stefan Monnier
@ 2006-03-06 21:01                     ` Michael Cadilhac
  2006-03-07  4:49                       ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Cadilhac @ 2006-03-06 21:01 UTC (permalink / raw)
  Cc: Luc Teirlinck, eliz, Michael Cadilhac, rms, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>
>> !     (shell-command (concat "for f in " name "; do test -e \"$f\" && echo \"$f\"; done") t)
>
> Problem is that this will fail depending on the user's shell (zsh vs tcsh
> vs bash vs rc vs ...).

  Well, can't we just do something like

  (let ((shell-file-name "sh"))
     (shell-command ...))

   Or directly use (call-process "sh" ...)  to make sure we have
   a Bourne compatible shell ?

   Maybe there's an issue with Windows, I don't know.

-- 
    Michael Cadilhac, a.k.a. Micha [mika] |
                    Epita/LRDE promo 2007 |   )\._.,--....,'``.
123 av. de Fontainebleau | 08.70.65.13.14 |  /.  _.. \   _\  (` ._,.
94270 Le Kremlin Bicetre | 06.23.20.31.30 | '._.-(,_..'--(,_...`-..'

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-06 21:01                     ` Michael Cadilhac
@ 2006-03-07  4:49                       ` Eli Zaretskii
  2006-03-07 11:26                         ` Juanma Barranquero
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2006-03-07  4:49 UTC (permalink / raw)
  Cc: emacs-devel

> From: Michael Cadilhac <michael.cadilhac@lrde.org>
> Cc: Michael Cadilhac <michael.cadilhac@lrde.org>,  Luc Teirlinck <teirllm@dms.auburn.edu>,  eliz@gnu.org,  rms@gnu.org,  emacs-devel@gnu.org
> Date: Mon, 06 Mar 2006 22:01:43 +0100
> 
> > Problem is that this will fail depending on the user's shell (zsh vs tcsh
> > vs bash vs rc vs ...).
> 
>   Well, can't we just do something like
> 
>   (let ((shell-file-name "sh"))
>      (shell-command ...))
> 
>    Or directly use (call-process "sh" ...)  to make sure we have
>    a Bourne compatible shell ?
> 
>    Maybe there's an issue with Windows, I don't know.

Yes, there is.  You cannot assume there's a port of "sh" on Windows.
So any solution that needs "sh" is not a good idea.

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-07  4:49                       ` Eli Zaretskii
@ 2006-03-07 11:26                         ` Juanma Barranquero
  2006-03-07 19:35                           ` Eli Zaretskii
  0 siblings, 1 reply; 19+ messages in thread
From: Juanma Barranquero @ 2006-03-07 11:26 UTC (permalink / raw)
  Cc: emacs-devel

On 3/7/06, Eli Zaretskii <eliz@gnu.org> wrote:

> Yes, there is.  You cannot assume there's a port of "sh" on Windows.

Well, yeah, you *can* assume there's a port of "sh" (or at least,
bash) on Windows (several in fact, as you already know) ;-)

But certainly it wouldn't be wise to assume the computer Emacs is
running on has "sh" available.

--
                    /L/e/k/t/u

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-07 11:26                         ` Juanma Barranquero
@ 2006-03-07 19:35                           ` Eli Zaretskii
  2006-03-07 23:21                             ` Juanma Barranquero
  0 siblings, 1 reply; 19+ messages in thread
From: Eli Zaretskii @ 2006-03-07 19:35 UTC (permalink / raw)
  Cc: emacs-devel

> Date: Tue, 7 Mar 2006 12:26:17 +0100
> From: "Juanma Barranquero" <lekktu@gmail.com>
> Cc: emacs-devel@gnu.org
> 
> But certainly it wouldn't be wise to assume the computer Emacs is
> running on has "sh" available.

That's exactly what I meant, sorry it wasn't clear enough from my
original wording.

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

* Re: [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.]
  2006-03-07 19:35                           ` Eli Zaretskii
@ 2006-03-07 23:21                             ` Juanma Barranquero
  0 siblings, 0 replies; 19+ messages in thread
From: Juanma Barranquero @ 2006-03-07 23:21 UTC (permalink / raw)
  Cc: emacs-devel

On 3/7/06, Eli Zaretskii <eliz@gnu.org> wrote:

> That's exactly what I meant, sorry it wasn't clear enough from my
> original wording.

It was clear enough all right; I was just adding a little lighthearted
noise to the thread...

--
                    /L/e/k/t/u

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

end of thread, other threads:[~2006-03-07 23:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-05  0:59 [michael.cadilhac@lrde.org: PC-do-completion with directories adding stars.] Richard Stallman
2006-03-05  4:36 ` Eli Zaretskii
2006-03-05 14:00   ` Michael Cadilhac
2006-03-05 19:59     ` Eli Zaretskii
2006-03-05 20:53       ` Stefan Monnier
2006-03-05 21:05         ` Luc Teirlinck
2006-03-06  3:31           ` Stefan Monnier
2006-03-06  3:31             ` Luc Teirlinck
2006-03-06  7:43               ` Stefan Monnier
2006-03-06 14:09             ` Luc Teirlinck
2006-03-06 18:38               ` Stefan Monnier
2006-03-06 20:18                 ` Michael Cadilhac
2006-03-06 20:52                   ` Stefan Monnier
2006-03-06 21:01                     ` Michael Cadilhac
2006-03-07  4:49                       ` Eli Zaretskii
2006-03-07 11:26                         ` Juanma Barranquero
2006-03-07 19:35                           ` Eli Zaretskii
2006-03-07 23:21                             ` Juanma Barranquero
2006-03-06  0:49   ` Richard Stallman

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