Today, we are competing with the Ido-mode of Emacs.

Source: Internet
Author: User

 

Emacs is undoubtedly the most powerful editor. She has recently upgraded to 23.2.
A powerful cedet is built in. There is no reason not to upgrade.

 

After the upgrade, you only need to disable the cedet loading configuration in. emacs. However, I encountered a problem in the daily use of Ido-mode.

 

Because Symbian mobile app development is underway, all projects are stored in the C:/Symbian/source directory with the large stream, modified with Emacs, and compiled with abld. Fine, write more and more projects step by step, use helloworldbasic to helloworldplus to Multiviews. After installing 23.2, you can only see the completion of one helloworldbasic directory each time you open C:/Symbian/source with C-x C-f. No reason. I have used CMD and explorer. There are no more than 20 subdirectories in the source directory.

 

I reinstalled 23.1, and the problem persists. If you have tried other directories, the completion is normal.

Is there a problem with. emacs (start normally with-q ). I tried Emacs using the binary method and found that the problem persists.

 

Finally, I suspect that ~ The/. Ido. Last file shows the C:/Symbian/source cache. Delete it ..

Restart Emacs. Still malfunction...

 

After a while, I think that the Ido-mode may write the cache back to. Ido. Last when I quit, so I quit Emacs and delete. Ido. Last. Finally.

 

This cache function should be used to speed up the prompt of Ido-mode. Why didn't you notice it before. We can use Customize-group to check that there is indeed a cache in Ido. Since there is a cache, there should be a refresh. Enter c-l in full time, and immediately update and delete. Ido. Last. This is simpler. If you do not like cache, you can customize it to 0.

 

During the previous "Chaos", I also checked Ido-find-file, wondering if it had a bug. I was shocked when I was reading Ido-find-file. It turns out that this function is so powerful that it also supports History Management, find lookup, and regular expressions. The find search (supplemented by full-time M-F) is very attractive to me, so that you can instantly locate files of the same name in multi-level subdirectories. I tried it in windows and found it was not feasible. SSH to Ubuntu, available... This is a bug ..

 

 

I spent some time modifying the Ido-wide-find-dirs-or-files function and enabled cygwin's Windows directory name compatibility support. Haha. In the future, find-file can be completed across multiple levels of directories ..

P.s: in windows, there is a conflict between find.exe and the built-in system. Therefore, we recommend that you copy the find of cygwin to cygfind.

Find-program can be customized to "cygfind.

 

; Remember to set cygwin = nodosfilewarning
(Defun Ido-wide-find-dirs-or-files (DIR file & optional prefix
Finddir)
; As Ido-run-find-command, but returns a list of cons pairs ("File ".
"Dir ")
(Let (filenames
(Split-string
(Shell-command-to-string
(Concat find-program ""; "cygfind"
(Shell-quote-argument DIR)
"-Name"
(Shell-quote-argument
(Concat (if prefix "" * ") file "*"))
"-Type" (if finddir "D" "F") "-print "))))
Filename d F
Res)
(While filenames
(Message find-Program)
(Setq filename (CAR filenames)
Filenames (CDR filenames ))
(If (and (or (string-match "^/" FILENAME) (string-match "^ .:"
Filename ))
(File-exists-P filename ))
(Setq D (file-name-directory filename)
F (file-name-nondirectory filename)
Res (Cons (if finddir (Ido-Final-slash f t) f) d) RES ))))
Res ))

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.