From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Newsgroups: gmane.emacs.bugs Subject: bug#15935: [PATCH] octave.el: Add `octave-source-file'. Date: Wed, 20 Nov 2013 20:46:35 +0100 Message-ID: <2139766.JCPkKN2uLn@descartes> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1384976893 1821 80.91.229.3 (20 Nov 2013 19:48:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Nov 2013 19:48:13 +0000 (UTC) Cc: Leo Liu To: 15935@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 20 20:48:17 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VjDl2-0006ua-Oj for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Nov 2013 20:48:16 +0100 Original-Received: from localhost ([::1]:56727 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjDl2-0007LA-DW for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Nov 2013 14:48:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjDku-0007Kr-WC for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2013 14:48:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjDkp-0001ZQ-EX for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2013 14:48:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjDkp-0001Z8-As for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2013 14:48:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VjDko-0001e4-Gp for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2013 14:48:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?R=C3=BCdiger?= Sonderfeld Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Nov 2013 19:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15935 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13849768296250 (code B ref -1); Wed, 20 Nov 2013 19:48:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Nov 2013 19:47:09 +0000 Original-Received: from localhost ([127.0.0.1]:35128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VjDjw-0001ck-Q7 for submit@debbugs.gnu.org; Wed, 20 Nov 2013 14:47:09 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37432) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VjDju-0001cC-SH for submit@debbugs.gnu.org; Wed, 20 Nov 2013 14:47:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjDjj-0001CV-UE for submit@debbugs.gnu.org; Wed, 20 Nov 2013 14:47:01 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:47358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjDjj-0001CQ-Qu for submit@debbugs.gnu.org; Wed, 20 Nov 2013 14:46:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjDje-0006gW-Gf for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2013 14:46:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjDjZ-00019E-BO for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2013 14:46:50 -0500 Original-Received: from ptmx.org ([178.63.28.110]:48659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjDjZ-00018m-5U for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2013 14:46:45 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by ptmx.org (Postfix) with ESMTP id 48EAA2D4CB; Wed, 20 Nov 2013 20:46:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ptmx.org Original-Received: from ptmx.org ([127.0.0.1]) by localhost (ptmx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TtRlhEiwMUid; Wed, 20 Nov 2013 20:46:41 +0100 (CET) Original-Received: from descartes.localnet (chello080108246092.7.14.vie.surfer.at [80.108.246.92]) by ptmx.org (Postfix) with ESMTPSA id 77AAB2D4A4; Wed, 20 Nov 2013 20:46:41 +0100 (CET) User-Agent: KMail/4.11.2 (Linux/3.11.0-12-generic; KDE/4.11.2; x86_64; ; ) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:80802 Archived-At: * progmodes/octave.el (octave-mode-map, octave-mode-menu): Add `octave-source-file'. (octave-source-file): New function. Signed-off-by: R=C3=BCdiger Sonderfeld --- lisp/ChangeLog | 6 ++++++ lisp/progmodes/octave.el | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 357087d..4b3416d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-11-20 R=C3=BCdiger Sonderfeld + +=09* progmodes/octave.el (octave-mode-map, octave-mode-menu): Add +=09`octave-source-file'. +=09(octave-source-file): New function. + 2013-11-20 era eriksson =20 =09* ses.el (ses-mode): Doc fix. (Bug#14748) diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index f128441..b4af1be 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -110,6 +110,7 @@ (defvar octave-mode-map (define-key map "\C-c;" 'octave-update-function-file-comment) (define-key map "\C-hd" 'octave-help) (define-key map "\C-ha" 'octave-lookfor) + (define-key map "\C-c\C-l" 'octave-source-file) (define-key map "\C-c\C-f" 'octave-insert-defun) (define-key map "\C-c\C-il" 'octave-send-line) (define-key map "\C-c\C-ib" 'octave-send-block) @@ -174,6 +175,7 @@ (easy-menu-define octave-mode-menu octave-mode-map ["Send Current Function" octave-send-defun t] ["Send Region" octave-send-region t] ["Send Buffer" octave-send-buffer t] + ["Source Current File" octave-source-file t] ["Show Process Buffer" octave-show-process-buffer t] ["Hide Process Buffer" octave-hide-process-buffer t] ["Kill Process" octave-kill-process t]) @@ -1463,6 +1465,22 @@ (defun octave-hide-process-buffer () (delete-windows-on inferior-octave-buffer) (message "No buffer named %s" inferior-octave-buffer))) =20 +(defun octave-source-file (&optional file) + "Parse and execute FILE in the inferior Octave process. +This is done using Octave's source function. If FILE is nil then +the variable `buffer-file-name' is used instead." + (interactive) + (unless file + (setq file buffer-file-name)) + (unless file + (user-error "Current buffer has no file")) + (setq file (expand-file-name file)) + (inferior-octave t) + (with-current-buffer inferior-octave-buffer + (setq file (file-relative-name file)) + (comint-send-string inferior-octave-process + (concat "source '" file "'\n")))) + (defun octave-send-region (beg end) "Send current region to the inferior Octave process." (interactive "r") --=20 1.8.4.3