From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: Oas: a small addon to Org Mode to automatically close tasks with statistics Date: Sun, 01 Sep 2019 00:41:40 -0500 Message-ID: <8736hglgiz.fsf@alphapapa.net> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:37726) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4Ica-0003aK-M5 for emacs-orgmode@gnu.org; Sun, 01 Sep 2019 01:41:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4IcZ-0003cm-Pz for emacs-orgmode@gnu.org; Sun, 01 Sep 2019 01:41:52 -0400 Received: from 195-159-176-226.customer.powertech.no ([195.159.176.226]:46224 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i4IcZ-0003be-K1 for emacs-orgmode@gnu.org; Sun, 01 Sep 2019 01:41:51 -0400 Received: from list by blaine.gmane.org with local (Exim 4.89) (envelope-from ) id 1i4IcU-000JMW-1V for emacs-orgmode@gnu.org; Sun, 01 Sep 2019 07:41:46 +0200 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: emacs-orgmode@gnu.org Hi Andrea, This is a nice idea. Here are a few notes: 1. You should implement it as a minor mode, and enable/disable the hooks there. 2. I would generally recommend using org-element to help with parsing. It will make your code much cleaner and easier to understand. Much of the searching code you currently have is unidiomatic and hard to follow, and org-element will help with that. 3. Avoid using hard-coded to-do keywords, because users may be using custom ones. Instead, use the variables and functions provided by Org that are related to to-do keywords. Use tools like apropos, Helm, or Counsel, or the Org source code, to help discover them.