all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: emacs-devel@gnu.org
Subject: Re: Keywords
Date: Thu, 11 Mar 2010 23:45:18 +0200	[thread overview]
Message-ID: <878w9yr0zh.fsf_-_@mail.jurta.org> (raw)
In-Reply-To: <87hbomwu4b.fsf_-_@mail.jurta.org> (Juri Linkov's message of "Thu, 11 Mar 2010 22:48:04 +0200")

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/




  reply	other threads:[~2010-03-11 21:45 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10  2:22 Emacs-23 release branch Stefan Monnier
2010-03-10  4:09 ` Chong Yidong
2010-03-10  5:18   ` Jason Rumney
2010-03-10 15:23     ` Chong Yidong
2010-03-10 23:11       ` Jason Rumney
2010-03-10 23:25         ` Lennart Borgman
2010-03-10  5:19   ` Stefan Monnier
2010-03-10  5:58   ` joakim
2010-03-10 13:30     ` Ted Zlatanov
2010-03-10  7:55   ` Ulrich Mueller
2010-03-10 15:24     ` Chong Yidong
2010-03-10 17:23   ` Eli Zaretskii
2010-03-10 17:34     ` Chong Yidong
2010-03-10 17:56       ` Eli Zaretskii
2010-03-10 18:15         ` Chong Yidong
2010-03-10 17:37     ` David Kastrup
2010-03-10 17:58       ` Eli Zaretskii
2010-03-10 19:23       ` Stefan Monnier
2010-03-10 19:41         ` David Kastrup
2010-03-10 21:53         ` Eli Zaretskii
2010-03-11  3:15           ` Stefan Monnier
2010-03-11  4:22             ` Eli Zaretskii
2010-03-11 14:00               ` Stefan Monnier
2010-03-11 18:00                 ` Eli Zaretskii
2010-03-11 19:04                   ` Stefan Monnier
2010-03-11 19:53                     ` Eli Zaretskii
2010-03-11 22:09                       ` Andreas Schwab
2010-03-11 22:19                       ` James Cloos
2010-03-12  8:41                         ` bidi branch (was: Emacs-23 release branch) Eli Zaretskii
2010-03-13 18:16                           ` bidi branch James Cloos
2010-03-13 19:03                             ` Eli Zaretskii
2010-03-13 21:33                               ` Eli Zaretskii
2010-03-13 21:39                                 ` Drew Adams
2010-03-15 14:10                               ` Stephen J. Turnbull
2010-03-11 22:45                       ` Emacs-23 release branch Stefan Monnier
2010-03-12  8:46                         ` bidi branch Eli Zaretskii
2010-03-12  9:16                         ` Emacs-23 release branch Andreas Schwab
2010-03-12 15:32                           ` Stefan Monnier
2010-03-10 21:22   ` Michael Albinus
2010-03-11  3:20     ` Stefan Monnier
2010-03-11  4:27       ` Michael Albinus
2010-03-11 14:04         ` Stefan Monnier
2010-03-11 14:30           ` Michael Albinus
2010-03-11 15:14             ` Stefan Monnier
2010-03-11 16:02               ` Michael Albinus
2010-03-11 16:07                 ` Chong Yidong
2010-03-11 16:10                   ` Michael Albinus
2010-03-12 15:28                 ` Ted Zlatanov
2010-03-12 15:31                   ` Ted Zlatanov
2010-03-12 16:36                     ` Keywords (was: Emacs-23 release branch) Juri Linkov
2010-03-12 16:32             ` Emacs-23 release branch Juri Linkov
2010-03-12 18:03               ` Stefan Monnier
2010-03-13 20:40                 ` secrets.el (was: Emacs-23 release branch) Michael Albinus
2010-03-14 16:37                   ` secrets.el Stefan Monnier
2010-03-20 19:32                   ` secrets.el Ted Zlatanov
2010-03-11 20:48           ` Keywords (Re: Emacs-23 release branch) Juri Linkov
2010-03-11 21:45             ` Juri Linkov [this message]
2010-03-12  1:30               ` Keywords Stefan Monnier
2010-03-14 21:33                 ` Keywords Juri Linkov
2010-03-15 21:33                   ` Keywords Juri Linkov
2010-03-19 17:25                     ` finder.el UI (was: Keywords) Ted Zlatanov
2010-03-19 22:48                       ` Juri Linkov
2010-03-22 13:30                         ` finder.el UI Ted Zlatanov
2010-03-22 14:19                           ` Stefan Monnier
2010-03-22 14:29                             ` Ted Zlatanov
2010-03-22 15:08                               ` Juri Linkov
2010-03-22 16:33                                 ` Ted Zlatanov
2010-03-22 16:09                               ` Stefan Monnier
2010-03-22 16:36                                 ` Ted Zlatanov
2010-03-22 15:07                             ` Juri Linkov
2010-03-22 17:13                             ` Drew Adams
2010-03-22 15:04                           ` Juri Linkov
2010-03-14 21:34   ` Customize UI (was: Emacs-23 release branch) Juri Linkov
2010-03-15  1:05     ` Customize UI Miles Bader
2010-03-15  1:34       ` Juri Linkov
2010-03-15  3:32         ` Miles Bader
2010-03-15 17:17     ` Chong Yidong
2010-03-15 17:34       ` Lennart Borgman
2010-03-15 21:34       ` Juri Linkov
2010-03-19 17:21     ` Ted Zlatanov
2010-03-10 17:21 ` Emacs-23 release branch Eli Zaretskii
2010-03-10 17:48   ` Sven Joachim
2010-03-10 18:00     ` Eli Zaretskii
2010-03-10 19:30     ` Chad Brown
2010-03-10 19:36       ` Óscar Fuentes
2010-03-10 19:55         ` Chad Brown
2010-03-10 19:47       ` Sven Joachim
2010-03-11  3:16         ` Stefan Monnier
2010-03-11  7:42           ` Sven Joachim
2010-03-11 13:35             ` Óscar Fuentes
2010-03-11 14:02             ` Stefan Monnier
2010-03-10 17:48 ` Eli Zaretskii
2010-03-10 17:59   ` Eli Zaretskii
2010-03-10 19:31     ` Stefan Monnier
2010-03-10 21:55       ` Eli Zaretskii
2010-03-11  3:17         ` Stefan Monnier
2010-03-10 19:44     ` Óscar Fuentes
2010-03-10 22:05       ` Eli Zaretskii
2010-03-10 22:19         ` Óscar Fuentes
2010-03-11  4:21           ` Eli Zaretskii
2010-03-11 13:42             ` Óscar Fuentes
2010-03-11 14:08             ` Stefan Monnier

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878w9yr0zh.fsf_-_@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.