all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Take effect on changes in .emacs without closing emacs
@ 2008-04-14 23:51 istillshine
  2008-04-14 23:58 ` Joost Diepenmaat
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: istillshine @ 2008-04-14 23:51 UTC (permalink / raw)
  To: help-gnu-emacs

How to see the results of my change of .emacs without exiting emacs?
Thanks.


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

* Re: Take effect on changes in .emacs without closing emacs
  2008-04-14 23:51 Take effect on changes in .emacs without closing emacs istillshine
@ 2008-04-14 23:58 ` Joost Diepenmaat
  2008-04-15  0:12   ` tyler
  2008-04-15  0:12 ` Giorgos Keramidas
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Joost Diepenmaat @ 2008-04-14 23:58 UTC (permalink / raw)
  To: help-gnu-emacs

istillshine@gmail.com writes:

> How to see the results of my change of .emacs without exiting emacs?
> Thanks.

Open your .emacs file in a buffer and type M-x eval-buffer - you won't
even have to save it. Or at least, that's what I do. And no guarantees
that that will work correctly with all extensions - though it generally
seems to work ok for simple changes.

-- 
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/


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

* Re: Take effect on changes in .emacs without closing emacs
  2008-04-14 23:58 ` Joost Diepenmaat
@ 2008-04-15  0:12   ` tyler
  0 siblings, 0 replies; 7+ messages in thread
From: tyler @ 2008-04-15  0:12 UTC (permalink / raw)
  To: help-gnu-emacs

You can also eval just the bit you've changed by placing point
immediately following the expression in question and entering C-x C-e.

HTH,

Tyler

-- 
Who is your computer working for?

http://www.defectivebydesign.org/faq


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

* Re: Take effect on changes in .emacs without closing emacs
  2008-04-14 23:51 Take effect on changes in .emacs without closing emacs istillshine
  2008-04-14 23:58 ` Joost Diepenmaat
@ 2008-04-15  0:12 ` Giorgos Keramidas
  2008-04-15 22:07 ` Mickey Ferguson
  2008-04-16 19:58 ` Rob Wolfe
  3 siblings, 0 replies; 7+ messages in thread
From: Giorgos Keramidas @ 2008-04-15  0:12 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, 14 Apr 2008 16:51:45 -0700 (PDT), istillshine@gmail.com wrote:
> How to see the results of my change of .emacs without exiting emacs?
> Thanks.

Most changes can be evaluated right there, in the buffer that you have
opened to edit your ~/.emacs file.  If you have changed the default
value of a variable:

    (setq-default diff-switches "-u")

You can move past the closing parenthesis, and type `C-x C-e'.  This
will evaluate the expression, and you are done.

If you are adding a new hook to text-mode

    (defun keramida-text-mode-hook ()
      (setq fill-colum 72))
    (add-hook 'text-mode-hook 'keramida-text-mode-hook)

You can mark the two expressions, and type `M-x eval-region'.  The
expressions in the current region will be evaluated, and immediatelly
apply to any new text-mode buffers that you open.

There _are_ a few exceptions, i.e. some of the changes to `customize'
stuff are trickier to evaluate directly in the buffer that edits your
~/.emacs file.  If you are making this sort of change, I'm sure some of
the experienced Emacs hackers who hang out here can help :)



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

* Re: Take effect on changes in .emacs without closing emacs
  2008-04-14 23:51 Take effect on changes in .emacs without closing emacs istillshine
  2008-04-14 23:58 ` Joost Diepenmaat
  2008-04-15  0:12 ` Giorgos Keramidas
@ 2008-04-15 22:07 ` Mickey Ferguson
  2008-04-16 19:58 ` Rob Wolfe
  3 siblings, 0 replies; 7+ messages in thread
From: Mickey Ferguson @ 2008-04-15 22:07 UTC (permalink / raw)
  To: help-gnu-emacs

How about M-x load-file

and then specify ~/.emacs as the file to load?

<istillshine@gmail.com> wrote in message 
news:9caa44ec-01a0-4638-a4ea-d819525400a5@w5g2000prd.googlegroups.com...
> How to see the results of my change of .emacs without exiting emacs?




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

* Re: Take effect on changes in .emacs without closing emacs
  2008-04-14 23:51 Take effect on changes in .emacs without closing emacs istillshine
                   ` (2 preceding siblings ...)
  2008-04-15 22:07 ` Mickey Ferguson
@ 2008-04-16 19:58 ` Rob Wolfe
  2008-04-16 23:55   ` Giorgos Keramidas
  3 siblings, 1 reply; 7+ messages in thread
From: Rob Wolfe @ 2008-04-16 19:58 UTC (permalink / raw)
  To: help-gnu-emacs

istillshine@gmail.com writes:

> How to see the results of my change of .emacs without exiting emacs?

I use this function:

;; reload the init file 
(defun reload ()                                         
  "Reload the .emacs file" 
  (interactive "*" )
  (load-file ".emacs"))

HTH,
Rob


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

* Re: Take effect on changes in .emacs without closing emacs
  2008-04-16 19:58 ` Rob Wolfe
@ 2008-04-16 23:55   ` Giorgos Keramidas
  0 siblings, 0 replies; 7+ messages in thread
From: Giorgos Keramidas @ 2008-04-16 23:55 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, 16 Apr 2008 21:58:38 +0200, Rob Wolfe <rw@smsnet.pl> wrote:
> istillshine@gmail.com writes:
>
>> How to see the results of my change of .emacs without exiting emacs?
>
> I use this function:
>
> ;; reload the init file
> (defun reload ()
>   "Reload the .emacs file"
>   (interactive "*" )
>   (load-file ".emacs"))

The current directory may have changed since Emacs started.  A minor
improvement is probably:

    (load-file user-init-file)

The `user-init-file' contains the absolute path of the user's init file.
If the actual init file loaded is a compiled file, such as `.emacs.elc',
the value refers to the corresponding source file, so the `load-file'
call will DTRT regardless of the current working directory.



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

end of thread, other threads:[~2008-04-16 23:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-14 23:51 Take effect on changes in .emacs without closing emacs istillshine
2008-04-14 23:58 ` Joost Diepenmaat
2008-04-15  0:12   ` tyler
2008-04-15  0:12 ` Giorgos Keramidas
2008-04-15 22:07 ` Mickey Ferguson
2008-04-16 19:58 ` Rob Wolfe
2008-04-16 23:55   ` Giorgos Keramidas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.