* Re: edit .emacs and then ....
[not found] <mailman.2187.1181903494.32220.help-gnu-emacs@gnu.org>
@ 2007-06-15 12:29 ` Andy Chambers
2007-06-15 12:53 ` Tassilo Horn
2007-06-19 19:53 ` Ken Goldman
1 sibling, 1 reply; 10+ messages in thread
From: Andy Chambers @ 2007-06-15 12:29 UTC (permalink / raw)
To: help-gnu-emacs
On 15 Jun, 10:24, David <dpley...@univ-fcomte.fr> wrote:
> This is a real newby question. I have a load of buffers in emacs and I
> edit .emacs with some new cool macro or what ever. To get the new code
> working I could close and restart emacs, but I will have to re-load
> every buffer. Is there an easy way to either 1) get the new lisp code
> working without closing and reopening, or 2) close and reopen and
> still have all the same buffers available so I don't have to open
> easch manually.
The load-file function evaluates all the elisp functions in a given
file. To apply this to your cool macros, do
M-x load-file RET ~/.emacs
Whilst you work on your .emacs, it may be an idea to bind this to some
key
(global-set-key '[f2] (lambda () (load-file "~/.emacs")))
Andy
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit .emacs and then ....
2007-06-15 12:29 ` edit .emacs and then Andy Chambers
@ 2007-06-15 12:53 ` Tassilo Horn
0 siblings, 0 replies; 10+ messages in thread
From: Tassilo Horn @ 2007-06-15 12:53 UTC (permalink / raw)
To: help-gnu-emacs
Andy Chambers <achambers.home@googlemail.com> writes:
Hi,
> The load-file function evaluates all the elisp functions in a given
> file. To apply this to your cool macros, do
>
> M-x load-file RET ~/.emacs
>
> Whilst you work on your .emacs,
Another yet simpler solution would be only to evaluate the new cool
funtion or macro, e.g.
(defun my-cool-function ()
...)
\
\
Place point behind the last closing paren and press `C-x C-e'.
,----[ C-h k C-x C-e ]
| C-x C-e runs the command eval-last-sexp
| which is an interactive compiled Lisp function in `lisp-mode.el'.
| It is bound to C-x C-e.
| (eval-last-sexp EVAL-LAST-SEXP-ARG-INTERNAL)
|
| Evaluate sexp before point; print value in minibuffer.
| Interactively, with prefix argument, print output into current buffer.
|
| If `eval-expression-debug-on-error' is non-nil, which is the default,
| this command arranges for all errors to enter the debugger.
`----
Bye,
Tassilo
--
The glass is neither half-full nor half-empty: it's twice as big as it
needs to be.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit .emacs and then ....
[not found] <mailman.2187.1181903494.32220.help-gnu-emacs@gnu.org>
2007-06-15 12:29 ` edit .emacs and then Andy Chambers
@ 2007-06-19 19:53 ` Ken Goldman
2007-06-19 20:39 ` Joel J. Adamson
1 sibling, 1 reply; 10+ messages in thread
From: Ken Goldman @ 2007-06-19 19:53 UTC (permalink / raw)
To: help-gnu-emacs
David wrote:
> This is a real newby question. I have a load of buffers in emacs and I
> edit .emacs with some new cool macro or what ever. To get the new code
> working I could close and restart emacs, but I will have to re-load
> every buffer. Is there an easy way to either 1) get the new lisp code
> working without closing and reopening, or 2) close and reopen and
> still have all the same buffers available so I don't have to open
> easch manually.
>
Put your cursor at the end of the statement, and then ...
C-x C-e runs the command eval-last-sexp
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit .emacs and then ....
2007-06-19 19:53 ` Ken Goldman
@ 2007-06-19 20:39 ` Joel J. Adamson
2007-06-20 20:11 ` Ken Goldman
0 siblings, 1 reply; 10+ messages in thread
From: Joel J. Adamson @ 2007-06-19 20:39 UTC (permalink / raw)
To: help-gnu-emacs
Ken Goldman <kgold@watson.ibm.com> writes:
> David wrote:
>> This is a real newby question. I have a load of buffers in emacs and I
>> edit .emacs with some new cool macro or what ever. To get the new code
>> working I could close and restart emacs, but I will have to re-load
>> every buffer. Is there an easy way to either 1) get the new lisp code
>> working without closing and reopening, or 2) close and reopen and
>> still have all the same buffers available so I don't have to open
>> easch manually.
>>
> Put your cursor at the end of the statement, and then ...
>
> C-x C-e runs the command eval-last-sexp
That's the simplest way: others are
M-x eval-buffer RET
M-x load-file RET ~/.emacs
Joel
--
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA 02114
(617) 643-1432
(303) 880-3109
A webpage of interest:
http://www.gnu.org/philosophy/sylvester-response.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit .emacs and then ....
2007-06-19 20:39 ` Joel J. Adamson
@ 2007-06-20 20:11 ` Ken Goldman
2007-06-21 14:29 ` Joel J. Adamson
0 siblings, 1 reply; 10+ messages in thread
From: Ken Goldman @ 2007-06-20 20:11 UTC (permalink / raw)
To: help-gnu-emacs
Joel J. Adamson wrote:
> Ken Goldman <kgold@watson.ibm.com> writes:
>
>
>>David wrote:
>>
>>>This is a real newby question. I have a load of buffers in emacs and I
>>>edit .emacs with some new cool macro or what ever. To get the new code
>>>working I could close and restart emacs, but I will have to re-load
>>>every buffer. Is there an easy way to either 1) get the new lisp code
>>>working without closing and reopening, or 2) close and reopen and
>>>still have all the same buffers available so I don't have to open
>>>easch manually.
>>>
>>
>>Put your cursor at the end of the statement, and then ...
>>
>>C-x C-e runs the command eval-last-sexp
>
>
> That's the simplest way: others are
>
> M-x eval-buffer RET
> M-x load-file RET ~/.emacs
Rerunning the entire file can cause problems. Some code may not be
idempotent - it does different things if you run it more than once. An
example would be code that appends.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit .emacs and then ....
2007-06-20 20:11 ` Ken Goldman
@ 2007-06-21 14:29 ` Joel J. Adamson
0 siblings, 0 replies; 10+ messages in thread
From: Joel J. Adamson @ 2007-06-21 14:29 UTC (permalink / raw)
To: help-gnu-emacs
Ken Goldman <kgold@watson.ibm.com> writes:
> Joel J. Adamson wrote:
>> Ken Goldman <kgold@watson.ibm.com> writes:
>> That's the simplest way: others are
>>
>> M-x eval-buffer RET
>> M-x load-file RET ~/.emacs
>
> Rerunning the entire file can cause problems. Some code may not be
> idempotent - it does different things if you run it more than once.
> An example would be code that appends.
Good point: I notice that when I run my .emacs after everything has
loaded, my colors change slightly.
Joel
--
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA 02114
(617) 643-1432
(303) 880-3109
A webpage of interest:
http://www.gnu.org/philosophy/sylvester-response.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* edit .emacs and then ....
@ 2007-06-15 9:24 David
2007-06-15 10:36 ` n_powell
2007-06-15 11:16 ` Peter Dyballa
0 siblings, 2 replies; 10+ messages in thread
From: David @ 2007-06-15 9:24 UTC (permalink / raw)
To: help-gnu-emacs
This is a real newby question. I have a load of buffers in emacs and I
edit .emacs with some new cool macro or what ever. To get the new code
working I could close and restart emacs, but I will have to re-load
every buffer. Is there an easy way to either 1) get the new lisp code
working without closing and reopening, or 2) close and reopen and
still have all the same buffers available so I don't have to open
easch manually.
peace
Dave
--
David Pleydell
Laboratoire de Biologie Environnementale
USC INRA-EA 3184
Université de Franche-Comté
Place Leclerc F
25030
Besançon
France
(0033) 0381665763
dpleydel@univ-fcomte.fr
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit .emacs and then ....
2007-06-15 9:24 David
@ 2007-06-15 10:36 ` n_powell
2007-06-15 11:16 ` Peter Dyballa
1 sibling, 0 replies; 10+ messages in thread
From: n_powell @ 2007-06-15 10:36 UTC (permalink / raw)
To: David; +Cc: help-gnu-emacs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Fri, Jun 15, 2007 at 11:24:50AM +0200 thus spake David:
> This is a real newby question. I have a load of buffers in emacs and I
> edit .emacs with some new cool macro or what ever. To get the new code
> working I could close and restart emacs, but I will have to re-load
> every buffer. Is there an easy way to either 1) get the new lisp code
> working without closing and reopening, or 2) close and reopen and
> still have all the same buffers available so I don't have to open
> easch manually.
my bad, forgot to hit 'g' (group reply)
C-x C-e right after the code.
- --
nathan
nathan_at_nathanpowell_dot_org
At this point, anyone proposing to run Windows on servers should be prepared
to explain what they know about servers that Google, Yahoo, and Amazon don't.
~ Paul Graham
- ------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFGcmu+v3H2lx1re5YRAgugAJ0SGqCNqVD4sTCmW2LFZ5UJqeaSSwCZAdPJ
FgbKE9lajuDJmOWl9kl5ceA=
=dEcO
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit .emacs and then ....
2007-06-15 9:24 David
2007-06-15 10:36 ` n_powell
@ 2007-06-15 11:16 ` Peter Dyballa
2007-06-15 13:33 ` David
1 sibling, 1 reply; 10+ messages in thread
From: Peter Dyballa @ 2007-06-15 11:16 UTC (permalink / raw)
To: dpleydel; +Cc: help-gnu-emacs
Am 15.06.2007 um 11:24 schrieb David:
> Is there an easy way to either 1) get the new lisp code
> working without closing and reopening,
Evaluate it in the *scratch* buffer.
> or 2) close and reopen and still have all the same buffers
> available so I don't have to open
> easch manually.
Use desktop.el and/or session.el.
--
Greetings
Pete
The mathematician who pursues his studies without clear views of this
matter, must often have the uncomfortable feeling that his paper and
pencil surpass him in intelligence.
Ernst Mach
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: edit .emacs and then ....
2007-06-15 11:16 ` Peter Dyballa
@ 2007-06-15 13:33 ` David
0 siblings, 0 replies; 10+ messages in thread
From: David @ 2007-06-15 13:33 UTC (permalink / raw)
To: help-gnu-emacs
Thanks guys for the pointers. By the way anyone know what Ernst Mach
is referring to at the end of Pete's email? (It clearly wasn't
evaluating LISP code).
Dave
On Fri, Jun 15, 2007 at 01:16:42PM +0200, Peter Dyballa wrote:
>
> Am 15.06.2007 um 11:24 schrieb David:
>
> >Is there an easy way to either 1) get the new lisp code
> >working without closing and reopening,
>
> Evaluate it in the *scratch* buffer.
>
> >or 2) close and reopen and still have all the same buffers
> >available so I don't have to open
> >easch manually.
>
> Use desktop.el and/or session.el.
>
> --
> Greetings
>
> Pete
>
> The mathematician who pursues his studies without clear views of this
> matter, must often have the uncomfortable feeling that his paper and
> pencil surpass him in intelligence.
> Ernst Mach
>
>
>
--
David Pleydell
Laboratoire de Biologie Environnementale
USC INRA-EA 3184
Université de Franche-Comté
Place Leclerc F
25030
Besançon
France
(0033) 0381665763
dpleydel@univ-fcomte.fr
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-06-21 14:29 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.2187.1181903494.32220.help-gnu-emacs@gnu.org>
2007-06-15 12:29 ` edit .emacs and then Andy Chambers
2007-06-15 12:53 ` Tassilo Horn
2007-06-19 19:53 ` Ken Goldman
2007-06-19 20:39 ` Joel J. Adamson
2007-06-20 20:11 ` Ken Goldman
2007-06-21 14:29 ` Joel J. Adamson
2007-06-15 9:24 David
2007-06-15 10:36 ` n_powell
2007-06-15 11:16 ` Peter Dyballa
2007-06-15 13:33 ` David
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).