From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: Automatic mtime and ctime on all or select group of trees? Date: Fri, 01 Sep 2017 20:09:40 -0500 Message-ID: <8760d1j48b.fsf@alphapapa.net> References: <87r2vrvols.fsf@pinto.chemeng.ucl.ac.uk> <87inh24u7m.fsf@pinto.chemeng.ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnwwd-0000CN-1F for emacs-orgmode@gnu.org; Fri, 01 Sep 2017 21:09:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnwwY-0004jx-G0 for emacs-orgmode@gnu.org; Fri, 01 Sep 2017 21:09:55 -0400 Received: from [195.159.176.226] (port=41457 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dnwwY-0004je-8b for emacs-orgmode@gnu.org; Fri, 01 Sep 2017 21:09:50 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dnwwP-0004Ue-6e for emacs-orgmode@gnu.org; Sat, 02 Sep 2017 03:09:41 +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 As Eric mentioned, a heading can be created by simply typing, so making that detect whether a new heading is created is possible, but I guess it would require some ugly hacks. Maybe if you could hook into the font-lock code, but like I said...ugly hacks. :) However, it would be easy to add advice to the heading-creating commands, so if you always use those to create headings, that would do it for you. For modification time, that would be more challenging. I guess you could use post-command-hook and update an mtime property in the current node with every keystroke. Another way might be to add a function to the before-save-hook that would diff the buffer with the file and update the mtime in each node that has been changed.