문제

I'm setting up emacs for Ruby on Rails development, and would like the ECB window to show only the directory for the project I'm working on. Is that possible?

Let's assume that I start emacs after I cd to the project's directory. I've added the following to my .emacs:

(defvar start-dir (getenv "PWD"))
(custom-set-variables
 '(ecb-layout-name "left14")
 '(ecb-layout-window-sizes (quote (("left14" (0.2564102564102564 . 0.6949152542372882) (0.2564102564102564 . 0.23728813559322035)))))
 '(ecb-options-version "2.32")
 '(ecb-primary-secondary-mouse-buttons (quote mouse-1--C-mouse-1))
 '(ecb-source-path (list start-dir))
 '(ecb-tip-of-the-day nil)
 '(ecb-tree-buffer-style (quote ascii-guides))
 '(inhibit-startup-screen t))

Notice I've created a list containing only the start-dir. However ECB shows both the start-dir and the root (/) dir.

도움이 되었습니까?

해결책

I figured out a solution to only show the directory from which I run emacs in the ECB window:

(defvar start-dir (getenv "PWD"))
(defvar start-dir-name (car (last (split-string start-dir "/"))))
(custom-set-variables
 '(ecb-layout-name "left14")
 '(ecb-layout-window-sizes (quote (("left14" (0.2564102564102564 . 0.6949152542372882) (0.2564102564102564 . 0.23728813559322035)))))
 '(ecb-options-version "2.32")
 '(ecb-primary-secondary-mouse-buttons (quote mouse-1--C-mouse-1))
 '(ecb-source-path (list (list start-dir start-dir-name)))
 '(ecb-tip-of-the-day nil)
 '(ecb-tree-buffer-style (quote ascii-guides))
 '(inhibit-startup-screen t))

다른 팁

Try (setq ecb-source-path (quote "/path/to/project/")). Your present setup makes ecb-source-path nil, which you can see if you do describe-variable.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top