From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Temporally/occasionally turn off hooks? Date: Tue, 29 Jan 2013 13:05:37 +0100 Message-ID: <87r4l42nzi.fsf@googlemail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U09wr-0003yf-96 for emacs-orgmode@gnu.org; Tue, 29 Jan 2013 07:06:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U09wp-00084m-GP for emacs-orgmode@gnu.org; Tue, 29 Jan 2013 07:05:56 -0500 Received: from plane.gmane.org ([80.91.229.3]:43859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U09wp-00084h-9Y for emacs-orgmode@gnu.org; Tue, 29 Jan 2013 07:05:55 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U09x4-0002QI-Va for emacs-orgmode@gnu.org; Tue, 29 Jan 2013 13:06:10 +0100 Received: from g231226168.adsl.alicedsl.de ([92.231.226.168]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jan 2013 13:06:10 +0100 Received: from tjolitz by g231226168.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jan 2013 13:06:10 +0100 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: emacs-orgmode@gnu.org Hi List, I copied this from Bernt Hansens set-up: ,----------------------------------------------------------- | org-insert-heading-hook is a variable defined in `org.el'. | Its value is (bh/insert-heading-inactive-timestamp) | Original value was nil `----------------------------------------------------------- and its often quite usefull to have a timestamp for each newly inserted todo-item (e.g.). But in other cases, like writing documents or building Org files programmatically, there is no need for heading-creation-timestamps, so I would like to turn the timestamp insertion off. I could probably use ,----------------------------------------- | (remove-hook | 'org-insert-heading-hook | 'bh/insert-heading-inactive-timestamp | ’LOCAL) `----------------------------------------- to deactivate the behaviour locally, since: ,------------------------------------------------------------------------ | remove-hook is a compiled Lisp function in `subr.el'. | | (remove-hook HOOK FUNCTION &optional LOCAL) | | Remove from the value of HOOK the function FUNCTION. | HOOK should be a symbol, and FUNCTION may be any valid function. If | FUNCTION isn't the value of HOOK, or, if FUNCTION doesn't appear in the | list of hooks to run in HOOK, then nothing is done. See `add-hook'. | | The optional third argument, LOCAL, if non-nil, says to modify | the hook's buffer-local value rather than its default value. `------------------------------------------------------------------------ but this is of course not a very generic solution for a program I want to share with others, their 'org-insert-heading-hook' might look different. Is there a way to inhibit a hook in a program, or to run it only conditionally in certain situations? -- cheers, Thorsten