emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [ANN] org-link-edit.el --- Slurp and barf with Org links
@ 2015-02-18  6:07 Kyle Meyer
  2015-02-18 10:42 ` Rasmus
  2015-02-22  2:21 ` Thomas S. Dye
  0 siblings, 2 replies; 11+ messages in thread
From: Kyle Meyer @ 2015-02-18  6:07 UTC (permalink / raw)
  To: Org-mode

Hello,

When working with links in Org documents, I noticed that I often kill
surrounding text to bring it into the description, or vice versa.  At
some point, this made me think that it'd be nice to be able to add and
remove description words like Paredit lets you do with S-expressions.
I've put these Paredit-inspired slurping and barfing commands for Org
link descriptions in org-link-edit.el [1], in case others find them
useful.  Below is an example for each command.

- org-link-edit-forward-slurp

  The [[http://orgmode.org/][Org mode]] site
                        |
                        v
  The [[http://orgmode.org/][Org mode site]]

- org-link-edit-backward-slurp

  The [[http://orgmode.org/][Org mode]] site
                        |
                        v
  [[http://orgmode.org/][The Org mode]] site

- org-link-edit-forward-barf

  The [[http://orgmode.org/][Org mode]] site
                        |
                        v
  The [[http://orgmode.org/][Org]] mode site

- org-link-edit-backward-barf

  The [[http://orgmode.org/][Org mode]] site
                        |
                        v
  The Org [[http://orgmode.org/][mode]] site

As I mention in the package commentary, I think this works well with
Oleh Krehel's excellent Hydra [2] because it allows you to repeat any of
these commands with a single key after the initial key sequence to
invoke the popup.

    (define-key org-mode-map YOUR-KEY
      (defhydra hydra-org-link-edit ()
        "Org Link Edit"
        ("j" org-link-edit-forward-slurp "forward slurp")
        ("k" org-link-edit-forward-barf "forward barf")
        ("u" org-link-edit-backward-slurp "backward slurp")
        ("i" org-link-edit-backward-barf "backward barf")
        ("q" nil "cancel")))


[1]: https://github.com/kyleam/org-link-edit/blob/master/org-link-edit.el
[2]: https://github.com/abo-abo/hydra

--
Kyle

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

end of thread, other threads:[~2015-08-13  5:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-18  6:07 [ANN] org-link-edit.el --- Slurp and barf with Org links Kyle Meyer
2015-02-18 10:42 ` Rasmus
2015-02-19  5:24   ` Kyle Meyer
2015-02-19 14:26     ` Suvayu Ali
2015-08-05  0:00   ` Bastien Guerry
2015-08-05  6:24     ` Nicolas Goaziou
2015-08-05  7:14       ` Bastien Guerry
2015-08-05  7:45         ` Thomas S. Dye
2015-08-05 11:34           ` Bastien Guerry
2015-08-13  5:55         ` Kyle Meyer
2015-02-22  2:21 ` Thomas S. Dye

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