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

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

Evaluating a variable under point?


From: Elena
Subject: Evaluating a variable under point?
Date: Wed, 08 Dec 2010 15:16:30 -0000
User-agent: G2/1.0

Hello,

I'm trying to write an interactive function which evaluates variable
at point, unless region is active. Currently it looks like this:

(defun smart-eval ()
        (interactive)
        (if mark-active
                (eval-region)
                (case (char-syntax  (char-after))
                  ((?w ?_)
                   (eval-expression (string (thing-at-point 'symbol))))
                  (t
                   (message "Nothing to evaluate.")))))

However, I'm not getting results. What's wrong?

Thanks.


reply via email to

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