From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: [BUG] Recently master branch commit breaks open file: link Date: Mon, 24 Feb 2020 23:09:13 +0800 Message-ID: <87imjwf2ee.fsf@gmail.com> References: <87o8tofq1b.fsf@gmail.com> <87lfosz8ai.fsf@gnu.org> <87lfosfave.fsf@gmail.com> <87zhd8mba7.fsf@gnu.org> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:56501) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6FN3-0004iD-Tt for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 10:10:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6FN2-0005sX-L1 for emacs-orgmode@gnu.org; Mon, 24 Feb 2020 10:10:09 -0500 In-reply-to: <87zhd8mba7.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 =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Bastien writes: > Hi Stardiviner, > > stardiviner writes: > >> So I did a git bisect. Found this bad commit caused this problem >> "afd3b04ec * bad ol: Extend open tooling in link parameters". > > This will work: > > #+begin_src org > [[file:~/Org/Tasks/Computer Todos.org::*=E5=8E=89=E5=AE=B3=E7=9A=84=E4=BA= =BA=E6=98=AF=E6=80=8E=E4=B9=88=E5=88=86=E6=9E=90=E9=97=AE=E9=A2=98=E7=9A=84= =EF=BC=9F][=E5=8E=89=E5=AE=B3=E7=9A=84=E4=BA=BA=E6=98=AF=E6=80=8E=E4=B9=88= =E5=88=86=E6=9E=90=E9=97=AE=E9=A2=98=E7=9A=84=EF=BC=9F]] > #+end_src > > org-store-link used to store the TODO keyword, which was a mistake. > > Nicolas fixed this recently, now org-store-link DTRT and C-c C-o on > stored links will work correctly. I see. Thanks for explanation. > > IMHO we may have several file links such as yours broken: Nicolas, > do you think the bugfix should be advertized in ORG-NEWS, along with > a helper function to fix file links (ie remove the TODO keyword and > priority cookies)? This broken update might need a little think. The new org-store-link does not include the TODO keyword. But what if user = add keyword before, then later does not use it in Org Mode config. This TODO ke= yword will caused broken. I personally used to have an advice on org-store-link to auto prompt user a "CUSTOM_ID" property with default value of headline string before (A month = ago I disabled it). #+begin_src emacs-lisp ;;; use :CUSTOM_ID: property for org headlines linking. (defun org-store-link-set-headline-custom-id (arg &optional interactive?) "Set property :CUSTOM_ID: for `org-store-link' on headline." (when (and (equal major-mode 'org-mode) ; handle case `org-store-link' no= t in org-mode file. (not (org-before-first-heading-p)) ; handle case point is in o= rg-mode buffer ahead of first headline. ;; (org-on-heading-p t) ; detect whether on a headline ;; (re-search-backward (concat "^\\(?:" outline-regexp "\\)") = nil t) ; detect whether under a headline? (not (region-active-p)) ; handle `org-drill' capture word case. (not (org-entry-get nil "CUSTOM_ID"))) (if (yes-or-no-p "Set property :CUSTOM_ID: ? ") (org-set-property "CUSTOM_ID" (read-from-minibuffer "Property :CUSTOM_ID: value: " (substring-no-properties (org-get-heading t = t))))))) (advice-add 'org-store-link :before #'org-store-link-set-headline-custom-id) #+end_src Is this solution will be better than headline link? Because it does not hav= e to consider TODO keyword, tags, end checkbox statistic etc. I know Org Mode ha= s a similar feature called ~org-id-link-to-org-use-id~. But I don't like meanin= gless ID personally. WDYT? =2D --=20 [ stardiviner ] I try to make every word tell the meaning what I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 =20=20=20=20=20=20 =2D----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl5T5xkUHG51bWJjaGls ZEBnbWFpbC5jb20ACgkQG13xyVromsO2jgf+NXmuhKM7CyjoN0qq+DuKppTvkv5S +iQUOOk5mGmRA8ayu6Veh1IJI5U/R61lXxYPJYzV6HIAuIG+Wz7c2UOUoJ4VJyf1 yp4sksY7d7/Uhak+hEjuQvsRWoT3F+80S251+kHcRkpyZZR41HLZVHlxLgGba6ub DP+8X4EmxO3bOByK5ixAuGUPCqASfT+njSOFK7CUGDPlFt58dTb78Z/hj0b5/pv0 er0e0mS3m6matGAlsmb0A8GM+9I/TxqBGdc6SySUqNrVhGZFXMBt7090jllqb6Cq SqGxUFUxI0G3vtZYp2kPPyaYCpb9OJlhKTVkd0PxCCWZrhuqKVyvx/OmNg=3D=3D =3DPJ1+ =2D----END PGP SIGNATURE-----