Re: [O] Bug in Sticky Agendas

2018-01-06 Thread Ian Dunn

NG> Thank you. It looks good.

NG> Could you send it again with a proper commit message so I can apply it?

This work?

>From df299def392a93a2adf41ae3cd740b54382d64b0 Mon Sep 17 00:00:00 2001
From: Ian Dunn <du...@gnu.org>
Date: Sat, 6 Jan 2018 17:29:11 -0500
Subject: [PATCH] org-agenda: Fix lprops when recreating sticky agendas

* lisp/org-agenda.el (org-agenda-lprops): New variable.
  (org-agenda-local-vars): Add it.
  (org-agenda-prepare): Set lprops from symbol property.
  (org-agenda-redo): Get lprops from variable, not property.
---
 lisp/org-agenda.el | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index c67f6e024..bf406f193 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2145,6 +2145,7 @@ When nil, `q' will kill the single agenda buffer."
 (defvar org-agenda-this-buffer-is-sticky nil)
 (defvar org-agenda-last-indirect-buffer nil
   "Last buffer loaded by `org-agenda-tree-to-indirect-buffer'.")
+(defvar org-agenda-lprops nil)
 
 (defconst org-agenda-local-vars
   '(org-agenda-this-buffer-name
@@ -2173,6 +2174,7 @@ When nil, `q' will kill the single agenda buffer."
 org-agenda-filtered-by-category
 org-agenda-filter-form
 org-agenda-cycle-counter
+org-agenda-lprops
 org-agenda-last-prefix-arg)
   "Variables that must be local in agenda buffers to allow multiple buffers.")
 
@@ -3752,6 +3754,10 @@ FILTER-ALIST is an alist of filters we need to apply when
 	  (org-uniquify org-done-keywords-for-agenda))
 	(setq org-agenda-last-prefix-arg current-prefix-arg)
 	(setq org-agenda-this-buffer-name org-agenda-buffer-name)
+	;; Don't set these until we know we're in the agenda buffer,
+	;; and we know they're valid.
+	(setq org-agenda-lprops (or org-agenda-lprops
+(get 'org-agenda-redo-command 'org-lprops)))
 	(and name (not org-agenda-name)
 	 (setq-local org-agenda-name name)))
   (setq buffer-read-only nil
@@ -7315,7 +7321,7 @@ in the agenda."
 	 (cols org-agenda-columns-active)
 	 (line (org-current-line))
 	 (window-line (- line (org-current-line (window-start
-	 (lprops (get 'org-agenda-redo-command 'org-lprops))
+	 (lprops org-agenda-lprops)
 	 (redo-cmd (get-text-property p 'org-redo-cmd))
 	 (last-args (get-text-property p 'org-last-args))
 	 (org-agenda-overriding-cmd (get-text-property p 'org-series-cmd))
-- 
2.15.1


-- 
Ian Dunn


Re: [O] Bug in Sticky Agendas

2018-01-05 Thread Ian Dunn
>>>>> "Ian" == Ian Dunn <du...@gnu.org> writes:

Ian> I've got a few tasks that I don't want appearing in the
Ian> daily agenda, so I tag them with agenda_exclude and set
Ian> org-agenda-skip-function to skip any entries with that tag for
Ian> my daily agenda:

Ian> (defun id/org-skip-by-tag ( tags) (if (not (apply
Ian> 'org-entry-has-tags-p tags)) nil (save-excursion
Ian> (outline-next-visible-heading 1) (point

Ian> (let* ((agenda-skip '(org-agenda-skip-function (lambda nil
Ian> (id/org-skip-by-tag "agenda_exclude") (setq
Ian> org-agenda-custom-commands `(("d" "Day View" agenda ""
Ian> ((org-agenda-span 'day) ,agenda-skip)) ("T" . "Tags View")
Ian> ("Tn" "Nightly" tags-todo "nightly==\"TODO\""

Ian> As you can see, I've got a second agenda view for my nightly
Ian> checklist.  So here's my problem: the skip-function is unset if
Ian> I try using the nightly view.

I went ahead and looked into this myself.  Looks like the issue is that the 
properties (lprops) are set using symbol properties with 
org-agenda-redo-command, which is buffer-local.  However, according to the 
elisp manual (at least for the upcoming 26.1 release), symbol properties aren't 
buffer-local; only the value itself is.  Thus, lprops are overridden by a new 
agenda.

I've created the following patch to address this.  The symbol property is used 
as a temporary variable, but the actual lprops are stored as a buffer-local 
variable to each agenda buffer.

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index a9ebb793b..5226ef486 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2142,6 +2142,7 @@ When nil, `q' will kill the single agenda buffer."
 (defvar org-agenda-this-buffer-is-sticky nil)
 (defvar org-agenda-last-indirect-buffer nil
   "Last buffer loaded by `org-agenda-tree-to-indirect-buffer'.")
+(defvar org-agenda-lprops nil)
 
 (defconst org-agenda-local-vars
   '(org-agenda-this-buffer-name
@@ -2170,6 +2171,7 @@ When nil, `q' will kill the single agenda buffer."
 org-agenda-filtered-by-category
 org-agenda-filter-form
 org-agenda-cycle-counter
+org-agenda-lprops
 org-agenda-last-prefix-arg)
   "Variables that must be local in agenda buffers to allow multiple buffers.")
 
@@ -3749,6 +3751,10 @@ FILTER-ALIST is an alist of filters we need to apply when
 	  (org-uniquify org-done-keywords-for-agenda))
 	(setq org-agenda-last-prefix-arg current-prefix-arg)
 	(setq org-agenda-this-buffer-name org-agenda-buffer-name)
+	;; Don't set these until we know we're in the agenda buffer,
+	;; and we know they're valid.
+	(setq org-agenda-lprops (or org-agenda-lprops
+(get 'org-agenda-redo-command 'org-lprops)))
 	(and name (not org-agenda-name)
 	 (setq-local org-agenda-name name)))
   (setq buffer-read-only nil
@@ -7312,7 +7318,7 @@ in the agenda."
 	 (cols org-agenda-columns-active)
 	 (line (org-current-line))
 	 (window-line (- line (org-current-line (window-start
-	 (lprops (get 'org-agenda-redo-command 'org-lprops))
+	 (lprops org-agenda-lprops)
 	 (redo-cmd (get-text-property p 'org-redo-cmd))
 	 (last-args (get-text-property p 'org-last-args))
 	 (org-agenda-overriding-cmd (get-text-property p 'org-series-cmd))

-- 
Ian Dunn


Re: [O] BeOrg

2018-01-02 Thread Ian Dunn
>>>>> "Peter" == Peter Davis <p...@pfdstudio.com> writes:

Peter> If we refuse to provide useful information just because it
Peter> violates some purist idea of what is or is not acceptably
Peter> unencumbered, then we’re just denying users potential helpful
Peter> capabilities that may make the difference between using
Peter> org-mode or abandoning it completely in favor of some
Peter> commercial, cross-platform solution.

Nicolas mentioned that as a GNU package, we're not allowed to mention
proprietary software[1].  My understanding is that the reasoning behind
this is that we don't want to appear to endorse proprietary software.
The GNU project finds proprietary software unethical, so they will not
see it as providing useful information, but endorsing an unethical
solution.

Peter, I understand your reasoning; the LGPL was designed specifically
for this purpose, i.e. allowing a non-free solution built upon a free
one.  However, I don't believe we should encourage use of such solutions
without evidence that people are turned away from Org mode because of a
mobile solution they don't like.

[1] https://www.gnu.org/prep/standards/html_node/References.html#References

-- 
Ian Dunn



[O] Bug in Sticky Agendas

2017-12-30 Thread Ian Dunn

I've got a few tasks that I don't want appearing in the daily agenda, so I 
tag them with agenda_exclude and set org-agenda-skip-function to skip any 
entries with that tag for my daily agenda:



binvGaqlAO1UI.bin
Description: application/emacs-lisp

As you can see, I've got a second agenda view for my nightly checklist.  So 
here's my problem: the skip-function is unset if I try using the nightly view.

To reproduce:

0. Turn on sticky agendas
1. C-c a d (day view agenda)
2. C-c q (quit-window)
3. C-c a T n (Nightly view)
4. Switch back to day view agenda
5. 'r' (org-agenda-redo)

Now the excluded tasks appear in the day view agenda, whereas they didn't 
before.

-- 
Ian Dunn


Re: [O] org-depend new features

2017-07-16 Thread Ian Dunn
Adrian Bradd <adrian.br...@gmail.com> writes:

> Hi,
>
> There was a discussion some time ago about adding some new features to
> org-depend [1]. I'm not sure if anyone else is looking into this, but I have
> started on trying to implement some of the features summarized in [2].
>
> I have multi-file TRIGGER and BLOCKER task actions working. My working branch
> can be found in [3] if anyone is interested.
>
> Should I submit each feature as a patch as I complete them or wait until I 
> have
> completed them all?
>
> I am new to elisp so any advice is appreciated.
>
> Adrian
>
> [1] https://lists.gnu.org/archive/html/emacs-orgmode/2016-12/msg00143.html
> [2] http://karl-voit.at/2016/12/18/org-depend/
> [3] https://github.com/abradd/org-mode
>

I wrote a package that I've used to replace org-depend called org-edna.
>From the project page:

> Edna provides an extensible means of specifying conditions which must be 
> fulfilled before a task can be completed and actions to take once it is. 

It's available on ELPA if you'd like to try it out, or check out the project on 
Savannah:
https://savannah.nongnu.org/projects/org-edna-el/

-- 
Ian Dunn



Re: [O] RFC: Extensible Dependencies 'N' Actions

2017-04-22 Thread Ian Dunn

Gergely Polonkai writes:

> • Some finders have missing documentation (although their names are pretty
> straightforward)

Yup, working on that.

> • Why the “new language”, why can’t it be lisp, or at least more lispish?

Initially, I made it similar to org-depend.el, but as parsing became
complicated, it has effectively morphed into lisp.  The keywords are all
symbols (they've got to be functions, after all), and the argument lists
are lisp lists.

I find this to be a good compromise between ease of coding for me, and
ease of understanding for the users.

> • You gave us a possibility to create naming clashes between targets,
> finders, etc. For example, I might want to file a note when a file of a
> project changes, so I use your file target, and create the file action. How
> will Edna know when to use which?

Right now, Edna will use the finder and ignore the action.  I didn't
want to force users to specify when to change from finders to actions or
conditions, so I just had Edna search for the functions.

Thinking about it, Guile uses the suffixes '!' to denote functions that
destructively change the input (like actions) and '?' to denote
predicates (like conditions).

If Edna looks for these characters at the end of the keyword (starting
character already means something), then that will allow users to name
both a finder and action 'file' (although the action would be 'file!').

And of course, thank you for your support and feedback.

-- 
Ian Dunn



[O] RFC: Extensible Dependencies 'N' Actions

2017-04-21 Thread Ian Dunn

I've been working on something akin to org-depend.el called org-edna.
Basically, Edna provides an extensible means of specifying blocking
conditions and trigger actions.

For example, Edna allows you to specify that a task should be blocked
until all TODOs have been addressed in source code:

* TODO Address all TODOs in code
  :PROPERTIES:
  :BLOCKER: file("main.cpp") file("code.cpp") re-search("TODO")
  :END:
* TODO Commit Code to Repository

Or schedule the following task for an hour after the current task is
completed:

* TODO Put clothes in washer
  SCHEDULED: <2017-04-08 Sat 09:00>
  :PROPERTIES:
  :TRIGGER: next-sibling scheduled("++1h")
  :END:
* TODO Put clothes in dryer
  :PROPERTIES:
  :TRIGGER: next-sibling scheduled("++1h")
  :BLOCKER:  previous-sibling
  :END:

The (semi-complete) documentation is here:
http://www.nongnu.org/org-edna-el/

I'd appreciate some feedback on it, whether the code or the
documentation.

-- 
Ian Dunn


Re: [O] org-mobile-push needs a visible frame ?

2017-04-17 Thread Ian Dunn
Bingo <right...@gmail.com> writes:

> Hi,
>
> I see that when there is an emacs server without a visible frame, 
>
> emacsclient --eval "(org-mobile-push)" , gives the error :
>
> *ERROR*: Unknown terminal type
>
> Only when there is a visible frame does org-mobile-push succeed. Is there a
> reason why org-mobile-push needs a frame ? How can I make it work without a
> frame?
>
> Org version is 8.3.2, emacs version 24.4.1, Debian Linux 8.2.
>
> thanks
>

What do you have org-agenda-window-setup set to?  I was able to fix the
problem on my machine by setting org-agenda-window-setup to
current-window.

-- 
Ian Dunn



Re: [O] org-mobile-push needs a visible frame ?

2017-04-08 Thread Ian Dunn
Bingo <right...@gmail.com> writes:

> Hi,
>
> I see that when there is an emacs server without a visible frame, 
>
> emacsclient --eval "(org-mobile-push)" , gives the error :
>
> *ERROR*: Unknown terminal type
>
> Only when there is a visible frame does org-mobile-push succeed. Is there a
> reason why org-mobile-push needs a frame ? How can I make it work without a
> frame?
>
> Org version is 8.3.2, emacs version 24.4.1, Debian Linux 8.2.
>
> thanks
>

Confirmed.  I'm seeing this on trunk Emacs on Debian.

-- 
Ian Dunn



[O] [PATCH] Fix bug in mobile outline path handling

2017-04-07 Thread Ian Dunn

* org-mobile.el (org-mobile-get-outline-path-link): Use a `:' after file 
instead of a `/'
---
 lisp/org-mobile.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index f6ef18f10..12e6c84b3 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -648,7 +648,7 @@ The table of checksums is written to the file 
mobile-checksums."
   (org-with-point-at pom
 (concat "olp:"
(org-mobile-escape-olp (file-name-nondirectory buffer-file-name))
-   "/"
+   ":"
(mapconcat 'org-mobile-escape-olp
   (org-get-outline-path)
   "/")
-- 
2.12.2



[O] Bug in org-mobile-get-outline-path-link

2017-04-05 Thread Ian Dunn

I recently tried turning off 'org-mobile-force-id-on-agenda-items', only
to find that there were problems updating agenda tasks.  I poked around
in the code and found that 'org-mobile-locate-entry' looks for an OLP in
the form olp:file:/path/to/heading, and
'org-mobile-get-outline-path-link' stores it as
olp:file/path/to/heading.

I've attached a patch to fix the latter function.

--
Ian Dunn

diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index f6ef18f10..12e6c84b3 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -648,7 +648,7 @@ The table of checksums is written to the file 
mobile-checksums."
   (org-with-point-at pom
 (concat "olp:"
(org-mobile-escape-olp (file-name-nondirectory buffer-file-name))
-   "/"
+   ":"
(mapconcat 'org-mobile-escape-olp
   (org-get-outline-path)
   "/")




[O] Bug in Recent Agenda Mod

2017-03-20 Thread Ian Dunn

Commit d262ae53c966c7a745c0fa779149f9eb7486333d "org-agenda: Fix agenda 
standard name when going unsticky" sets org-agenda-buffer-name to "*Org 
Agenda*" if not in sticky.

However, org-agenda-redo sets org-agenda-sticky to nil before redoing the 
agenda command.

Steps to Reproduce:

1. Turn on org-agenda-sticky
2. Execute any agenda command that only involves org-agenda-list
   - Agenda is in buffer *Org Agenda(CMD)* (ex. *Org Agenda(d:)*)
3. Press 'g' (org-agenda-redo)
   - Agenda is now in *Org Agenda*

The included patch fixes this for sticky redo, and will have no effect for 
anything other than a sticky redo.

--
Ian Dunn

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index b618653d5..04e6685b5 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4076,6 +4076,7 @@ items if they have an hour specification like [h]h:mm."
   (catch 'exit
 (setq org-agenda-buffer-name
  (or org-agenda-buffer-tmp-name
+ (and org-agenda-doing-sticky-redo org-agenda-buffer-name)
  (if org-agenda-sticky
  (cond ((and org-keys (stringp org-match))
 (format "*Org Agenda(%s:%s)*" org-keys org-match))



Re: [O] Bug: Problem with org-agenda-sticky and org-mobile

2017-01-14 Thread Ian Dunn
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Ian Dunn <du...@gnu.org> writes:
>
>> With trunk org mode, when I run org-mobile-push when in an agenda
>> buffer, then refresh the buffer (via 'r' or 'g'), it spawns a new
>> agenda buffer and populates it. This only happens with
>> org-agenda-sticky set to 't'.
>>
>> To replicate, I do the following:
>>
>> 1. Turn on org-agenda-sticky
>> 2. Activate an agenda (any agenda)
>> 3. Run org-mobile-push
>> 4. Press 'r' after it's finished
>>
>> On mine, it spawns a new agenda buffer.  This is not the behavior I'd 
>> expect.
>>
>> It looks to me like this is an issue in org-mobile-push.  It sets
>> org-agenda-this-buffer-name to the original value of org-agenda-buffer-name,
>> which isn't necessarily the same.
>>
>> Thanks for your help.
>
> I pushed a fix for this. Could you confirm the problem is solved? Thank
> you.
>
>
> Regards,

That fixed it.  Thank you.

-- 
Ian Dunn



[O] Bug: Problem with org-agenda-sticky and org-mobile

2017-01-10 Thread Ian Dunn

With trunk org mode, when I run org-mobile-push when in an agenda buffer, 
then refresh the buffer (via 'r' or 'g'), it spawns a new agenda buffer and 
populates it.  This only happens with org-agenda-sticky set to 't'.

To replicate, I do the following:

1. Turn on org-agenda-sticky
2. Activate an agenda (any agenda)
3. Run org-mobile-push
4. Press 'r' after it's finished

On mine, it spawns a new agenda buffer.  This is not the behavior I'd 
expect.

It looks to me like this is an issue in org-mobile-push.  It sets 
org-agenda-this-buffer-name to the original value of org-agenda-buffer-name, 
which isn't necessarily the same.

Thanks for your help.

--
Ian Dunn



[O] Subtree macro

2017-01-02 Thread Ian Dunn

Is there something like this macro in org?

(defmacro org-with-subtree ( body)
  "Evaluate BODY with the buffer narrowed to the current subtree."
  (declare (debug (body)))
  `(save-mark-and-excursion
 (save-restriction
   (org-narrow-to-subtree)
   ,@body)))

--
Ian Dunn



Re: [O] Bug: Org Emphasis Issues (Trunk)

2016-12-15 Thread Ian Dunn
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Matt Lundin <m...@imapmail.org> writes:
>
>> Ian Dunn <du...@gnu.org> writes:
>>
>>> I encountered these issues this morning when I updated Org from
>>> trunk (and reloaded it with C-c C-x !). I believe it's following
>>> commit "Split `org-emph-re' and `org-verbatim-re'". I've got 2
>>> issues:
>>
>>> 1. Nothing longer than one character has emphasis. I find changing
>>> the 4th element of org-emphasis-regexp-components ("body-regexp")
>>> to ".*?" fixes this.
>>
>> I cannot replicate this particular issue. Could you provide a minimal
>> recipe for replicating?
>
> I cannot either.
>

Set the last element of org-emphasis-regexp-components ("newline") to zero, 
reload org, then try:

emacs -Q
;; load trunk org mode
M-: (setf (seq-elt org-emphasis-regexp-components 4) 0)
C-c C-x !

*abcd*

On mine, that string isn't bold.

    It looks like there's some regex magic that goes on in org-set-emph-re that 
doesn't happen if the last component is zero.  Part of that magic is adding 
that *?.

-- 
Ian Dunn



[O] Bug: Org Emphasis Issues (Trunk)

2016-12-13 Thread Ian Dunn


I encountered these issues this morning when I updated Org from trunk (and 
reloaded it with C-c C-x !).  I believe it's following commit "Split 
`org-emph-re' and `org-verbatim-re'".  I've got 2 issues:

1. Nothing longer than one character has emphasis.  I find changing the 4th 
element of org-emphasis-regexp-components ("body-regexp") to ".*?" fixes this.

2. Headings of level >= 3 are fontified as if they were emphasized.  I'm 
guessing org-do-emphasis-face is considering "***" as an acceptable emphasis 
string.

If it helps, this is my setting for org-emphasis-regexp-components:

(defconst org-emphasis-regexp-components
  '(" \t('\"{<“‘–"
"- \t.,:!?;'\")}\\[>”’–…"
" \t\r\n"
".*?"
0))

--
Ian Dunn



Re: [O] Bug: MobileOrg pull broken

2016-08-07 Thread Ian Dunn
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Ian Dunn <du...@gnu.org> writes:
>
>> I stepped through org-mobile-apply using Edebug and found that the
>> problem is with "(eval cmd)" in org-mobile.el, line 889. It fails with
>> the error "(void-variable data)". I don't know why this is happening,
>> but I've included a simple fix for this that passes the `data', `old',
>> and `new' variables as a lexical environment to `eval'. This may not
>> work if `org-mobile-action-alist' is modified.
>
> Actually `org-mobile-action-alist' is not meant to be modified, per its
> docstring. Anyway I replaced the action sexp with a function. Does it
> solve the problem ?
>
> Regards,

  It almost worked, but your change to `org-mobile-action-alist' doesn't need 
the function quote.

-- 
Ian Dunn

diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index 93b1481..f7ae0a9 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -228,7 +228,7 @@ capture file `mobileorg.org' back to the WebDAV directory, 
for example
 using `rsync' or `scp'.")
 
 (defconst org-mobile-action-alist
-  '(("edit" . #'org-mobile-edit))
+  '(("edit" . org-mobile-edit))
   "Alist with flags and actions for mobile sync.
 When flagging an entry, MobileOrg will create entries that look like



[O] Bug: MobileOrg pull broken

2016-07-31 Thread Ian Dunn

Emacs  : GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.6) of 
2016-07-22
Package: Org-mode version 8.3.5 (release_8.3.5-1032-g9798da)

For the past month or so (I don't know exactly when it started), I've been 
having problems with MobileOrg (Android if it helps).  When I'd pull changes 
from my phone to my computer, I'd always get "EXECUTION FAILED" messages, and 
nothing would work.

I stepped through org-mobile-apply using Edebug and found that the problem 
is with "(eval cmd)" in org-mobile.el, line 889.  It fails with the error 
"(void-variable data)".  I don't know why this is happening, but I've included 
a simple fix for this that passes the `data', `old', and `new' variables as a 
lexical environment to `eval'.  This may not work if `org-mobile-action-alist' 
is modified.

I tried using "(eval cmd t)", but that didn't work; I got the same 
"void-variable" error.  If someone more familiar with lexical binding can look 
into this, or at least explain why this is happening, I'd appreciate it.

Thanks!

-- 
Ian Dunn

--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -886,7 +886,11 @@ If BEG and END are given, only do this in that region."
(condition-case msg
(org-with-point-at id-pos
  (progn
-   (eval cmd)
+   ;; Using (eval cmd t) doesn't work here, so
+   ;; specify each required variable by hand.
+   (eval cmd `((data . ,data)
+   (old  . ,old)
+   (new  . ,new)))
(unless (member data (list "delete" "archive" 
"archive-sibling" "addheading"))
  (if (member "FLAGGED" (org-get-tags))
  (add-to-list 'org-mobile-last-flagged-files



[O] MobileOrg Export Broken

2016-06-23 Thread Ian Dunn

I run Org from the git repo, updating daily.  I unsuccessfully tried 
syncing with MobileOrg (Android) about two hours ago.  I reverted org-mobile.el 
back to the version from yesterday and found the problem: TODO keywords aren't 
being listed correctly.  Here's an example:

Old:
#+TODO: TODO | DEFERRED DONE PENDING CANCELLED

New:
#+TODO: TODO

This messes with MobileOrg, preventing it from syncing.

I worked through the problem, which appears to be caused by org-delete-all 
being called before the TODO keywords are inserted into the file.  I attached a 
patch that fixes this problem.

-- 
Ian Dunn

diff --git a/lisp/org-mobile.el b/lisp/org-mobile.el
index 9c69128..9192561 100644
--- a/lisp/org-mobile.el
+++ b/lisp/org-mobile.el
@@ -446,8 +446,9 @@ agenda view showing the flagged items."
   x))
 			 (cdr entry)))
 	   (dwds (or (member "|" kwds) (last kwds)))
-	   (twds (org-delete-all dwds kwds)))
+	   (twds kwds))
 	  (insert "#+TODO: " (mapconcat 'identity kwds " ") "\n")
+	  (org-delete-all dwds twds)
 	  (setq todo-kwds (org-delete-all twds todo-kwds))
 	  (setq done-kwds (org-delete-all dwds done-kwds
   (when (or todo-kwds done-kwds)


[O] Bug: Agenda: Invalid Function 4 [8.3.4 (release_8.3.4-702-gcd47ab @ ~/.emacs.d/packages/org-mode/lisp/)]

2016-04-05 Thread Ian Dunn


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.


For some time now, I've been noticing that org-agenda-redo (the
'g' key in the Agenda buffer, since it isn't *exactly* the same) often
fails with the error "Invalid Function 4".  I looked into this, and
discovered that it only happened when I used a tag view list with only
TODO items.  A backtrace showed that the issue was the redo command, and
I believe I have solved the problem with the following patch:

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index e9f3505..2f7241b 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4852,7 +4852,7 @@ The prefix arg TODO-ONLY limits the search to TODO 
entries."
   (setq org-agenda-query-string match)
   (setq org-agenda-redo-command
(list 'org-tags-view
- org--matcher-tags-todo-only
+ (list 'quote org--matcher-tags-todo-only)
  `(if current-prefix-arg nil ,org-agenda-query-string)))
   (setq files (org-agenda-files nil 'ifmode)
rtnall nil)

If my patch doesn't work, I at least hope it helps everyone figure out
the real problem.

Thank you for your time.

-- 
Ian Dunn

Emacs  : GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.13)
 of 2016-04-04
Package: Org-mode version 8.3.4 (release_8.3.4-702-gcd47ab @ 
~/.emacs.d/packages/org-mode/lisp/)

current state:
==
(setq
 org-tab-first-hook '(org-hide-block-toggle-maybe 
org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-shell-link-function 'yes-or-no-p
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook org-show-block-all 
append local] 5]
 #[nil "\300\301\302\303\304$\207"
   [org-add-hook change-major-mode-hook 
org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point 
org-babel-execute-safely-maybe)
 org-directory "~/Documents/org"
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )