From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Keywords Date: Thu, 11 Mar 2010 23:45:18 +0200 Organization: JURTA Message-ID: <878w9yr0zh.fsf_-_@mail.jurta.org> References: <87zl2g24xy.fsf@stupidchicken.com> <87mxyfq3bz.fsf@gmx.de> <87sk87h49a.fsf@gmx.de> <87hbomwu4b.fsf_-_@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1268343972 19242 80.91.229.12 (11 Mar 2010 21:46:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 11 Mar 2010 21:46:12 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 11 22:46:08 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 1NpqCm-0006hY-5S for ged-emacs-devel@m.gmane.org; Thu, 11 Mar 2010 22:46:08 +0100 Original-Received: from localhost ([127.0.0.1]:47661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NpqCl-0008G0-K2 for ged-emacs-devel@m.gmane.org; Thu, 11 Mar 2010 16:46:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NpqCg-0008EG-8D for emacs-devel@gnu.org; Thu, 11 Mar 2010 16:46:02 -0500 Original-Received: from [140.186.70.92] (port=59599 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NpqCf-0008DF-Bi for emacs-devel@gnu.org; Thu, 11 Mar 2010 16:46:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NpqCe-0004rE-1K for emacs-devel@gnu.org; Thu, 11 Mar 2010 16:46:01 -0500 Original-Received: from smtp-out1.starman.ee ([85.253.0.3]:41656 helo=mx1.starman.ee) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NpqCd-0004qz-Ji for emacs-devel@gnu.org; Thu, 11 Mar 2010 16:46:00 -0500 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.70.237.cable.starman.ee [82.131.70.237]) by mx1.starman.ee (Postfix) with ESMTP id B66823F40C5 for ; Thu, 11 Mar 2010 23:45:52 +0200 (EET) In-Reply-To: <87hbomwu4b.fsf_-_@mail.jurta.org> (Juri Linkov's message of "Thu, 11 Mar 2010 22:48:04 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:121834 Archived-At: A few days ago I got a bug report about numeric keywords displayed by ee-finder - a package that lists all unknown finder keywords (that are not registered in `finder-known-keywords'). I already fixed "RFC 2104" that resulted in two separate keywords "RFC" and "2104" in finder-inf.el. But I'm not going to hunt for more such keywords. The problem lies in the design flaw of keywords handling in finder.el and lisp-mnt.el. `lm-keywords-list' assumes that keywords are separated by a sequence of commas and whitespace. This means that in: ;; Keywords: mule, multilingual, character composition there is 4 keywords: "mule", "multilingual", "character" and "composition". So a list of all unknown keywords currently is a mess. To fix this problem I propose the following heuristics: if the keywords line contains a comma, then split keywords using a comma and not whitespace, because the presence of a comma means that the author decided to separate keywords by commas only. The patch below implements this: Using parent branch file:///home/work/emacs/bzr/emacs/trunk/ === modified file 'lisp/emacs-lisp/lisp-mnt.el' --- lisp/emacs-lisp/lisp-mnt.el 2010-01-13 08:35:10 +0000 +++ lisp/emacs-lisp/lisp-mnt.el 2010-03-11 21:43:07 +0000 @@ -458,7 +458,9 @@ (defun lm-keywords-list (&optional file) "Return list of keywords given in file FILE." (let ((keywords (lm-keywords file))) (if keywords - (split-string keywords "[, \t\n]+" t)))) + (if (string-match-p "," keywords) + (split-string keywords ",[ \t\n]*" t) + (split-string keywords "[, \t\n]+" t))))) (defvar finder-known-keywords) (defun lm-keywords-finder-p (&optional file) But there are more problems. In finder-inf.el multi-word keywords need to be grouped using Lisp syntax. Currently they are symbols, and the entry look like: ("composite.el" "support character composition" (mule multilingual character composition)) There are two ways to group multi-word keywords: 1. Converting symbols to strings: ("composite.el" "support character composition" (mule multilingual "character composition")) 2. Adding some separator to symbols: ("composite.el" "support character composition" (mule multilingual character-composition)) I don't know yet what to prefer. -- Juri Linkov http://www.jurta.org/emacs/