From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: generating org headings from a source block Date: Mon, 09 Nov 2015 16:57:14 -0500 Message-ID: <87wptqg7k5.fsf@alphaville.usersys.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvuRc-0005pR-95 for emacs-orgmode@gnu.org; Mon, 09 Nov 2015 16:57:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvuRY-0001Qb-8T for emacs-orgmode@gnu.org; Mon, 09 Nov 2015 16:57:44 -0500 Received: from plane.gmane.org ([80.91.229.3]:44112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvuRY-0001QU-1e for emacs-orgmode@gnu.org; Mon, 09 Nov 2015 16:57:40 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZvuRO-0005Rr-TM for emacs-orgmode@gnu.org; Mon, 09 Nov 2015 22:57:30 +0100 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Nov 2015 22:57:30 +0100 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Nov 2015 22:57:30 +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 Matt Price writes: > I would like to be able to insert into an org-buffer the text extracted from a pdf file. PDF-Tools ( > https://github.com/politza/pdf-tools/) provides some excellent tools for doing this.  I've written > (well, msotly stolen) a defun that finds all my highlights and returns them in the form of an org > heading: > > (defun pdf-annot-export-as-org-heading (pdfpath) > ...) > ------------- > > I'm sure it is very clumsy, but it sort of works.  I would like to be able to call this function from a > source block: > > #+BEGIN_SRC elisp > (pdf-annot-export-as-org-heading "/home/matt/HackingHistory/readings/latour-pandoras-hope.pdf") > (pdf-annot-export-as-org-heading "/home/matt/HackingHistory/readings/historical-authority-hampton.pdf") > #+END_SRC > > The results are close to, but not precisely, what I want: > > #+RESULTS: > #+begin_example > ** historical-authority-hampton > >  ([[file:///home/matt/HackingHistory/readings/historical-authority-hampton.pdf] > [historical-authority-hampton]], 1) > > In the Tudor palace at Hampton Court, there is a.... > ... > #+end_example > > (a) I only get the last command, because I guess :results value only reports the final returned value. > But :results output gets me nothing.  What should I be doing? Have two source blocks? Or use :results output and output the string with (princ string)? > (b) the whole output is wrapped in an example block, which I don't want.  Can I do something to fix > this? Maybe :results value raw or :results value verbatim - untested. I can never remember the right combo off the top of my head. > also, (c): I'd rather set the level of the org heading based on context. Can I do that when I call from > a source block? Should I maybe be doing this some other way (e.g., jsut write an interactive function > and call it with M-x? But I like being able to assemble all the readings at one go, if possible.  > Pass the level as a parameter? -- Nick