From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Elena Newsgroups: gmane.emacs.help Subject: Evaluating a variable under point? Date: Wed, 30 Jun 2010 07:33:27 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4969c2ad-d554-4d07-99af-392a72d56a84@u7g2000yqm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1291847410 25606 80.91.229.12 (8 Dec 2010 22:30:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 22:30:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 08 23:30:07 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQSWU-0000Ti-R7 for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 23:30:06 +0100 Original-Received: from localhost ([127.0.0.1]:36391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQSWU-0006Lj-1i for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 17:30:06 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!u7g2000yqm.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 18 Original-NNTP-Posting-Host: 89.96.190.244 Original-X-Trace: posting.google.com 1277908408 23015 127.0.0.1 (30 Jun 2010 14:33:28 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 30 Jun 2010 14:33:28 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: u7g2000yqm.googlegroups.com; posting-host=89.96.190.244; posting-account=AFCLjAoAAABJAOf_HjgEEEi3ty-lG5m2 User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.80 (Windows NT 5.1; U; en) Presto/2.5.24 Version/10.53,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:179370 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76132 Archived-At: 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.