GNU bug report logs -
#73656
30.0.91; icomplete-vertical has no matches for M-x man RET chdir
Previous Next
Reported by: Van Ly <van.ly <at> sdf.org>
Date: Sun, 6 Oct 2024 12:44:02 UTC
Severity: normal
Found in version 30.0.91
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73656 in the body.
You can then email your comments to 73656 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 06 Oct 2024 12:44:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Van Ly <van.ly <at> sdf.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 06 Oct 2024 12:44:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
The manpage auto-completions under icomplete-vertical mode won't list
chdir(2), fchdir(2) but will list acct(2).
To demonstrate,
1. start, emacs -Q
2. M-x icomplete-vertical
3. M-x man RET
then very slowly type with 3 second delay a character, c h d i r, from
chd onwards the status feedback says [No matches], this is also the case
for fchdir. At the end of the full sequence chdir or fchdir, despite
the status being [No matches] I depress RET and the manpage displays.
The manpage acct(2) will list in the auto-complete but if I type too
quick the *Messages* buffer shows: Waiting for process to die...done
Expected behavior, since acct(2) is listed by auto-complete in
icomplete-vertical mode, chdir(2) and fchdir(2) should.
[x (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]
--
vl
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 06 Oct 2024 13:35:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 73656 <at> debbugs.gnu.org (full text, mbox):
> Date: Sun, 06 Oct 2024 12:38:04 +0000
> From: Van Ly via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>
> The manpage auto-completions under icomplete-vertical mode won't list
> chdir(2), fchdir(2) but will list acct(2).
>
>
>
> To demonstrate,
>
> 1. start, emacs -Q
> 2. M-x icomplete-vertical
> 3. M-x man RET
>
> then very slowly type with 3 second delay a character, c h d i r, from
> chd onwards the status feedback says [No matches], this is also the case
> for fchdir. At the end of the full sequence chdir or fchdir, despite
> the status being [No matches] I depress RET and the manpage displays.
>
> The manpage acct(2) will list in the auto-complete but if I type too
> quick the *Messages* buffer shows: Waiting for process to die...done
Most probably NetBSD-specific.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 06 Oct 2024 13:36:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 73656 <at> debbugs.gnu.org (full text, mbox):
> Date: Sun, 06 Oct 2024 12:38:04 +0000
> From: Van Ly via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>
> The manpage auto-completions under icomplete-vertical mode won't list
> chdir(2), fchdir(2) but will list acct(2).
>
>
>
> To demonstrate,
>
> 1. start, emacs -Q
> 2. M-x icomplete-vertical
> 3. M-x man RET
>
> then very slowly type with 3 second delay a character, c h d i r, from
> chd onwards the status feedback says [No matches], this is also the case
> for fchdir. At the end of the full sequence chdir or fchdir, despite
> the status being [No matches] I depress RET and the manpage displays.
>
> The manpage acct(2) will list in the auto-complete but if I type too
> quick the *Messages* buffer shows: Waiting for process to die...done
Most probably NetBSD-specific.
What does "man -k chdir" say?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 06 Oct 2024 14:35:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 73656 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Most probably NetBSD-specific.
At a guess, I thought the manpage sections are indexed somewhere. That
chdir(2) and fchdir(2) won't list but acct(2) will dispels that theory.
All of section 2 wouldn't be listed. Does emacs icomplete-vertical
manpage autocomplete lookup something like a locatedb for manpages and
that needs to update periodically? chdir(2) and fchdir(2) are
fundamental and would be indexed at the earliest run. The status update
is incorrect where it says [No matches] at the full "chdir" manpage name
and RET displays the manpage. I will ask the netbsd-users.
--
vl
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 06 Oct 2024 14:49:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 73656 <at> debbugs.gnu.org (full text, mbox):
> From: Van Ly <van.ly <at> sdf.org>
> Cc: 73656 <at> debbugs.gnu.org
> Date: Sun, 06 Oct 2024 14:33:11 +0000
>
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Most probably NetBSD-specific.
>
> At a guess, I thought the manpage sections are indexed somewhere. That
> chdir(2) and fchdir(2) won't list but acct(2) will dispels that theory.
> All of section 2 wouldn't be listed. Does emacs icomplete-vertical
> manpage autocomplete lookup something like a locatedb for manpages and
> that needs to update periodically? chdir(2) and fchdir(2) are
> fundamental and would be indexed at the earliest run. The status update
> is incorrect where it says [No matches] at the full "chdir" manpage name
> and RET displays the manpage. I will ask the netbsd-users.
We use "man -k", which is why I asked what does it say about chdir.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 06 Oct 2024 14:56:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 73656 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>
> What does "man -k chdir" say?
>
See attached output.
man -k chdir
generates multiline context output
apropos -M chdir
generates single line output for each manpage
[x (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]
--
vl
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 06 Oct 2024 16:12:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 73656 <at> debbugs.gnu.org (full text, mbox):
> From: Van Ly <van.ly <at> sdf.org>
> Cc: 73656 <at> debbugs.gnu.org
> Date: Sun, 06 Oct 2024 14:54:58 +0000
>
> > What does "man -k chdir" say?
> >
>
> See attached output.
I think this points out the problem: man.el expects a different
format, as documented in the doc string of Man-parse-man-k. But maybe
I'm missing something, so I'll let others chime in.
My suggestion is to step with Edebug through Man-parse-man-k and see
what's wrong there.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Wed, 09 Oct 2024 12:45:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 73656 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>
> I think this points out the problem: man.el expects a different
> format, as documented in the doc string of Man-parse-man-k. But maybe
> I'm missing something, so I'll let others chime in.
>
> My suggestion is to step with Edebug through Man-parse-man-k and see
> what's wrong there.
>
The netbsd-users say legacy behavior for "man -k output" is obtained by
$ man -k -l chdir
$ apropos -l chdir
$ env APROPOS="-l" emacs -Q
The Edebug session would cycle to line 16 below (line 953 in man.el)
foreach of the characters from chdir during icomplete-vertical
autocomplete to find no matches.
1 (defun Man-parse-man-k ()
2 "Parse \"man -k\" output and return the list of page names.
3
4 The current buffer should contain the output of a command of the
5 form \"man -k keyword\", which is traditionally also available with
6 apropos(1).
7
8 While POSIX man(1p) is a bit vague about what to expect here,
9 this function tries to parse some commonly used formats, which
10 can be described in the following informal way, with square brackets
11 indicating optional parts and whitespace being interpreted
12 somewhat loosely.
13
14 foo[, bar [, ...]] [other stuff] (sec) - description
15 foo(sec)[, bar(sec) [, ...]] [other stuff] - description"
16 (goto-char (point-min))
17 ;; See man-tests for data about which systems use which format (hopefully we
18 ;; will be able to simplify the code if/when some of those formats aren't
19 ;; used any more).
20 (let (table)
21 (while (search-forward-regexp "^\\([^ \t,\n]+\\)\\(.*?\\)\
22 \\(?:[ \t]\\(([^ \t,\n]+?)\\)\\)?\\(?:[ \t]+- ?\\(.*\\)\\)?$" nil t)
23 (let ((section (match-string 3))
24 (description (match-string 4))
25 (bound (match-end 2)))
26 (goto-char (match-end 1))
27 (while
28 (progn
29 ;; The first regexp grouping may already match the section
30 ;; tacked on to the name, which is ok since for the formats we
31 ;; claim to support the third (non-shy) grouping does not
32 ;; match in this case, i.e., section is nil.
33 (push (propertize (concat (match-string 1) section)
34 'help-echo description)
35 table)
36 (search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t)))))
37 (nreverse table)))
--
vl
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 13 Oct 2024 12:10:01 GMT)
Full text and
rfc822 format available.
Message #29 received at 73656 <at> debbugs.gnu.org (full text, mbox):
> From: Van Ly <van.ly <at> sdf.org>
> Cc: monnier <at> iro.umontreal.ca, 73656 <at> debbugs.gnu.org
> Date: Wed, 09 Oct 2024 23:43:12 +1100
>
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >
> > I think this points out the problem: man.el expects a different
> > format, as documented in the doc string of Man-parse-man-k. But maybe
> > I'm missing something, so I'll let others chime in.
> >
> > My suggestion is to step with Edebug through Man-parse-man-k and see
> > what's wrong there.
> >
>
>
>
> The netbsd-users say legacy behavior for "man -k output" is obtained by
>
>
>
> $ man -k -l chdir
> $ apropos -l chdir
> $ env APROPOS="-l" emacs -Q
>
>
>
> The Edebug session would cycle to line 16 below (line 953 in man.el)
> foreach of the characters from chdir during icomplete-vertical
> autocomplete to find no matches.
>
>
>
> 1 (defun Man-parse-man-k ()
> 2 "Parse \"man -k\" output and return the list of page names.
> 3
> 4 The current buffer should contain the output of a command of the
> 5 form \"man -k keyword\", which is traditionally also available with
> 6 apropos(1).
> 7
> 8 While POSIX man(1p) is a bit vague about what to expect here,
> 9 this function tries to parse some commonly used formats, which
> 10 can be described in the following informal way, with square brackets
> 11 indicating optional parts and whitespace being interpreted
> 12 somewhat loosely.
> 13
> 14 foo[, bar [, ...]] [other stuff] (sec) - description
> 15 foo(sec)[, bar(sec) [, ...]] [other stuff] - description"
> 16 (goto-char (point-min))
> 17 ;; See man-tests for data about which systems use which format (hopefully we
> 18 ;; will be able to simplify the code if/when some of those formats aren't
> 19 ;; used any more).
> 20 (let (table)
> 21 (while (search-forward-regexp "^\\([^ \t,\n]+\\)\\(.*?\\)\
> 22 \\(?:[ \t]\\(([^ \t,\n]+?)\\)\\)?\\(?:[ \t]+- ?\\(.*\\)\\)?$" nil t)
> 23 (let ((section (match-string 3))
> 24 (description (match-string 4))
> 25 (bound (match-end 2)))
> 26 (goto-char (match-end 1))
> 27 (while
> 28 (progn
> 29 ;; The first regexp grouping may already match the section
> 30 ;; tacked on to the name, which is ok since for the formats we
> 31 ;; claim to support the third (non-shy) grouping does not
> 32 ;; match in this case, i.e., section is nil.
> 33 (push (propertize (concat (match-string 1) section)
> 34 'help-echo description)
> 35 table)
> 36 (search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t)))))
> 37 (nreverse table)))
If you edit this part of Man-completion-table:
(let ((process-environment (copy-sequence process-environment)))
(setenv "COLUMNS" "999") ;; don't truncate long names
;; manual-program might not even exist. And since it's
;; run differently in Man-getpage-in-background, an error
;; here may not necessarily mean that we'll also get an
;; error later.
(when (eq 0
(ignore-errors
(process-file
manual-program nil '(t nil) nil
>>>>>>>>>>>>>>>> "-k" (concat (when (or Man-man-k-use-anchor
(string-equal prefix ""))
"^")
(if (string-equal prefix "")
prefix
;; FIXME: shell-quote-argument
;; is not entirely
;; appropriate: we actually
;; need to quote ERE here.
;; But we don't have that, and
;; shell-quote-argument does
;; the job...
(shell-quote-argument prefix))))))
(setq table (Man-parse-man-k)))))
to use "-k" "-l" instead of "-k" in the line I emphasized, does that
solve the problem?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Tue, 15 Oct 2024 05:25:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 73656 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>
> If you edit this part of Man-completion-table:
>
> (let ((process-environment (copy-sequence process-environment)))
> (setenv "COLUMNS" "999") ;; don't truncate long names
> ;; manual-program might not even exist. And since it's
> ;; run differently in Man-getpage-in-background, an error
> ;; here may not necessarily mean that we'll also get an
> ;; error later.
> (when (eq 0
> (ignore-errors
> (process-file
> manual-program nil '(t nil) nil
> >>>>>>>>>>>>>>>> "-k" (concat (when (or Man-man-k-use-anchor
> (string-equal prefix ""))
> "^")
> (if (string-equal prefix "")
> prefix
> ;; FIXME: shell-quote-argument
> ;; is not entirely
> ;; appropriate: we actually
> ;; need to quote ERE here.
> ;; But we don't have that, and
> ;; shell-quote-argument does
> ;; the job...
> (shell-quote-argument prefix))))))
> (setq table (Man-parse-man-k)))))
>
> to use "-k" "-l" instead of "-k" in the line I emphasized, does that
> solve the problem?
>
Yes. See diff patch on man.el .
[m (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]
--
vl
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Thu, 17 Oct 2024 17:49:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 73656 <at> debbugs.gnu.org (full text, mbox):
>> to use "-k" "-l" instead of "-k" in the line I emphasized, does that
>> solve the problem?
> Yes. See diff patch on man.el .
AFAICT, the `-l` meaning is different in your `man` than on Debian's, so
we'll need a more complex code which is system-dependent.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Fri, 18 Oct 2024 00:39:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 73656 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
See diff patch on man.el .
>
> AFAICT, the `-l` meaning is different in your `man` than on Debian's, so
> we'll need a more complex code which is system-dependent.
The Redhat Linux redistribution may behave a little bit different to Debian.
FreeBSD would be to NetBSD what Redhat is to Debian.
--
vl
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sat, 19 Oct 2024 09:43:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 73656 <at> debbugs.gnu.org (full text, mbox):
> From: Van Ly <van.ly <at> sdf.org>
> Cc: eliz <at> gnu.org, 73656 <at> debbugs.gnu.org
> Date: Fri, 18 Oct 2024 00:37:01 +0000
>
>
> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
> See diff patch on man.el .
> >
> > AFAICT, the `-l` meaning is different in your `man` than on Debian's, so
> > we'll need a more complex code which is system-dependent.
>
> The Redhat Linux redistribution may behave a little bit different to Debian.
>
> FreeBSD would be to NetBSD what Redhat is to Debian.
I guess the change should affect systems whose system-type is
berkeley-unix? Patches welcome.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 20 Oct 2024 15:08:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 73656 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>
> I guess the change should affect systems whose system-type is
> berkeley-unix? Patches welcome.
>
The attached works for berkeley-unix opsys.
[x (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]
--
vl
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 20 Oct 2024 15:52:02 GMT)
Full text and
rfc822 format available.
Message #47 received at 73656 <at> debbugs.gnu.org (full text, mbox):
> From: Van Ly <van.ly <at> sdf.org>
> Cc: monnier <at> iro.umontreal.ca, 73656 <at> debbugs.gnu.org
> Date: Sun, 20 Oct 2024 15:06:30 +0000
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >
> > I guess the change should affect systems whose system-type is
> > berkeley-unix? Patches welcome.
> >
>
> The attached works for berkeley-unix opsys.
This puts a nil into the arguments of process-file (on systems other
than *BSD).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Mon, 21 Oct 2024 02:28:02 GMT)
Full text and
rfc822 format available.
Message #50 received at 73656 <at> debbugs.gnu.org (full text, mbox):
> + (if (eq system-type 'berkeley-unix) "-l")
Maybe a more robust approach would be something like
(defvar man--apropos-args (...))
where (...) is a piece of code which actually runs `man` with `-k` and
with or without `-l` to try and determine which kind of `man` we're
dealing with, but without making assumptions about which kind of `man`
is installed on which kind of OS.
Then we can use this new `man--apropos-args` var when running
`process-file`.
Oh, and `process-file` makes this worse because it may end up spawning
a process on a remote systems, so the local OS and local `man` may not
have anything to do with the remote OS and remote `man`.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Tue, 22 Oct 2024 09:34:02 GMT)
Full text and
rfc822 format available.
Message #53 received at 73656 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> + (if (eq system-type 'berkeley-unix) "-l")
>
> Maybe a more robust approach would be something like
>
> (defvar man--apropos-args (...))
>
> where (...) is a piece of code which actually runs `man` with `-k` and
> with or without `-l` to try and determine which kind of `man` we're
> dealing with, but without making assumptions about which kind of `man`
> is installed on which kind of OS.
The following *shell* buffer logs show "man -k -l chd" then "man -k chd"
run on debian/aarch64 and netbsd/amd64
on debian/aarch64
. deb$ man -k -l chd
. chdir (2) - change working directory
. fchdir (2) - change working directory
. wdctl (8) - show hardware watchdog status
. deb$ man -k chd
. chdir (2) - change working directory
. fchdir (2) - change working directory
. wdctl (8) - show hardware watchdog status
. deb$ echo $APROPOS
.
. deb$
on netbsd/amd64
. net$ man -k -l chd
. man -k -l chd
. swwdog(4) - software watchdog timer
. pwdog(4) - Quancom PWDOG1 watchdog timer device
. acpiwdrt(4) - ACPI Watchdog Timer WDRT
. rdcpcib(4) - RDC PCI/ISA bridge and watchdog timer driver
. i386/geodewdog(4) - AMD Geode SC1100 Watchdog Timer driver
. gcscpcib(4) - AMD CS553[56] PCI-ISA bridge with timecounter, watchdog timer, and GPIO
. evbarm/iopwdog(4) - Intel I/O Processor Watchdog Timer
. x86/tco(4) - Intel Controller Hub TCO watchdog timer device
. posix_spawn_file_actions_addchdir(3) - add chdir or fchdir action to spawn file actions object
. chdir(2) - change current working directory
. wdogctl(8) - Watchdog timer control utility
. ifwatchd(8) - watch for addresses added to or deleted from interfaces and call up/down-scripts for them
. net$ man -k chd
. man -k chd
. apropos: No relevant results obtained.
. Please make sure that you spelled all the terms correctly or try using different keywords.
. net$ echo $APROPOS
. echo $APROPOS
.
. net$
--
vl
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Fri, 25 Oct 2024 05:37:02 GMT)
Full text and
rfc822 format available.
Message #56 received at 73656 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> + (if (eq system-type 'berkeley-unix) "-l")
>
As gap filler, the following change does not misbehave on deb or netbsd.
+ (if (eq system-type 'berkeley-unix) "-l" "")
> Maybe a more robust approach would be something like
>
> (defvar man--apropos-args (...))
>
> where (...) is a piece of code which actually runs `man` with `-k` and
> with or without `-l` to try and determine which kind of `man` we're
> dealing with, but without making assumptions about which kind of `man`
> is installed on which kind of OS.
>
As probe to reveal switches available to "man", try "man -h" and
"man -?" but the output doesn't look helpful, perhaps a complete
solution has to probe the manpage for "man".
. net$ man -h
. man -h
. Usage: man [-acw|-h] [-C cfg] [-M path] [-m path] [-S srch] [[-s] sect] name ...
. Usage: man [-C file] -f command ...
. Usage: man [-C file] -k keyword ...
. Usage: man -p
. net$ man -?
. man -?
. man: unknown option -- ?
. Usage: man [-acw|-h] [-C cfg] [-M path] [-m path] [-S srch] [[-s] sect] name ...
. Usage: man [-C file] -f command ...
. Usage: man [-C file] -k keyword ...
. Usage: man -p
. deb$ man -h
. Usage: man [OPTION...] [SECTION] PAGE...
.
. -C, --config-file=FILE use this user configuration file
. -d, --debug emit debugging messages
. -D, --default reset all options to their default values
. --warnings[=WARNINGS] enable warnings from groff
.
. Main modes of operation:
. -f, --whatis equivalent to whatis
. -k, --apropos equivalent to apropos
. -K, --global-apropos search for text in all pages
. -l, --local-file interpret PAGE argument(s) as local filename(s)
. -w, --where, --path, --location
. print physical location of man page(s)
. -W, --where-cat, --location-cat
. print physical location of cat file(s)
.
. -c, --catman used by catman to reformat out of date cat pages
. -R, --recode=ENCODING output source page encoded in ENCODING
.
. Finding manual pages:
. -L, --locale=LOCALE define the locale for this particular man search
. -m, --systems=SYSTEM use manual pages from other systems
. -M, --manpath=PATH set search path for manual pages to PATH
.
. -S, -s, --sections=LIST use colon separated section list
.
. -e, --extension=EXTENSION limit search to extension type EXTENSION
.
. -i, --ignore-case look for pages case-insensitively (default)
. -I, --match-case look for pages case-sensitively
.
. --regex show all pages matching regex
. --wildcard show all pages matching wildcard
.
. --names-only make --regex and --wildcard match page names only,
. not descriptions
.
. -a, --all find all matching manual pages
. -u, --update force a cache consistency check
.
. --no-subpages don't try subpages, e.g. 'man foo bar' => 'man
. foo-bar'
.
. Controlling formatted output:
. -P, --pager=PAGER use program PAGER to display output
. -r, --prompt=STRING provide the `less' pager with a prompt
.
. -7, --ascii display ASCII translation of certain latin1 chars
. -E, --encoding=ENCODING use selected output encoding
. --no-hyphenation, --nh turn off hyphenation
. --no-justification, --nj turn off justification
. -p, --preprocessor=STRING STRING indicates which preprocessors to run:
. e - [n]eqn, p - pic, t - tbl,
. g - grap, r - refer, v - vgrind
.
. -t, --troff use groff to format pages
. -T, --troff-device[=DEVICE] use groff with selected device
.
. -H, --html[=BROWSER] use www-browser or BROWSER to display HTML output
. -X, --gxditview[=RESOLUTION] use groff and display through gxditview
. (X11):
. -X = -TX75, -X100 = -TX100, -X100-12 = -TX100-12
. -Z, --ditroff use groff and force it to produce ditroff
.
. -?, --help give this help list
. --usage give a short usage message
. -V, --version print program version
.
. Mandatory or optional arguments to long options are also mandatory or optional
. for any corresponding short options.
.
. Report bugs to cjwatson <at> debian.org.
--
vl
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Thu, 31 Oct 2024 18:17:02 GMT)
Full text and
rfc822 format available.
Message #59 received at 73656 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
>>> + (if (eq system-type 'berkeley-unix) "-l")
> As gap filler, the following change does not misbehave on deb or netbsd.
I don't think we need a gap filler.
How 'bout the patch below?
Stefan
[man.patch (text/x-diff, inline)]
diff --git a/lisp/man.el b/lisp/man.el
index 816c75d749c..ebf4646d133 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -973,6 +973,27 @@ Man-parse-man-k
(search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t)))))
(nreverse table)))
+(defvar Man-man-k-flags
+ ;; It's not clear which man page will "always" be available, `man -k man'
+ ;; seems like the safest choice, but `man -k apropos' seems almost as safe
+ ;; and usually returns a much shorter output.
+ (with-temp-buffer
+ (with-demoted-errors "%S" (call-process "man" nil t nil "-k" "apropos"))
+ (let ((lines (count-lines (point-min) (point-max)))
+ (completions (Man-parse-man-k)))
+ (if (>= (length completions) lines)
+ '("-k") ;; "-k" seems to return sane results: look no further!
+ (erase-buffer)
+ ;; Try "-k -l" (bug#73656).
+ (with-demoted-errors "%S" (call-process "man" nil t nil
+ "-k" "-l" "apropos"))
+ (let ((lines (count-lines (point-min) (point-max)))
+ (completions (Man-parse-man-k)))
+ (if (>= (length completions) lines)
+ '("-k" "-l") ;; "-k -l" seems to return sane results.
+ '("-k"))))))
+ "List of arguments to pass to get the expected \"man -k\" output.")
+
(defun Man-completion-table (string pred action)
(cond
;; This ends up returning t for pretty much any string, and hence leads to
@@ -1009,7 +1009,10 @@
(ignore-errors
(process-file
manual-program nil '(t nil) nil
- "-k" (concat (when (or Man-man-k-use-anchor
+ ;; FIXME: When `process-file' runs on a remote hosts,
+ ;; `Man-man-k-flags' may be wrong.
+ `(,@Man-man-k-flags
+ ,(concat (when (or Man-man-k-use-anchor
(string-equal prefix ""))
"^")
(if (string-equal prefix "")
@@ -1021,7 +1024,7 @@
;; But we don't have that, and
;; shell-quote-argument does
;; the job...
- (shell-quote-argument prefix))))))
+ (shell-quote-argument prefix)))))))
(setq table (Man-parse-man-k)))))
;; Cache the table for later reuse.
(when table
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Fri, 01 Nov 2024 16:05:01 GMT)
Full text and
rfc822 format available.
Message #62 received at 73656 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> [1:text/plain Hide]
>
>>>> + (if (eq system-type 'berkeley-unix) "-l")
>> As gap filler, the following change does not misbehave on deb or netbsd.
>
> I don't think we need a gap filler.
> How 'bout the patch below?
>
>
On NetBSD the patch fails to generate the icomplete-vertical-mode
autocomplete for "chd" when invoked in "emacs -Q" session. The man.elc
file was byte recompiled.
On debian the patch also fails. Emacs was configured --without-x and
has *Messages* buffer content referring to unbound image-scaling-factor
. Byte-Compile man.el? (y or n) y
. Compiling /u/van/src/emacs/30.0.91/lisp/man.el...done
. Wrote /u/van/src/emacs/30.0.91/lisp/man.elc
. Byte-Compile: 1 file.
. Quit
. Note, built-in variable ‘image-scaling-factor’ not bound
. You can run the command ‘icomplete-vertical-mode’ with M-x ic--m
. Note, built-in variable ‘image-scaling-factor’ not bound
Note, also, on debian the -l switch means as follows
-l, --local-file interpret PAGE argument(s) as local filename(s)
[x (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]
--
vl
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Fri, 01 Nov 2024 17:54:02 GMT)
Full text and
rfc822 format available.
Message #65 received at 73656 <at> debbugs.gnu.org (full text, mbox):
> On NetBSD the patch fails to generate the icomplete-vertical-mode
> autocomplete for "chd" when invoked in "emacs -Q" session. The man.elc
> file was byte recompiled.
I meant for the patch to be read rather than applied.
Also, what value do you get for `Man-man-k-flags`?
> On debian the patch also fails.
Yes, there was a trivial error. Fixed in the patch below.
Stefan
diff --git a/lisp/man.el b/lisp/man.el
index 816c75d749c..d5ac8b93d99 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -973,6 +973,27 @@ Man-parse-man-k
(search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t)))))
(nreverse table)))
+(defvar Man-man-k-flags
+ ;; It's not clear which man page will "always" be available, `man -k man'
+ ;; seems like the safest choice, but `man -k apropos' seems almost as safe
+ ;; and usually returns a much shorter output.
+ (with-temp-buffer
+ (with-demoted-errors "%S" (call-process "man" nil t nil "-k" "apropos"))
+ (let ((lines (count-lines (point-min) (point-max)))
+ (completions (Man-parse-man-k)))
+ (if (>= (length completions) lines)
+ '("-k") ;; "-k" seems to return sane results: look no further!
+ (erase-buffer)
+ ;; Try "-k -l" (bug#73656).
+ (with-demoted-errors "%S" (call-process "man" nil t nil
+ "-k" "-l" "apropos"))
+ (let ((lines (count-lines (point-min) (point-max)))
+ (completions (Man-parse-man-k)))
+ (if (and (> lines 0) (>= (length completions) lines))
+ '("-k" "-l") ;; "-k -l" seems to return sane results.
+ '("-k"))))))
+ "List of arguments to pass to get the expected \"man -k\" output.")
+
(defun Man-completion-table (string pred action)
(cond
;; This ends up returning t for pretty much any string, and hence leads to
@@ -1007,9 +1028,13 @@ Man-completion-table
;; error later.
(when (eq 0
(ignore-errors
- (process-file
+ (apply
+ #'process-file
manual-program nil '(t nil) nil
- "-k" (concat (when (or Man-man-k-use-anchor
+ ;; FIXME: When `process-file' runs on a remote hosts,
+ ;; `Man-man-k-flags' may be wrong.
+ `(,@Man-man-k-flags
+ ,(concat (when (or Man-man-k-use-anchor
(string-equal prefix ""))
"^")
(if (string-equal prefix "")
@@ -1021,7 +1046,7 @@ Man-completion-table
;; But we don't have that, and
;; shell-quote-argument does
;; the job...
- (shell-quote-argument prefix))))))
+ (shell-quote-argument prefix)))))))
(setq table (Man-parse-man-k)))))
;; Cache the table for later reuse.
(when table
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sat, 16 Nov 2024 13:47:01 GMT)
Full text and
rfc822 format available.
Message #68 received at 73656 <at> debbugs.gnu.org (full text, mbox):
Ping! Can you try this patch? If it solves the problem, I'd like us
to install it.
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: eliz <at> gnu.org, 73656 <at> debbugs.gnu.org
> Date: Fri, 01 Nov 2024 13:52:55 -0400
>
> > On NetBSD the patch fails to generate the icomplete-vertical-mode
> > autocomplete for "chd" when invoked in "emacs -Q" session. The man.elc
> > file was byte recompiled.
>
> I meant for the patch to be read rather than applied.
> Also, what value do you get for `Man-man-k-flags`?
>
> > On debian the patch also fails.
>
> Yes, there was a trivial error. Fixed in the patch below.
>
>
> Stefan
>
>
> diff --git a/lisp/man.el b/lisp/man.el
> index 816c75d749c..d5ac8b93d99 100644
> --- a/lisp/man.el
> +++ b/lisp/man.el
> @@ -973,6 +973,27 @@ Man-parse-man-k
> (search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t)))))
> (nreverse table)))
>
> +(defvar Man-man-k-flags
> + ;; It's not clear which man page will "always" be available, `man -k man'
> + ;; seems like the safest choice, but `man -k apropos' seems almost as safe
> + ;; and usually returns a much shorter output.
> + (with-temp-buffer
> + (with-demoted-errors "%S" (call-process "man" nil t nil "-k" "apropos"))
> + (let ((lines (count-lines (point-min) (point-max)))
> + (completions (Man-parse-man-k)))
> + (if (>= (length completions) lines)
> + '("-k") ;; "-k" seems to return sane results: look no further!
> + (erase-buffer)
> + ;; Try "-k -l" (bug#73656).
> + (with-demoted-errors "%S" (call-process "man" nil t nil
> + "-k" "-l" "apropos"))
> + (let ((lines (count-lines (point-min) (point-max)))
> + (completions (Man-parse-man-k)))
> + (if (and (> lines 0) (>= (length completions) lines))
> + '("-k" "-l") ;; "-k -l" seems to return sane results.
> + '("-k"))))))
> + "List of arguments to pass to get the expected \"man -k\" output.")
> +
> (defun Man-completion-table (string pred action)
> (cond
> ;; This ends up returning t for pretty much any string, and hence leads to
> @@ -1007,9 +1028,13 @@ Man-completion-table
> ;; error later.
> (when (eq 0
> (ignore-errors
> - (process-file
> + (apply
> + #'process-file
> manual-program nil '(t nil) nil
> - "-k" (concat (when (or Man-man-k-use-anchor
> + ;; FIXME: When `process-file' runs on a remote hosts,
> + ;; `Man-man-k-flags' may be wrong.
> + `(,@Man-man-k-flags
> + ,(concat (when (or Man-man-k-use-anchor
> (string-equal prefix ""))
> "^")
> (if (string-equal prefix "")
> @@ -1021,7 +1046,7 @@ Man-completion-table
> ;; But we don't have that, and
> ;; shell-quote-argument does
> ;; the job...
> - (shell-quote-argument prefix))))))
> + (shell-quote-argument prefix)))))))
> (setq table (Man-parse-man-k)))))
> ;; Cache the table for later reuse.
> (when table
>
>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 17 Nov 2024 05:35:02 GMT)
Full text and
rfc822 format available.
Message #71 received at 73656 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Ping! Can you try this patch? If it solves the problem, I'd like us
> to install it.
The patch as received, applied works on debian, netbsd.
diff -u /u/van/src/emacs/30.0.91/lisp/man.el.original /u/van/src/emacs/30.0.91/lisp/man.el
--- /u/van/src/emacs/30.0.91/lisp/man.el.original 2024-11-11 03:14:07.625129807 +1100
+++ /u/van/src/emacs/30.0.91/lisp/man.el 2024-11-17 16:22:08.348331007 +1100
@@ -972,6 +972,27 @@
table)
(search-forward-regexp "\\=, *\\([^ \t,]+\\)" bound t)))))
(nreverse table)))
+
+(defvar Man-man-k-flags
+ ;; It's not clear which man page will "always" be available, `man -k man'
+ ;; seems like the safest choice, but `man -k apropos' seems almost as safe
+ ;; and usually returns a much shorter output.
+ (with-temp-buffer
+ (with-demoted-errors "%S" (call-process "man" nil t nil "-k" "apropos"))
+ (let ((lines (count-lines (point-min) (point-max)))
+ (completions (Man-parse-man-k)))
+ (if (>= (length completions) lines)
+ '("-k") ;; "-k" seems to return sane results: look no further!
+ (erase-buffer)
+ ;; Try "-k -l" (bug#73656).
+ (with-demoted-errors "%S" (call-process "man" nil t nil
+ "-k" "-l" "apropos"))
+ (let ((lines (count-lines (point-min) (point-max)))
+ (completions (Man-parse-man-k)))
+ (if (and (> lines 0) (>= (length completions) lines))
+ '("-k" "-l") ;; "-k -l" seems to return sane results.
+ '("-k"))))))
+ "List of arguments to pass to get the expected \"man -k\" output.")
(defun Man-completion-table (string pred action)
(cond
@@ -1007,9 +1028,13 @@
;; error later.
(when (eq 0
(ignore-errors
- (process-file
+ (apply
+ #'process-file
manual-program nil '(t nil) nil
- "-k" (concat (when (or Man-man-k-use-anchor
+ ;; FIXME: When `process-file' runs on a remote hosts,
+ ;; `Man-man-k-flags' may be wrong.
+ `(,@Man-man-k-flags
+ ,(concat (when (or Man-man-k-use-anchor
(string-equal prefix ""))
"^")
(if (string-equal prefix "")
@@ -1021,7 +1046,7 @@
;; But we don't have that, and
;; shell-quote-argument does
;; the job...
- (shell-quote-argument prefix))))))
+ (shell-quote-argument prefix)))))))
(setq table (Man-parse-man-k)))))
;; Cache the table for later reuse.
(when table
Diff finished. Sun Nov 17 16:29:12 2024
--
vl
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#73656
; Package
emacs
.
(Sun, 17 Nov 2024 07:09:02 GMT)
Full text and
rfc822 format available.
Message #74 received at 73656 <at> debbugs.gnu.org (full text, mbox):
> From: Van Ly <van.ly <at> SDF.ORG>
> Cc: monnier <at> iro.umontreal.ca, 73656 <at> debbugs.gnu.org
> Date: Sun, 17 Nov 2024 05:34:35 +0000
>
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Ping! Can you try this patch? If it solves the problem, I'd like us
> > to install it.
>
>
>
> The patch as received, applied works on debian, netbsd.
Thanks for testing.
Stefan, please install on master when you have time, and thanks in
advance.
Reply sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
You have taken responsibility.
(Sun, 17 Nov 2024 21:57:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Van Ly <van.ly <at> sdf.org>
:
bug acknowledged by developer.
(Sun, 17 Nov 2024 21:57:02 GMT)
Full text and
rfc822 format available.
Message #79 received at 73656-done <at> debbugs.gnu.org (full text, mbox):
> Stefan, please install on master when you have time, and thanks in
> advance.
Thanks, pushed, closing.
Arguably we should do something similar for `Man-man-k-use-anchor`, but
it's pretty far down the list of priorities.
Stefan
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 16 Dec 2024 12:24:13 GMT)
Full text and
rfc822 format available.
This bug report was last modified 264 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.