Changeset 7959 for lang/elisp

Show
Ignore:
Timestamp:
03/15/08 00:28:53 (9 months ago)
Author:
kentaro
Message:

lang/elisp/set-perl5lib: PERL5LIBを上書きするんじゃなくて、追加するようにした。

Files:
1 modified

Legend:

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

    r7060 r7959  
    4545 
    4646(defun set-perl5lib () 
    47   "set path into PERL5LIB if its file path includes 'lib' directory" 
     47  "Set path into PERL5LIB if its file path includes 'lib' directory" 
    4848  (interactive) 
    49   (let ((path-list (cdr (split-string buffer-file-name "/")))) 
    50     (if (setf lib-path (perllib-check-path path-list "")) 
    51         (let () 
    52           (setenv "PERL5LIB" lib-path) 
    53           (message (concat "PERL5LIB=" lib-path)))))) 
     49  (let* ((path-list (cdr (split-string buffer-file-name "/"))) 
     50         (lib-path (perllib-check-path path-list "")) 
     51         (current-perl5lib (getenv "PERL5LIB"))) 
     52    (when (and lib-path 
     53               (not (string-match lib-path current-perl5lib))) 
     54      (setenv "PERL5LIB" (concat lib-path ":" current-perl5lib)) 
     55      (message "Added %s into PERL5LIB" lib-path)))) 
    5456 
    5557(provide 'set-perl5lib)