0

I just added the following line to my init.el:

(global-set-key (kbd "M-o") 'man)

but it is not enough. Before, if I wanted to perform the shell command equivalent to man 2 read I would do M-x man RET 2 read. Emacs doesn't to like the numbers and spaces, and takes multiple seconds to load it up, whereas M-x man RET read is instantaneous, but not what I want.

What is an easy way to grab a specific numbered man page?

Something where I can see all the reads would be ideal, so that I could do something like M-n within man-mode to browse through my options, or even something that can see whether I'm in a shell buffer, or in C mode and grab the relevant man page.

Drew
  • 75,699
  • 9
  • 109
  • 225
  • 2
    Can you explain what you mean by “Emacs doesn't like the numbers”? Typing “2 read” into the prompt works just fine for me; there’s no extra delay compared to just typing “read”. The space doesn’t do anything unusual either. – db48x Apr 22 '23 at 22:10
  • Typing `2` with a space afterward makes emacs hang for several seconds. If I type in `read`, it won't show up on my screen, but after hitting `RET`, in an indeterministic amount of time, the man page will load. – user129393192 Apr 22 '23 at 22:12
  • 1
    That sounds like an unrelated problem; perhaps something to do with how you have set up completion. Comment out that part of your init file and try again without whatever extra completion stuff you had set up. Then at least you can ask questions about the right thing. – db48x Apr 22 '23 at 23:03
  • Ah. My init file doesn't have anything to do with completion. I'm running on MacOS Ventura, and installed as a homebrew cask. – user129393192 Apr 22 '23 at 23:29
  • 1
    `M-x man RET 2 read RET` works fine for me: no delays. So does `M-x man RET read(2) RET`. No perceived difference in the timing (but I did not profile them). – NickD Apr 23 '23 at 03:03
  • Related Question: https://stackoverflow.com/q/76097655/324105 – phils May 23 '23 at 05:17

1 Answers1

1

Two solutions I have found since posting:

M-x man RET command-name(man-page-number) RET

a.ka., put the number in parentheses, or via

M-x customize RET change Man-switches to -a and use M-n to go through man pages. Found via docs.