emacs-devel
[Top][All Lists]
Advanced

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

RE: patch for woman (woman-topic-at-point)


From: Drew Adams
Subject: RE: patch for woman (woman-topic-at-point)
Date: Mon, 29 Aug 2005 09:08:48 -0700

    > is there a more elegant way of writing the following?
    >    (and word-at-point
    >        (test-completion word-at-point woman-topic-all-completions)
    >        word-at-point)

    (when (and word-at-point
               (test-completion word-at-point woman-topic-all-completions))
      word-at-point)
    It's more verbose, but brings across the purpose somewhat better.

Why don't we let `test-completion' return the completion (string) argument,
whenever the return value is non-nil?

This would then be simply:
 (and word-at-point
      (test-completion word-at-point woman-topic-all-completions))

This is a common use case - most uses of `test-completion' will want to use
the string, but only if it is a completion. And a return value of `t' is not
particularly useful.






reply via email to

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