help-gnu-emacs
[Top][All Lists]
Advanced

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

Need help with eshell hack


From: Mathias Dahl
Subject: Need help with eshell hack
Date: Thu, 20 Dec 2007 22:43:37 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

Inspired by `eev' I wanted to write a command that executes the current
line as a command in eshell. This is what I have:

(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)))))
    (save-excursion
      (unless (get-buffer eshell-buffer-name)
        (eshell))
      (display-buffer eshell-buffer-name t)
      (set-buffer eshell-buffer-name)
      (end-of-buffer)
      (eshell-kill-input)
      (insert command)
      (eshell-send-input))))

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.

Any idea on how to achieve this?

/Mathias


reply via email to

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