Diary SiteMap RecentChanges About Contact 2012-05 Calendar

Search:

Matching Pages:

2012-05-16 MANPATH

I’m using Emacs on Mac OSX.

Apparently the correct solution for using man and all the related tools is to make sure your /etc/man.conf file is correct. Mine was missing the following line:

MANPATH	/usr/local/man

You can ignore the rest of this page. :)

Thank you, Phil Hudson.

In my /.bashrc:

# MANPATH
# there's no MANPATH by default, and manpath(1) just prints /usr/share/man
if [ -z "$MANPATH" ]; then
    export MANPATH=/opt/local/man:/usr/local/man:/usr/local/share/man:/usr/X11R6/man:/usr/share/man
fi

In my /.emacs:

;; man
(unless (getenv "MANPATH")
  (setenv "MANPATH"
	  (with-temp-buffer
	    (insert-file-contents-literally "~/.bashrc")
	    (when (re-search-forward "MANPATH=\\(.*\\)" nil t)
	      (match-string 1)))))

And finally my little rebinding of C-h f for Perl mode works for modules as well:

(add-hook 'cperl-mode-hook
	  (lambda ()
	    (local-set-key (kbd "C-h f") 'cperl-perldoc)))

This calls perldoc which in turn calls man which uses MANPATH.

Tags: RSS

Read Comments (2)

Show Google +1