From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Vladimir Alexiev" Newsgroups: gmane.emacs.devel Subject: [PATCH] woman.el (woman-file-name): custom option `woman-use-file-directly' Date: Sat, 25 Dec 2010 11:46:29 +0200 Organization: Sirma Group Corp Message-ID: <001d01cba418$9b8fbd10$d2af3730$@bg> Reply-To: vladimir@sirma.bg NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_001E_01CBA429.5F188D10" X-Trace: dough.gmane.org 1293275105 6796 80.91.229.12 (25 Dec 2010 11:05:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Dec 2010 11:05:05 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 25 12:05:00 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PWRvl-0006IG-Ub for ged-emacs-devel@m.gmane.org; Sat, 25 Dec 2010 12:04:58 +0100 Original-Received: from localhost ([127.0.0.1]:33021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PWRvl-0007Kx-83 for ged-emacs-devel@m.gmane.org; Sat, 25 Dec 2010 06:04:57 -0500 Original-Received: from [140.186.70.92] (port=51129 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PWQh6-0000OD-0T for emacs-devel@gnu.org; Sat, 25 Dec 2010 04:46:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PWQg8-0007LF-7E for emacs-devel@gnu.org; Sat, 25 Dec 2010 04:45:43 -0500 Original-Received: from pmx.sirma.bg ([62.213.161.134]:17822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PWQg7-0007JQ-PE for emacs-devel@gnu.org; Sat, 25 Dec 2010 04:44:44 -0500 Original-Received: from pmx.sirma.bg (localhost [127.0.0.1]) by pmx.sirma.bg (Sirma mail system) with ESMTP id E107A2400F for ; Sat, 25 Dec 2010 11:44:39 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sirma.bg; h= reply-to:from:to:subject:date:message-id:mime-version: content-type; q=dns/txt; s=s1024; bh=7n4aUYYZUnytfXPJejYxkZUgkyI =; b=rywLsbdAjGxz8TCfgIUbznRcrnP2mcw/kj0qwKOyKndKC+6k13ov8nXfo62 OdaSczcjJnBBFQ947/T312v7Y2rT9kv3uhv1H0Hhp0Rg0mgyGWUxtaVNcVtFKZ5F EhjC9s/+mRj2yoU1gWE4Gg0jn73h2cuQitpbi28Cv5XuhoXM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=sirma.bg; q=dns; s=s1024; b=eDD5V hCUUvimBmZocwVO4y5TnlVD80SjI1Z0ATSauxGkGWlw2QF+r/BtT0lD1w1nQm0vi 0fXEBZxKW89XqUzDNDRWR5snH/ng/v5rQpPleR3NXUth1tgAiBHZqy6aj8+NMXna 7HVZMOag4XRfgWe7o4Jzb3DPOcNtQ9C0XD7xIM= Original-Received: from vlado (unknown [85.239.150.142]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client did not present a certificate) by pmx.sirma.bg (Sirma mail system) with ESMTP id CD0582400D for ; Sat, 25 Dec 2010 11:44:39 +0200 (EET) X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us Thread-Index: AcuhLYXDmqt2JdZnRfWqMRmSjKeGWABgVnsAAFlao6A= X-detected-operating-system: by eggs.gnu.org: Linux 2.6? (barebone, rare!) X-Mailman-Approved-At: Sat, 25 Dec 2010 06:04:52 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133962 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_001E_01CBA429.5F188D10 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi everyone and Merry Christmas! Sometimes a system may have several versions of man pages. E.g. my = cygwin installation has these for "ls": - c:/cygwin/usr/man/man1/ls.1 -- ls (fileutils) 4.1 (April 2001) - c:/cygwin/usr/share/man/man1/ls.1.gz -- GNU coreutils 8.5 (June 2010) In this case woman.el asks you to select one. This is distracting if you are in the middle of something and want to = quickly refer to man, and don't care about the particular version. I attach a small patch for woman.el that fixes this. Tested on: GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2010-11-10 on = SHAN-PC It's less than 20 lines (I've signed a GPL waiver before, but that was = like 10 years ago). Cheers! V ------=_NextPart_000_001E_01CBA429.5F188D10 Content-Type: application/octet-stream; name="woman.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="woman.patch" =EF=BB=BF2010-12-23 Vladimir Alexiev * woman.el (woman-file-name): custom option `woman-use-first-file' to use the first file found, if multiple files match the man topic. --- c:/emacs/lisp/woman.el 2010-11-10 08:39:48.000000000 +0200 +++ woman.el 2010-12-25 11:41:56.796875000 +0200 @@ -809,4 +809,11 @@ :group 'woman-interface) =20 +(defcustom woman-use-file-directly nil + "If multiple files match the man topic, use the first or last file = directly." + :type '(choice (const :tag "No" nil) + (const :tag "First" 'first) + (const :tag "Last" 'last)) + :group 'woman-interface) + (defvar woman-file-regexp nil "Regexp used to select (possibly compressed) man source files, e.g. @@ -1320,4 +1327,6 @@ ((null files) nil) ; no file found for topic. ((null (cdr files)) (car (car files))) ; only 1 file for topic. + ((eq 'first woman-use-file-directly) (car (car files))) ; use = the first file + ((eq 'last woman-use-file-directly) (car (car (last files)))) ; = use the last file (t ;; Multiple files for topic, so must select 1. ------=_NextPart_000_001E_01CBA429.5F188D10--