unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: John Mastro <john.b.mastro@gmail.com>
To: Chris Seberino <cseberino@gmail.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: How automatically answer same 2 questions that always pop up for a certain Emacs command (python-mode's python-shell-send-region command)
Date: Wed, 10 Dec 2014 13:17:39 -0800	[thread overview]
Message-ID: <CAOj2CQTd6Tz4__7RtvUEmrfayfbCWzJNL7Kuj_C5=a7S8w8_+g@mail.gmail.com> (raw)
In-Reply-To: <ffdb6308-db23-4ab7-87b8-c4b8faa1b581@googlegroups.com>

Hi,

Chris Seberino <cseberino@gmail.com> wrote:
> How automatically answer same 2 questions that always pop up for
> python-mode's python-shell-send-region command?
>
> python-shell-send-region asks for python interpreter to use and
> question about separate processes. I don't want to always answer that.
>
> Thanks!
>
> cs

If I understand correctly, I think this will do what you want.

    (defun python-shell-get-or-create-process-noask
        (old &optional _cmd _dedicated show)
      (funcall old (python-shell-parse-command) t show))

    (advice-add 'python-shell-get-or-create-process
                :around
                #'python-shell-get-or-create-process-noask)

Hope that helps!

--
john



  reply	other threads:[~2014-12-10 21:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10 17:00 How automatically answer same 2 questions that always pop up for a certain Emacs command (python-mode's python-shell-send-region command) Chris Seberino
2014-12-10 21:17 ` John Mastro [this message]
     [not found] ` <mailman.15796.1418246283.1147.help-gnu-emacs@gnu.org>
2014-12-18 12:53   ` Chris Seberino

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='CAOj2CQTd6Tz4__7RtvUEmrfayfbCWzJNL7Kuj_C5=a7S8w8_+g@mail.gmail.com' \
    --to=john.b.mastro@gmail.com \
    --cc=cseberino@gmail.com \
    --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).