GNU bug report logs - #3717
M-x man completion

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Mon, 29 Jun 2009 20:55:04 UTC

Severity: wishlist

Merged with 4056

Found in version 1:20100118-1

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kevin Ryde <user42 <at> zip.com.au>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: jidanni <at> jidanni.org, 3717 <at> debbugs.gnu.org
Subject: bug#3717: M-x man completion
Date: Thu, 17 Dec 2009 08:44:02 +1100
I wrote:
>
> insinuate "-k " and "-l " so it's possible to type those things
> without needing C-q Space.

I've since thought to help any "-" option, not just -k and -l, with a
constructed table in the completion handler along these lines.

Not sure it's fantastic for "?" or "tab", but gets the right effect on
space.


        ((string-match "\\`-\\(.\\)?" str)
         ;; "-" or "-X" -- alone and with a space so you don't have to type
         ;; C-q space after an option.  "-l" or "-k" are shown as standard
         ;; options, but then add anything else so other options can be
         ;; typed.
         ;;
         ;; For formatting options like "-Tascii" could think about applying
         ;; the pagename or filename completion to the next arg, but
         ;; normally such options will go in `Man-switches'.
         ;;
         (let ((table '(("-l " . "run man on a file")
                        ("-k " . "search apropos database"))))
           (unless (member str '("-k" "-l" "-k " "-l "))
             (push (cons str "option") table)
             (push (cons (concat str " ") "option") table))
           (man-completion--complete-with-action action table str pred)))



This bug report was last modified 15 years and 108 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.