Sailor Family

Home

Sailor At Work

Firefox
Java
Rubik Cube
Toto/4D

Html
Perl
Chinese

Emacs/Cygwin









Drop me a note
Email Web Sailor
Welcome to Web Sailor's Home
Home > Emacs/Cygwin > EShell Customizations

Eshell Introduction

Emacs 21.1 comes with a powerful package, eshell. This is a very powerful package. It should have been included earlier. I have been suffering all these years without a proper shell. The only short coming is, eshell does not support input redirection.

Although it is great, I still have to write some lisp codes to fix a few things that borther me.



EShell Environment Settings

You may type alt-x eshell to invoke eshell. To set the path and environment correctly, you may want to put this into your .emacs file.

(add-hook 'eshell-mode-hook
   '(lambda nil
   (eshell/export "EPOCROOT=\\Paragon\\")
   (let ((path))
      (setq path ".;c:/program files/microsoft visual studio/vb98/")
      (setq path (concat path ";d:/program files/microsoft visual studio/vc98/bin"))
    (setenv "PATH" path))
   (local-set-key "\C-u" 'eshell-kill-input))
 )
          


Running Perl Scripts in EShell

Eshell does not recognize perl script extensions. So I have to do this.

;; To make eshell understand .pl perl extensions.
(add-hook 'eshell-named-command-hook 'n-eshell-exec-perl)
(defun n-eshell-exec-perl (command args)
  "04Dec2001 - sailor, to make eshell understand perl scripts."
  (if (string-match "^.+\.pl[ \t]*" command)
      (progn
         (setq args (cons command args))
         (setq args (cons "-S" args))
         (throw 'eshell-replace-command
                (eshell-parse-command "perl" args))
        )
    )
  )


Clearing EShell Buffer

When the eshell buffer gets too large, you can simple type the command clear within the eshell to clear the entire buffer.

(defun eshell/clear ()
  "04Dec2001 - sailor, to clear the eshell buffer."
  (interactive)
  (let ((inhibit-read-only t))
    (erase-buffer)))


Langkawi Sunset