मैं अपने लिए निम्नलिखित "समाधान" का उपयोग करता हूं: एक प्रोजेक्ट रूट को उस निर्देशिका द्वारा परिभाषित किया जाता है जिसमें Makefile
होता है। मैंने मोड विशिष्ट एलिसिप फ़ंक्शन में F12 को बाध्य किया है जो "संकलित करता है" प्रोजेक्ट मेकफ़ाइल का पहला लक्ष्य बनाकर प्रोजेक्ट। यह वर्तमान फ़ाइल की निर्देशिका से ऊपर की तरफ जा रहा है।
यह सेटअप का एक छोटा सा है, लेकिन आप Neve आर को आपकी .metadata
निर्देशिका का पुनर्निर्माण करना होगा जैसा अक्सर ग्रहण के साथ होता था। और एक बार स्थापित होने के बाद, आपको बस उचित मेकफ़ाइल रखना होगा और आपके पास अपनी परियोजनाएं होंगी।
(defun get-makefile-recursively-higher()
(loop for i below 100 for cwd = (expand-file-name default-directory)
then next for next = (expand-file-name (concat cwd "/..")) for file =
(concat cwd "/" "Makefile") do (cond ((and (file-exists-p file))
(return file))) until (equal cwd next))
)
यह तो जैसे प्रयोग किया जाता है LaTeX और अजगर मोड द्वारा इस प्रकार है:
(defun py-execute-prog (&optional target)
"Invoke python on the file being edited in the current buffer using
arguments obtained from the minibuffer. It will save all of the modified
buffers before trying to execute the file."
(interactive)
(let* (makefile file cmd)
(setq makefile (get-makefile-recursively-higher))
(setq file (buffer-file-name (current-buffer)))
(setq cmd (concat "make -f " makefile))
(setq default-directory (file-name-directory makefile))
(save-some-buffers (not py-ask-about-save) nil)
(setq py-pdbtrack-do-tracking-p t)
(if (get-buffer py-output-buffer)
(kill-buffer py-output-buffer)) ; Get rid of buffer if it exists.
(global-unset-key "\C-x\C-l")
(global-unset-key "\C-x\C-p")
(global-unset-key "\C-x\C-e")
(global-unset-key "\C-x\C-n")
(global-set-key "\C-x\C-l" 'py-last-exception)
(global-set-key "\C-x\C-p" 'py-previous-exception)
(global-set-key "\C-x\C-e" 'py-current-line-exception)
(global-set-key "\C-x\C-n" 'py-next-exception)
(define-key comint-mode-map [mouse-3] 'py-current-line-exception)
(make-comint "Python Output" "make" nil "-f" makefile)
(if (not (get-buffer py-output-buffer))
(message "No output.")
(setq py-exception-buffer (current-buffer))
(pop-to-buffer py-output-buffer)
)))
(defun make-tex (&optional target)
(interactive)
(let (makefile cmd)
(setq makefile (get-makefile-recursively-higher))
(save-buffer)
(TeX-save-document (TeX-master-file))
(setq cmd (concat "make -j4 -f " makefile " LATEXPARAM=\"-halt-on-error -file-line-error\""
" TEXMASTER=" (expand-file-name (TeX-master-file)) ".tex"
" TEXMASTERDIR=" (file-name-directory makefile) "/"))
(when (stringp target)
(setq cmd (concat cmd " " target))
)
(ad-activate-regexp "auto-compile-yes-or-no-p-always-yes")
(compile cmd)
(ad-deactivate-regexp "auto-compile-yes-or-no-p-always-yes")
)
)
स्रोत
2009-06-27 15:11:36
अच्छा है कि लोग उस पर काम कर रहे हैं! मुझे एक वाणिज्यिक कोड संपादक और emacs के लिए बहुत नया उपयोग किया जाता है, मुझे कर्सर के नीचे क्या है, इस पर निर्भर करता है कि प्रोजेक्ट फाइलों, स्वत: पूर्णता, फ़ंक्शन प्रोटोटाइप का पूर्वावलोकन सीमित होना पसंद है ... ये पहले से मौजूद हैं अनुमान लगाओ, लेकिन उन्हें एक परियोजना की सामग्री तक सीमित रखने के लिए मुझे ऐसा नहीं लगता है। – Gauthier