emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Suggested Modification to fix Org-Mobile.el (can someone submit fix or suggest better way to do this)
@ 2012-07-04 18:06 Jeffrey Spencer
  0 siblings, 0 replies; only message in thread
From: Jeffrey Spencer @ 2012-07-04 18:06 UTC (permalink / raw)
  To: emacs-orgmode

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

The issue arises with org-agenda-redo. When running this command it selects
the last file that was used to make an agenda buffer. Since the previous
file used to do that was *SUMO* it tries to rebuild using that if currently
an *Org Agenda* buffer was open because this is the only time
(org-agenda-redo) is run.

If you put (org-agenda-list) or anything that modifies the agenda buffer in
place >>>Insert here (probably something better to do than this but with my
limited knowledge of org and recent uptaking not sure. Read 2 below). This
forces so *Org Agenda* is set again. The command works fine and
(org-agenda-redo) updates and places you in the buffer.

1) Not entirely sure why you need to run (org-agenda-redo) at all?? Just
seems non-essential unless something was saved that would now be in the
agenda view and wasn't before. Not opposed just curious why it was put
there.

2) I would say implementation suggested above is fine but there is probably
a lot better way to implement it. Like possibly setting whatever remembers
*SUMO* in org-agenda to the a-buffer file before running (org-agenda-redo).

Any help would be great because want to set autosave for mobileorg when
idle but always messes with the agenda buffer which is annoying.

Pasted org-mobile-push from current development pulled today:

(defun org-mobile-push ()
  "Push the current state of Org affairs to the WebDAV directory.
This will create the index file, copy all agenda files there, and also
create all custom agenda views, for upload to the mobile phone."
  (interactive)
  (let ((a-buffer (get-buffer org-agenda-buffer-name)))
    (let ((org-agenda-buffer-name "*SUMO*")
  (org-agenda-tag-filter org-agenda-tag-filter)
  (org-agenda-redo-command org-agenda-redo-command))
      (save-excursion
(save-window-excursion
  (run-hooks 'org-mobile-pre-push-hook)
  (org-mobile-check-setup)
  (org-mobile-prepare-file-lists)
  (message "Creating agendas...")
  (let ((inhibit-redisplay t)) (org-mobile-create-sumo-agenda))
  (message "Creating agendas...done")
  (org-save-all-org-buffers) ; to save any IDs created by this process
  (message "Copying files...")
  (org-mobile-copy-agenda-files)
  (message "Writing index file...")
  (org-mobile-create-index-file)
  (message "Writing checksums...")
  (org-mobile-write-checksums)
  (run-hooks 'org-mobile-post-push-hook)))
      )
>>> Insert Here
    (redraw-display)
    (when (and a-buffer (buffer-live-p a-buffer))
      (if (not (get-buffer-window a-buffer))
  (kill-buffer a-buffer)
 (let ((cw (selected-window)))
  (select-window (get-buffer-window a-buffer))
          (org-agenda-redo)
  (select-window cw)))))
  (message "Files for mobile viewer staged"))



Cheers,
Jeff

[-- Attachment #2: Type: text/html, Size: 4739 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-04 18:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-04 18:06 Suggested Modification to fix Org-Mobile.el (can someone submit fix or suggest better way to do this) Jeffrey Spencer

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).