From mboxrd@z Thu Jan 1 00:00:00 1970 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 Message-ID: References: <87o8tofq1b.fsf@gmail.com> <87lfosz8ai.fsf@gnu.org> <87lfosfave.fsf@gmail.com> <87zhd8mba7.fsf@gnu.org> <87imjwf2ee.fsf@gmail.com> <874kvf67wd.fsf_-_@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:59112) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6LKX-0000fa-33 for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 16:31:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6LKV-00046F-UI for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 16:31:56 -0500 In-Reply-To: <874kvf67wd.fsf_-_@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Bastien Cc: Org Mode , mail 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 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