unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/3] octave.el: Add `octave-send-buffer' function.
@ 2013-09-27 13:11 Rüdiger Sonderfeld
  2013-09-28  0:34 ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Rüdiger Sonderfeld @ 2013-09-27 13:11 UTC (permalink / raw)
  To: emacs-devel; +Cc: Leo Liu

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'.

Regards,
Rüdiger

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

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

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
---
 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."
   (interactive)
-- 
1.8.4





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

* Re: [PATCH 1/3] octave.el: Add `octave-send-buffer' function.
  2013-09-27 13:11 [PATCH 1/3] octave.el: Add `octave-send-buffer' function Rüdiger Sonderfeld
@ 2013-09-28  0:34 ` Stefan Monnier
  2013-09-28  2:44   ` Leo Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2013-09-28  0:34 UTC (permalink / raw)
  To: Rüdiger Sonderfeld; +Cc: Leo Liu, emacs-devel

> 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'.

The "traditional" binding to send current file to the inferior process
is C-c C-l.  Admittedly, the current file is slightly different from the
current buffer.


        Stefan



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

* Re: [PATCH 1/3] octave.el: Add `octave-send-buffer' function.
  2013-09-28  0:34 ` Stefan Monnier
@ 2013-09-28  2:44   ` Leo Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Leo Liu @ 2013-09-28  2:44 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Rüdiger Sonderfeld, emacs-devel

On 2013-09-28 08:34 +0800, Stefan Monnier wrote:
> The "traditional" binding to send current file to the inferior process
> is C-c C-l.  Admittedly, the current file is slightly different from the
> current buffer.

Merged with thanks. "\C-c\C-ia" is consistent with other similar keys,
so I didn't change it.

Leo



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

end of thread, other threads:[~2013-09-28  2:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-27 13:11 [PATCH 1/3] octave.el: Add `octave-send-buffer' function Rüdiger Sonderfeld
2013-09-28  0:34 ` Stefan Monnier
2013-09-28  2:44   ` Leo Liu

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).