emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeffrey Spencer <jeffspencerd@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Suggested Modification to fix Org-Mobile.el (can someone submit fix or suggest better way to do this)
Date: Thu, 5 Jul 2012 04:06:45 +1000	[thread overview]
Message-ID: <CALmFPZ0++2vHDVcyVVsgYaHy=ZUib84SEqXfoUjXdn3niMYBwA@mail.gmail.com> (raw)

[-- 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 --]

                 reply	other threads:[~2012-07-04 18:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CALmFPZ0++2vHDVcyVVsgYaHy=ZUib84SEqXfoUjXdn3niMYBwA@mail.gmail.com' \
    --to=jeffspencerd@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 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).