From 7e138a62168e5a027c8818b344f73ae227cca547 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=BCdiger=20Sonderfeld?= Date: Sat, 28 Sep 2013 10:41:48 +0800 Subject: [PATCH] * lisp/progmodes/octave.el (octave-mode-map): Bind octave-send-buffer. (octave-mode-menu): Add octave-send-buffer. (octave-send-buffer): New function. --- lisp/ChangeLog | 6 ++++++ lisp/progmodes/octave.el | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 67bfd2e5c67..fa7c08fcc39 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-09-28 Rüdiger Sonderfeld + + * lisp/progmodes/octave.el (octave-mode-map): Bind octave-send-buffer. + (octave-mode-menu): Add octave-send-buffer. + (octave-send-buffer): New function. + 2013-09-28 Rüdiger Sonderfeld * lisp/progmodes/octave.el (octave-mode-map): Add key binding for diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index a5e59b744a6..67a973263d1 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -24,7 +24,7 @@ ;;; Commentary: -;; This package provides emacs support for Octave. It defines a major +;; This package provides Emacs support for Octave. It defines a major ;; mode for editing Octave code and contains code for interacting with ;; an inferior Octave process using comint. @@ -115,6 +115,7 @@ parenthetical grouping.") (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) @@ -122,6 +123,7 @@ parenthetical grouping.") (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) @@ -171,6 +173,7 @@ parenthetical grouping.") ["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]) @@ -648,7 +651,7 @@ mode, include \"-q\" and \"--traditional\"." (defvar inferior-octave-mode-syntax-table (let ((table (make-syntax-table octave-mode-syntax-table))) table) - "Syntax table in use in inferior-octave-mode buffers.") + "Syntax table in use in `inferior-octave-mode' buffers.") (defvar inferior-octave-font-lock-keywords (list @@ -1465,6 +1468,11 @@ entered without parens)." (if octave-send-show-buffer (display-buffer inferior-octave-buffer))) +(defun octave-send-buffer () + "Send current buffer to the inferior Octave process." + (interactive) + (octave-send-region (point-min) (point-max))) + (defun octave-send-block () "Send current Octave block to the inferior Octave process." (interactive) @@ -1752,7 +1760,7 @@ If the environment variable OCTAVE_SRCDIR is set, it is searched first." (defun octave-find-definition (fn) "Find the definition of FN. Functions implemented in C++ can be found if -`octave-source-directories' is set correctly." +variable `octave-source-directories' is set correctly." (interactive (list (octave-completing-read))) (require 'etags) (let ((orig (point))) -- 2.39.2