emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog man.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/lisp ChangeLog man.el
Date: Tue, 24 Nov 2009 20:00:45 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/11/24 20:00:45

Modified files:
        lisp           : ChangeLog man.el 

Log message:
        (Man-completion-table): New function.
        (man): Use it.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16717&r2=1.16718
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/man.el?cvsroot=emacs&r1=1.186&r2=1.187

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16717
retrieving revision 1.16718
diff -u -b -r1.16717 -r1.16718
--- ChangeLog   24 Nov 2009 15:31:01 -0000      1.16717
+++ ChangeLog   24 Nov 2009 20:00:41 -0000      1.16718
@@ -1,6 +1,11 @@
+2009-11-24  Stefan Monnier  <address@hidden>
+
+       * man.el (Man-completion-table): New function.
+       (man): Use it.
+
 2009-11-24  David Reitter  <address@hidden>
 
-       * vc-git.el (vc-git-registered): use checkout directory (where
+       * vc-git.el (vc-git-registered): Use checkout directory (where
        .git is) rather than the file's directory and a relative path spec
        to work around a bug in git.
 
@@ -12,18 +17,18 @@
        (eshell-parse-colon-path): New defun.
        (eshell-file-attributes): Use `eshell-parse-colon-path'.
 
-       * eshell/esh-ext.el (eshell-search-path): Use
-       `eshell-parse-colon-path'.
+       * eshell/esh-ext.el (eshell-search-path):
+       Use `eshell-parse-colon-path'.
        (eshell-remote-command): Remove argument HANDLER.
        (eshell-external-command): Check for FTP remote connection.
 
-       * eshell/esh-proc.el (eshell-gather-process-output): Use
-       `file-truename', in order to start also symlinked files. Apply
-       `start-file-process' instead of `start-process'. Shorten `command'
-       to the local file name part.
+       * eshell/esh-proc.el (eshell-gather-process-output):
+       Use `file-truename', in order to start also symlinked files.
+       Apply `start-file-process' instead of `start-process'.
+       Shorten `command' to the local file name part.
 
-       * eshell/em-cmpl.el (eshell-complete-commands-list): Use
-       `eshell-parse-colon-path'.
+       * eshell/em-cmpl.el (eshell-complete-commands-list):
+       Use `eshell-parse-colon-path'.
 
        * eshell/em-unix.el (eshell/du): Check for FTP remote connection.
 
@@ -33,8 +38,7 @@
 2009-11-24  Tassilo Horn  <address@hidden>
 
        * doc-view.el (doc-view-mode): Switch off view-mode explicitly,
-       because it could be enabled automatically if view-read-only is
-       non-nil.
+       because it could be enabled automatically if view-read-only is non-nil.
 
 2009-11-24  Michael Kifer  <address@hidden>
 

Index: man.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/man.el,v
retrieving revision 1.186
retrieving revision 1.187
diff -u -b -r1.186 -r1.187
--- man.el      3 Sep 2009 06:55:00 -0000       1.186
+++ man.el      24 Nov 2009 20:00:44 -0000      1.187
@@ -749,6 +749,26 @@
 ;;;###autoload
 (defalias 'manual-entry 'man)
 
+(defun Man-completion-table (string pred action)
+  (cond
+   ((memq action '(t nil))
+    (let ((table '()))
+      (with-temp-buffer
+        ;; 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))
+        (goto-char (point-min))
+        (while (re-search-forward "^[^ \t\n]+" nil t)
+          (push (match-string 0) table)))
+      ;; The table may contain false positives since the match is made
+      ;; by "man -k" not just on the manpage's name.
+      (complete-with-action action table string pred)))
+   ((eq action 'lambda) t)
+   ((eq (car-safe action) 'boundaries) nil)))
 
 ;;;###autoload
 (defun man (man-args)
@@ -765,12 +785,13 @@
 `Man-switches' variable, which see."
   (interactive
    (list (let* ((default-entry (Man-default-man-entry))
-               (input (read-string
+               (input (completing-read
                        (format "Manual entry%s"
                                (if (string= default-entry "")
                                    ": "
                                  (format " (default %s): " default-entry)))
-                       nil 'Man-topic-history default-entry)))
+                        'Man-completion-table
+                       nil nil nil 'Man-topic-history default-entry)))
           (if (string= input "")
               (error "No man args given")
             input))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]