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-substring start end))
      (setf (buffer-substring start end)
            (format "[[%s]]" word)))))
#+END_SRC

Chaitanya Krishna <icym...@gmail.com> writes:

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

-- 
-----------------------------------
John Kitchin
Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

Reply via email to