.emacs-defs
changeset 1254 19c7b3be9b3a
parent 1241 4f22d9fe2e5b
child 1278 8e47e801be9d
equal deleted inserted replaced
1253:504c216e8d21 1254:19c7b3be9b3a
    35   (when (file-directory-p my-usr-lisp-dir)
    35   (when (file-directory-p my-usr-lisp-dir)
    36     (add-to-list 'load-path my-usr-lisp-dir)
    36     (add-to-list 'load-path my-usr-lisp-dir)
    37     (let ((default-directory my-usr-lisp-dir))
    37     (let ((default-directory my-usr-lisp-dir))
    38       (normal-top-level-add-subdirs-to-load-path))))
    38       (normal-top-level-add-subdirs-to-load-path))))
    39 
    39 
       
    40 (defmacro my--eval-after-load (feature &rest forms)
       
    41   `(,(if (or (not (boundp 'byte-compile-current-file))
       
    42              (not byte-compile-current-file)
       
    43              (if (symbolp feature)
       
    44                  (require feature nil :no-error)
       
    45                (load feature :no-message :no-error)))
       
    46          'progn
       
    47        (message "my--eval-after-load: cannot find %s" feature)
       
    48        'with-no-warnings)
       
    49     (eval-after-load ',feature
       
    50       `(funcall (function ,(lambda () ,@forms))))))
       
    51