Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 May 2009 12:30:21 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Peter Jeremy <peterjeremy@optushome.com.au>
Cc:        svn-src-head@freebsd.org, "George V. Neville-Neil" <gnn@freebsd.org>, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r192398 - in head/usr.bin: . perror
Message-ID:  <86vdntzayq.fsf@ds4.des.no>
In-Reply-To: <20090520200138.GA33344@server.vk2pj.dyndns.org> (Peter Jeremy's message of "Thu, 21 May 2009 06:01:38 %2B1000")
References:  <200905191740.n4JHeMMU005087@svn.freebsd.org> <20090520200138.GA33344@server.vk2pj.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Jeremy <peterjeremy@optushome.com.au> writes:
> Given how easy it is to "grep <<errno>> /usr/include/sys/errno.h" or
>   perl -e '$! =3D <<errno>>; print "$!\n";'
> I'm not sure of the utility of this tool.  One downside is that
>   man perror
> will now return perror(1) instead of perror(3)

This is already the case for many system calls and library functions:

basename(3) bind(2) calendar(3) chdir(2) chflags(2) chmod(2) clear(3)
cpuset(2) crypt(3) dialog(3) dirname(3) echo(3) end(3) exec(3) exit(3)
fetch(3) fstat(2) fsync(2) getopt(3) glob(3) hash(3) hexdump(3)
history(3) intro(2) intro(3) kenv(2) kill(2) ktrace(2) link(2) lockf(3)
log(3) login(3) logout(3) md5(3) mkdir(2) mkfifo(2) mktemp(3) nice(3)
nl(3) printf(3) read(2) readlink(2) realpath(3) rmdir(2) rtprio(2)
setenv(3) setfib(2) sha256(3) sleep(3) stat(2) time(3) times(3) trace(3)
truncate(2) ulimit(3) umask(2) uname(3) unlink(2) unsetenv(3) unvis(3)
uuidgen(2) vis(3) wait(2) write(2)

It is easily solved by setting MANSECT in your environment and / or
configuring your editor to search sections 2 and 3 before section 1:

(defvar des-man-sections nil
  "Colon-separated list of manual sections to search")
(defun des-context-help ()
  "Bring up the man page for the word closest to the current point"
  (interactive)
  (if des-man-sections
      (man (format "-S%s %s" des-man-sections (current-word)))
    (man (current-word))))
(defun des-man-page-hook ()
  (make-local-variable 'des-man-sections)
  (setq des-man-sections "3:2:9:4:5:1:8:7:6")
  (local-set-key [f1] 'des-context-help))
(add-hook 'c-mode-common-hook 'des-man-page-hook)

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86vdntzayq.fsf>