Synch with Gnus.
[elisp/gnus.git-] / lisp / dgnushack.el
index 202c66b..5072a5d 100644 (file)
 
 (defvar srcdir (or (getenv "srcdir") "."))
 
-(defvar dgnushack-w3-dir
-  (file-name-as-directory
-   (or (getenv "W3DIR") (expand-file-name "../../w3/lisp/" srcdir))))
-(push dgnushack-w3-dir load-path)
-
-(load (expand-file-name "dgnuspath.el" srcdir) nil nil t)
+(defvar dgnushack-w3-dir (let ((w3dir (getenv "W3DIR")))
+                          (unless (zerop (length w3dir))
+                            (file-name-as-directory w3dir))))
+(when dgnushack-w3-dir
+  (push dgnushack-w3-dir load-path))
 
 ;; If we are building w3 in a different directory than the source
 ;; directory, we must read *.el from source directory and write *.elc
         '(char-before (point))
        form))))
 
+(load (expand-file-name "dgnuspath.el" srcdir) nil nil t)
+
+(condition-case err
+    (load "~/.lpath.el" t nil t)
+  (error (message "Error in \"~/.lpath.el\" file: %s" err)))
+
 ;; Don't load path-util until `char-after' and `char-before' have been
 ;; optimized because it requires `poe' and then modify the functions.
 (or (featurep 'path-util)
 (add-path "flim")
 (add-path "semi")
 
-(condition-case err
-    (load "~/.lpath.el" t nil t)
-  (error (message "Error in \"~/.lpath.el\" file: %s" err)))
-
 (push srcdir load-path)
 (load (expand-file-name "lpath.el" srcdir) nil t t)
 
@@ -247,6 +248,11 @@ You also then need to add the following to the lisp/dgnushack.el file:
      (push \"~/lisp/custom\" load-path)
 
 Modify to suit your needs."))
+
+  ;; Show `load-path'.
+  (message "load-path=(\"%s\")"
+          (mapconcat 'identity load-path "\"\n           \""))
+
   (dolist (file dgnushack-exporting-files)
     (setq file (expand-file-name file srcdir))
     (when (and (file-exists-p (setq elc (concat file "c")))
@@ -467,4 +473,19 @@ Modify to suit your needs."))
        (while (setq file (pop files))
          (insert "info/" file "\n"))))))
 
+\f
+(define-compiler-macro describe-key-briefly (&whole form key &optional insert)
+  (if (condition-case nil
+         (progn
+           (describe-key-briefly '((())) nil)
+           t)
+       (wrong-number-of-arguments nil);; Old Emacsen.
+       (error t))
+      form
+    (if insert
+       `(if ,insert
+            (insert (funcall 'describe-key-briefly ,key))
+          (funcall 'describe-key-briefly ,key))
+      `(funcall 'describe-key-briefly ,key))))
+
 ;;; dgnushack.el ends here