emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Word under cursor to internal link
@ 2014-12-19  0:31 Chaitanya Krishna
  2014-12-19  1:08 ` John Kitchin
  0 siblings, 1 reply; 3+ messages in thread
From: Chaitanya Krishna @ 2014-12-19  0:31 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

Hello there,

Is there a shortcut to change word under cursor to an internal link?
Basically it is a pain trying to surround with two braces all the time!

C-c C-l does not prompt me to create an internal link.

Best regards,
Chai

[-- Attachment #2: Type: text/html, Size: 348 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Word under cursor to internal link
@ 2014-12-19  1:45 Leu Zhe
  0 siblings, 0 replies; 3+ messages in thread
From: Leu Zhe @ 2014-12-19  1:45 UTC (permalink / raw)
  To: icymist, emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]

You can use the function below to make it.
But in order to replace it rightly, you need to put you cursor inside the
word or at the beginning of the word.

(defun word-to-link ()
  (interactive)
  (let ((word (thing-at-point 'word)))
    (forward-word)
    (kill-word -1)
    (insert (format "[[%s]]" word))))

Hope it helps. And any improvement will be welcome.

[-- Attachment #2: Type: text/html, Size: 518 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-19  1:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-19  0:31 Word under cursor to internal link Chaitanya Krishna
2014-12-19  1:08 ` John Kitchin
  -- strict thread matches above, loose matches on Subject: below --
2014-12-19  1:45 Leu Zhe

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).