does (setq Man-switches "-a") work?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

does (setq Man-switches "-a") work?

Emacs - Help mailing list
For zshall(1), I still get only page 1 of 16...

--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal


Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Eli Zaretskii
> Date: Sat, 30 Nov 2019 06:22:50 +0100
> From: Emanuel Berg via Users list for the GNU Emacs text editor <[hidden email]>
>
> For zshall(1), I still get only page 1 of 16...

Did you try "C-h m" and look for a command to go to the next page?

Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Emacs - Help mailing list
Eli Zaretskii wrote:

>> For zshall(1), I still get only page 1 of
>> 16...
>
> Did you try "C-h m" and look for a command to
> go to the next page?

I thought the option would make it appear all
in one page (i.e. one Emacs buffer), as the
man(1) pager (/usr/bin/man) does with that
option in the shell for Unix users.

Does Emacs invoke an external pager or does it
happen in-house? If so (in-house), what
switches are supported? If not, what pager
is used?

--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal


Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Eli Zaretskii
> Date: Sat, 30 Nov 2019 11:25:34 +0100
> From: Emanuel Berg via Users list for the GNU Emacs text editor <[hidden email]>
>
> > Did you try "C-h m" and look for a command to
> > go to the next page?
>
> I thought the option would make it appear all
> in one page (i.e. one Emacs buffer), as the
> man(1) pager (/usr/bin/man) does with that
> option in the shell for Unix users.

I guess we display "page 1 of N" to make it clear that's not so.

> Does Emacs invoke an external pager or does it
> happen in-house?

The latter.

> If so (in-house), what switches are supported? If not, what pager is
> used?

There's no pager involved, so I don't understand what switches could
be relevant here.  See Man-goto-page for how the paging is done.

Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Emacs - Help mailing list
Eli Zaretskii wrote:

> There's no pager involved, so I don't
> understand what switches could be relevant
> here. See Man-goto-page for how the paging
> is done.

C-h v Man-switches RET:

Man-switches is a variable defined in ‘man.el’.
Its value is "-a"
Original value was ""

Documentation:
Switches passed to the man command, as a single string.
For example, the -a switch lets you see all the manpages for a
specified subject, if your ‘man’ program supports it.

--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal


Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Eli Zaretskii
> Date: Sat, 30 Nov 2019 11:40:46 +0100
> From: Emanuel Berg via Users list for the GNU Emacs text editor <[hidden email]>
>
> Eli Zaretskii wrote:
>
> > There's no pager involved, so I don't
> > understand what switches could be relevant
> > here. See Man-goto-page for how the paging
> > is done.
>
> C-h v Man-switches RET:
>
> Man-switches is a variable defined in ‘man.el’.
> Its value is "-a"
> Original value was ""
>
> Documentation:
> Switches passed to the man command, as a single string.
> For example, the -a switch lets you see all the manpages for a
> specified subject, if your ‘man’ program supports it.

Which sounds absolutely fine to me (and it says nothing about any
pager).

Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Emacs - Help mailing list
Eli Zaretskii wrote:

>>  C-h v Man-switches RET:
>>
>> Man-switches is a variable defined in
>> ‘man.el’. Its value is "-a" Original value
>> was ""
>>
>> Documentation: Switches passed to the man
>> command, as a single string. For example,
>> the -a switch lets you see all the manpages
>> for a specified subject, if your ‘man’
>> program supports it.
>
> Which sounds absolutely fine to me (and it
> says nothing about any pager).

What switches are supported?

I mean except for -a, which is the only one
mentioned, and doesn't work.

What is the 'man' program refered to?

The Unix man(1) is a pager.

--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal


Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Emacs - Help mailing list
I had a look in
/usr/share/emacs/25.1/lisp/

$ grep call-process man.el | wc -l
$ 9

;; line 246
(defcustom manual-program "man"
  "Program used by `man' to produce man pages."
  :type 'string
  :group 'man)

;; line 1069
(message "Invoking %s %s in the background" manual-program man-args)

;; line 1095
(call-process shell-file-name nil (list buffer nil) nil

--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal


Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Eli Zaretskii
In reply to this post by Emacs - Help mailing list
> Date: Sat, 30 Nov 2019 13:42:46 +0100
> From: Emanuel Berg via Users list for the GNU Emacs text editor <[hidden email]>
>
> What switches are supported?

Any switches supported by the 'man' command you have installed, I
think.

> I mean except for -a, which is the only one
> mentioned, and doesn't work.

It does work: it produces all of the man pages by that name, in all of
the sections.  You just need to go from one to the other with M-n and
M-p, as "C-h m" tells you.

> What is the 'man' program refered to?

The one you have installed.  man.el just invokes the first one it
finds on PATH.

> The Unix man(1) is a pager.

No, 'man' is not a pager.  It is a program that formats and displays
manual pages.  A pager is a program like 'more' or 'less'.  At least
that's what I would call a "pager".

Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Perry Smith-2
In reply to this post by Emacs - Help mailing list


> On Nov 29, 2019, at 11:22 PM, Emanuel Berg via Users list for the GNU Emacs text editor <[hidden email]> wrote:
>
> For zshall(1), I still get only page 1 of 16…

I didn’t see anyone mention: the buffer has been narrowed down to the first manpage.  
There are options to wide it as well as move from page to page.

C-x n w runs the command widen

or C-h m:

> m       Prompt to retrieve a new manpage.
> r       Retrieve reference in SEE ALSO section.
> M-n   Jump to next manpage in circular list.  <<<<<<<<<
> M-p   Jump to previous manpage in circular list.  <<<<<<<<<
> n       Jump to next manpage section.
> p       Jump to previous manpage section.
> g       Go to a manpage section.
> s       Jumps to the SEE ALSO manpage section.
> q       Deletes the manpage window, bury its buffer.
> k       Deletes the manpage window, kill its buffer.
> h       Prints this help text.


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Emacs - Help mailing list
In reply to this post by Eli Zaretskii
Eli Zaretskii wrote:

>> What switches are supported?
>
> Any switches supported by the 'man' command
> you have installed, I think.

zshall(1) with Emacs M-x man RET zshall RET

"page 1 of 16", and page 1 has 345 lines,

same with
(setq Man-switches "-a")
and
(setq Man-switches "")

In the Unix shell with man(1) - no concept of
a sixteenth division, 'man -a' loads the whole
manpage immediately and if you hit G you get to
line 32 213.

> It does work: it produces all of the man
> pages by that name, in all of the sections.
> You just need to go from one to the other
> with M-n and M-p, as "C-h m" tells you.

If you are to search the entire document for
a keyword, the entire document must be in one
and only one buffer.

>> The Unix man(1) is a pager.
>
> No, 'man' is not a pager. It is a program
> that formats and displays manual pages.
> A pager is a program like 'more' or 'less'.
> At least that's what I would call a "pager".

$ man man

MAN(1)                    Manual pager utils                   MAN(1)

[...]

       -P pager, --pager=pager
              Specify which output pager to  use.   By  default,  man
              uses  pager.  This option overrides the $MANPAGER envi‐
              ronment variable, which in turn  overrides  the  $PAGER
              environment  variable.

What's pager?

$ t pager # [1]
/usr/bin/pager
lrwxrwxrwx 1 root 23 Mar 18  2016 /usr/bin/pager -> /etc/alternatives/pager
 * links to: /bin/less
             -rwxr-xr-x 1 root 148K Mar  5  2016 /bin/less


[1] https://dataswamp.org/~incal/conf/.zsh/ide (line 67)

--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal


Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Emacs - Help mailing list
In reply to this post by Perry Smith-2
Perry Smith wrote:

>> For zshall(1), I still get only page 1 of
>> 16...
>
> I didn’t see anyone mention: the buffer has
> been narrowed down to the first manpage.
> There are options to wide it as well as move
> from page to page.
>
> C-x n w runs the command widen

That's it, thank you!

Now just automate that, file the report, and
look forward to the promotion :)

--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal


Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Perry Smith-2


> On Nov 30, 2019, at 8:40 AM, Emanuel Berg via Users list for the GNU Emacs text editor <[hidden email]> wrote:
>
> Perry Smith wrote:
>
>>> For zshall(1), I still get only page 1 of
>>> 16...
>>
>> I didn’t see anyone mention: the buffer has
>> been narrowed down to the first manpage.
>> There are options to wide it as well as move
>> from page to page.
>>
>> C-x n w runs the command widen
>
> That's it, thank you!
>
> Now just automate that, file the report, and
> look forward to the promotion :)
I just hit this exact same issue about a month ago.

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Omar Polo
In reply to this post by Emacs - Help mailing list
On Sat, Nov 30, 2019 at 03:38:18PM +0100, Emanuel Berg via Users list for the GNU Emacs text editor wrote:

> Eli Zaretskii wrote:
>
> >> What switches are supported?
> >
> > Any switches supported by the 'man' command
> > you have installed, I think.
>
> zshall(1) with Emacs M-x man RET zshall RET
>
> "page 1 of 16", and page 1 has 345 lines,
>
> same with
> (setq Man-switches "-a")
> and
> (setq Man-switches "")
>
> In the Unix shell with man(1) - no concept of
> a sixteenth division, 'man -a' loads the whole
> manpage immediately and if you hit G you get to
> line 32 213.
>
> > It does work: it produces all of the man
> > pages by that name, in all of the sections.
> > You just need to go from one to the other
> > with M-n and M-p, as "C-h m" tells you.
>
> If you are to search the entire document for
> a keyword, the entire document must be in one
> and only one buffer.
>
> >> The Unix man(1) is a pager.
> >
> > No, 'man' is not a pager. It is a program
> > that formats and displays manual pages.
> > A pager is a program like 'more' or 'less'.
> > At least that's what I would call a "pager".
>
> $ man man
>
> MAN(1)                    Manual pager utils                   MAN(1)
>
> [...]
>
>        -P pager, --pager=pager
>               Specify which output pager to  use.   By  default,  man
>               uses  pager.  This option overrides the $MANPAGER envi‐
>               ronment variable, which in turn  overrides  the  $PAGER
>               environment  variable.
>
> What's pager?
>
> $ t pager # [1]
> /usr/bin/pager
> lrwxrwxrwx 1 root 23 Mar 18  2016 /usr/bin/pager -> /etc/alternatives/pager
>  * links to: /bin/less
>              -rwxr-xr-x 1 root 148K Mar  5  2016 /bin/less
>
>
> [1] https://dataswamp.org/~incal/conf/.zsh/ide (line 67)
>
> --
> underground experts united
> http://user.it.uu.se/~embe8573
> https://dataswamp.org/~incal
>
>


