all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Xavier Maillard <xma@gnu.org>
To: Bob Babcock <wssddc@nospam.gis.net>
Cc: help-gnu-emacs@gnu.org
Subject: Re: eval-last-sexp in other window
Date: Tue, 31 Mar 2009 22:25:06 +0200	[thread overview]
Message-ID: <200903312025.n2VKP6hh017697@zogzog.maillard.mobi> (raw)
In-Reply-To: message from Bob Babcock on Tue, 31 Mar 2009 04:42:01 +0000


   pjb@informatimago.com (Pascal J. Bourguignon) wrote in
   news:87d4bzbfky.fsf@galatea.local: 

   >> Is there a way to have eval-last-sexp (typically bound to C-xC-e) run
   >> in a different window?  This would be convenient when developing a
   >> macro that reformats text - I want the part of the macro I'm testing
   >> to be applied to the file being reformatted, not to my macro.
   > 
   > You may use M-:  to apply a form to the current buffer. 
   > 
   > 
   > Otherwise:
   > 
   > (with-current-buffer (get-buffer "The Other Buffer Name")
   >    (do-what-you-want)) C-x C-e

   Thanks.  After several false starts, I have a simple macro that seems to do 
   what I want:

   (defun last-sexp-other-window()
   "Get last sexp and run it in other window.
   If there isn't another window, use current window."
     (interactive)
     (setq ow-sexp (preceding-sexp))
     (other-window 1) (eval ow-sexp) (other-window -1) )

Why not use let instead of setq ?

	Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org




             reply	other threads:[~2009-03-31 20:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31 20:25 Xavier Maillard [this message]
     [not found] <mailman.4338.1238531287.31690.help-gnu-emacs@gnu.org>
2009-03-31 20:29 ` eval-last-sexp in other window Pascal J. Bourguignon
  -- strict thread matches above, loose matches on Subject: below --
2009-03-30  4:22 Bob Babcock
2009-03-30  8:05 ` Pascal J. Bourguignon
2009-03-31  4:42   ` Bob Babcock
2009-03-31  7:53     ` Pascal J. Bourguignon
2009-04-01  2:10       ` Bob Babcock
2009-04-01  9:09         ` Pascal J. Bourguignon

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

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

  git send-email \
    --in-reply-to=200903312025.n2VKP6hh017697@zogzog.maillard.mobi \
    --to=xma@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=wssddc@nospam.gis.net \
    /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.
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.