all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Need help with eshell hack
@ 2007-12-20 21:43 Mathias Dahl
  2007-12-20 23:32 ` Mathias Dahl
  0 siblings, 1 reply; 3+ messages in thread
From: Mathias Dahl @ 2007-12-20 21:43 UTC (permalink / raw)
  To: help-gnu-emacs


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-28  7:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-20 21:43 Need help with eshell hack Mathias Dahl
2007-12-20 23:32 ` Mathias Dahl
2008-02-28  7:45   ` Kevin Rodgers

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.