emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mikael Fornius <mfo@abc.se>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: David O'Toole <dto@gnu.org>, emacs-orgmode@gnu.org
Subject: Re: orgmode and physical fitness training
Date: Fri, 07 Nov 2008 18:54:04 +0100	[thread overview]
Message-ID: <87od0rl8w3.fsf@abc.se> (raw)
In-Reply-To: <87abccu71x.fsf@gmail.com> (Eric Schulte's message of "Thu, 06 Nov 2008 08:56:42 -0800")

[-- Attachment #1: Type: text/plain, Size: 1795 bytes --]

Thanks for org-collector.el, now I have read it and tried it out.

It is very nice to have the possibility to evaluate lisp expressions as
values, that is something missing in org-columns!

But it was only a few seconds faster than column-view and column dblock
and therefore not fast enough for my slow computer ;-). I timed it to 62
seconds to insert exercise data table for one year (83 headings) with 4
columns and no calculations.

* ELP Profiling Results 

|---------------------------+-------+--------------+--------------|
| org-dblock-write:propview |     1 |    62.158395 |    62.158395 |
| org-propview-collect      |     1 |    60.578724 |    60.578724 |
| org-map-entries           |     1 |    60.519551 |    60.519551 |
| org-scan-tags             |     1 |    60.267157 |    60.267157 |
| org-entry-properties      |    94 | 57.451918999 | 0.6111906276 |
| org-get-tags-at           |    94 | 54.069399999 | 0.5752063829 |
| org-up-heading-all        |   365 | 53.664638999 | 0.1470264082 |
| outline-up-heading        |   365 |    53.647627 |    0.1469798 |
| outline-previous-heading  | 29751 | 39.418412999 | 0.0013249441 |
| org-outline-level         | 30306 | 6.0971540000 | 0.0002011863 |
| org-split-string          |   555 | 2.0629750000 | 0.0037170720 |
|---------------------------+-------+--------------+--------------|

It is clear from above who is the time thief.

* Comment

It did not work at first because sometimes I have properties without
values, they then gets the empty string assigned, "".

I had to adjust function org-read-prop because in my emacs (GNU Emacs
23.0.60.5):

(stringp "")           -> t

and

(string-to-number "")  -> 0
(string-to-number "0") -> 0

and then at line 34 it tries to take substring out of "".

Attaches diff if interested :-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-collector.diff --]
[-- Type: text/x-patch, Size: 1441 bytes --]

*** /home/mfo/org/org-collector.el~	2008-11-07 17:19:12.000000000 +0100
--- /home/mfo/org/org-collector.el	2008-11-07 18:14:23.000000000 +0100
***************
*** 27,45 ****
  Otherwise if prop looks like a list (meaning it starts with a
  '(') then read it as lisp, otherwise return it unmodified as a
  string."
!   (if (stringp prop)
!       (if prop
! 	  (let ((out (string-to-number prop)))
! 	    (if (equal out 0)
! 		(if (or (equal "(" (substring prop 0 1)) (equal "'" (substring prop 0 1)))
! 		    (read prop)
! 		    (if (string-match "^\\(+0\\|-0\\|0\\)$" prop)
! 			0
! 			(progn (set-text-properties 0 (length prop) nil prop)
! 			       prop)))
! 		out))
! 	  nil)
!       prop))
  
  (defun org-dblock-write:propview (params)
    "collect the column specification from the #+cols line
--- 27,43 ----
  Otherwise if prop looks like a list (meaning it starts with a
  '(') then read it as lisp, otherwise return it unmodified as a
  string."
!   (if (and (stringp prop) (not (equal prop "")))
!       (let ((out (string-to-number prop)))
! 	(if (equal out 0)
! 	    (if (or (equal "(" (substring prop 0 1)) (equal "'" (substring prop 0 1)))
! 		(read prop)
! 	      (if (string-match "^\\(+0\\|-0\\|0\\)$" prop)
! 		  0
! 		(progn (set-text-properties 0 (length prop) nil prop)
! 		       prop)))
! 	  out))
!     prop))
  
  (defun org-dblock-write:propview (params)
    "collect the column specification from the #+cols line

[-- Attachment #3: Type: text/plain, Size: 17 bytes --]


/Mikael Fornius

[-- Attachment #4: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  parent reply	other threads:[~2008-11-07 17:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-14 14:28 orgmode and physical fitness training David O'Toole
2008-10-14 16:53 ` Nick Dokos
2008-11-05 19:45 ` Mikael Fornius
2008-11-06 16:56   ` Eric Schulte
2008-11-06 21:33     ` Mikael Fornius
2008-11-07 17:54     ` Mikael Fornius [this message]
2008-11-07 18:02       ` Eric Schulte
2008-11-07 20:25         ` Mikael Fornius
2008-11-07 21:25           ` Eric Schulte
2008-11-10  9:29             ` Mikael Fornius
2008-11-07 20:52     ` Carsten Dominik
2008-11-07 21:52       ` Mikael Fornius
  -- strict thread matches above, loose matches on Subject: below --
2008-10-17 22:36 David O'Toole

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87od0rl8w3.fsf@abc.se \
    --to=mfo@abc.se \
    --cc=dto@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).