unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Location of init files for M-x shell.
@ 2006-12-03 17:02 Michaël Cadilhac
  2006-12-04  5:15 ` Richard Stallman
  0 siblings, 1 reply; 6+ messages in thread
From: Michaël Cadilhac @ 2006-12-03 17:02 UTC (permalink / raw)



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

It has been decided, a while ago, that the not-in-~ .emacs will be
~/.emacs/init.el, and this is Great Thing for many reasons.

Init files for M-x shell didn't have that chance. Why not ?

I propose the following:


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

Index: lisp/shell.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/shell.el,v
retrieving revision 1.143
diff -c -r1.143 shell.el
*** lisp/shell.el	15 Oct 2006 20:42:10 -0000	1.143
--- lisp/shell.el	3 Dec 2006 17:01:24 -0000
***************
*** 521,529 ****
  Program used comes from variable `explicit-shell-file-name',
   or (if that is nil) from the ESHELL environment variable,
   or else from SHELL if there is no ESHELL.
! If a file `~/.emacs_SHELLNAME' exists, it is given as initial input
!  (Note that this may lose due to a timing error if the shell
!   discards input when it starts up.)
  The buffer is put in Shell mode, giving commands for sending input
  and controlling the subjobs of the shell.  See `shell-mode'.
  See also the variable `shell-prompt-pattern'.
--- 521,529 ----
  Program used comes from variable `explicit-shell-file-name',
   or (if that is nil) from the ESHELL environment variable,
   or else from SHELL if there is no ESHELL.
! If a file `~/.emacs_SHELLNAME' exists, or `~/.emacs.d/init_SHELLNAME.sh',
! it is given as initial input (Note that this may lose due to a timing
! error if the shell discards input when it starts up).
  The buffer is put in Shell mode, giving commands for sending input
  and controlling the subjobs of the shell.  See `shell-mode'.
  See also the variable `shell-prompt-pattern'.
***************
*** 556,563 ****
  	   (name (file-name-nondirectory prog))
  	   (startfile (concat "~/.emacs_" name))
  	   (xargs-name (intern-soft (concat "explicit-" name "-args"))))
