From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: IDs w/ human friendly component Date: Sun, 2 Feb 2014 12:47:49 -0500 Message-ID: References: <877g9e80yo.wl%n142857@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec51f8e896dcbe504f17001af Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WA1DW-0001Gq-7e for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 12:55:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WA195-00032L-09 for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 12:52:26 -0500 Received: from mail-pd0-x235.google.com ([2607:f8b0:400e:c02::235]:64313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WA194-00032H-KE for emacs-orgmode@gnu.org; Sun, 02 Feb 2014 12:47:50 -0500 Received: by mail-pd0-f181.google.com with SMTP id y10so6038978pdj.40 for ; Sun, 02 Feb 2014 09:47:49 -0800 (PST) In-Reply-To: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ken Mankoff Cc: Org-mode --bcaec51f8e896dcbe504f17001af Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable you can put some kind of prefix on like this: * intro to a section :PROPERTIES: :ID: intro-to-a:0f141497-f3ad-488a-b8c9-0a5c3ea53ba0 :END: #+BEGIN_SRC emacs-lisp (defun get-my-id () "create an org-id with prefix based on headline" (let ((s)) (setq s (replace-regexp-in-string " " "-" (nth 4 (org-heading-components)))) (org-id-get (point) t (substring s 0 (if (> (length s) 10) 10 (length s)))))) (get-my-id) #+END_SRC #+RESULTS: : intro-to-a:0f141497-f3ad-488a-b8c9-0a5c3ea53ba0 John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Sun, Feb 2, 2014 at 12:10 PM, Ken Mankoff wrote: > > Yes that is a fairly simple and obvious solution. > > -k. > > On Sun, 2 Feb 2014, Daniel Clemente wrote: > > >> Have you tried changing the strange ID to the ID that you want? (e.g. >> 7f3b531b-f1c9-41aa-854b-37235500495f =E2=86=92 introduction). They shoul= d be >> unique. I use my manually written IDs for some important headers which I >> want to detect from outside org. In addition there's CUSTOM_ID, but I th= ink >> that's the id=3D"=E2=80=A6" you want in HTML exports. >> >> >> El Sat, 1 Feb 2014 14:39:15 -0500 (EST) Ken Mankoff va escriure: >> >>> >>> >>> I've never cared that the ID field was not human friendly. >>> >>> But I've just learned about the Estimate Table where you can see your >>> estimates >>> and actual clock time to complete tasks. If you want to see the >>> estimates for >>> the current tree, you need to know the ID, which is not human friendly. >>> >>> It seems like with IDO mode, the first few characters or words of the >>> title, >>> stripped of whitespace, could be pre- or ap- pended onto the ID, and >>> then it >>> would be easy to select IDs. If this were how IDs were created, would >>> this break >>> some other features? Do others see this as a good or bad thing? Or is >>> there some >>> other way to tell the Estimate Table to work on the local tree. >>> >>> Cheers, >>> >>> -k. >>> >>> >> > > --bcaec51f8e896dcbe504f17001af Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
you can put some kind of prefix on like this:

* int= ro to a section
=C2=A0 :PROPERTIES:
=C2=A0 :ID:=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 intro-to-a:0f141497-f3ad-488a-b8c9-0a5c3ea53ba0
=C2=A0 := END:

#+BEGIN_SRC emacs-lisp
(defun get-my-id ()
=C2=A0 "create an org-id with prefix based on headline"
=C2=A0= (let ((s))
=C2=A0=C2=A0=C2=A0 (setq s
=C2=A0=C2=A0=C2=A0 =C2=A0 (re= place-regexp-in-string
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 " " &q= uot;-"
=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 (nth 4 (org-heading-componen= ts))))
=C2=A0=C2=A0=C2=A0 (org-id-get
=C2=A0=C2=A0=C2=A0=C2=A0 (point)
=C2=A0=C2=A0=C2=A0=C2=A0 t
=C2=A0= =C2=A0=C2=A0=C2=A0 (substring
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 s
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 0
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (> = (length s) 10) 10
=C2=A0=C2=A0=C2=A0 (length s))))))

(get-my-id)<= br>#+END_SRC

#+RESULTS:
: intro-to-a:0f141497-f3ad-488a-b8c9-0a5c= 3ea53ba0



John
-----------------------------------
John Kitchin
Associate Professor=
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Me= llon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

<= /div>

On Sun, Feb 2, 2014 at 12:10 PM, Ken Man= koff <mankoff@gmail.com> wrote:

Yes that is a fairly simple and obvious solution.

=C2=A0 -k.

On Sun, 2 Feb 2014, Daniel Clemente wrote:


Have you tried changing the strange ID to the ID that you want? (e.g. 7f3b5= 31b-f1c9-41aa-854b-37235500495f =E2=86=92 introduction). They should= be unique. I use my manually written IDs for some important headers which = I want to detect from outside org. In addition there's CUSTOM_ID, but I= think that's the id=3D"=E2=80=A6" you want in HTML exports.<= br>

El Sat, 1 Feb 2014 14:39:15 -0500 (EST) Ken Mankoff va escriure:


I've never cared that the ID field was not human friendly.

But I've just learned about the Estimate Table where you can see your e= stimates
and actual clock time to complete tasks. If you want to see the estimates f= or
the current tree, you need to know the ID, which is not human friendly.

It seems like with IDO mode, the first few characters or words of the title= ,
stripped of whitespace, could be pre- or ap- pended onto the ID, and then i= t
would be easy to select IDs. If this were how IDs were created, would this = break
some other features? Do others see this as a good or bad thing? Or is there= some
other way to tell the Estimate Table to work on the local tree.

Cheers,

=C2=A0 -k.





--bcaec51f8e896dcbe504f17001af--