Hi list,

I'm regularily using Org for taking notes in meetings.  It's very handy
to be able to send a HTML/PDF report to everyone quickly.  While doing
this, I like to link some parts of the text that need to be searched
further, after the meeting.    

Then I'm using this small function to convert the selected text into a
google search:

(defun bzg-org-googlify-region (beg end)
  "Convert the selected region into a google search.
This requires that \"google\" is an abbreviated link for
http://www.google.com/search?q=%s";
  (interactive "r")
  (let ((query (buffer-substring beg end)))
    (delete-region beg end)
    (insert (org-make-link-string (concat "google:" query) query))))

This can be generalized for any kind of abbreviated link:

(defun bzg-org-abbrev-linkify-region (beg end)
  "Convert the selected region into an abbreviated link."
  (interactive "r")
  (let ((abbrev
         (completing-read 
          "Abbrev: " 
          (mapcar (lambda (x) (list (concat (car x) ":")))
                  (append org-link-abbrev-alist-local 
                          org-link-abbrev-alist))))
        (reg (buffer-substring beg end)))
    (delete-region beg end)
    (insert (org-make-link-string (concat abbrev reg) reg))))

I guess this might be useful to other people...

-- 
Bastien


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to