Changeset 7047 for lang/elisp

Show
Ignore:
Timestamp:
02/22/08 23:15:29 (9 months ago)
Author:
taiyoh
Message:

lang/elisp/set-perl5lib: t/内のファイル編集時に、t/と同階層にlib/があれば、そこをPERL5LIBに登録する

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/elisp/set-perl5lib/set-perl5lib.el

    r4903 r7047  
    2424;;; * set-perl5lib について 
    2525 
    26 ;;; ファイルのパスに"dir"というディレクトリが含まれていたら、 
     26;;; ファイルのパスに"lib"というディレクトリが含まれていたら、 
    2727;;; そこまでのパスをPERL5LIBに登録します。 
    2828;;; 
     
    3131;;; のあとで、Flymakeのflymake-perl-load関数をオーバーライドして 
    3232;;; (set-perl5lib) 
    33 ;;; を関数内に追加すれば、 
    34 ;;; 自動的にパスを登録できます。 
     33;;; を関数内に追加すれば、自動的にパスを登録できます。 
    3534;;; 
    3635;;; SeeAlso: http://d.hatena.ne.jp/sun-basix/20080117/1200528765 
     
    3837(defun perllib-check-path (lst lib-path) 
    3938  (let ((dir (car lst)) (lst (cdr lst))) 
    40     (setf lib-path (concat lib-path "/" dir)) 
    41     (if lst 
    42         (if (string= dir "lib") 
    43             lib-path 
    44           (perllib-check-path lst lib-path))))) 
     39    (let ((set-lib-path (concat lib-path "/lib"))) 
     40      (if lst 
     41          (if (string= dir "lib") 
     42              set-lib-path 
     43            (if (and (string= dir "t") 
     44                     (file-readable-p set-lib-path)) 
     45                set-lib-path 
     46              (perllib-check-path lst (concat lib-path "/" dir)))))))) 
    4547 
    4648(defun set-perl5lib ()