[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help with eshell hack

From: Kevin Rodgers
Subject: Re: Need help with eshell hack
Date: Thu, 28 Feb 2008 00:45:53 -0700
User-agent: Thunderbird (Macintosh/20080213)

Mathias Dahl wrote:
Mathias Dahl <address@hidden> 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."
  (let ((command (buffer-substring

(buffer-substring (line-beginning-position) (line-end-position))

    (let ((buf (current-buffer)))
      (unless (get-buffer eshell-buffer-name)
      (display-buffer eshell-buffer-name t)
      (switch-to-buffer-other-window eshell-buffer-name)
      (insert command)
      (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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]