[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Document backward-incompatible change in ORG-NEWS? (was: [BUG] Recen
From: |
Samuel Wales |
Subject: |
Re: Document backward-incompatible change in ORG-NEWS? (was: [BUG] Recently master branch commit breaks open file: link) |
Date: |
Mon, 24 Feb 2020 14:31:46 -0700 |
no opinion on anything but a suggestion.
i really like these little scripts that update your org files so they
are compatible with new org versions.
perhaps one can give them an argument or something to work on all
agenda files, or a list of files, or somethign liek that?
On 2/24/20, Bastien <address@hidden> wrote:
> Hi Nicolas,
>
> it seems that org-store-link stored links to headlines as
>
> [[*TODO headline][headline]]
>
> keeping the TODO keyword, if any.
>
> This is fixed in master but I won't if we should document this bug
> fix in ORG-NEWS (or if org-store-link was just momentarily broken.)
>
> If org-store-link was storing the todo keyword, perhaps we can add
> a command similar to this one to help users fix broken links:
>
> (defun org-fix-links ()
> "Fix ill-formatted internal links.
> E.g. replace [[*TODO Headline][headline]] by [[*Headline][headline]].
> Go through the buffer and ask for the replacement."
> (interactive)
> (visible-mode 1)
> (save-excursion
> (goto-char (point-min))
> (while (re-search-forward org-link-any-re nil t)
> (let* ((raw (match-string 2))
> (desc (match-string 3))
> fix new)
> (when (and raw desc
> (string-match-p
> (concat "^\*" (regexp-opt org-todo-keywords-1)
> "\\s-+\\(.+\\)$")
> raw))
> (setq new (replace-regexp-in-string
> (concat (regexp-opt org-todo-keywords-1) "\\s-+")
> "" raw))
> (set-text-properties 0 (length new) nil new)
> (setq fix (completing-read "Replace link at point by: "
> nil nil nil new))
> (replace-match (format "[[%s][%s]]" fix desc))))))
> (visible-mode -1))
>
> WDYT?
>
> --
> Bastien
>
>
--
The Kafka Pandemic
What is misopathy?
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
- [BUG] Recently master branch commit breaks open file: link, stardiviner, 2020/02/24
- Re: [BUG] Recently master branch commit breaks open file: link, Bastien, 2020/02/24
- Re: [BUG] Recently master branch commit breaks open file: link, stardiviner, 2020/02/24
- Re: [BUG] Recently master branch commit breaks open file: link, Bastien, 2020/02/24
- Re: [BUG] Recently master branch commit breaks open file: link, stardiviner, 2020/02/24
- Re: [BUG] Recently master branch commit breaks open file: link, Bastien, 2020/02/24
- Document backward-incompatible change in ORG-NEWS? (was: [BUG] Recently master branch commit breaks open file: link), Bastien, 2020/02/24
- Re: Document backward-incompatible change in ORG-NEWS? (was: [BUG] Recently master branch commit breaks open file: link),
Samuel Wales <=
- Re: Document backward-incompatible change in ORG-NEWS? (was: [BUG] Recently master branch commit breaks open file: link), stardiviner, 2020/02/25
- Re: Document backward-incompatible change in ORG-NEWS?, Nicolas Goaziou, 2020/02/25
- Re: Document backward-incompatible change in ORG-NEWS?, Bastien, 2020/02/25