> 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.




_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to