🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99417

Re: bug report

#99417
From: Joseph Wells
Date: Sun, 23 Sep 1990 02:05
88 lines
3872 bytes
In <9009191234.AA17028@bounty.cma.fr> girod@BOUNTY.CMA.FR (Joseph Girod)writes:

   GNU Emacs 18.52.3 of Tue Nov 15 1988 on cma (berkeley-unix)

   In inferior-lisp-mode, no care is taken by <RET> (shell-send-input) of
   the value of inferior-lisp-prompt.  Actually, shell-prompt-pattern is
   used instead. So it should be interesting to include in the definition
   of inferior-lisp-mode:
   file shell.el, line 403: (or about)
	   (make-variable-buffer-local 'shell-prompt-pattern)
	   (setq shell-prompt-pattern inferior-lisp-prompt)

This is indeed a problem.  Unfortunately, the solution proposed is not
correct.

inferior-lisp-prompt is used by lisp-send-defun as a regexp pattern which
must match a line which contains a prompt and *nothing else*.  Thus, the
default value of inferior-lisp-prompt ends with a "$".  If this value is
assigned to shell-prompt-pattern, it will prevent shell-send-input from
ever working correctly on a line that is not at the end of the buffer.

Here is my solution:  Make inferior-lisp-prompt be just a pattern that
matches any lisp prompt at the beginning of the line, and change
lisp-send-defun to add the "$" itself.  Then the solution proposed above
will make shell-send-input correctly look for lisp prompts instead of
shell prompts.

Here is a patch for GNU Emacs 18.55:

*** /usr14/gnu/dist-18.55/lisp/shell.el	Sun Jul  3 10:37:12 1988
--- shell.el	Sat Sep 22 22:02:35 1990
***************
*** 358,364 ****
  but it works only in Common Lisp.")
  
! (defvar inferior-lisp-prompt "^.*>:? *$"
    "*Regexp to recognize prompts from the inferior Lisp.
! Default is right for Franz Lisp and kcl.")
  
  (defun inferior-lisp-mode ()
--- 358,365 ----
  but it works only in Common Lisp.")
  
! (defvar inferior-lisp-prompt "^.*>:? *"
    "*Regexp to recognize prompts from the inferior Lisp.
! Default is right for Franz Lisp and kcl, except in kcl's error mode, where
! many commands start with a colon.")
  
  (defun inferior-lisp-mode ()
***************
*** 402,405 ****
--- 403,408 ----
    (make-local-variable 'last-input-end)
    (setq last-input-end (make-marker))
+   (make-local-variable 'shell-prompt-pattern)
+   (setq shell-prompt-pattern inferior-lisp-prompt)
    (run-hooks 'shell-mode-hook 'lisp-mode-hook))
  
***************
*** 430,434 ****
  	      (w (or (get-buffer-window buffer) (display-buffer buffer)))
  	      (height (window-height w))
! 	      (end))
  	 (save-excursion
  	   (set-buffer buffer)
--- 433,438 ----
  	      (w (or (get-buffer-window buffer) (display-buffer buffer)))
  	      (height (window-height w))
! 	      (end)
! 	      (end-pattern (concat inferior-lisp-prompt "$")))
  	 (save-excursion
  	   (set-buffer buffer)
***************
*** 439,443 ****
  		    (beginning-of-line)
  		    (or (= (point-max) end)
! 			(not (looking-at inferior-lisp-prompt)))))
  	   (setq end (point-max))
  	   (vertical-motion (- 4 height))
--- 443,447 ----
  		    (beginning-of-line)
  		    (or (= (point-max) end)
! 			(not (looking-at end-pattern)))))
  	   (setq end (point-max))
  	   (vertical-motion (- 4 height))

-- 
Joe Wells <jbw@bu.edu>
Technical Details
Message-ID: <JBW.90Sep22220506@bucsf.bu.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu.edu!nntp-read!jbw
References: <9009191234.AA17028@bounty.cma.fr>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,4339b49ea248bfb7
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-09-22 19:32:01 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!bu.edu!nntp-read!jbw
From: jbw@bucsf.bu.edu (Joseph Wells)
Newsgroups: gnu.emacs.bug
Subject: Re: bug report
Message-ID: <JBW.90Sep22220506@bucsf.bu.edu>
Date: 23 Sep 90 02:05:06 GMT
References: <9009191234.AA17028@bounty.cma.fr>
Sender: news@bu.edu.bu.edu
Distribution: gnu
Organization: Boston University Computer Science Department
Lines: 88
Posted: Sun Sep 23 03:05:06 1990
In-reply-to: girod@BOUNTY.CMA.FR's message of 19 Sep 90 12:34:06 GMT