2009-11-10 41 views
3

我正面臨一些奇怪的行爲,在emacs中完成文件名。 C-x C-f查找文件用i:/ cygwin/home/rrajagop/StockScreener/working_copy/master_repo/stock_screener /打開minibuffer。打一個選項卡使其成爲我:/ cygwini:/ cygwin/home/rrajagop/StockScreener/working_copy/master_repo/stock_screener /。一對夫婦的有趣的事情,我注意到:Emacs:文件名的Tab完成附加一個額外的i: cygwin

  1. 當迷你緩衝區打開了,我:/ cygwin的是灰色和路徑似乎從/家開始。一個C-a(去開始行)把我帶到/ home而不是我:/ cygwin。所以它看起來像emacs中的東西是解析路徑從/ home開始,而不是從i:/ cygwin開始。
  2. 我檢查了TAB從minibuffer.el(通過爲TAB執行describe-key)運行minibuffer-complete,因此看起來像minibuffer-complete爲cygwin做了一些翻譯並附加了額外的i:/ cygwin。

我該如何解決這個問題呢?

編輯:額外信息 我試圖用-Q打開emacs,這個問題不會發生。所以這是我在我的.emacs中加載的東西。這是我在我的.emacs

(require 'cl) 

; Needed to see how fast Emacs loads. Loading time is printed at the 
; and of the execution of .emacs file. 
(defvar *emacs-load-start* (current-time)) 

; I really like this font. I also tried Monaco which you can 
; see on lot of Railscasts but I couldn't find the one which 
; supports Serbian Cyrillic and Latin letters. 
(set-default-font "-outline-Courier New-normal-r-normal-normal-19-142-96-96-c-*-iso8859-1") 

;; Don't show that splash screen 
(setq inhibit-startup-message t) 

; This should allegedly speed up Emacs starting by preventing 
; some requests from the window manager back to the Emacs. Frankly 
; speaking I didn't notice some speed up but I still keep it:(
(modify-frame-parameters nil '((wait-for-wm . nil))) 

;Allows syntax highlighting to work, among other things 
(global-font-lock-mode 1) 

; Sets initial window position 
(set-frame-position (selected-frame) 0 0) 

; Sets initial window size to 85 columns and 47 rows 
(set-frame-size (selected-frame) 88 32) 

; Makes last line ends in carriage return 
(setq requre-final-newline t) 

; Sets Ctrl-x/key combination for easy commenting 
; out of selected lines. 
(global-set-key "\C-x/" 'comment-or-uncomment-region) 

; Allow resizing of the mini-buffer when necessary 
(setq resize-minibuffer-mode t) 

; Auto magically read compressed files 
(auto-compression-mode 1) 

; Set standard indent to 2 rather then 4 
(setq standard-indent 2) 

; This tells Emacs to create backup files. 
(setq make-backup-files t) 

; And this will enable versioning with default values. 
(setq version-control t) 

; Remove annoying message about deleting excess backup of .recentf 
; which is list of recent files used 
(setq delete-old-versions t) 

; Finally do not spread backups all over the disk. 
; Just save all backup files in this directory. 
(setq backup-directory-alist (quote ((".*" . "~/.emacs_backups/")))) 

;; Directory to put various el files. 
(add-to-list 'load-path "~/.emacs.d/includes") 

(require 'ascii-table) 

;; Loading collection of generic modes for different languages 
(require 'generic-x) 

;; Recent files 
(require 'recentf) 
(recentf-mode 1) 

;; Loads ruby mode when a ruby file is opened. 
(autoload 'ruby-mode "ruby-mode" "Major mode for editing ruby scripts." t) 
(setq auto-mode-alist (cons '(".rb$" . ruby-mode) auto-mode-alist)) 
(setq auto-mode-alist (cons '(".rhtml$" . html-mode) auto-mode-alist)) 
(setq auto-mode-alist (cons '(".html.erb$" . html-mode) auto-mode-alist)) 

;; Turn on ruby electric (auto completion of parenthesis, etc.) 
(add-hook 'ruby-mode-hook 
     (lambda() 
     (add-hook 'local-write-file-hooks 
       '(lambda() 
      (save-excursion 
       (untabify (point-min) (point-max)) 
       (delete-trailing-whitespace)))) 
     (set (make-local-variable 'indent-tabs-mode) 'nil) 
     (set (make-local-variable 'tab-width) 2) 
     (imenu-add-to-menubar "IMENU") 
     (define-key ruby-mode-map "\C-m" 'newline-and-indent) 
     (require 'ruby-electric) 
     (ruby-electric-mode t))) 

;; Ruby debugging. 
(add-to-list 'load-path "~/.emacs.d/plugins/rdebug") 
(autoload 'rdebug "rdebug" "Ruby debugging support." t) 
(global-set-key [f9] 'gud-step) 
(global-set-key [f10] 'gud-next) 
(global-set-key [f11] 'gud-cont) 
(global-set-key "\C-c\C-d" 'rdebug) 


;; set compile command based on current major mode 
(autoload 'mode-compile "mode-compile" 
"Command to compile current buffer file based on the major mode" t) 
(global-set-key "\C-cc" 'mode-compile) 
(autoload 'mode-compile-kill "mode-compile" 
"Command to kill a compilation launched by `mode-compile'" t) 
(global-set-key "\C-ck" 'mode-compile-kill) 

;; yasnippet - adding code snippet insertion 
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet") 
(require 'yasnippet) ;; not yasnippet-bundle 
(yas/initialize) 
(yas/load-directory "~/.emacs.d/plugins/yasnippet/snippets") 

;; Use CYGWIN bash 
(require 'setup-cygwin) 

;; Subversion integration via psvn - not gonna use svn anymore 
;; (require 'psvn) 


;; add some elisp tutorials to the info directory 
(let ((info-root (concat usb-drive-letter "cygwin/usr/local/bin/emacs/info/"))) 
    (setq Info-directory-list (list info-root 
        (concat info-root "elisp-tutorial-2.04/") 
        (concat info-root "emacs-lisp-intro-2.14"))) 
) 

;; Load time for .emacs - this should be the last line in .emacs for accurate load time 
(message "ido and org-install took: %ds" 
    (destructuring-bind (hi lo ms) (current-time) 
     (- (+ hi lo) (+ (first *emacs-load-start*) (second *emacs-load-start*))))) 
+0

註釋掉(需要「設置,Cygwin的)中的.emacs似乎解決了這個問題。我還注意到,在第一次發生此問題之前,有一條消息「正在加載tramp ... done」。 – Rohith 2009-11-10 05:46:11

+0

http://starks-browning.com/david/tramp/似乎認爲tramp與cygwin-mount不兼容。我有cygwin掛載。如果我必須在tramp和cygwin-mount之間進行選擇,我會採用cygwin-mount。所以現在我需要弄清楚什麼是加載流氓,以及如何刪除它 - 並且希望沒有因爲沒有加載流氓而破壞。 – Rohith 2009-11-10 06:32:38

+0

經過更多的故障排除之後,我終於決定從電腦中刪除流氓相關的el和elc文件(是的,非常激烈!),問題仍然存在!現在我認爲這是minibuffer-complete與cygwin之間的某種相互作用 - 因爲如果沒有cygwin-mount和setup-cygwin,問題似乎就會消失。 – Rohith 2009-11-10 10:52:35

回答

0

,你可以通過改變可變tramp-mode控制流浪漢。

注意,您可能會發現使用customize來定製emacs很有用。 我做了customize-apropostramp,它發現流浪漢組。點擊此處顯示配置流浪漢的所有方法,包括關閉它。

0

文件名陰影模式灰色的c:在文件名.....所以當cygwin安裝替代最長安裝名運行它沒有看到C:並增加了另一個

的Mx查找文件

c:/home/ 
> a 
c:/home/a   ; but the c: is greyed 
> TAB 
c:c:/home/anything 
相關問題