unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19823: 25.0.50; Inferior-python-mode buffer can't be killed if process is dead
@ 2015-02-09 20:05 Dima Kogan
  2015-02-12  3:42 ` Fabián Ezequiel Gallina
  0 siblings, 1 reply; 2+ messages in thread
From: Dima Kogan @ 2015-02-09 20:05 UTC (permalink / raw)
  To: 19823

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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#19823: 25.0.50; Inferior-python-mode buffer can't be killed if process is dead
  2015-02-09 20:05 bug#19823: 25.0.50; Inferior-python-mode buffer can't be killed if process is dead Dima Kogan
@ 2015-02-12  3:42 ` Fabián Ezequiel Gallina
  0 siblings, 0 replies; 2+ messages in thread
From: Fabián Ezequiel Gallina @ 2015-02-12  3:42 UTC (permalink / raw)
  To: 19823-done


Fixed at revno da726ad in the master branch.


Thanks,
Fabián.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-12  3:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-09 20:05 bug#19823: 25.0.50; Inferior-python-mode buffer can't be killed if process is dead Dima Kogan
2015-02-12  3:42 ` Fabián Ezequiel Gallina

Code repositories for project(s) associated with this public inbox

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