1

Recently start exploring org-mode, find it awesome so far. I use Emacs+Auctex for editing my tex file and tried to create a link that links to my tex file directly to the exact line in my org file. I found some weird results as shown in the screenshot below.

enter image description here

The ridiculous thing is the search doesn't work for \begin{} but work for \end{}. Anybody knows how to fix it? Or is this a bug? GIF Thanks for all the helps.

EDIT1: What I expect is that, when I click on the link, it will direct me to the relevant file at the EXACT line according to the search keyword after the :: after the link. EDIT2 GIF included.

2
  • Can you be a little more descriptive? What do you expect to see in the output file? Also, if you have a question about search, that is probably better posted as a separate question.
    – zck
    Feb 26, 2016 at 20:19
  • @zck The two semicolons after the link is the search key, right? What I expect is that, when I click on the link, it will direct me to the relevant file at the EXACT line. The problem is the link 1 and 3 won't bring me there, "No Match", while link 2 and 4 do. Sorry for my deficiency of description.
    – Wilson
    Feb 26, 2016 at 22:24

1 Answer 1

0

I'm 99% sure this is related to escape characters in regexes. \b in a regexp means "word boundary", not "backslash, then a b". In text.tex, if you delete the first character of the match, so the text is egin{Document}, your search will work.

If you want to fix the existing link, escape the backslash:

file:~/target.txt::\\begin{Document}

This will search for a literal backslash. I'm assuming it's working for the \end{Document} search because I don't think there's an escape character \e.

Another cool thing you can do is to use org links that have short names. If you press C-c C-l, org mode will prompt you for a link, and then a description. In the org buffer, it'll only show the description.

1
  • Thanks so much zck! I always do C-cl to store a link and C-c C-l to insert a link, I displayed the whole link in purpose. It seems like I have to add/remove a backslash manually every time I insert a link from the stored-link-lists.
    – Wilson
    Feb 26, 2016 at 23:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.