RE: Using ACL with ILISP on MS Windows

"Clementson, Bill" <[email protected]> Mon, 15 Apr 2002 14:24:56 -0600
Newsgroups gmane.lisp.ilisp.general
Message-ID <[email protected]>
I am attempting to get rid of the extraneous "^M"s in the *allegro*
listener buffer based on some of the approaches that other people 
have attempted in the past for other Windows applications. 

I decided to try some brute force approaches first and then refine
my approach.

My first attempt was to just replace the RET key handler in ILISP 
and to scrub the buffer each time the Enter key is pressed:

(defun acl-return-ilisp ()
  "strip ^M characters from Allegro CL ILISP buffer"
  (interactive)
  (return-ilisp)
  (save-excursion
    (set-buffer (get-buffer "*allegro*"))
    (goto-char (point-min))
    (while (search-forward "\r" nil t) (replace-match ""))))

(define-key ilisp-mode-map [(control m)] 'acl-return-ilisp)

This sorta works - it clears the "^M"s in the *allegro*
listener buffer up to the point that the return was pressed. 
However, any output still prints with the "^M"s.

My next attempt was to replace the ilisp-display-output-default
function that is called by lisp-display-output. Since all output
appears to be routed through this function, this looked like the
right place to tackle the problem:

(defun acl-ilisp-display-output-default (output ilisp-output-sink)
  "strip ^M characters from Allegro CL ILISP buffer"
  (ilisp-display-output-default output ilisp-output-sink)
  (save-excursion
    ;(set-buffer (get-buffer "*allegro*"))
    (goto-char (point-min))
    (while (search-forward "\r" nil t) (replace-match ""))))

(defvar ilisp-display-output-function 'acl-ilisp-display-output-default)

However, this doesn't have any impact at all - the "^M"s aren't affected
by the change. Any ideas why this approach isn't working or suggestions
for other approaches that I can try?

--
Bill Clementson

> -----Original Message-----
> From: Nicolas Neuss [mailto:[email protected]]
> Sent: Wednesday, April 10, 2002 9:17 AM
> To: Clementson, Bill
> Cc: 'Nicolas Neuss'; [email protected]
> Subject: Re: [Ilisp-help] Using ACL with ILISP on MS Windows
> 
> 
> "Clementson, Bill" <[email protected]> writes:
> 
> > That looked really promising. Unfortunately, after I added 
> the line, it
> > still doesn't change anything. Do you use ACL with ILISP 
> under Windows or
> > are you using a different Lisp? If you are using ACL with 
> ILISP, is there
> > any chance you could send me your .emacs (by private email) 
> so that I can
> > try to work out why your configuration works and mine doesn't?
> > 
> > Thanks for your suggestion.
> > 
> > --
> > Bill Clementson
> 
> I must admit that I didn't try it under Windows but only with Emacs
> under Unix/Linux, where it is a quite usual question on .  But I
> thought it would be a good try...  Since it was not, I searched for
> info in the gnu.emacs.help newsgroup with
> 
> http://groups.google.com/groups?hl=en&q=gnu.emacs.help+Windows
> +%5EM&btnG=Google+Search
> 
> and it seems to be a harder problem.  I recommend reading the
> discussions there and also
> 
> http://www.gnu.org/software/emacs/windows/ntemacs.html
> 
> If nothing helps, and further searches on gnu.emacs.help don't give
> any more info, I'd probably ask that question again on gnu.emacs.help.
> Someone should have found a solution up to now...
> 
> Yours, Nicolas.
>