emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115179: * progmodes/octave.el (inferior-octave-proc


From: Leo Liu
Subject: [Emacs-diffs] trunk r115179: * progmodes/octave.el (inferior-octave-process-live-p): New helper.
Date: Fri, 22 Nov 2013 02:04:26 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115179
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/10564
committer: Leo Liu <address@hidden>
branch nick: trunk
timestamp: Fri 2013-11-22 10:02:42 +0800
message:
  * progmodes/octave.el (inferior-octave-process-live-p): New helper.
  (inferior-octave-startup, inferior-octave-check-process)
  (inferior-octave-track-window-width-change)
  (octave-completion-at-point, octave-eldoc-function): Use it.
  (octave-kill-process): Provide confirmation.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/octave.el       
octavemod.el-20091113204419-o5vbwnq5f7feedwu-1028
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-11-21 17:33:30 +0000
+++ b/lisp/ChangeLog    2013-11-22 02:02:42 +0000
@@ -1,3 +1,11 @@
+2013-11-22  Leo Liu  <address@hidden>
+
+       * progmodes/octave.el (inferior-octave-process-live-p): New helper.
+       (inferior-octave-startup, inferior-octave-check-process)
+       (inferior-octave-track-window-width-change)
+       (octave-completion-at-point, octave-eldoc-function): Use it.
+       (octave-kill-process): Provide confirmation.  (Bug#10564)
+
 2013-11-21  Leo Liu  <address@hidden>
 
        * progmodes/octave.el (octave-mode, inferior-octave-mode): Fix

=== modified file 'lisp/progmodes/octave.el'
--- a/lisp/progmodes/octave.el  2013-11-21 17:33:30 +0000
+++ b/lisp/progmodes/octave.el  2013-11-22 02:02:42 +0000
@@ -698,6 +698,9 @@
 
 (declare-function compilation-forget-errors "compile" ())
 
+(defun inferior-octave-process-live-p ()
+  (and inferior-octave-process (process-live-p inferior-octave-process)))
+
 (define-derived-mode inferior-octave-mode comint-mode "Inferior Octave"
   "Major mode for interacting with an inferior Octave process."
   :abbrev-table octave-abbrev-table
@@ -782,7 +785,7 @@
     ;; output may be mixed up).  Hence, we need to digest the Octave
     ;; output to see when it issues a prompt.
     (while inferior-octave-receive-in-progress
-      (or (process-live-p inferior-octave-process)
+      (or (inferior-octave-process-live-p)
           (error "Process `%s' died" inferior-octave-process))
       (accept-process-output inferior-octave-process))
     (goto-char (point-max))
@@ -903,8 +906,7 @@
   (setq inferior-octave-output-string string))
 
 (defun inferior-octave-check-process ()
-  (or (and inferior-octave-process
-           (process-live-p inferior-octave-process))
+  (or (inferior-octave-process-live-p)
       (error (substitute-command-keys
               "No inferior octave process running. Type \\[run-octave]"))))
 
@@ -973,8 +975,7 @@
   (let ((width (max inferior-octave-minimal-columns (window-width))))
     (unless (eq inferior-octave-last-column-width width)
       (setq-local inferior-octave-last-column-width width)
-      (when (and inferior-octave-process
-                 (process-live-p inferior-octave-process))
+      (when (inferior-octave-process-live-p)
         (inferior-octave-send-list-and-digest
          (list (format "putenv ('COLUMNS', '%s');\n" width)))))))
 
@@ -1398,8 +1399,7 @@
         (save-excursion (skip-syntax-forward "w_")
                         (setq end (point))))
     (when (> end beg)
-      (list beg end (or (and inferior-octave-process
-                             (process-live-p inferior-octave-process)
+      (list beg end (or (and (inferior-octave-process-live-p)
                              inferior-octave-completion-table)
                         octave-reserved-words)))))
 
@@ -1444,12 +1444,13 @@
 (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)))
+  (or (yes-or-no-p "Kill the inferior Octave process and its buffer? ")
+      (user-error "Aborted"))
+  (when (inferior-octave-process-live-p)
+    (process-send-string inferior-octave-process "quit;\n")
+    (accept-process-output inferior-octave-process))
+  (when inferior-octave-buffer
+    (kill-buffer inferior-octave-buffer)))
 
 (defun octave-show-process-buffer ()
   "Make sure that `inferior-octave-buffer' is displayed."
@@ -1592,8 +1593,7 @@
 
 (defun octave-eldoc-function ()
   "A function for `eldoc-documentation-function' (which see)."
-  (when (and inferior-octave-process
-             (process-live-p inferior-octave-process))
+  (when (inferior-octave-process-live-p)
     (let* ((ppss (syntax-ppss))
            (paren-pos (cadr ppss))
            (fn (save-excursion


reply via email to

[Prev in Thread] Current Thread [Next in Thread]