GNU bug report logs - #10564
24.0.92; octave-kill-process kills octave process without warning user

Previous Next

Package: emacs;

Reported by: Phillip Garland <pgarland <at> gmail.com>

Date: Fri, 20 Jan 2012 07:56:01 UTC

Severity: normal

Found in version 24.0.92

Done: Leo Liu <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10564 in the body.
You can then email your comments to 10564 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10564; Package emacs. (Fri, 20 Jan 2012 07:56:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Phillip Garland <pgarland <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 20 Jan 2012 07:56:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Phillip Garland <pgarland <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.92; octave-kill-process kills octave process without warning user
Date: Thu, 19 Jan 2012 21:09:07 -0800
I recently started using octave and discovered a frustrating problem
with octave mode. It's too easy to accidently kill the inferior octave
process.

C-c C-i l executes a line of octave code from an octave buffer
C-c C-i k kills the inferior octave process (octave-kill-process)

Sometimes, when I want to execute a line of code, my finger slipped,
hitting the 'k' key instead of the 'l' key, and the octave process is
immediately killed, losing the results of my computations. Right now,
octave-kill-process kills the octave process without double-checking
with the user. It does ask if you really want to kill the inferior
octave buffer, but at that point, the process has already been killed.

Right now octave-kill-buffer is defined like this:

(defun octave-kill-process ()
  "Kill inferior Octave process and its buffer."
  (interactive)
  (if inferior-octave-process
      (progn
	(process-send-string inferior-octave-process "quit;\n")
	(accept-process-output inferior-octave-process)))
  (if inferior-octave-buffer
      (kill-buffer inferior-octave-buffer)))

There seems to me to be at least three ways to solve this
problem. octave-kill-process could just call kill-buffer and have
kill-buffer kill the octave process:

(defun octave-kill-process ()
  "Kill inferior Octave process and its buffer."
  (interactive)
  (if inferior-octave-buffer
      (kill-buffer inferior-octave-buffer)))

The disadvantage of this is that there is no way to kill the process but
retain the inferior octave buffer (if you wanted to keep a record of your
octave session).

Alternatively, octave kill-process could first query the user about
killing the process, then if they kill the process, query them about
killing the inferior octave buffer:

(defun octave-kill-process ()
  "Kill inferior Octave process and its buffer."
  (interactive)
  (if (and inferior-octave-process
           (yes-or-no-p
            (format "Really kill the running Octave process? ")))
      (progn
        (process-send-string inferior-octave-process "quit;\n")
        (accept-process-output inferior-octave-process)
        (if inferior-octave-buffer
            (kill-buffer inferior-octave-buffer)))))

It's a little annoying to be queried twice, first to kill the process,
second to kill the buffer, when killing both is probably the common
case, but this seems like the least worst solution to me.

Finally, octave-kill-buffer could just kill the inferior octave process
and leave the inferior octave buffer around for the user to clean up:

(defun octave-kill-process ()
  "Kill inferior Octave process"
  (interactive)
  (if (and inferior-octave-process
           (yes-or-no-p
            (format "Really kill the running Octave process? ")))
      (progn
        (process-send-string inferior-octave-process "quit;\n")
        (accept-process-output inferior-octave-process))))

Thanks!
~Phillip


In GNU Emacs 24.0.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.8)
 of 2012-01-17 on cradle
Windowing system distributor `The X.Org Foundation', version 11.0.11102902
configured using `configure  '--prefix=/usr/local''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o r t - e m a c s - b u g <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr message format-spec rfc822 mml easymenu
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
emacsbug time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)




Reply sent to Leo Liu <sdl.web <at> gmail.com>:
You have taken responsibility. (Fri, 22 Nov 2013 02:08:02 GMT) Full text and rfc822 format available.

Notification sent to Phillip Garland <pgarland <at> gmail.com>:
bug acknowledged by developer. (Fri, 22 Nov 2013 02:08:03 GMT) Full text and rfc822 format available.

Message #10 received at 10564-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: Phillip Garland <pgarland <at> gmail.com>
Cc: 10564-done <at> debbugs.gnu.org
Subject: Re: bug#10564: 24.0.92;
 octave-kill-process kills octave process without warning user
Date: Fri, 22 Nov 2013 10:07:34 +0800
Fixed in 24.4

On 2012-01-20 13:09 +0800, Phillip Garland wrote:
> I recently started using octave and discovered a frustrating problem
> with octave mode. It's too easy to accidently kill the inferior octave
> process.

Hi Phillip,

Just noticed this bug report. Should be fixed in emacs trunk and will
show up in Emacs 24.4. Sorry for the long delay.

Leo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 20 Dec 2013 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 151 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.