RE: Some questions concerning buffers
"Clementson, Bill" <[email protected]> Fri, 23 May 2003 12:20:40 -0600
| Newsgroups | gmane.lisp.ilisp.general |
|---|---|
| Message-ID | <[email protected]> |
From: Nicolas Neuss on Friday, May 23, 2003 10:54 AM
> Thanks for your answer. One thing is still not as I want to=20
> have it: I would like to have the output buffer visible after=20
> the command and scrolling (the reason is that I usually print=20
> statistics about some ongoing computation).
>=20
> For fun, I have tried this with my keyboard macro approach:
>=20
> (fset 'copy-eval-last-sexp
> [?\C- ?\C-\M-b ?\M-w ?\C-\M-f ?\M-x ?c ?m ?u ?l ?i ?s ?p=20
> return ?\M-> ?\C-y return ?\C-x ?o])
>=20
> ;;; set it to some key: whatever (for me [f9] is starting up=20
> lisp) (global-set-key [f9] 'copy-eval-last-sexp)
>=20
> This works, with one problem: jumping back is too fast and=20
> the cursor in the output buffer remains at the beginning of=20
> the expression and the buffer does not scroll...
Ok, this revised version of the function should take care of the first
issue (always having the output buffer visible after the command):
(defun copy-eval-last-sexp (arg)
"Evaluate the last s-expression in the buffer in the Lisp listener."
(interactive "p")
(let ((end (point))
(beg (save-excursion
(backward-list 1)
(point)))
(edit-buffer (current-buffer)))
(cond ((and (member* ilisp-buffer (buffer-list)
:key #'buffer-name
:test #'equal)
(get-buffer-process (get-buffer ilisp-buffer)))
(switch-to-lisp t)
(other-window 1)
(append-to-buffer ilisp-buffer beg end)
(switch-to-lisp t)
(return-ilisp)
(other-window 1)))))
Not sure how to address the scrolling issue. I tried setting
comint-always-scroll to t but that doesn't seem to help :(
--
Bill Clementson
-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge