From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: Feedback on changes to org-id Date: Wed, 21 Sep 2016 23:28:55 +0100 Message-ID: <8760porioo.fsf@gmail.com> References: <87fuphzv70.fsf@gmail.com> <87oa45z8y2.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmq1k-0001j4-6w for emacs-orgmode@gnu.org; Wed, 21 Sep 2016 18:30:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmq1e-0000k0-Tz for emacs-orgmode@gnu.org; Wed, 21 Sep 2016 18:30:03 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:34884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmq1e-0000jR-Nw for emacs-orgmode@gnu.org; Wed, 21 Sep 2016 18:29:58 -0400 Received: by mail-wm0-f46.google.com with SMTP id l132so294393191wmf.0 for ; Wed, 21 Sep 2016 15:29:58 -0700 (PDT) In-Reply-To: <87oa45z8y2.fsf@saiph.selenimh> 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.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou , Org-mode Hi Nicolas, Thanks for your feedback. I am almost done incorporating it into the patch. I have only two further questions. 2016ko irailak 3an, Nicolas Goaziou-ek idatzi zuen: [...] >> 4. A similar issue arises for org-id-find. I would like it to always >> return a marker, rather than having an argument switch between a >> marker and a cons of filename and position. (There are functions >> which return the filename or position individually, so returning both >> as a cons is useless from an API point of view). There=E2=80=99s no goo= d way >> to detect the old calling convention, however, so I think I have to >> introduce a new name. (My draft patch is written instead with hard >> breakage, but stability of API is important so I will change >> that...) >=20 > Please don't make that change. A marker is pointless if the file is not > currently associated to any buffer. In that case (file-name . postition) > cons cell is a valuable return value. The API has the following two functions already: - org-id-find-file-for: id -> file-name - org-id-find-id-in-file: id file -> position Imagine I add to this API org-id-find-marker: id -> marker. Then I think we can deprecate (and eventually delete) org-id-find, since all its uses can be replaced by some combination of the other 3 functions. (We could also keep it as a convenience function wrapping the other 3, but it hardly seems worth it: the marker case just adds the overhead of another funcall, whereas a significant proportion of the non-marker calls in the codebase actually only care about the file name, so it is a waste of effort to calculate the buffer position only to throw it away.) WDYT? >=20 > You can also remove `org-id-track-globally'. "org-id.el" is useless if > it is set to nil anyway, since CUSTOM_ID does a better job in this > case. I think this would imply writing the ID database to =E2=80=98org-id-locatio= ns-file=E2=80=99 under certain circumstances without asking/letting the user approve this action. Is that OK? (I am not bothered by it, FWIW). If it=E2=80=99s not acceptable, perhaps this variable should be replaced by= a new defcustom =E2=80=98org-id-write-database=E2=80=99 which would control o= nly the writing of the DB to disk (but unlike the existing implementation would not turn off the ID tracking code paths within the emacs session). TIA, --=20 Aaron Ecay