emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Aaron Ecay <aaronecay@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH 2/2] babel: don’t add babel eval to the session’s comint input ring
Date: Tue, 29 Oct 2013 19:20:49 -0600	[thread overview]
Message-ID: <87bo27cyl7.fsf@gmail.com> (raw)
In-Reply-To: 1383001132-6610-1-git-send-email-aaronecay@gmail.com

Very nice.  Thank you for this patch.  Applied.

Aaron Ecay <aaronecay@gmail.com> writes:

> * lisp/ob-comint.el (org-babel-comint-in-buffer): don’t add to
> comint-input-ring
>
> Previously, babel code would be added to the comint input ring of a
> babel session, making interactive use of the session difficult: one
> had to page through the babel generated commands when browsing the
> comint history with M-p/M-n.  The session repl’s history should just
> contain commands the user has specifically entered in the repl buffer,
> and not those which are fed in from org mode.  So, we bind
> ‘comint-input-filter’ to a function that always returns nil in the
> ‘org-babel-comint-in-buffer’ macro, to avoid any additions to the
> input ring while executing code from babel.
> ---
>  lisp/ob-comint.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/ob-comint.el b/lisp/ob-comint.el
> index 4e2b352..1f28a2c 100644
> --- a/lisp/ob-comint.el
> +++ b/lisp/ob-comint.el
> @@ -53,7 +53,8 @@ executed inside the protection of `save-excursion' and
>         (error "Buffer %s does not exist or has no process" ,buffer))
>       (save-match-data
>         (with-current-buffer ,buffer
> -	 ,@body))))
> +	 (let ((comint-input-filter (lambda (input) nil)))
> +	   ,@body)))))
>  (def-edebug-spec org-babel-comint-in-buffer (form body))
>  
>  (defmacro org-babel-comint-with-output (meta &rest body)

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

      reply	other threads:[~2013-10-30  1:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-28 22:58 [PATCH 2/2] babel: don’t add babel eval to the session’s comint input ring Aaron Ecay
2013-10-30  1:20 ` Eric Schulte [this message]

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.orgmode.org/

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

  git send-email \
    --in-reply-to=87bo27cyl7.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=aaronecay@gmail.com \
    --cc=emacs-orgmode@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).