all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dima Kogan <dima@secretsauce.net>
To: 19823@debbugs.gnu.org
Subject: bug#19823: 25.0.50; Inferior-python-mode buffer can't be killed if process is dead
Date: Mon, 09 Feb 2015 12:05:09 -0800	[thread overview]
Message-ID: <874mqusvey.fsf@secretsauce.net> (raw)

Hi. Currently emacs requires the inferior python process to exist to be
able to kill that buffer. If the inferior process exits earlier for any
reason, it's impossible to kill the buffer. Recipe:

1. emacs -Q
2. M-x python
3. exit()       [ this exits the session, killing the inferior process ]
4. C-x k enter  [ Error! "No inferior Python process running" ]


This happens because a cleanup handler fails. It needs to explicitly
ignore this particular failure. Wrapping the contents of
python-shell-font-lock-kill-buffer() into (ignore-errors ....) is one
way to fix this:

(defun python-shell-font-lock-kill-buffer ()
  "Kill the font-lock buffer safely."
  (ignore-errors
    (python-shell-with-shell-buffer
      (when (and python-shell--font-lock-buffer
                 (buffer-live-p python-shell--font-lock-buffer))
        (kill-buffer python-shell--font-lock-buffer)
        (when (derived-mode-p 'inferior-python-mode)
          (setq python-shell--font-lock-buffer nil))))))

It should probably be more specific than a blanket ignore-errors, but
the maintainers should decide what they want here.





             reply	other threads:[~2015-02-09 20:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 20:05 Dima Kogan [this message]
2015-02-12  3:42 ` bug#19823: 25.0.50; Inferior-python-mode buffer can't be killed if process is dead Fabián Ezequiel Gallina

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=874mqusvey.fsf@secretsauce.net \
    --to=dima@secretsauce.net \
    --cc=19823@debbugs.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 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.