顺便纪念一下--首次在 ubuntu 下面发文 
下面的小配置让 eshell 的 prompt 最多只显示最后 4 个文件夹名。
;; change eshell prompt
(defun yami-adjust-eshell-prompt (path)
  (let* ( (path-components (split-string path "/"))
          (len (length path-components))
          (max-comp 4) )
    (if (<= len max-comp)
        path
      (concat "<< " (mapconcat (lambda (str) str)
                               (nthcdr (- len max-comp) path-components)
                               "/")))))
      
(setq eshell-prompt-function
      (lambda ()
        (concat (yami-adjust-eshell-prompt (eshell/pwd))
                (if (= (user-uid) 0) " # " " $ "))))
傻傻的效果,凑合着用先 
<< download/emacs/admin/charsets # ls
CVS       compact.awk  eucjp-ms.awk  kuten.awk
Makefile  cp51932.awk  gb180302.awk  mapconv
big5.awk  cp932.awk    gb180304.awk  mule-charsets.el
                  	
				
