Re: [Orgmode] Scaling org-mode

2009-09-13 Thread Nick Dokos
Dave Täht d...@teklibre.org wrote:

 ...
 so thought 2) would be to have it only attempt to construct background
 agendas when the system is otherwise idle for a few minutes. I don't
 know how to do that, I figure wrapping this bit with something that
 could detect idleness instead of just running arbitrarily would be good.
 
   (run-at-time nil 3600 'org-agenda-to-appt)
 
 don't know how to detect idleness.
 

[Apologies if this is off-topic - I haven't read your message carefully,
as I was catching up on email between jobs.]

Not sure whether it'll work any better, but there is run-with-idle-timer.
C-h f run-with-idle-timer RET says:

,
| run-with-idle-timer is an interactive compiled Lisp function in
| `timer.el'.
| 
| (run-with-idle-timer SECS REPEAT FUNCTION rest ARGS)
| 
| Perform an action the next time Emacs is idle for SECS seconds.
| The action is to call FUNCTION with arguments ARGS.
| SECS may be an integer, a floating point number, or the internal
| time format (HIGH LOW USECS) returned by, e.g., `current-idle-time'.
| If Emacs is currently idle, and has been idle for N seconds (N  SECS),
| then it will call FUNCTION in SECS - N seconds from now.
| 
| If REPEAT is non-nil, do the action each time Emacs has been idle for
| exactly SECS seconds (that is, only once for each time Emacs becomes idle).
| 
| This function returns a timer object which you can use in `cancel-timer'.
`


HTH,
Nick


___
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


[Orgmode] Scaling org-mode

2009-09-12 Thread Dave Täht
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


I have really been enjoying importing my life into org-mode, which I've
been doing for about two months now. 

But.

It currently visits about 100 files and 10k of text to construct the
agenda. It's starting to get kind of slow and interrupt my workflow,
particularly the background process that scans them. 

While the system is effectively frozen, my message buffer fills up with
messages about setting the flyspell dictionary to en, etc. This is quite
annoying with text to speech turned on. I ended up just having appts
spoken.

;; quick hack for saying announcements, need more thought turned into it.

(when window-system
  (defun dtaht/say-stuff (id msg optional delay vattrib hattrib font) 
Speak a message msg. Currently requires say.el
(unless vattrib (setq vattrib top))
(unless hattrib (setq hattrib right))
(unless delay (setq delay 5000))
(unless font (setq font Arial 12))
(save-window-excursion
  (say (dtaht/ssml-escape msg)


;; my personal fav, run every 15 minutes

(defun nag-timer () Nag me when there isn't a clock running  
  (interactive)
  (unless (marker-buffer org-clock-marker)
(say Are you mating now?)))

It gets a bit chunky even when all the org files are in memory (and I
have gobs of memory).

Solution #1) cut the number of files down - is a good one. I probably
can cut those files easily in half right now. The problem is that I have
about 600 more files to import (scenes from a book), and I really like
the idea of being able to know what my characters are doing in 2023, and
separate files was kind of useful at one point.

That's a couple hundred k of text (what I have in there now is mostly
normal items for managing my personal and professional life)

Solution #2) Make org-mode faster. I am compiling and installing
org-mode from git at the moment. So it's compiled. I have a lot of hooks
installed for text buffers - At minimum, auto-capitalize, flyspell, yas,
wrap, and abbrev. Most (all?) of those are compiled, too, but aren't
needed to be run or initialized when merely being visited.

so thought 1) would be to come up with some sort of text mode hook that
only hooks in when a human is viewing or editing the buffer, not when it
is happening programmatically.

so thought 2) would be to have it only attempt to construct background
agendas when the system is otherwise idle for a few minutes. I don't
know how to do that, I figure wrapping this bit with something that
could detect idleness instead of just running arbitrarily would be good.

  (run-at-time nil 3600 'org-agenda-to-appt)

don't know how to detect idleness.

And thought 0) would be to understand emacs well enough to profile
what's really going on as maybe starting a new flyspell process is not
really the problem but a symptom, but I don't (yet). (suggestions
desired. I have read up a bit on emacs profiling)

I am deeply grateful for the existence of org-mode and the fine work
going into it. I wrote a nice blog entry about it recently. 

http://the-edge.blogspot.com/2009/08/going-retro-re-adopting-emacs.html

TIA.

- -- 
Dave Taht
http://the-edge.blogspot.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ http://mailcrypt.sourceforge.net/

iEYEARECAAYFAkqshuUACgkQpdejJcOV4uRkTwCgyz5IMWJTzCHa8CmUAgU/fyIa
cvwAoJKQ5Gr+1vlSAbEfbKob76xJIvB8
=/Xdv
-END PGP SIGNATURE-


___
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