From: Matt Price <moptop99@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Showing Property in headline; generating table from properties; exporting table to CSV
Date: Thu, 6 Aug 2015 12:26:22 -0400 [thread overview]
Message-ID: <CAN_Dec9TkVMd=X6tJDGs2AFNFy4BRHEgOb5xAexz9rFUb7kkng@mail.gmail.com> (raw)
In-Reply-To: <m2lhdoh5pv.fsf@andrew.cmu.edu>
[-- Attachment #1: Type: text/plain, Size: 2271 bytes --]
On Thu, Aug 6, 2015 at 10:06 AM, John Kitchin <jkitchin@andrew.cmu.edu>
wrote:
> You could do something with overlays like this:
>
> #+BEGIN_SRC emacs-lisp
> (require 'ov)
>
> (org-map-entries
> (lambda ()
> (when (org-entry-get (point) "GRADE")
> (setq ov (make-overlay (+ 0 (line-end-position))
> (+ 1 (line-end-position))))
> (overlay-put
> ov 'display
> (format " grade: %s\n" (org-entry-get (point) "GRADE"))))))
> #+END_SRC
>
> #+RESULTS:
> | nil | grade: 10\n | grade: 20\n | grade: 30\n | nil | grade: 40\n |
> grade: 50\n | grade: 60\n |
>
> #+BEGIN_SRC emacs-lisp
> (ov-clear)
> #+END_SRC
>
>
>
The final \n in the overlay is a little irritating when the buffer is
folded, as it adds an extra line between the headlines. I changed it this,
which doesn't seem perfect but so far works for me:
#+BEGIN_SRC emacs-lisp :results output
(require 'ov)
(org-map-entries
(lambda ()
(when (org-entry-get (point) "GRADE")
(setq ov (make-overlay (- (line-end-position) 1)
(+ 0 (line-end-position))))
(setq character (buffer-substring (- (line-end-position) 1)
(line-end-position)))
(overlay-put
ov 'display
(format "%s GRADE: %s" character (org-entry-get (point)
"GRADE"))))))
#+END_SRC
you need to run this to refresh the grades on the headlines when they
> change. The TODO state is a good indication of which ones are done,
> although they do not show the grades.
>
so I should probably make this into a function which can be called by the
function that writes grades...
>
>
> Eric S Fraga writes:
>
> > On Thursday, 6 Aug 2015 at 07:24, Matt Price wrote:
> >
> > [...]
> >
> >> - I currently store my grades as properties of level-2 headlines.
> However,
> >> I would really like to be able to see the grades when the headline is
> >> folded, so I can have a quick visual sense of how many papers I've
> marked,
> >
> > I would like something like this as well. The nearest I have found is
> > to use column view.
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
[-- Attachment #2: Type: text/html, Size: 3500 bytes --]
next prev parent reply other threads:[~2015-08-06 16:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-06 11:24 Showing Property in headline; generating table from properties; exporting table to CSV Matt Price
2015-08-06 11:28 ` Eric S Fraga
2015-08-06 11:34 ` Nicolas Goaziou
2015-08-06 12:17 ` Eric S Fraga
2015-08-06 12:24 ` Matt Price
2015-08-06 13:44 ` Nicolas Goaziou
2015-08-06 13:13 ` John Kitchin
2015-08-06 13:29 ` Matt Price
2015-08-06 14:19 ` John Kitchin
2015-08-06 16:39 ` Matt Price
2015-08-06 16:47 ` John Kitchin
2015-08-07 16:41 ` Pip Cet
2015-08-10 14:41 ` Eric S Fraga
2015-08-07 1:43 ` Richard Lawrence
2015-08-06 14:06 ` John Kitchin
2015-08-06 16:26 ` Matt Price [this message]
2015-08-06 13:52 ` John Kitchin
2015-08-06 17:27 ` Matt Price
2015-08-06 18:14 ` John Kitchin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAN_Dec9TkVMd=X6tJDGs2AFNFy4BRHEgOb5xAexz9rFUb7kkng@mail.gmail.com' \
--to=moptop99@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.