emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: a@xkqr.org (Christoffer Stjernlöf)
To: emacs-orgmode@gnu.org
Subject: [PATCH] ox.el: Fix extra character deleted in org-export--update-included-link
Date: Sun, 03 Nov 2019 14:14:35 +0100	[thread overview]
Message-ID: <86tv7lm79g.fsf@xkqr.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]

* ox.el (org-export--update-included-link): Fix bug.
(org-export--update-included-link): Delete region only until one less
than (org-element-property :end link).

The old behaviour meant that e.g. the following headline could fail to
parse correctly after inclusion:

[[file:something.org][Title]] :tags:following:immediately

because it would be converted to

[[file:path/to/something.org][Title]]:tags:following:immediately
where the whitespace was necessary for Org to understand that the tags
indeed were tags.

TINYCHANGE
---
 lisp/ox.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index 5b4134ecc..6c1d1b455 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -3468,7 +3468,7 @@ Move point after the link."
                            (org-element-property :contents-end link)))))
        (org-element-put-property new-link :path new-path)
        (delete-region (org-element-property :begin link)
-                      (org-element-property :end link))
+                      (1- (org-element-property :end link)))
        (insert (org-element-link-interpreter new-link contents))))))
 
 (defun org-export--prepare-file-contents
-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

             reply	other threads:[~2019-11-03 13:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-03 13:14 Christoffer Stjernlöf [this message]
2020-02-11 15:55 ` [PATCH] ox.el: Fix extra character deleted in org-export--update-included-link Bastien
2020-02-11 18:15   ` Nicolas Goaziou
2020-02-13  8:12     ` Bastien
2020-02-13 10:25       ` Nicolas Goaziou
2020-02-13 11:01         ` Bastien
2020-02-13 19:07           ` Adam Porter

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=86tv7lm79g.fsf@xkqr.org \
    --to=a@xkqr.org \
    --cc=emacs-orgmode@gnu.org \
    /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).