[Top][All Lists]

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

Re: Need help with eshell hack

From: Mathias Dahl
Subject: Re: Need help with eshell hack
Date: Fri, 21 Dec 2007 00:32:24 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

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
    (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.

Oh well,


reply via email to

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