From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Suvayu Ali Newsgroups: gmane.emacs.help Subject: How to execute code on cursor move Date: Sat, 13 Jul 2013 12:39:03 +0200 Message-ID: <20130713103903.GA11006@kuru.dyndns-at-home.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1373711966 29613 80.91.229.3 (13 Jul 2013 10:39:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Jul 2013 10:39:26 +0000 (UTC) To: Emacs help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 13 12:39:27 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UxxEa-0007HW-Sl for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Jul 2013 12:39:25 +0200 Original-Received: from localhost ([::1]:39473 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxxEa-000054-Gp for geh-help-gnu-emacs@m.gmane.org; Sat, 13 Jul 2013 06:39:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxxEM-0008VY-Eu for help-gnu-emacs@gnu.org; Sat, 13 Jul 2013 06:39:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UxxEL-0001wZ-MJ for help-gnu-emacs@gnu.org; Sat, 13 Jul 2013 06:39:10 -0400 Original-Received: from mail-ea0-x22f.google.com ([2a00:1450:4013:c01::22f]:38765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxxEL-0001wP-Ff for help-gnu-emacs@gnu.org; Sat, 13 Jul 2013 06:39:09 -0400 Original-Received: by mail-ea0-f175.google.com with SMTP id z7so6821682eaf.34 for ; Sat, 13 Jul 2013 03:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=b/0a75k1Sdqd3QjgUqALU9SpI5/4iHBU5G9lt5WNqq0=; b=DSLl6/LAhMX2WhRN7CmlkhuEbhtmooRIiIogiEY0GioxZq9ISn5zrvEON0/hF9GMHl hUBllVUIyrf+9UuZPKKGAOAhxPQ2F63sRFlH9yzwmZgHk2OdFvs7PDSQ8n/qF4PjXvMk JIoI2Pm7S7XRghboVIN4p12XFEjHzA013rpYsRbWAm/CSq+TWJHaUL3j49If+5a+V7cl aBsqSVR2M+Y2N3mYDuVeP51eoe06SaK3n3wSXu4+4xehJhTWiMBk1c/eqMb76Daakq6c pRKOIDR84aoMhF9HDSLeedB1nqWccv6FjHzEWJo05aGf3EXOzOlBtS/18FqgcvlPVPPr hmNA== X-Received: by 10.14.95.69 with SMTP id o45mr51202191eef.48.1373711948302; Sat, 13 Jul 2013 03:39:08 -0700 (PDT) Original-Received: from kuru.dyndns-at-home.com (sd44012d5.adsl.online.nl. [212.64.18.213]) by mx.google.com with ESMTPSA id c3sm22663794eev.3.2013.07.13.03.39.06 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 13 Jul 2013 03:39:07 -0700 (PDT) Content-Disposition: inline User-Agent: Mutt/1.5.21 (2012-12-30) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::22f X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92102 Archived-At: Hi, I want to check a text property and display in the minibuffer depending on context (in my case, on an org-link). This is what I have so far (working): (add-hook 'post-command-hook (lambda() (if (eq (get-text-property (point) 'face) 'org-link) (display-message-or-buffer (get-text-property (point) 'help-echo))))) Is using the post-command-hook a good idea? Is there something better? As you can see, I'm trying to get the link target; are there better ways to do this? Thanks for any ideas. -- Suvayu Open source is the future. It sets us free.