> Rule of thumb: if your solution uses `eval' it's either buggy or
clunky.

Interesting, I've never heard this.
My elisp isn't all that great yet so I looked for instances where
I use it.

(defun tacl-eldoc-function ()
  "Returns a documentation string for context near point or nil"
  (let ((word (thing-at-point 'symbol)))
    (if word
        (eval (intern-soft (upcase word) tacl-eldoc-obarray)))))

tacl-eldoc-obarray is populated like this.

(set (intern "FOO" tacl-eldoc-obarray) "FOO help text here")
(set (intern "BAR" tacl-eldoc-obarray) "BAR help text")
...

I thought this might be an exception to your rule because apply
doesn't apply.  But then it occured to me that symbol-value is
probably what I should have coded.

Is there a collection of more such tips someplace?

Thanks
Rick

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to