2009-06-27 2 views
7

나는 "프로젝트 파일"을 가장 느슨한 의미로 말합니다. Windows 용 emacs W32를 사용하여 ropemac을 사용하여 작업하는 몇 가지 파이썬 프로젝트가 있습니다. 이상적인 점은 바탕 화면에서 이맥스를 열고, 로프 프로젝트를 열고, 그 프로젝트의 최상위 디렉토리에 스피드 바를 설정하기위한 아이콘을 가질 수 있다면 어떨까요. 그렇다면 어쩌면 같은 방법으로 (그러나 그 프로젝트를 위해) 설정된 이맥스에서 다음 프로젝트를 여는 방법을 가질 수 있습니다. 물론 바탕 화면의 아이콘 대신에 동일한 효과를 내기 위해 사용할 수있는 emacs 명령이나 셸 명령이있는 경우에도 허용됩니다.Emacs에서 "프로젝트 파일"을 만들 수있는 방법이 있습니까?

이렇게 할 방법이 있습니까? 나에게는 elisp-fu가 전혀 없다. :-(

답변

1

bash/cmd.exe에서 직접 롤백 할 수 있습니다. 이맥스 배포판에는 runemacs.bat라는 .bat 파일이 있습니다.이 파일은 인수로 열 파일을 허용합니다. 작은 스크립트를 작성하면 하나의 아이콘에서 모든 것을 열려면

2

프로젝트 루트는 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 사용에 대한 게시 해답을 사용하여 프로젝트에 대해 원하는 방법을 설정하고 이름을 얻을 수
2

eproject이 있지만 매우 드문 것으로 기록되어 있습니다.

4

저는 실제로이 문제에 대한 해결책을 찾고 있습니다. 나는 항상 같은 시간에 열고 닫고 싶었던 파일 그룹을 가지고 있었고, magit-status 윈도우, dired 버퍼 등을 열었다. metaproject라는 프로젝트 모드에서 시작했다. 초기 단계에 있지만 기능적으로 충분히 작동하고 있으므로 현재 프로젝트 그룹에서 사용하고 있습니다.

은 여기를 체크 아웃 : 드문 드문 기록하지만 자식의 내용 http://nafai77.github.com/metaproject/

이 꽤 안정적이다. 나는 곧 여기에서 다시 일하기 시작할 것이다. 현재 작은 플러그인 아키텍처의 기초가 있으므로 프로젝트를 열 때 수행 할 수있는 사용자 지정 작업을 등록 할 수 있습니다.

+0

사람들이 잘 작업하고 있습니다. 상업용 코드 편집기에 익숙하며 emacs에 익숙하지 않은 나는 프로젝트 파일, 자동 완성, 커서 아래에있는 기능 프로토 타입의 미리보기 등을 제한적으로 검색하고 싶다. 이미 존재한다. 추측하지만 프로젝트의 내용에 제한을 가하는 것은 그렇게 생각하지 않습니다. – Gauthier

0

데스크톱 북마크, Dired 북마크 또는 북마크 북마크를 사용하여 원하는대로 할 수 있습니다. Bookmark+을 참조하십시오. 하나의 책갈피에 코드와 여러 책갈피를 캡슐화하여 원하는 상태와 설정 만 얻을 수 있습니다.

다음을 참조하십시오 : Iciclessupport for projects 더 많은 옵션.

관련 문제