[O] Word under cursor to internal link

2014-12-18 Thread Leu Zhe
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]]

Re: [O] Word under cursor to internal link

2014-12-18 Thread John Kitchin
Something like this seems to do approximately what you want: #+BEGIN_SRC emacs-lisp (defun word-to-link () (interactive) (save-excursion (let (start end word) (backward-word) (setq start (point)) (forward-word) (setq end (point)) (setq word (buffer-subs

[O] Word under cursor to internal link

2014-12-18 Thread Chaitanya Krishna
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