unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Barry Margolin <barmar@alum.mit.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: reload customization
Date: Wed, 11 Feb 2015 11:43:44 -0500	[thread overview]
Message-ID: <barmar-61D9E8.11434411022015@88-209-239-213.giganet.hu> (raw)
In-Reply-To: 8761b8z9zu.fsf@engels.histomat.net

In article <8761b8z9zu.fsf@engels.histomat.net>,
 Haines Brown <haines@engels.histomat.net> wrote:

> In my init file I have
> 
>   (defun reload () "Reloads .emacs interactively."
>     (interactive)
>     (load "~/.emacs"))
> 
> The problem is that I also have
> 
>   (split-window-horizontally)
> 
> As things now stand, a reload splits current window so that I end up
> with three. I'd like to have reload instead preserve the two window
> split.

Wrap it with save-window-excursion:

(save-window-excursion
  (load "~/.emacs"))

You should read the caveats in
 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Configur
ations.html

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


  reply	other threads:[~2015-02-11 16:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11 16:30 reload customization Haines Brown
2015-02-11 16:43 ` Barry Margolin [this message]
2015-02-11 17:46   ` Haines Brown
2015-02-11 22:28     ` Barry Margolin
2015-02-12 11:35 ` Nicolas Richard
2015-02-12 13:26   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=barmar-61D9E8.11434411022015@88-209-239-213.giganet.hu \
    --to=barmar@alum.mit.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).