unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Small bug in PC-expand-many-files.
@ 2006-06-05 23:59 Michaël Cadilhac
  2006-06-13 14:37 ` Michaël Cadilhac
  0 siblings, 1 reply; 5+ messages in thread
From: Michaël Cadilhac @ 2006-06-05 23:59 UTC (permalink / raw)



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


Recipe:
In your ~, you have a directory `helloworld' in which there's a file
called `foobarbaz'. You don't have a directory named `demaille'.

$ emacs -Q
M-x partial-completion-mode RET
C-x C-f ~/demaille/akim RET
 (message: Use M-x make-directory RET RET to create the directory and
 its parents)

C-x C-f ~/hell/foo TAB
 (*error*: shell-command: Setting current directory: no such file or
 directory, /home/micha/demaille)


This is due to a call to `call-process' within a buffer created after
the `akim' one, from which it takes its default directory.

I propose the following change, which AFAICT, fixes the bug:


[-- Attachment #1.1.2: complete.patch --]
[-- Type: text/x-patch, Size: 1367 bytes --]

Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.9661
diff -c -r1.9661 ChangeLog
*** lisp/ChangeLog	1 Jun 2006 06:42:07 -0000	1.9661
--- lisp/ChangeLog	5 Jun 2006 23:51:00 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2006-06-06  Michaël Cadilhac  <micha@mahaena.lrde>
+ 
+ 	* complete.el (PC-expand-many-files): Go to the home directory
+ 	before `shell-command' if the default one is not executable.
+ 
  2006-06-01  Jan Djärv  <jan.h.d@swipnet.se>
  
  	* term/x-win.el: Change x-menu-bar-start to menu-bar-open.
Index: lisp/complete.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/complete.el,v
retrieving revision 1.53
diff -c -r1.53 complete.el
*** lisp/complete.el	22 May 2006 18:09:40 -0000	1.53
--- lisp/complete.el	5 Jun 2006 23:51:00 -0000
***************
*** 778,783 ****
--- 778,785 ----
  (defun PC-expand-many-files (name)
    (with-current-buffer (generate-new-buffer " *Glob Output*")
      (erase-buffer)
+     (unless (file-executable-p default-directory)
+       (setq default-directory "~/"))
      (shell-command (concat "echo " name) t)
      (goto-char (point-min))
      ;; CSH-style shells were known to output "No match", whereas

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


-- 
 |      Michaël `Micha' Cadilhac   |  Un certain Blaise Pascal              |
 |         Epita/LRDE Promo 2007   |    etc... etc...                       |
 | http://www.lrde.org/~cadilh_m   |  -- Prévert (Les paris stupides)       |
 `--  -   JID: micha@amessage.be --'                                   -  --'

[-- 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] 5+ messages in thread

* Re: Small bug in PC-expand-many-files.
  2006-06-05 23:59 Small bug in PC-expand-many-files Michaël Cadilhac
@ 2006-06-13 14:37 ` Michaël Cadilhac
  2006-07-17 11:30   ` Michaël Cadilhac
  2006-07-29 12:16   ` Michaël Cadilhac
  0 siblings, 2 replies; 5+ messages in thread
From: Michaël Cadilhac @ 2006-06-13 14:37 UTC (permalink / raw)



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

michael.cadilhac@lrde.org (Michaël Cadilhac) writes:

> Recipe:
> In your ~, you have a directory `helloworld' in which there's a file
> called `foobarbaz'. You don't have a directory named `demaille'.
>
> $ emacs -Q
> M-x partial-completion-mode RET
> C-x C-f ~/demaille/akim RET
>  (message: Use M-x make-directory RET RET to create the directory and
>  its parents)
>
> C-x C-f ~/hell/foo TAB
>  (*error*: shell-command: Setting current directory: no such file or
>  directory, /home/micha/demaille)
>
>
> This is due to a call to `call-process' within a buffer created after
> the `akim' one, from which it takes its default directory.
>
> I propose the following change, which AFAICT, fixes the bug:

Can anyone review this proposal? TIA.


[-- Attachment #1.1.2: complete.patch --]
[-- Type: text/x-patch, Size: 1367 bytes --]

Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.9661
diff -c -r1.9661 ChangeLog
*** lisp/ChangeLog	1 Jun 2006 06:42:07 -0000	1.9661
--- lisp/ChangeLog	5 Jun 2006 23:51:00 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2006-06-06  Michaël Cadilhac  <micha@mahaena.lrde>
+ 
+ 	* complete.el (PC-expand-many-files): Go to the home directory
+ 	before `shell-command' if the default one is not executable.
+ 
  2006-06-01  Jan Djärv  <jan.h.d@swipnet.se>
  
  	* term/x-win.el: Change x-menu-bar-start to menu-bar-open.
Index: lisp/complete.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/complete.el,v
retrieving revision 1.53
diff -c -r1.53 complete.el
*** lisp/complete.el	22 May 2006 18:09:40 -0000	1.53
--- lisp/complete.el	5 Jun 2006 23:51:00 -0000
***************
*** 778,783 ****
--- 778,785 ----
  (defun PC-expand-many-files (name)
    (with-current-buffer (generate-new-buffer " *Glob Output*")
      (erase-buffer)
+     (unless (file-executable-p default-directory)
+       (setq default-directory "~/"))
      (shell-command (concat "echo " name) t)
      (goto-char (point-min))
      ;; CSH-style shells were known to output "No match", whereas

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


-- 
 |      Michaël `Micha' Cadilhac   |  Un certain Blaise Pascal              |
 |         Epita/LRDE Promo 2007   |    etc... etc...                       |
 | http://www.lrde.org/~cadilh_m   |  -- Prévert (Les paris stupides)       |
 `--  -   JID: micha@amessage.be --'                                   -  --'

[-- 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] 5+ messages in thread

* Re: Small bug in PC-expand-many-files.
  2006-06-13 14:37 ` Michaël Cadilhac
@ 2006-07-17 11:30   ` Michaël Cadilhac
  2006-07-29 12:16   ` Michaël Cadilhac
  1 sibling, 0 replies; 5+ messages in thread
From: Michaël Cadilhac @ 2006-07-17 11:30 UTC (permalink / raw)



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

michael.cadilhac@lrde.org (Michaël Cadilhac) writes:

> michael.cadilhac@lrde.org (Michaël Cadilhac) writes:
>
>> Recipe:
>> In your ~, you have a directory `helloworld' in which there's a file
>> called `foobarbaz'. You don't have a directory named `demaille'.
>>
>> $ emacs -Q
>> M-x partial-completion-mode RET
>> C-x C-f ~/demaille/akim RET
>>  (message: Use M-x make-directory RET RET to create the directory and
>>  its parents)
>>
>> C-x C-f ~/hell/foo TAB
>>  (*error*: shell-command: Setting current directory: no such file or
>>  directory, /home/micha/demaille)
>>
>>
>> This is due to a call to `call-process' within a buffer created after
>> the `akim' one, from which it takes its default directory.
>>
>> I propose the following change, which AFAICT, fixes the bug:

AFAICT, this patch hasn't been reviewed.

Can anyone review this proposal? TIA!

> Index: lisp/ChangeLog
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
> retrieving revision 1.9661
> diff -c -r1.9661 ChangeLog
> *** lisp/ChangeLog	1 Jun 2006 06:42:07 -0000	1.9661
> --- lisp/ChangeLog	5 Jun 2006 23:51:00 -0000
> ***************
> *** 1,3 ****
> --- 1,8 ----
> + 2006-06-06  Michaël Cadilhac  <michael.cadilhac@lrde.org>
> + 
> + 	* complete.el (PC-expand-many-files): Go to the home directory
> + 	before `shell-command' if the default one is not executable.
> + 
>   2006-06-01  Jan Djärv  <jan.h.d@swipnet.se>
>
>   	* term/x-win.el: Change x-menu-bar-start to menu-bar-open.
> Index: lisp/complete.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/complete.el,v
> retrieving revision 1.53
> diff -c -r1.53 complete.el
> *** lisp/complete.el	22 May 2006 18:09:40 -0000	1.53
> --- lisp/complete.el	5 Jun 2006 23:51:00 -0000
> ***************
> *** 778,783 ****
> --- 778,785 ----
>   (defun PC-expand-many-files (name)
>     (with-current-buffer (generate-new-buffer " *Glob Output*")
>       (erase-buffer)
> +     (unless (file-executable-p default-directory)
> +       (setq default-directory "~/"))
>       (shell-command (concat "echo " name) t)
>       (goto-char (point-min))
>       ;; CSH-style shells were known to output "No match", whereas

-- 
 |      Michaël `Micha' Cadilhac   |  Si les religions etaient aussi tole-  |
 |         Epita/LRDE Promo 2007   |  rantes qu'elles le pretendent, il y   |
 | http://www.lrde.org/~cadilh_m   |  a longtemps qu'il n'y en aurait plus  |
 `--  -   JID: micha@amessage.be --'           -- Moustic              -  --'

[-- 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] 5+ messages in thread

* Re: Small bug in PC-expand-many-files.
  2006-06-13 14:37 ` Michaël Cadilhac
  2006-07-17 11:30   ` Michaël Cadilhac
@ 2006-07-29 12:16   ` Michaël Cadilhac
  2006-08-02 14:09     ` Stefan Monnier
  1 sibling, 1 reply; 5+ messages in thread
From: Michaël Cadilhac @ 2006-07-29 12:16 UTC (permalink / raw)



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

michael.cadilhac@lrde.org (Michaël Cadilhac) writes:

> michael.cadilhac@lrde.org (Michaël Cadilhac) writes:
>
>> Recipe:
>> In your ~, you have a directory `helloworld' in which there's a file
>> called `foobarbaz'. You don't have a directory named `demaille'.
>>
>> $ emacs -Q
>> M-x partial-completion-mode RET
>> C-x C-f ~/demaille/akim RET
>>  (message: Use M-x make-directory RET RET to create the directory and
>>  its parents)
>>
>> C-x C-f ~/hell/foo TAB
>>  (*error*: shell-command: Setting current directory: no such file or
>>  directory, /home/micha/demaille)
>>
>>
>> This is due to a call to `call-process' within a buffer created after
>> the `akim' one, from which it takes its default directory.
>>
>> I propose the following change, which AFAICT, fixes the bug:
>

Sorry for the noise, but I still got this funny error, say, once per
week :-) Anyone for a review?

> Index: lisp/ChangeLog
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
> retrieving revision 1.9661
> diff -c -r1.9661 ChangeLog
> *** lisp/ChangeLog	1 Jun 2006 06:42:07 -0000	1.9661
> --- lisp/ChangeLog	5 Jun 2006 23:51:00 -0000
> ***************
> *** 1,3 ****
> --- 1,8 ----
> + 2006-06-06  Michaël Cadilhac  <micha@mahaena.lrde>
> + 
> + 	* complete.el (PC-expand-many-files): Go to the home directory
> + 	before `shell-command' if the default one is not executable.
> + 
>   2006-06-01  Jan Djärv  <jan.h.d@swipnet.se>
>
>   	* term/x-win.el: Change x-menu-bar-start to menu-bar-open.
> Index: lisp/complete.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/complete.el,v
> retrieving revision 1.53
> diff -c -r1.53 complete.el
> *** lisp/complete.el	22 May 2006 18:09:40 -0000	1.53
> --- lisp/complete.el	5 Jun 2006 23:51:00 -0000
> ***************
> *** 778,783 ****
> --- 778,785 ----
>   (defun PC-expand-many-files (name)
>     (with-current-buffer (generate-new-buffer " *Glob Output*")
>       (erase-buffer)
> +     (unless (file-executable-p default-directory)
> +       (setq default-directory "~/"))
>       (shell-command (concat "echo " name) t)
>       (goto-char (point-min))
>       ;; CSH-style shells were known to output "No match", whereas

-- 
 |      Michaël `Micha' Cadilhac   |  All your base are belong to us.       |
 |         Epita/LRDE Promo 2007   |    You have no change to survive       |
 | http://www.lrde.org/~cadilh_m   |       make your time, hahaha.          |
 `--  -   JID: micha@amessage.be --'       -- Zero Wings               -  --'

[-- 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] 5+ messages in thread

* Re: Small bug in PC-expand-many-files.
  2006-07-29 12:16   ` Michaël Cadilhac
@ 2006-08-02 14:09     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2006-08-02 14:09 UTC (permalink / raw)
  Cc: emacs-devel

> Sorry for the noise, but I still got this funny error, say, once per
> week :-) Anyone for a review?

I installed a slightly different fix.
Merci et désolé du délai,


        Stefan

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

end of thread, other threads:[~2006-08-02 14:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-05 23:59 Small bug in PC-expand-many-files Michaël Cadilhac
2006-06-13 14:37 ` Michaël Cadilhac
2006-07-17 11:30   ` Michaël Cadilhac
2006-07-29 12:16   ` Michaël Cadilhac
2006-08-02 14:09     ` 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).