2012-07-17 6 views

답변

2

여러 가지 방법이 있습니다.

  • 유형 apropos,이어서 pymacs. 기호를 찾으면로드되었습니다.

  • 이 (필요 '- (pymacs을 pymacs을)은 오류를 반환하지 않는 경우 이미로드의 경우는

  • 를로드, 그것은 제공)라는', 변수로드 역사는 문자 유지

다른 방법으로 ckeck을 사용할 수 있습니다.

+2

'(require 'pymacs nil'noerror)'와 같이 require를 호출 할 수도 있습니다. 그런 다음 오류가 발생하지 않고 라이브러리를로드 할 수없는 경우 false를 반환합니다. 라이브러리가 이미로드되거나 성공적으로로드 된 경우 비 nil을 반환합니다. – jpkotta

3

M-x locate-library은 이맥스가 load-path에서 라이브러리를 찾을 수 있는지 알려줍니다. 아무 것도 반환하지 않으면 먼저 load-path을 수정해야 할 수도 있습니다.

1

당신이 ELPA 패키지에 대해 얘기하는 경우 확실하지,하지만 난 내 이맥스에서 사용되는 용어의 정의는 다음이있다 : 나는 다음과 같은 패키지를 활성화하기 위해 내 이맥스에 다음과 같은 코드를 포함 할 수

 
    (defun sh-elpa-ensure-package (name) 
     "Make sure that a particular package is installed; if not then 
    automatically download, compile and install it. 

    This is primarily used by sh-elpa-require to allow deployment of 
    the configuration to a new machine - packages will therefore be 
    downloaded on that fresh machine (following installation they are 
    automatically kept up to date by the package manager). 

    Use this as follows: 
    (sh-elpa-ensure-package 'org)" 
     (if (not (package-installed-p name)) 
      (package-install name))) 

    (defun sh-elpa-require (name) 
     "A replacement for the standard Emacs 'require' 
    function. This uses sh-elpa-require to download and install a 
    package if necessary prior to using the standard 'require' 
    function to import it. This is useful to allow the configuration 
    to just 'sh-elpa-require' a package and not have to bother 
    checking whether it has been installed yet." 
     (sh-elpa-ensure-package name) 
     (require name)) 

- 아직 설치되어 있지 않은 경우 다음이 ELPA에서 다운로드하고이 "필요"하기 전에 그것을 바이트 컴파일 :

(sh-elpa-require 'pymacs) 

그냥 패키지가 elisp에서 설치되어 있는지 여부를 확인 얘기하는 경우, 당신은 위 스 니펫에서 해당 뼈를 골라 낼 수도 있습니다 -를 참조하십시오.비트.

+0

먼저'(package-initialize)'가 호출되었는지 확인하십시오. 그렇지 않으면'(package-installed-p name)'은 ~/.emacs.d/elpa /에 인스톨 된 패키지에 대해'nil'을 반환합니다.'(package-install name)'시도로 이미 존재하고 있습니다. . –

관련 문제