Commits

Fabrice Gabolde  committed cbd8a10

Moved woman-path manipulation into an eval-after-load, and replaced cache rebuild with trickery.

The old perlbrew--rebuild-woman-cache was just cribbed from woman.el code.
Currently we just make a critical value disappear from under
woman-file-name's feet, which makes it rebuild its cache.

  • Participants
  • Parent commits dcfa16f

Comments (0)

Files changed (1)

 
 (defun perlbrew-set-current-woman-path ()
   "Set the path to the current brew's /man directory."
-  (if (featurep 'woman)
-      (progn
-        (setq woman-path
-              (remove-if (lambda (path) (string-match (concat "^" perlbrew-perls-dir) path)) woman-path))
-        (if perlbrew-current-brew
-            (add-to-list 'woman-path
-                         (concat (file-name-directory perlbrew-perls-dir) perlbrew-current-brew
-                                 "/man/.*")))
-        (perlbrew--rebuild-woman-cache))))
+  (eval-after-load "woman"
+    (progn
+      (setq woman-path
+            (remove-if (lambda (path) (string-match (concat "^" perlbrew-perls-dir) path)) woman-path))
+      (if perlbrew-current-brew
+          (add-to-list 'woman-path
+                       (concat (file-name-directory perlbrew-perls-dir) perlbrew-current-brew
+                               "/man/.*")))
+      (setq woman-cached-data nil))))
 
 (defun perlbrew-set-current-brew (brew)
   (if (perlbrew-brew-exists brew)
       (setq perlbrew-current-brew brew)
     nil))
 
-(defun perlbrew--rebuild-woman-cache ()
-  "Lifted straight from woman.el code."
-  (message "Building list of manual directory expansions...")
-  (setq woman-expanded-directory-path
-        (woman-expand-directory-path woman-manpath woman-path))
-  (message "Building completion list of all manual topics...")
-  (setq woman-topic-all-completions
-        (woman-topic-all-completions woman-expanded-directory-path))
-  (woman-write-directory-cache))
-
 (provide 'perlbrew)
 ;;; perlbrew.el ends here