From bfad0126290a6f8dc6dd12c5dbcd690266976d15 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Thu, 14 Jan 2010 18:06:22 +0100 Subject: [PATCH] Repair the export of source code line references in LaTeX Marting G. Skjaeveland writes: > I pulled a fresh copy of org-mode this morning and noticed that > references to source code line numbers no longer work as they used > to. Instead of displaying the number of the line with the label, the > label is displayed. > > Exporting the following example, retrieved from the online > documentation (http://orgmode.org/manual/Literal-examples.html), > > -------------------------------------start > #+BEGIN_SRC emacs-lisp -n -r > (save-excursion (ref:sc) > (goto-char (point-min)) (ref:jump) > #+END_SRC > > In line [[(sc)]] we remember the current position. [[(jump)][Line > (jump)]] jumps to point-min. > > -------------------------------------end > > gives me in latex export > > -------------------------------------start > \begin{verbatim} > 1: (save-excursion > 2: (goto-char (point-min)) > \end{verbatim} > > In line \hyperref[(sc)]{(sc)} we remember the current > position. \hyperref[(jump)]{Line (jump)} jumps to point-min. > -------------------------------------end > --- lisp/ChangeLog | 3 +++ lisp/org-exp.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1b2afaebb..58ca50d42 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2010-01-14 Carsten Dominik + * org-exp.el (org-export-target-internal-links): Check for + protectedness after the first bracket. + * org.el (org-entry-properties): Don't match wrong-case TODO keywords. diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 7fad8a546..dae88beba 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1537,7 +1537,7 @@ This function also handles the id links, if they have a match in the current file." (goto-char (point-min)) (while (re-search-forward org-bracket-link-regexp nil t) - (org-if-unprotected-at (match-beginning 1) + (org-if-unprotected-at (1+ (match-beginning 0)) (let* ((md (match-data)) (desc (match-end 2)) (link (org-link-unescape (match-string 1)))