!       (if (not (file-exists-p startfile))
! 	  (setq startfile (concat "~/.emacs.d/.emacs_" name)))
        (apply 'make-comint-in-buffer "shell" buffer prog
  	     (if (file-exists-p startfile) startfile)
  	     (if (and xargs-name (boundp xargs-name))
--- 556,563 ----
  	   (name (file-name-nondirectory prog))
  	   (startfile (concat "~/.emacs_" name))
  	   (xargs-name (intern-soft (concat "explicit-" name "-args"))))
!       (unless (file-exists-p startfile)
! 	(setq startfile (concat "~/.emacs.d/init_" name ".sh")))
        (apply 'make-comint-in-buffer "shell" buffer prog
  	     (if (file-exists-p startfile) startfile)
  	     (if (and xargs-name (boundp xargs-name))
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.10370
diff -c -0 -r1.10370 ChangeLog
*** lisp/ChangeLog	29 Nov 2006 16:10:13 -0000	1.10370
--- lisp/ChangeLog	3 Dec 2006 17:01:27 -0000
***************
*** 0 ****
--- 1,5 ----
+ 2006-12-03  Michaël Cadilhac  <michael.cadilhac@lrde.org>
+ 
+ 	* shell.el (shell): Search the start file in ~/.emacs.d as
+ 	`init_SHELLNAME.sh' instead.
+ 

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


-- 
/!\ My mail address has changed, please update your files accordingly.
 |      Michaël `Micha' Cadilhac     |  «Tu aimeras ton prochain.»            |
 |         Epita/LRDE Promo 2007     |    D'abord, Dieu ou pas,               |
 |  http://michael.cadilhac.name     |       j'ai horreur qu'on me tutoie.    |
 `--JID: michael.cadilhac@gmail.com--'           -- P. Desproges         -  --'

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

* Re: Location of init files for M-x shell.
  2006-12-03 17:02 Location of init files for M-x shell Michaël Cadilhac
@ 2006-12-04  5:15 ` Richard Stallman
  2006-12-04 13:16   ` Michaël Cadilhac
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2006-12-04  5:15 UTC (permalink / raw)
  Cc: emacs-devel

I think this is a good change, but before we install it,
you need to change the manuals, etc/NEWS, and anything else
that describes these names.  Would you like to write that?

In 4 days, if nobody has made an argument that this is a mistake,
and if you've shown us those companion changes, please install this.

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

* Re: Location of init files for M-x shell.
  2006-12-04  5:15 ` Richard Stallman
@ 2006-12-04 13:16   ` Michaël Cadilhac
  2006-12-05  1:45     ` Richard Stallman
  0 siblings, 1 reply; 6+ messages in thread
From: Michaël Cadilhac @ 2006-12-04 13:16 UTC (permalink / raw)
  Cc: emacs-devel


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

Richard Stallman <rms@gnu.org> writes:

> I think this is a good change, but before we install it,
> you need to change the manuals, etc/NEWS, and anything else
> that describes these names.  Would you like to write that?

Okey, here attached.  As I was grepping the whole thing, I've seen
that cmuscheme has the same `problem'.  I've modified it too (see NEWS
diff).


[-- Attachment #1.1.2: init-files.patch --]
[-- Type: text/x-patch, Size: 11504 bytes --]

Index: lisp/cmuscheme.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/cmuscheme.el,v
retrieving revision 1.42
diff -c -r1.42 cmuscheme.el
*** lisp/cmuscheme.el	6 Feb 2006 14:33:32 -0000	1.42
--- lisp/cmuscheme.el	4 Dec 2006 12:35:02 -0000
***************
*** 244,250 ****
  If there is a process already running in `*scheme*', switch to that buffer.
  With argument, allows you to edit the command line (default is value
  of `scheme-program-name').
! If a file `~/.emacs_SCHEMENAME' exists, it is given as initial input.
  Note that this may lose due to a timing error if the Scheme processor
  discards input when it starts up.
  Runs the hook `inferior-scheme-mode-hook' \(after the `comint-mode-hook'
--- 244,251 ----
  If there is a process already running in `*scheme*', switch to that buffer.
  With argument, allows you to edit the command line (default is value
  of `scheme-program-name').
! If the file `~/.emacs_SCHEMENAME' or `~/.emacs.d/init_SCHEMENAME.scm' exists,
! it is given as initial input.
  Note that this may lose due to a timing error if the Scheme processor
  discards input when it starts up.
  Runs the hook `inferior-scheme-mode-hook' \(after the `comint-mode-hook'
***************
*** 268,279 ****
    "Return the name of the start file corresponding to PROG.
  Search in the directories \"~\" and \"~/.emacs.d\", in this
  order.  Return nil if no start file found."
!   (let* ((name (concat ".emacs_" (file-name-nondirectory prog)))
!          (start-file (concat "~/" name)))
      (if (file-exists-p start-file)
          start-file
!       (let ((start-file (concat "~/.emacs.d/" name)))
!         (and (file-exists-p start-file) start-file)))))
  
  (defun scheme-send-region (start end)
    "Send the current region to the inferior Scheme process."
--- 269,280 ----
    "Return the name of the start file corresponding to PROG.
  Search in the directories \"~\" and \"~/.emacs.d\", in this
  order.  Return nil if no start file found."
!   (let ((progname (file-name-nondirectory prog))
! 	(start-file (concat "~/.emacs_" progname))
! 	(alt-start-file (concat "~/.emacs.d/init_" progname ".scm")))
      (if (file-exists-p start-file)
          start-file
!       (and (file-exists-p alt-start-file) alt-start-file))))
  
  (defun scheme-send-region (start end)
    "Send the current region to the inferior Scheme process."
Index: lisp/shell.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/shell.el,v
retrieving revision 1.143
diff -c -r1.143 shell.el
*** lisp/shell.el	15 Oct 2006 20:42:10 -0000	1.143
--- lisp/shell.el	4 Dec 2006 12:35:03 -0000
***************
*** 521,529 ****
  Program used comes from variable `explicit-shell-file-name',
   or (if that is nil) from the ESHELL environment variable,
   or else from SHELL if there is no ESHELL.
! If a file `~/.emacs_SHELLNAME' exists, it is given as initial input
!  (Note that this may lose due to a timing error if the shell
!   discards input when it starts up.)
  The buffer is put in Shell mode, giving commands for sending input
  and controlling the subjobs of the shell.  See `shell-mode'.
  See also the variable `shell-prompt-pattern'.
--- 521,529 ----
  Program used comes from variable `explicit-shell-file-name',
   or (if that is nil) from the ESHELL environment variable,
   or else from SHELL if there is no ESHELL.
! If a file `~/.emacs_SHELLNAME' exists, or `~/.emacs.d/init_SHELLNAME.sh',
! it is given as initial input (Note that this may lose due to a timing
! error if the shell discards input when it starts up).
  The buffer is put in Shell mode, giving commands for sending input
  and controlling the subjobs of the shell.  See `shell-mode'.
  See also the variable `shell-prompt-pattern'.
***************
*** 556,563 ****
  	   (name (file-name-nondirectory prog))
  	   (startfile (concat "~/.emacs_" name))
  	   (xargs-name (intern-soft (concat "explicit-" name "-args"))))
!       (if (not (file-exists-p startfile))
! 	  (setq startfile (concat "~/.emacs.d/.emacs_" name)))
        (apply 'make-comint-in-buffer "shell" buffer prog
  	     (if (file-exists-p startfile) startfile)
  	     (if (and xargs-name (boundp xargs-name))
--- 556,563 ----
  	   (name (file-name-nondirectory prog))
  	   (startfile (concat "~/.emacs_" name))
  	   (xargs-name (intern-soft (concat "explicit-" name "-args"))))
!       (unless (file-exists-p startfile)
! 	(setq startfile (concat "~/.emacs.d/init_" name ".sh")))
        (apply 'make-comint-in-buffer "shell" buffer prog
  	     (if (file-exists-p startfile) startfile)
  	     (if (and xargs-name (boundp xargs-name))
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.10400
diff -c -0 -r1.10400 ChangeLog
*** lisp/ChangeLog	4 Dec 2006 10:24:04 -0000	1.10400
--- lisp/ChangeLog	4 Dec 2006 12:35:15 -0000
***************
*** 0 ****
--- 1,7 ----
+ 2006-12-04  Michaël Cadilhac  <michael.cadilhac@lrde.org>
+ 
+ 	* cmuscheme.el (run-scheme, scheme-start-file): Search the start
+ 	file in ~/.emacs.d as `init_SCHEMENAME.scm' instead.
+ 	* shell.el (shell): Search the start file in ~/.emacs.d as
+ 	`init_SHELLNAME.sh' instead.
+ 
Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.1409
diff -c -r1.1409 NEWS
*** etc/NEWS	1 Dec 2006 13:36:26 -0000	1.1409
--- etc/NEWS	4 Dec 2006 12:38:55 -0000
***************
*** 235,242 ****
  +++
  ** Init file changes
  If the init file ~/.emacs does not exist, Emacs will try
! ~/.emacs.d/init.el or ~/.emacs.d/init.elc.  You can also put the shell
! init file .emacs_SHELL under ~/.emacs.d.
  
  +++
  ** Emacs now reads the standard abbrevs file ~/.abbrev_defs
--- 235,242 ----
  +++
  ** Init file changes
  If the init file ~/.emacs does not exist, Emacs will try
! ~/.emacs.d/init.el or ~/.emacs.d/init.elc.  Likewise, if the shell init file
! ~/.emacs_SHELL is not found, Emacs will try ~/.emacs.d/init_SHELL.sh.
  
  +++
  ** Emacs now reads the standard abbrevs file ~/.abbrev_defs
***************
*** 2162,2170 ****
  *** Emacs now offers to start Scheme if the user tries to
  evaluate a Scheme expression but no Scheme subprocess is running.
  
! *** If a file `.emacs_NAME' (where NAME is the name of the Scheme interpreter)
! exists in the user's home directory or in ~/.emacs.d, its
! contents are sent to the Scheme subprocess upon startup.
  
  *** There are new commands to instruct the Scheme interpreter to trace
  procedure calls (`scheme-trace-procedure') and to expand syntactic forms
--- 2162,2170 ----
  *** Emacs now offers to start Scheme if the user tries to
  evaluate a Scheme expression but no Scheme subprocess is running.
  
! *** If the file ~/.emacs_NAME or ~/.emacs.d/init_NAME.scm (where NAME
! is the name of the Scheme interpreter) exists, its contents are sent
! to the Scheme subprocess upon startup.
  
  *** There are new commands to instruct the Scheme interpreter to trace
  procedure calls (`scheme-trace-procedure') and to expand syntactic forms
Index: etc/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/etc/ChangeLog,v
retrieving revision 1.476
diff -c -0 -r1.476 ChangeLog
*** etc/ChangeLog	1 Dec 2006 17:43:30 -0000	1.476
--- etc/ChangeLog	4 Dec 2006 12:39:02 -0000
***************
*** 0 ****
--- 1,7 ----
+ 2006-12-04  Michaël Cadilhac  <michael.cadilhac@lrde.org>
+ 
+ 	* NEWS (Changes to cmuscheme): Mention the alternative for
+ 	`~/.emacs_SCHEMEPROG' which is `~/.emacs.d/init_SCHEMEPROG.scm'.
+ 	(Init file changes): Same for `~/.emacs_SHELL' versus 
+ 	`~/.emacs.d/init_SHELL.sh'.
+ 
Index: man/anti.texi
===================================================================
RCS file: /sources/emacs/emacs/man/anti.texi,v
retrieving revision 1.39
diff -c -r1.39 anti.texi
*** man/anti.texi	22 Nov 2006 17:13:41 -0000	1.39
--- man/anti.texi	4 Dec 2006 12:39:24 -0000
***************
*** 66,72 ****
  We have standardized on one location for the user init file: the file
  named @file{.emacs} in your home directory.  Emacs will not look for
  the init file in @file{~/.emacs.d/init.el}.  Similarly, don't try
! putting @file{.emacs_SHELL} in @file{~/.emacs.d}; Emacs won't find it.
  
  @item
  Emacs will not read @file{~/.abbrev_defs} automatically.  If you want
--- 66,73 ----
  We have standardized on one location for the user init file: the file
  named @file{.emacs} in your home directory.  Emacs will not look for
  the init file in @file{~/.emacs.d/init.el}.  Similarly, don't try
! putting @file{.emacs_SHELL} as @file{init_SHELL.sh} in
! @file{~/.emacs.d}; Emacs won't find it.
  
  @item
  Emacs will not read @file{~/.abbrev_defs} automatically.  If you want
Index: man/faq.texi
===================================================================
RCS file: /sources/emacs/emacs/man/faq.texi,v
retrieving revision 1.100
diff -c -r1.100 faq.texi
*** man/faq.texi	7 Oct 2006 00:14:09 -0000	1.100
--- man/faq.texi	4 Dec 2006 12:39:24 -0000
***************
*** 2761,2767 ****
  endif
  @end example
  
! Or put this in your @file{.emacs_tcsh} file:
  
  @example
  unset edit
--- 2761,2767 ----
  endif
  @end example
  
! Or put this in your @file{.emacs_tcsh} or @file{~/.emacs.d/init_tcsh.sh} file:
  
  @example
  unset edit
Index: man/misc.texi
===================================================================
RCS file: /sources/emacs/emacs/man/misc.texi,v
retrieving revision 1.94
diff -c -r1.94 misc.texi
*** man/misc.texi	18 Nov 2006 21:00:16 -0000	1.94
--- man/misc.texi	4 Dec 2006 12:39:25 -0000
***************
*** 478,484 ****
  @file{~/.emacs_@var{shellname}} as input, if it exists, where
  @var{shellname} is the name of the file that the shell was loaded
  from.  For example, if you use bash, the file sent to it is
! @file{~/.emacs_bash}.
  
    To specify a coding system for the shell, you can use the command
  @kbd{C-x @key{RET} c} immediately before @kbd{M-x shell}.  You can
--- 478,485 ----
  @file{~/.emacs_@var{shellname}} as input, if it exists, where
  @var{shellname} is the name of the file that the shell was loaded
  from.  For example, if you use bash, the file sent to it is
! @file{~/.emacs_bash}.  If this file is not found, Emacs tries to fallback
! on @file{~/.emacs.d/init_@var{shellname}.sh}.
  
    To specify a coding system for the shell, you can use the command
  @kbd{C-x @key{RET} c} immediately before @kbd{M-x shell}.  You can
Index: man/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/man/ChangeLog,v
retrieving revision 1.1138
diff -c -0 -r1.1138 ChangeLog
*** man/ChangeLog	1 Dec 2006 13:23:01 -0000	1.1138
--- man/ChangeLog	4 Dec 2006 12:39:34 -0000
***************
*** 0 ****
--- 1,7 ----
+ 2006-12-04  Michaël Cadilhac  <michael.cadilhac@lrde.org>
+ 
+ 	* misc.texi (Interactive Shell): Mention the alternative to
+ 	`~/.emacs_SHELLNAME', which is `~/.emacs.d/init_SHELLNAME.sh'.
+ 	* faq.texi (^M in the shell buffer): Ditto.
+ 	* anti.texi (Antinews): Ditto.
+ 

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


TIA !

-- 
/!\ My mail address has changed, please update your files accordingly.
 |      Michaël `Micha' Cadilhac     |  ... KVim is cited in the talk.        |
 |         Epita/LRDE Promo 2007     |   "I can't tell if I am more sorry     |
 |  http://michael.cadilhac.name     |        for vim or for KDE."            |
 `--JID: michael.cadilhac@gmail.com--'          -- RMS                   -  --'

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

* Re: Location of init files for M-x shell.
  2006-12-04 13:16   ` Michaël Cadilhac
@ 2006-12-05  1:45     ` Richard Stallman
  2006-12-05 14:06       ` Michaël Cadilhac
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2006-12-05  1:45 UTC (permalink / raw)
  Cc: emacs-devel

Please install your change.

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

* Re: Location of init files for M-x shell.
  2006-12-05  1:45     ` Richard Stallman
@ 2006-12-05 14:06       ` Michaël Cadilhac
  2006-12-05 14:38         ` Juanma Barranquero
  0 siblings, 1 reply; 6+ messages in thread
From: Michaël Cadilhac @ 2006-12-05 14:06 UTC (permalink / raw)
  Cc: emacs-devel


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

Richard Stallman <rms@gnu.org> writes:

> Please install your change.

Please someone do!

TIA!

-- 
/!\ My mail address has changed, please update your files accordingly.
 |      Michaël `Micha' Cadilhac     |  Ajoutez du whisky                     |
 |         Epita/LRDE Promo 2007     |           à n'importe quel texte,      |
 |  http://michael.cadilhac.name     |    ça vous fera un beau pangramme.     |
 `--JID: michael.cadilhac@gmail.com--'          -- Michel Clavel         -  --'

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

* Re: Location of init files for M-x shell.
  2006-12-05 14:06       ` Michaël Cadilhac
@ 2006-12-05 14:38         ` Juanma Barranquero
  0 siblings, 0 replies; 6+ messages in thread
From: Juanma Barranquero @ 2006-12-05 14:38 UTC (permalink / raw)
  Cc: rms, emacs-devel

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

On 12/5/06, Michaël Cadilhac <michael@cadilhac.name> wrote:
> Richard Stallman <rms@gnu.org> writes:
>
> > Please install your change.
>
> Please someone do!

Done.

                    /L/e/k/t/u

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

end of thread, other threads:[~2006-12-05 14:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-03 17:02 Location of init files for M-x shell Michaël Cadilhac
2006-12-04  5:15 ` Richard Stallman
2006-12-04 13:16   ` Michaël Cadilhac
2006-12-05  1:45     ` Richard Stallman
2006-12-05 14:06       ` Michaël Cadilhac
2006-12-05 14:38         ` Juanma Barranquero

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