Preferring certain file extensions with Emacs file name completion -
I have a number of directories with a set of tax documents. Therefore, many files are with the same base filename and various extensions. Only one of them, however, is editable. I have a way of explaining to Alex that if I am in a directory where I have found
document.tex document.log document.pdf document.bbl document.aux ... And I am in the minibut and
~ / document /.../ doctor & lt; TAB & gt; This fills in 'document.tex', because that directory actually has a really editable document; Anyone knows a good way to do this?
I've written some code that you want to do. The basic idea is to set those variables 'Completion-Ignore-Extensions' to match those extensions that you want to skip, but when only .tex files exist This code does this.
(Set search-file-reading-option-limit-option activated) (defadvice find-file-read-args around) "Set some stuff to control the extension when the tab is complete" (Search-file-limit-option T)) (Ad-minus-option T)) (Defedby's minibfer-full (activate zero-options-around-round-minibut) "When in the search-file, check files of extension.txt, and if If you are found, then ignore .log .pdf .bbl. "(But (but add-or-delete (if (bound ('bound' search-file-limit-option) search-file-limit-option (saved- Travel (let's (pre-line (point-line)) (e (forecast (end-line) (point)))) (directory-files (file-name-directory (buffer-substring-no- Properties)) Zero "\\. Tex $")))) Remove 'add-to-list') (map (lambda (e) (static completion-ignore-extension (full-unseen-a-function Enjoy the advertise) ).
>
Comments
Post a Comment