[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: Bug fix release 4.59

From: Carsten Dominik
Subject: Re: [Orgmode] Re: Bug fix release 4.59
Date: Fri, 8 Dec 2006 17:21:20 +0100

On Dec 8, 2006, at 17:00, Eddward DeVilla wrote:

   For me, on my work desktop I pretty much only restart emacs to get
the newest versions of org-mode after testing them out on my laptop.

   Think it would work if I wrote a function to reload org and then
iterate through the buffers, restarting org-ode in the org-mode
buffers or would the function still hold on to the version of org that
was active when it was called?  Would there be an easy/automated way
to restart the agenda buffer without messing up the buffer-window

For sure this would work, if you take some care like actually selecting
the *window* displaying the agenda before refreshing it.
Something like (untested):

(defun org-upgrade ()
  "Reload org.el and renew the mode in all applicable buffers."
  (load-library "org")
  (let ((buffers (buffer-list))
        (cwin (selected-window))
        (org-inhibit-startup t) ; avoid re-folding of the buffers
        buf win)
    (while (setq buf (pop buffers))
      (when (buffer-live-p buf)
        (with-current-buffer buf
          (and (eq major-mode 'org-mode) (org-mode)))))
    (when (setq win (get-buffer-window org-agenda-buffer-name))
      (select-window win)
    (select-window cwin)
    (message "All buffers upgraded to org-mode version %s"

- Carsten

reply via email to

[Prev in Thread] Current Thread [Next in Thread]