Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xLispStat support #154

Closed
Txellenne opened this issue Mar 21, 2015 · 10 comments

Comments

@Txellenne
Copy link

commented Mar 21, 2015

Hi group!
I got installed xlispstat and put the following lines in my init emacs file.

(autoload 'run-xlispstat "/usr/local/lib/xlispstat"
  "Run inferior xlispstat process" t)
(autoload 'run-kcl "/usr/local/lib/xlispstat"
  "Run inferior kcl process" t)
(global-set-key "\C-xd" 'lisp-send-defun)
(global-set-key "\C-xj" 'lisp-send-defun-and-go)
(global-set-key (kbd "\C-x C-e") 'lisp-eval-last-sexp)

Would anyone know to tell why I keep having as output --> No lisp sub process; see var inferior lisp buffer ?
I also have had a look here at lines 270, 330, 424, 425 -because I can't find in my Emacs distribution where at the involved code resides, and I'm not sure what the error is or what I'm overlooking.
I'd appreciate any clue on this.

@vspinu

This comment has been minimized.

Copy link
Member

commented Mar 21, 2015

Unfortunately Xlispstat is not supported anymore. Some years go we (at ess-core) agreed that it's more pain than it's worth.

I couldn't even manage to install it last time when I wanted to try it for didactical curiosity.

@Txellenne

This comment has been minimized.

Copy link
Author

commented Mar 21, 2015

so, I got lucky, then? That uses not to be the case. I go on fedora (not tried on any other platform). Just downloaded the xlispstat-3-52-23.tar.gz. Once extracted did $ ./configure $ make, $ make install as instructed in the file called install found in the directory just extracted and done!
Lib files will get installed at/usr/local/lib/xlispstat and the executable at /usr/local/bin. When on any *.lsp file Emacs will get run in ESS-XLS-mode I just wanted to get an inferior lisp suport for it, just a friendly REPL, that's all..

At command line it runs OK by:

$ xlispstat

long-live-to-xlispstat

@Txellenne

This comment has been minimized.

Copy link
Author

commented Mar 22, 2015

So, that said. Would anyone know to tell whether I'm wrong trying to use xlispstat as another inferior-lisp-process? I'd love to have a xlispstat REPL like scheme & clojure users have in geiser or cider. But I still dunno what I should do so any clue, (or warning) will be very much welcomed. I'd really appreciate it.

To start with I got 2 scripts. The first one found in the tar.gz file mentioned above state itself is part of the gnu-emacs but as vspinu also said, xlispstat is not supported anymore, so I'm some puzzled about its situation in the whole ess body, so reuse it or what. I thought do show it here could help to clarify the question:

;; Running an inferior xlispstat process
;; Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc.

;; This file is part of GNU Emacs.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY.  No author or distributor
;; accepts responsibility to anyone for the consequences of using it
;; or for whether it serves any particular purpose or works at all,
;; unless he says so in writing.  Refer to the GNU Emacs General Public
;; License for full details.

;; Everyone is granted permission to copy, modify and redistribute
;; GNU Emacs, but only under the conditions described in the
;; GNU Emacs General Public License.   A copy of this license is
;; supposed to have been given to you along with GNU Emacs so you
;; can know your rights and responsibilities.  It should be in a
;; file named COPYING.  Among other things, the copyright notice
;; and this notice must be preserved on all copies.

(require 'shell)

(defun xlisp-quit-sentinel (proc reason)
  (if (and (not (memq reason '(run stop))))
      (save-buffers-kill-emacs)))

(defun set-xlisp-sentinel ()
  (let ((process (get-process "lisp")))
    (set-process-sentinel process 'xlisp-quit-sentinel)
    (process-kill-without-query process)))

(defun run-xlispstat-exit () 
  (run-xlispstat)
  (set-xlisp-sentinel))

(defun run-kcl-exit () 
  (run-kcl)
  (set-xlisp-sentinel))

(defun run-xlispstat ()
  "Run an inferior xlispstat process."
  (interactive)
  (let ((old-prog inferior-lisp-program))
    (setq inferior-lisp-program "xlispstat")
    (run-lisp)
    (setq inferior-lisp-program old-prog)))

(defun run-kcl ()
  (interactive)
  (let ((old-prog inferior-lisp-program))
    (setq inferior-lisp-program "kcl")
    (run-lisp)
    (setq inferior-lisp-program old-prog)))

;; modified to use .lsp suffix on temp file - xlisp gets upset without it.
(defun lisp-send-defun (display-flag)
  "Send the current defun to the Lisp process made by M-x run-lisp.
With argument, force redisplay and scrolling of the *lisp* buffer.
Variable `inferior-lisp-load-command' controls formatting of
the `load' form that is set to the Lisp process."
  (interactive "P")
  (or (get-process "lisp")
      (error "No current lisp process"))
  (save-excursion
   (end-of-defun)
   (let ((end (point))
     (filename (format "/tmp/emlisp%d.lsp" (process-id (get-process "lisp")))))
     (beginning-of-defun)
     (write-region (point) end filename nil 'nomessage)
     (process-send-string "lisp" (format inferior-lisp-load-command filename)))
   (if display-flag
       (let* ((process (get-process "lisp"))
          (buffer (process-buffer process))
          (w (or (get-buffer-window buffer) (display-buffer buffer)))
          (height (window-height w))
          (end))
     (save-excursion
       (set-buffer buffer)
       (setq end (point-max))
       (while (progn
            (accept-process-output process)
            (goto-char (point-max))
            (beginning-of-line)
            (or (= (point-max) end)
            (not (looking-at inferior-lisp-prompt)))))
       (setq end (point-max))
       (vertical-motion (- 4 height))
       (set-window-start w (point)))
     (set-window-point w end)))))
;;ends here

The second one is an add-hook script trying to create a handful of kbd:

(add-hook 'ess-mode-hook
          '(lambda ()
             (define-key ess-mode-map 
               "\C-c\C-e" '(lambda ()
                             (interactive)
                             (let ((curr (point)))
                               (end-of-defun)
                               (lisp-eval-last-sexp)
                               (goto-char curr))))
             (define-key ess-mode-map 
               "\C-x\C-e" 'lisp-eval-last-sexp)
             (define-key ess-mode-map 
               "\C-c\C-r" 'lisp-eval-region)
             (define-key ess-mode-map 
               "\C-c\C-c" '(lambda ()
                             (interactive)
                             (lisp-eval-string (buffer-string))))
             (define-key ess-mode-map 
               "\C-c\C-z" 'run-lisp)))

;; the line below is commented because should be redundant considering 
;; that in the above script the ;;inferior-lisp-program is already set, isn't?

;;(add-hook 'ess-mode-hook (lambda () (setq inferior-lisp-program "/usr/local/lib/xlispstat/xlisp")))

Well, that's it by now. As said any comment or help will be greatly appreciated.

@Txellenne

This comment has been minimized.

Copy link
Author

commented Mar 24, 2015

posting-progress.. in the year of our lord, Emacs. March 23th 2015
Well, I got some lost now. Even if I setq the inferior-lisp-program variable to xlisp ;; /usr/local/lib/xlispstat/xlisp I cannot get Emacs to create a inferior-lisp-process.
Next step Plan:
reading up on how to other known REPL systems as cider or geiser work so that we probably can draw a minimal version of them.
sub-steps: answer the following question: WTF happens with the above xlispstat .el script, because it got loaded indeed. Test against I say this latter: If you run the C-h-v command and type run-xlis.. the function got appeared as an option in the list of values the modeline buffer out puts. Even if I actually run M-x run-lispstat I cannot get it.
Other: If I run run-lisp what I got is, as expected, as documented, an inferior-lisp process so, (also) what I got if I run lisp or the value I got for the variable inferior-lisp-program at my terminal command line.
As I got installed slime via quickslip That variable is defined in the slime.el script and its value is "/usr/bin/sbcl".
OK. you probably gonna say it's my setting which get it into conflict. The Davidlian function run-xlispstat against the powerful inferior-lisp process triggered by the slime-helper.el script (:wow! you have to read the script to get what i mean). But even if I got it commented and straight setting the inferior-lisp-program by e.g.:

(setq inferior-lisp-program "xlispstat")`

or

(setq inferior-lisp-program "/usr/local/bin/xlispstat")

or

(setq inferior-lisp-program "/usr/local/lib/xlispstat/xlisp") 
;; the above xlispstat is really a bash executable link to
;; /usr/local/lib/xlispstat/xlisp

or do this by adding a hook when at ess or xls-mode for by:

(add-hook 'xls-mode-hook 
     (lambda () 
      (setq inferior-lisp-program "/usr/local/lib/xlispstat/xlisp")))

I got no success. I cannot get an inferior xlispstat process. (not yet). 👎

@vspinu

This comment has been minimized.

Copy link
Member

commented Mar 24, 2015

If I will manage to install xlispstat then I hope I can fix ESS pretty strightforwardly, but I don't know when I can get down to it. Not this week for sure.

You can try opening files in lisp-mode and configure inferior-lisp-program. That's the plain emacs way of dealing with it. Not ESS, but still something.

@Txellenne

This comment has been minimized.

Copy link
Author

commented Jul 13, 2015

Hey, group!
I was wondering.. what if I forked the ess project and tried to essay changes here e.g. at lines 330 424 425 ~~

@eddelbuettel

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2015

FWIW on current Ubuntu, the usual configure; make also produced a binary src/c/xlisp and the associated x11 binary src/c/X11WINDOWSxlisp.

@mmaechler

This comment has been minimized.

Copy link
Member

commented Nov 4, 2015

as @vspinu did not get to this (and I'd rather have him look at the M-C-a / M-C-e problem and others, notably polymode !! ;-), I'd say
**yes, please go ahead @Txellenne ! -- for and try and if things work nicely you'd end in a pull request for us!

@vspinu

This comment has been minimized.

Copy link
Member

commented Nov 4, 2015

Yeh. This is rather low on my personal priority list. I surely won't be able to get to it this year. Rewriting polymode is currently taking most of my free time.

So yes, please go ahead and change whatever you see fit in order to make it work again.

@lionel- lionel- changed the title No Lisp subprocess; see var 'inferior-lisp-buffer' xLispStat support Mar 17, 2018
@lionel- lionel- added the infra label Mar 17, 2018
@jabranham

This comment has been minimized.

Copy link
Contributor

commented Oct 18, 2018

Closing this for inactivity.

@jabranham jabranham closed this Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.