gnu-emacs-sources
[Top][All Lists]
Advanced

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

RE: file-props.el


From: Drew Adams
Subject: RE: file-props.el
Date: Thu, 29 Jun 2006 11:02:01 -0700

    > - tag completion when adding new tags (to promote resuing existing
tags)

    This could be easily done by using `completing-read' instead of
    `read-string' as when searching for tags, but it would be hard to
    combine this with supporting entering multiple tags with a comma in
    between.  (This is where Drew comes in and mentions icicle's amazing
    multi choice stuff... :)

Mathias - Just use `icicle-define-command' instead of `defun'. Just pass it
the function to do whatever you do with a single tag that the user inputs.
Users can then enter any number of tags when prompted (see
http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Multi-Commands).

For your users who don't have or don't use Icicles, you can provide your
plain `defun' version that repeats completing-read (e.g. a loop). The two
definitions will be virtually identical.

`icicle-define-command' is no harder to use than `defun'. It takes these
args (and some others that are optional):

1. the new command name (symbol)
2. its doc string
3. the function to apply to each user input (candidate choice)
4. the args for `completing-read' (prompt etc.)

#3 does whatever it is you want the command to do. This function takes as
input the user's input (completion candidate).

Your code can do this, to require Icicles if it is present and raise no
error if it is not:

(require 'icicles nil t)

HTH - Drew





reply via email to

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