[Top][All Lists]

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

[PATCH 1/3] octave.el: Add `octave-send-buffer' function.

From: Rüdiger Sonderfeld
Subject: [PATCH 1/3] octave.el: Add `octave-send-buffer' function.
Date: Fri, 27 Sep 2013 15:11:10 +0200
User-agent: KMail/4.10.5 (Linux/3.8.0-30-generic; KDE/4.10.5; x86_64; ; )

I'm not sure what key binding would be the best for it.  I picked "\C-c\C-ia"
because "\C-c\C-ib" is already used for `octave-send-block'.


-- 8< ------------------------------------------------------------- >8 --

* lisp/progmodes/octave.el (octave-mode-map): Add key binding for
  (octave-mode-menu): Add menu entry for `octave-send-buffer'.
  (octave-send-buffer): New function.

Signed-off-by: Rüdiger Sonderfeld <address@hidden>
 lisp/progmodes/octave.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el
index f20a579..c5710b8 100644
--- a/lisp/progmodes/octave.el
+++ b/lisp/progmodes/octave.el
@@ -114,6 +114,7 @@ (defvar octave-mode-map
     (define-key map "\C-c\C-ib" 'octave-send-block)
     (define-key map "\C-c\C-if" 'octave-send-defun)
     (define-key map "\C-c\C-ir" 'octave-send-region)
+    (define-key map "\C-c\C-ia" 'octave-send-buffer)
     (define-key map "\C-c\C-is" 'octave-show-process-buffer)
     (define-key map "\C-c\C-iq" 'octave-hide-process-buffer)
     (define-key map "\C-c\C-ik" 'octave-kill-process)
@@ -121,6 +122,7 @@ (defvar octave-mode-map
     (define-key map "\C-c\C-i\C-b" 'octave-send-block)
     (define-key map "\C-c\C-i\C-f" 'octave-send-defun)
     (define-key map "\C-c\C-i\C-r" 'octave-send-region)
+    (define-key map "\C-c\C-i\C-a" 'octave-send-buffer)
     (define-key map "\C-c\C-i\C-s" 'octave-show-process-buffer)
     (define-key map "\C-c\C-i\C-q" 'octave-hide-process-buffer)
     (define-key map "\C-c\C-i\C-k" 'octave-kill-process)
@@ -169,6 +171,7 @@ (easy-menu-define octave-mode-menu octave-mode-map
      ["Send Current Block"      octave-send-block t]
      ["Send Current Function"   octave-send-defun t]
      ["Send Region"             octave-send-region t]
+     ["Send Buffer"             octave-send-buffer t]
      ["Show Process Buffer"     octave-show-process-buffer t]
      ["Hide Process Buffer"     octave-hide-process-buffer t]
      ["Kill Process"            octave-kill-process t])
@@ -1462,6 +1465,11 @@ (defun octave-send-region (beg end)
   (if octave-send-show-buffer
       (display-buffer inferior-octave-buffer)))
+(defun octave-send-buffer ()
+  "Send the complete buffer to inferior octave."
+  (interactive)
+  (octave-send-region (point-min) (point-max)))
 (defun octave-send-block ()
   "Send current Octave block to the inferior Octave process."

reply via email to

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