프로젝트 루트는 Makefile
을 포함하는 디렉토리로 정의됩니다. "컴파일"하는 모드 특정 elisp 함수에 F12를 바인딩했습니다. 해당 Makefile의 첫 번째 대상을 만들어 프로젝트를 만듭니다.이 파일은 현재 파일의 디렉터리에서 위쪽으로 재귀 적으로 이동하여 찾습니다.
약간의 설정이지만, 당신의 .metadata
디렉토리를 재구성해야한다. 일단 설정을 마치면 적절한 Makefile을 배치해야하며 프로젝트가 있습니다.
(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")
)
)
당신은 모든 세션 그때 desktop.el 사용에 대한 게시 해답을 사용하여 프로젝트에 대해 원하는 방법을 설정하고 이름을 얻을 수
사람들이 잘 작업하고 있습니다. 상업용 코드 편집기에 익숙하며 emacs에 익숙하지 않은 나는 프로젝트 파일, 자동 완성, 커서 아래에있는 기능 프로토 타입의 미리보기 등을 제한적으로 검색하고 싶다. 이미 존재한다. 추측하지만 프로젝트의 내용에 제한을 가하는 것은 그렇게 생각하지 않습니다. – Gauthier