diff --git a/contrib/lisp/org-e-groff.el b/contrib/lisp/org-e-groff.el index c976b5d76..50b823d7b 100644 --- a/contrib/lisp/org-e-groff.el +++ b/contrib/lisp/org-e-groff.el @@ -38,9 +38,9 @@ ;;; Code: (eval-when-compile (require 'cl)) - (require 'org-export) + ;;; Define Back-End @@ -1242,14 +1242,14 @@ CONTENTS is nil. INFO is a plist holding contextual information." ((string= key "GROFF") value) (t nil)))) -;;; Groff Environment +;;; LaTeX Environment -(defun org-e-groff-groff-environment (groff-environment contents info) - "Transcode a GROFF-ENVIRONMENT element from Org to Groff. +(defun org-e-groff-latex-environment (latex-environment contents info) + "Transcode a LATEX-ENVIRONMENT element from Org to Groff. CONTENTS is nil. INFO is a plist holding contextual information." - (let ((label (org-element-property :name groff-environment)) + (let ((label (org-element-property :name latex-environment)) (value (org-remove-indentation - (org-element-property :value groff-environment)))) + (org-element-property :value latex-environment)))) (if (not (org-string-nw-p label)) value ;; Environment is labelled: label must be within the environment ;; (otherwise, a reference pointing to that element will count @@ -1261,12 +1261,12 @@ CONTENTS is nil. INFO is a plist holding contextual information." (insert (format "%s\n" label)) (buffer-string))))) -;;; Groff Fragment +;;; LaTeX Fragment -(defun org-e-groff-groff-fragment (groff-fragment contents info) - "Transcode a GROFF-FRAGMENT object from Org to Groff. +(defun org-e-groff-latex-fragment (latex-fragment contents info) + "Transcode a LATEX-FRAGMENT object from Org to Groff. CONTENTS is nil. INFO is a plist holding contextual information." - (org-element-property :value groff-fragment)) + (org-element-property :value latex-fragment)) ;;; Line Break diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 79e5a5d3d..49ab60c4b 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1486,7 +1486,7 @@ The template may still contain \"%?\" for cursor positioning." ;; Interactive template entries (goto-char (point-min)) (while (and (re-search-forward "%^\\({\\([^}]*\\)}\\)?\\([gGtTuUCLp]\\)?" nil t) - (not (get-text-property (point) 'org-protected))) + (not (get-text-property (1- (point)) 'org-protected))) (unless (org-capture-escaped-%) (setq char (if (match-end 3) (match-string-no-properties 3)) prompt (if (match-end 2) (match-string-no-properties 2))) diff --git a/lisp/org.el b/lisp/org.el index f30ba3ff8..fe63b62f1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9418,6 +9418,7 @@ If the DEFAULT-DESCRIPTION parameter is non-nil, this value will be used as the default description." (interactive "P") (let* ((wcf (current-window-configuration)) + (origbuf (current-buffer)) (region (if (org-region-active-p) (buffer-substring (region-beginning) (region-end)))) (remove (and region (list (region-beginning) (region-end)))) @@ -9493,7 +9494,8 @@ Use TAB to complete link prefixes, then RET for type-specific completion support (and (equal ":" (substring link -1)) (member (substring link 0 -1) all-prefixes) (setq link (substring link 0 -1)))) - (setq link (org-link-try-special-completion link)))) + (setq link (with-current-buffer origbuf + (org-link-try-special-completion link))))) (set-window-configuration wcf) (kill-buffer "*Org Links*")) (setq entry (assoc link org-stored-links))