From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Document backward-incompatible change in ORG-NEWS? (was: [BUG] Recently master branch commit breaks open file: link) Date: Mon, 24 Feb 2020 21:35:14 +0100 Message-ID: <874kvf67wd.fsf_-_@gnu.org> References: <87o8tofq1b.fsf@gmail.com> <87lfosz8ai.fsf@gnu.org> <87lfosfave.fsf@gmail.com> <87zhd8mba7.fsf@gnu.org> <87imjwf2ee.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:46641) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6KRl-00064m-Ht for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 15:35:22 -0500 In-Reply-To: <87imjwf2ee.fsf@gmail.com> (stardiviner's message of "Mon, 24 Feb 2020 23:09:13 +0800") 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: mail Cc: Org Mode 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