From: Carsten Dominik <dominik@science.uva.nl>
To: Bastien <bzg@altern.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Making Abbreviated links
Date: Mon, 21 May 2007 09:08:38 +0200 [thread overview]
Message-ID: <4e52b634bfe0075885b25db6ed7befb0@science.uva.nl> (raw)
In-Reply-To: <871whe0wlb.fsf@bzg.ath.cx>
This is a great idea. If you agree, I will incorporate
this into the C-c C-l command. Stored links will still be
accessible through <up> and <down>, while completion
will complete link prefixes like http, and also link
abbreviation prefixes.
- Carsten
On May 18, 2007, at 21:18, Bastien wrote:
> Hello,
>
> this function allows you to turn the region into a abbreviated link,
> the
> minibuffer being aware of the local #+LINK: options. With a prefix,
> ask
> for the link itself as well.
>
> Comments & suggestions welcome !
>
> =======================================================================
> =
> (defun bzg-org-link-this-region (&optional full)
> "Turn the region into a abbreviated link.
> With a prefix, ask the for link as well."
> (interactive "P")
> (when (org-region-active-p)
> (let* ((beg (region-beginning))
> (end (region-end))
> (history (mapcar 'car org-link-abbrev-alist-local))
> (desc (buffer-substring-no-properties beg end))
> (link (if full (concat (completing-read "#+LINK: " history)
> ":" (read-from-minibuffer "Link: "))
> (concat (completing-read "#+LINK: " history) ":" desc))))
> (kill-region beg end)
> (insert (org-make-link-string link desc)))))
> =======================================================================
> =
>
> --
> Bastien
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477
next prev parent reply other threads:[~2007-05-21 7:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-18 19:18 Making Abbreviated links Bastien
2007-05-21 7:08 ` Carsten Dominik [this message]
2007-05-22 4:37 ` Xavier Maillard
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4e52b634bfe0075885b25db6ed7befb0@science.uva.nl \
--to=dominik@science.uva.nl \
--cc=bzg@altern.org \
--cc=emacs-orgmode@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.