From: Kevin Ryde <user42@zip.com.au>
To: Juri Linkov <juri@jurta.org>
Cc: 3717@emacsbugs.donarmstrong.com, jidanni@jidanni.org
Subject: bug#3717: M-x man completion
Date: Wed, 25 Nov 2009 09:58:09 +1100 [thread overview]
Message-ID: <87k4xf4jjy.fsf@blah.blah> (raw)
In-Reply-To: <87ocmsqa7z.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 24 Nov 2009 19:11:32 +0200")
[-- Attachment #1: Type: text/plain, Size: 1409 bytes --]
Juri Linkov <juri@jurta.org> writes:
>
> man-completion.el are the cache for `man -k'
It's pretty vital for me, since man -k is about 1 to 2 seconds per run,
which is too slow if you hit tab a few times (twice each to see the
completion list).
> handling same names in different sections.
It's been through a few goes at making it friendly for both page names
and file names and stuff. :-)
> Also part of man-completion.el deals with man-completion-at-point
> that returns a man page name as a string found at point.
That's another been though loosening and tightening. I quite like what
I got to for line-break hyphenations. I looked last week at
Man-hyphenated-reference-regexp and wondered if it was the same thing,
but the docstring of Man-possibly-hyphenated-word about returning the
previous line's word like "tcgetp-" suggested not. If it is the same
then a U+2010 hyphen could be worked in there -- it comes out of recent
groff "-Tutf8".
If nothing else then give the following bit a go. man-db truncates page
names longer than about half the screen width. (Long names arise from
perl classes.)
2009-11-24 Kevin Ryde <user42@zip.com.au>
* man.el (Man-completion-table): default-directory "/" in case
doesn't otherwise exist. process-environment COLUMNS=999 so as
not to truncate long names. process-connection-type pipe to avoid
any chance of hitting the pseudo-tty TIOCGWINSZ.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: man.el.no-truncate.diff --]
[-- Type: text/x-diff, Size: 1079 bytes --]
--- man.el.~1.187.~ 2009-11-25 09:08:03.000000000 +1100
+++ man.el 2009-11-25 09:26:02.000000000 +1100
@@ -754,13 +754,17 @@
((memq action '(t nil))
(let ((table '()))
(with-temp-buffer
+ (setq default-directory "/") ;; in case inherited doesn't exist
;; Actually for my `man' the arg is a regexp. Don't know how
;; standard that is. Also, it's not clear what kind of
;; regexp are accepted: under GNU/Linux it seems it's ERE-style,
;; whereas under MacOSX it seems to be BRE-style and
;; doesn't accept backslashes at all. Let's not bother to
;; quote anything.
- (call-process "man" nil '(t nil) nil "-k" (concat "^" string))
+ (let ((process-connection-type nil) ;; pipe
+ (process-environment (copy-sequence process-environment)))
+ (setenv "COLUMNS" "999") ;; don't truncate long names
+ (call-process "man" nil '(t nil) nil "-k" (concat "^" string)))
(goto-char (point-min))
(while (re-search-forward "^[^ \t\n]+" nil t)
(push (match-string 0) table)))
next prev parent reply other threads:[~2009-11-24 22:58 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87fx7x72qd.fsf@mail.jurta.org>
2009-06-29 20:48 ` bug#3717: M-x man completion jidanni
2009-06-29 22:02 ` Stefan Monnier
2009-06-30 7:50 ` Sven Joachim
[not found] ` <87ab3pfqj0.fsf@jidanni.org>
2009-11-24 17:11 ` Juri Linkov
2009-11-24 20:01 ` Stefan Monnier
2009-11-25 17:29 ` Juri Linkov
2009-11-25 19:30 ` Stefan Monnier
2009-11-25 21:17 ` Juri Linkov
2009-11-25 23:18 ` Kevin Ryde
2009-11-26 9:28 ` Juri Linkov
2009-11-26 22:09 ` Kevin Ryde
2009-11-27 2:30 ` Stefan Monnier
2009-12-04 22:53 ` Kevin Ryde
2009-12-05 9:31 ` Eli Zaretskii
2009-12-11 22:43 ` Kevin Ryde
2009-12-12 9:03 ` Eli Zaretskii
2009-11-25 23:04 ` Kevin Ryde
2009-11-26 9:28 ` Juri Linkov
2009-11-26 16:54 ` Stefan Monnier
2009-12-02 22:41 ` Kevin Ryde
2009-12-03 0:53 ` Stefan Monnier
2009-12-04 22:50 ` Kevin Ryde
2009-12-05 5:02 ` Stefan Monnier
2009-12-05 23:12 ` Kevin Ryde
2009-12-07 2:26 ` Stefan Monnier
2009-11-26 22:01 ` Kevin Ryde
2009-11-26 22:36 ` Juri Linkov
2009-11-26 23:15 ` Kevin Ryde
2009-11-27 9:01 ` Juri Linkov
2009-11-28 17:56 ` Juri Linkov
2009-11-28 20:14 ` Kevin Ryde
2009-11-28 22:54 ` Juri Linkov
2009-12-15 6:18 ` jidanni
2009-12-15 8:04 ` Eli Zaretskii
2009-12-16 0:42 ` Juri Linkov
2009-12-16 4:19 ` Eli Zaretskii
2009-12-16 21:25 ` Kevin Ryde
[not found] ` <87ljh29ypb.fsf@mail.jurta.org>
[not found] ` <87r5qt5p52.fsf@blah.blah>
2009-12-17 23:35 ` Juri Linkov
2009-12-18 1:00 ` Kevin Ryde
2009-11-26 23:34 ` jidanni
2009-11-27 0:24 ` Kevin Ryde
2009-11-27 9:04 ` Juri Linkov
2009-11-25 23:11 ` Kevin Ryde
2009-11-26 3:03 ` Stefan Monnier
2009-11-26 21:12 ` Kevin Ryde
2009-12-16 21:40 ` Kevin Ryde
2009-12-16 21:44 ` Kevin Ryde
2009-11-24 22:58 ` Kevin Ryde [this message]
2009-11-24 23:45 ` Kevin Ryde
2009-11-25 4:21 ` Eli Zaretskii
2009-11-25 14:47 ` Stefan Monnier
2009-11-25 22:53 ` Kevin Ryde
2009-11-26 4:20 ` Eli Zaretskii
2009-11-26 21:36 ` Kevin Ryde
2009-11-27 8:47 ` Eli Zaretskii
2009-11-28 19:49 ` Kevin Ryde
2009-11-28 22:59 ` Juri Linkov
2009-11-29 15:34 ` Stefan Monnier
2009-06-30 22:38 ` Kevin Ryde
2009-11-29 16:15 ` bug#3717: marked as done (M-x man completion) Emacs bug Tracking System
2009-08-06 1:47 ` bug#4056: 23.1.50; use shell-command completion for M-x man page names jidanni
2009-11-29 16:15 ` bug#4056: marked as done (23.1.50; use shell-command completion for M-x man page names) Emacs bug Tracking System
2010-01-23 22:04 ` bug#4056: completion--some: Searching for program: no such file or directory, LC_CTYPE=C man jidanni
2010-02-08 19:07 ` bug#4056: " jidanni
2010-02-09 0:42 ` Kenichi Handa
2010-02-11 16:10 ` Stefan Monnier
2010-02-09 0:51 ` jidanni
2010-02-11 21:42 ` jidanni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k4xf4jjy.fsf@blah.blah \
--to=user42@zip.com.au \
--cc=3717@emacsbugs.donarmstrong.com \
--cc=jidanni@jidanni.org \
--cc=juri@jurta.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).