[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/smalltalk-mode fb9072e 04/34: add gst-prog-name, patch
From: |
Stefan Monnier |
Subject: |
[elpa] externals/smalltalk-mode fb9072e 04/34: add gst-prog-name, patch from Stephen Compall |
Date: |
Tue, 9 Apr 2019 22:30:41 -0400 (EDT) |
branch: externals/smalltalk-mode
commit fb9072e6dedf47c93b2b0ad548ffd2700cd64a63
Author: Paolo Bonzini <address@hidden>
Commit: Paolo Bonzini <address@hidden>
add gst-prog-name, patch from Stephen Compall
git-archimport-id: address@hidden/smalltalk--devo--2.2--patch-121
---
gst-mode.el.in | 58 +++++++++++++++++++++++++++++++---------------------------
1 file changed, 31 insertions(+), 27 deletions(-)
diff --git a/gst-mode.el.in b/gst-mode.el.in
index a4e70b9..a20461a 100644
--- a/gst-mode.el.in
+++ b/gst-mode.el.in
@@ -31,8 +31,8 @@
(defvar *gst-process* nil
"Holds the GNU Smalltalk process")
-(defvar gst-args '("-Vp")
- "Arguments to pass to GNU Smalltalk")
+(defvar gst-program-name "@bindir@/gst -V"
+ "GNU Smalltalk command to run. Do not use the -a, -f or -- options.")
(defvar smalltalk-command-string nil
"Non nil means that we're accumulating output from Smalltalk")
@@ -54,33 +54,38 @@
keymap)
"Keymap used in Smalltalk interactor mode.")
-(defun gst (args)
+(defun gst (command-line)
"Invoke GNU Smalltalk"
(interactive (list (if (null current-prefix-arg)
- gst-args
- (read-smalltalk-args))))
- (setq gst-args args)
- (if (not (eq major-mode 'gst-mode))
- (switch-to-buffer-other-window
- (apply 'make-gst "gst" gst-args))
- ;; invoked from a Smalltalk interactor window, so stay there
- (apply 'make-gst "gst" gst-args))
+ gst-program-name
+ (read-smalltalk-command))))
+ (setq gst-program-name command-line)
+ (funcall (if (not (eq major-mode 'gst-mode))
+ #'switch-to-buffer-other-window
+ ;; invoked from a Smalltalk interactor window, so stay
+ ;; there
+ #'identity)
+ (apply 'make-gst "gst" (parse-smalltalk-command gst-program-name)))
(setq *smalltalk-process* (get-buffer-process (current-buffer))))
-(defun read-smalltalk-args ()
- "Reads the arguments to pass to Smalltalk as a string, returns a list."
- (let (str args args-str result-args start end)
- (setq args gst-args)
- (setq args-str "")
- (while args
- (setq args-str (concat args-str " " (car args)))
- (setq args (cdr args)))
- (setq str (read-string "Invoke Smalltalk: " args-str))
- (while (setq start (string-match "[^ ]" str))
+(defun read-smalltalk-command (&optional command-line)
+ "Reads the program name and arguments to pass to Smalltalk,
+providing COMMAND-LINE as a default (which itself defaults to
+`gst-program-name'), answering the string."
+ (read-string "Invoke Smalltalk: " (or command-line gst-program-name)))
+
+(defun parse-smalltalk-command (&optional str)
+ "Parse a list of command-line arguments from STR (default
+`gst-program-name'), adding --emacs-mode and answering the list."
+ (unless str (setq str gst-program-name))
+ (let (start end result-args)
+ (while (setq start (string-match "[^ \t]" str))
(setq end (or (string-match " " str start) (length str)))
- (setq result-args (cons (substring str start end) result-args))
+ (push (substring str start end) result-args)
(setq str (substring str end)))
- (reverse result-args)))
+ ;; This is an heuristic to insert option --emacs-mode into the gst
+ ;; argument list. Don't use -f or -- or anything silly like that.
+ (nreverse (cons "--emacs-mode" result-args))))
(defun make-gst (name &rest switches)
(let ((buffer (get-buffer-create (concat "*" name "*")))
@@ -102,7 +107,6 @@
(frame-width))
"TERM=emacs"
"EMACS=t"
- "@bindir@/gst"
switches))
(setq name (process-name proc)))
(goto-char (point-max))
@@ -143,12 +147,12 @@ text."
; (save-excursion
; (set-buffer (process-buffer
process))
; (goto-char (point-max))
- ;; (set-window-dot (get-buffer-window (current-buffer)) (point-max))
+ ;; (set-window-point (get-buffer-window (current-buffer)) (point-max))
; (sit-for 0))
(let ((buf (current-buffer)))
(set-buffer (process-buffer process))
(goto-char (point-max)) (sit-for 0)
- (set-window-dot (get-buffer-window (current-buffer)) (point-max))
+ (set-window-point (get-buffer-window (current-buffer)) (point-max))
(set-buffer buf)))
(defun smalltalk-accum-command (string)
@@ -475,7 +479,7 @@ running."
)
(kill-buffer buf)
;; this should probably be conditional
- (save-window-excursion (gst gst-args))
+ (save-window-excursion (gst gst-program-name))
;;; why is this like this?
;; (if mode
;; (progn
- [elpa] branch externals/smalltalk-mode created (now 453b7f5), Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 381d6ed 02/34: update FSF address, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode c39c42b 07/34: set comint-use-prompt-regexp, patch from Nick Gasson, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 71cd97f 11/34: update copyright years, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 6a18dea 23/34: change defun* to defun, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 2633e7a 18/34: recognize class declaration with explicit namespace in the superclass, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode a7e8c36 14/34: fix smalltalk-scope-begin-of-defun, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 0448eaa 08/34: merge from stephen, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 320dcae 15/34: fix indent and smalltalk-at-begin-of-{defun|scope}, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode fb9072e 04/34: add gst-prog-name, patch from Stephen Compall,
Stefan Monnier <=
- [elpa] externals/smalltalk-mode c8ce0e0 16/34: disable generational GC on sparc, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 4a29da5 31/34: Highlight ^ as a keyword, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 27c9a1a 09/34: update copyright from 2.3.6 release, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode c95682c 24/34: correct defun* -> defun patch, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 57c7cfa 20/34: fix smalltalk-mode.el to work in emacs 22, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 4160554 12/34: simplify installation of Emacs modes, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 90f07e6 32/34: Move smalltalk-mode autoloads to smalltalk-mode, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 453b7f5 34/34: smalltalk-mode: Fix version and author in header, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode d7f4421 28/34: emacs: Fix the smalltalk-mode mode for emacs 24.2 and later, Stefan Monnier, 2019/04/09
- [elpa] externals/smalltalk-mode 7706ca9 22/34: merge smalltalk-mode bugfixes and tags support, Stefan Monnier, 2019/04/09