|
From: | Kevin Rodgers |
Subject: | Re: Need help with eshell hack |
Date: | Thu, 28 Feb 2008 00:45:53 -0700 |
User-agent: | Thunderbird 2.0.0.12 (Macintosh/20080213) |
Mathias Dahl wrote:
Mathias Dahl <mathias.dahl@gmail.com> writes:It almost works. The problem is that when output from the command reaches the bottom of the visible part of the eshell window, the window isn't scrolled down to show the output.I let go of the `save-excursion' + `set-buffer' approach, in other words being a bad boy, and got this that seems to work for me: (defun my-eshell-execute-current-line () "Insert text of current line in eshell and execute." (interactive) (let ((command (buffer-substring (save-excursion (beginning-of-line) (point)) (save-excursion (end-of-line) (point)))))
(buffer-substring (line-beginning-position) (line-end-position))
(let ((buf (current-buffer))) (unless (get-buffer eshell-buffer-name) (eshell)) (display-buffer eshell-buffer-name t) (switch-to-buffer-other-window eshell-buffer-name) (end-of-buffer) (eshell-kill-input) (insert command) (eshell-send-input) (end-of-buffer) (switch-to-buffer-other-window buf)))) It annoys be however that I could not get it working without using switch-to-buffer... The docstring says to avoid use it.
(pop-to-buffer eshell-buffer-name) -- Kevin Rodgers Denver, Colorado, USA
[Prev in Thread] | Current Thread | [Next in Thread] |