emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Suvayu Ali <fatkasuvayu+linux@gmail.com>
To: Jambunathan K <kjambunathan@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Adding text properties to all Org mode links
Date: Tue, 10 Sep 2013 13:39:11 +0200	[thread overview]
Message-ID: <20130910113911.GU20690@kuru.dyndns-at-home.com> (raw)
In-Reply-To: <87hadtdv1l.fsf@gmail.com>

Hi Jambu,

On Tue, Sep 10, 2013 at 12:26:22PM +0530, Jambunathan K wrote:
> 
> Add salt to taste or cookup your own recipe based on the hints here.
> 
> (add-hook 'org-mode-hook
> 	  (lambda nil
> 	    (setq-local default-text-properties
> 			'(point-entered org-link-entered-maybe))))
> 
> (defun org-link-entered-maybe (op np)
>   (when (derived-mode-p 'org-mode)
>     ;; (message "In org-link-entered-maybe")
>     (let* ((inhibit-point-motion-hooks t)
> 	   (ctx (org-element-context)))
>       (when (eq 'link (org-element-type ctx))
> 	(tooltip-show (org-element-property :raw-link ctx)
> 		      (not 'use-echo-area))))))

I can't see the properties.  This is what I tried:

(add-hook 'org-mode-hook
	  (lambda nil
	    ;; (setq-local default-text-properties
	    ;; 		'(point-entered org-link-entered-maybe point-left org-link-entered-maybe))
	    (setq-local default-text-properties
			'(point-entered sa-echo-tooltip point-left sa-echo-tooltip))
	    ))

Where sa-echo-tooltip is my function.  Then I open the following Org
file:

------8<---------8<----------
#+TITLE: Test adding text properties to links

#+STARTUP: showeverything

* Links
- [[https://www.google.com][Google]]
- https://en.wikipedia.org/wiki/Main_page
------8<---------8<----------

With my cursor on the 2 links, I see the following with describe-char:

There are text properties here:
  face                 org-link
  font-lock-multiline  t
  fontified            t
  help-echo            "LINK: https://www.google.com"
  htmlize-link         (:uri "https://www.google.com")
  keymap               [Show]
  mouse-face           highlight
  org-no-flyspell      t

There are text properties here:
  face                 org-link
  fontified            t
  htmlize-link         (:uri "https://en.wikipedia.org/wiki/Main_page")
  keymap               [Show]
  mouse-face           highlight
  org-no-flyspell      t

As you see there is no mention of point-left or point-entered.

Any ideas?

-- 
Suvayu

Open source is the future. It sets us free.

  reply	other threads:[~2013-09-10 11:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-13 13:40 Adding text properties to all Org mode links Suvayu Ali
2013-07-14  3:01 ` Nick Dokos
2013-07-14  6:41   ` Suvayu Ali
2013-09-09 23:15     ` Suvayu Ali
2013-09-10  6:56       ` Jambunathan K
2013-09-10 11:39         ` Suvayu Ali [this message]
2013-09-10 12:09           ` Jambunathan K
2013-09-10 12:24             ` Suvayu Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130910113911.GU20690@kuru.dyndns-at-home.com \
    --to=fatkasuvayu+linux@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kjambunathan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).