From 5e80b74f7aa90e002186ca510e877883c2f1f14f Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Sat, 18 May 2013 09:17:50 +0800 Subject: [PATCH] * progmodes/octave.el (inferior-octave-startup): Use OCTAVE_SRCDIR instead. (octave-source-directories): Don't check process. (octave-source-directories, octave-find-definition): Doc fix. --- lisp/ChangeLog | 7 +++++++ lisp/progmodes/octave.el | 16 ++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e80cc88b5e9..87f0e5242ab 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2013-05-18 Leo Liu + + * progmodes/octave.el (inferior-octave-startup): Use OCTAVE_SRCDIR + instead. + (octave-source-directories): Don't check process. + (octave-source-directories, octave-find-definition): Doc fix. + 2013-05-18 Glenn Morris * progmodes/vhdl-mode.el (vhdl-mode-map-init): diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 26fb254af5f..03da4095449 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -738,8 +738,10 @@ startup file, `~/.emacs-octave'." (inferior-octave-send-list-and-digest (list "PS2 (\"> \");\n"))) (inferior-octave-send-list-and-digest - (list "if exist(\"__octave_srcdir__\") disp(__octave_srcdir__) endif\n")) - (process-put proc 'octave-srcdir (car inferior-octave-output-list)) + (list "disp(getenv(\"OCTAVE_SRCDIR\"))\n")) + (process-put proc 'octave-srcdir + (unless (equal (car inferior-octave-output-list) "") + (car inferior-octave-output-list))) ;; O.K., now we are ready for the Inferior Octave startup commands. (inferior-octave-send-list-and-digest @@ -1627,14 +1629,16 @@ if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n" :type 'octave-help-function)))))))) (defcustom octave-source-directories nil - "A list of directories for Octave sources." + "A list of directories for Octave sources. +If the environment variable OCTAVE_SRCDIR is set, it is searched first." :type '(repeat directory) :group 'octave :version "24.4") (defun octave-source-directories () - (inferior-octave-check-process) - (let ((srcdir (process-get inferior-octave-process 'octave-srcdir))) + (let ((srcdir (or (and inferior-octave-process + (process-get inferior-octave-process 'octave-srcdir)) + (getenv "OCTAVE_SRCDIR")))) (if srcdir (cons srcdir octave-source-directories) octave-source-directories))) @@ -1668,7 +1672,7 @@ if ismember(exist(\"%s\"), [2 3 5 103]) print_usage(\"%s\") endif\n" (defun octave-find-definition (fn) "Find the definition of FN. -Definitions for functions implemented in C++ can be found if +Functions implemented in C++ can be found if `octave-source-directories' is set correctly." (interactive (list (octave-completing-read))) (inferior-octave-send-list-and-digest -- 2.11.4.GIT