I don't know how to solve your issue (sorry!), but I love nitpicking :)
I hope I'm not too offtopic.

On Sat, Nov 30, 2019 at 03:38:18PM +0100, Emanuel Berg via Users list for the GNU Emacs text editor wrote:
> Eli Zaretskii wrote:
[snip]

> >> The Unix man(1) is a pager.
> >
> > No, 'man' is not a pager. It is a program
> > that formats and displays manual pages.
> > A pager is a program like 'more' or 'less'.
> > At least that's what I would call a "pager".
>
> $ man man
>
> MAN(1)                    Manual pager utils                   MAN(1)
>
> [...]
>
>        -P pager, --pager=pager
>               Specify which output pager to  use.   By  default,  man
>               uses  pager.  This option overrides the $MANPAGER envi‐
>               ronment variable, which in turn  overrides  the  $PAGER
>               environment  variable.

It means that, by default, if stdin is a tty man(1) will exec less(1)
(or more, or most, or ...) to "page" the result.  If I've understood
correctly, emacs itself is acting as a pager in this case paging the
result from man.

Having the headline for man(1) "Manual pager utils" doesn't help, it's
misleading in my opinion.  OpenBSD' manpage is a bit cleaner maybe:

$ man man

MAN(1)               General Commands Manual               MAN(1)

NAME
     man - display manual pages

[...]

     -c      Copy the manual page to the standard output instead
             of using more(1) to paginate it.  This is done by
             default if the standard output is not a terminal
             device.
[...]

EXAMPLES
[...]
     Read a typeset page in a PDF viewer:

           $ MANPAGER=mupdf man -T pdf lpd

> What's pager?

a program that "pages" something (text generally.)

$ man more

MORE(1)              General Commands Manual              MORE(1)

NAME
     more - view files

DESCRIPTION
     The more pager displays text one screenful at a time.

>
> $ t pager # [1]
> /usr/bin/pager
> lrwxrwxrwx 1 root 23 Mar 18  2016 /usr/bin/pager -> /etc/alternatives/pager
>  * links to: /bin/less
>              -rwxr-xr-x 1 root 148K Mar  5  2016 /bin/less
>
>
> [1] https://dataswamp.org/~incal/conf/.zsh/ide (line 67)
>
> --
> underground experts united
> http://user.it.uu.se/~embe8573
> https://dataswamp.org/~incal
>
>

--
Omar Polo

Reply | Threaded
Open this post in threaded view
|

Re: does (setq Man-switches "-a") work?

Emacs - Help mailing list
Omar Polo wrote:

> man(1) will exec less(1) (or more, or most,
> or ...) to "page" the result.

Yes, of course.

> If I've understood correctly, emacs itself is
> acting as a pager in this case paging the
> result from man.

Yes.

> Having the headline for man(1) "Manual pager
> utils" doesn't help, it's misleading in my
> opinion. OpenBSD' manpage is a bit cleaner
> maybe:
>
> $ man man
>
> MAN(1) General Commands Manual MAN(1)

The Linux (Debian) headline is better in the
sense it mentions "Manual" first, not
"General Commands" which can mean anything,
also it calls it "pager" which is good so
people can identify it easily, the third word
"utils" is good because that's what it is.

But... what is a "General Commands Manual"?
It is like something one would find in a trench
on top of a smashed MBT-70, and then one would
think, hey, maybe the CIA came up with the most
bland title, so they could put state secrets in
it, and still be sure no one would ever read
it...

>> What's pager?
>
> a program that "pages" something
> (text generally.)

Yes, of course, but here "pager" doesn't refer
to just any pager but a specific a program, or
actually a symbolic link:

$ t pager # [1]
/usr/bin/pager
lrwxrwxrwx 1 root 23 Mar 18  2016 /usr/bin/pager -> /etc/alternatives/pager
 * links to: /bin/less
             -rwxr-xr-x 1 root 148K Mar  5  2016 /bin/less

This (/usr/bin/pager) is maybe a Linux or
Debian thing (?), it isn't on OpenBSD anyway.


[1] https://dataswamp.org/~incal/conf/.zsh/ide (line 67)

--
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal