From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremie Juste Subject: How to obtain the headline level from org-element-at-point Date: Sat, 8 Apr 2017 16:17:51 +0200 (CEST) Message-ID: <87fuhj2dbn.fsf@u-cergy.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwrBf-0000GW-Hq for emacs-orgmode@gnu.org; Sat, 08 Apr 2017 10:18:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwrBb-0004v7-FO for emacs-orgmode@gnu.org; Sat, 08 Apr 2017 10:17:59 -0400 Received: from snowwhite.contactoffice.com ([212.3.242.89]:33421) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cwrBb-0004uY-9Q for emacs-orgmode@gnu.org; Sat, 08 Apr 2017 10:17:55 -0400 Received: from univcergy2.co-bxl (univcergy2.co-bxl [10.2.0.13]) by snowwhite.contactoffice.com (Postfix) with ESMTP id 7D362811 for ; Sat, 8 Apr 2017 16:17:53 +0200 (CEST) Received: from freegnu ([194.167.235.219]) by univcergy.contactoffice.com (envelope-from ) with ESMTPSA for ; Sat, 8 Apr 2017 16:17:50 +0200 (CEST) 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 Hello, Interleave-mode https://github.com/rudolfochrist/interleave, is a very convenient tool for writing notes in associated with pdf. It uses org-mode for this purpose. I recently noticed that in the case where I want to write notes for multiple pdf in a singlie org file, I have to use the level 1 headline * Notes for CS103 :PROPERTIES: :INTERLEAVE_PDF: cs103.pdf :END: I would like to have the possibility of using any headline level for this purpose but my org-fu is weak. I think it boils down to this function in interleave-mode mode where (org-element-type headline) checks only for level 1 headline. #+BEGIN_SRC elisp (defun interleave--headline-pdf-path (buffer) "Return the INTERLEAVE_PDF property of the current headline in BUFFER." (with-current-buffer buffer (save-excursion (let ((headline (org-element-at-point))) (when (and (equal (org-element-type headline) 'headline) (org-entry-get nil interleave--pdf-prop)) (setq interleave-multi-pdf-notes-file t) (org-entry-get nil interleave--pdf-prop)))))) #+END_SRC Can anyone see a way around it ? Best regards, Jeremie