From mboxrd@z Thu Jan 1 00:00:00 1970 From: thunk2@arcor.de (Thomas Plass) Subject: bug? 'org-ctrl-c-ctrl-c-final-hook not run Date: Sun, 17 Mar 2019 19:53:20 +0100 Message-ID: <23694.38816.468259.88211@AGAME7.local> Reply-To: Thomas Plass Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:59340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h5b6W-0005SQ-Fs for emacs-orgmode@gnu.org; Sun, 17 Mar 2019 15:05:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h5auf-0003fb-D2 for emacs-orgmode@gnu.org; Sun, 17 Mar 2019 14:53:42 -0400 Received: from mx009.vodafonemail.xion.oxcs.net ([153.92.174.39]:8790) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h5auZ-0003dM-9K for emacs-orgmode@gnu.org; Sun, 17 Mar 2019 14:53:33 -0400 Received: from vsmx002.vodafonemail.xion.oxcs.net (unknown [192.168.75.192]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTP id 24167D9B13F for ; Sun, 17 Mar 2019 18:53:26 +0000 (UTC) Received: from agame7.arcor.de (unknown [2.205.23.198]) by mta-6-out.mta.xion.oxcs.net (Postfix) with ESMTPA id D646A199C21 for ; Sun, 17 Mar 2019 18:53:23 +0000 (UTC) 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 This is a question for Org API users regarding 'org-ctrl-c-ctrl-c-final-hook and how it is to be understood. As per the docstring This can be used to add additional functionality to the C-c C-c key which executes context-dependent commands. This hook is run after any other test, ... should the 'message in the hook function below be executed=3F (add-hook 'org-ctrl-c-ctrl-c-final-hook (function (lambda () (message "org-ctrl-c-ctrl-c-final-hook called fro= m %s" (org-element-type (org-element-context))= ) t))) In fact, the hook isn't run at all, although it makes no assumptions whatsoever about its context. =20 Is this the way things are intended or is this behaviour a bug=3F What I'm trying to achieve is to post-process a standard Org element. However, my target element is already taken care of by one of the patterns in 'ctrl-c-ctrl-c, so the hook-caller is never reached. As a workaround, I take advantage of the rest of the above docstring ... while =E2=80=98org-ctrl-c-ctrl-c-hook=E2=80=99 is run before the= first test. and add to this hook a function that recursively calls 'org-ctrl-c-ctrl-c before it does its own work - which seems incredibly kludgy. Thanks for any feedback. Regards Thomas