diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-10-13 23:51:17 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2015-10-13 23:51:17 +0200 |
commit | 1c7dca9692c935918da41bb14dee83b93454bbc3 (patch) | |
tree | d02dcfa04925ce9cdaa2642637b3f5bdf29878fc | |
parent | d183c59e46dc2779d22f08d6387d482d0e3dd29d (diff) | |
download | org-mode-1c7dca9692c935918da41bb14dee83b93454bbc3.tar.gz |
ox-beamer: Fix againframe command
* lisp/ox-beamer.el (org-beamer-headline): Make sure any fuzzy reference
provided for an againframe ends up pointing to a headline.
-rw-r--r-- | lisp/ox-beamer.el | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index 3119bd4..22bf53c 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -597,28 +597,27 @@ as a communication channel." (when overlay (org-beamer--normalize-argument overlay - (if (string-match "^\\[.*\\]$" overlay) 'defaction + (if (string-match "\\`\\[.*\\]\\'" overlay) 'defaction 'action)))) ;; Options. (let ((options (org-element-property :BEAMER_OPT headline))) (when options (org-beamer--normalize-argument options 'option))) ;; Resolve reference provided by "BEAMER_ref" - ;; property. This is done by building a minimal fake - ;; link and calling the appropriate resolve function, - ;; depending on the reference syntax. - (let* ((type - (progn - (string-match "^\\(id:\\|#\\|\\*\\)?\\(.*\\)" ref) - (cond - ((or (not (match-string 1 ref)) - (equal (match-string 1 ref) "*")) 'fuzzy) - ((equal (match-string 1 ref) "id:") 'id) - (t 'custom-id)))) - (link (list 'link (list :path (match-string 2 ref)))) - (target (if (eq type 'fuzzy) - (org-export-resolve-fuzzy-link link info) - (org-export-resolve-id-link link info)))) + ;; property. This is done by building a minimal + ;; fake link and calling the appropriate resolve + ;; function, depending on the reference syntax. + (let ((target + (if (string-match "\\`\\(id:\\|#\\)" ref) + (org-export-resolve-id-link + `(link (:path ,(substring ref (match-end 0)))) + info) + (org-export-resolve-fuzzy-link + `(link (:path + ;; Look for headlines only. + ,(if (eq (string-to-char ref) ?*) ref + (concat "*" ref)))) + info)))) ;; Now use user-defined label provided in TARGET ;; headline, or fallback to standard one. (format "{%s}" (org-beamer--get-label target info))))))) |