From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Aviv <orgmodegmaneFeb14.z.m1@dfgh.net>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Using a simpler link syntax in org-mode?
Date: Wed, 12 Feb 2014 12:26:46 -0500 [thread overview]
Message-ID: <CAJ51EToHmodqwH71+ZUaJYW9PCL8XtzY+7kqvdJw3OShuD80qw@mail.gmail.com> (raw)
In-Reply-To: <loom.20140207T024951-748@post.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2099 bytes --]
you can kind of achieve this with yasnippet. I made this below:
# -*- mode: snippet -*-
# name: simple-link
# key: sl
# --
[[$1.org][$1]
to use it, you type sl, press tab, type in the file, and then tab ], and
you get your link. that may be better than typing everything out, if you
remember sl for simple link, and press tab. I tried to not have the
trailing ] typed in, but as soon as you type a character org shrinks the
link and it does not behave as you want.
As an alternative, consider writing a short emacs function that inserts
what you want.
(defun sl (link)
(interactive "sLink: ")
(insert (format "[[%s.org][%s]]" link link)))
Now you type M-x sl
then enter the link in the minibuffer.
What you want probably isn't feasible. How do you differentiate [[foo bar]]
from a file and a heading in the current file? Another customization
variable ;)
John
-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu
On Thu, Feb 6, 2014 at 9:28 PM, Aviv <orgmodegmaneFeb14.z.m1@dfgh.net>wrote:
> I'd like to have links with the syntax [[foo bar]] go to files with the
> name
> foo bar.org. This would make using org-mode much more like using a
> personal
> local wiki.
>
> Is this possible without breaking existing link functionality? I'd also
> ideally still be able to export to html, etc. with standard org-mode tools.
>
> The best I've been able to do is something like:
> (setq org-link-abbrev-alist '(("o" . "file:%s.org")))
>
> This lets me use the syntax [[o:foo bar]], but that is more verbose, and
> looks distractingly ugly inline.
> For example: The quick brown o:fox jumps over the o:lazy_dog.
> And `[[o:foo bar][foo bar]]` is even
> more verbose to type and edit (though it reads fine in org modde).
>
> FYI, I was asked to crosspost this from stackoverflow at
> http://stackoverflow.com/q/21085720/1137803
> (I waited several weeks with no answer; I hope that is appropriate)
>
> Regards
> - Aviv
>
>
>
[-- Attachment #2: Type: text/html, Size: 3089 bytes --]
prev parent reply other threads:[~2014-02-12 17:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-07 2:28 Using a simpler link syntax in org-mode? Aviv
2014-02-12 17:26 ` John Kitchin [this message]
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
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJ51EToHmodqwH71+ZUaJYW9PCL8XtzY+7kqvdJw3OShuD80qw@mail.gmail.com \
--to=jkitchin@andrew.cmu.edu \
--cc=emacs-orgmode@gnu.org \
--cc=orgmodegmaneFeb14.z.m1@dfgh.net \
/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 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).