org-read-date-minibuffer-local-map should use C-n/p/f/b

2020-05-29 Thread Alex Branham
Hello -

I find it unintuitive that the usual calendar keys C-n/p/f/b don't work
when scheduling tasks in org mode (yes, I know about S-right, etc). I've
something like this to my init file for those four keys (based on their
setup in org-keys.el) for some time with no negative repercussions (that
I know about anyway), perhaps the same should be done for org itself?

#+begin_src emacs-lisp
(define-key org-read-date-minibuffer-local-map (kbd "C-n") (lambda () 
(interactive) (org-eval-in-calendar '(calendar-forward-week 1
#+end_src

Thanks,
Alex



[O] Update Org in Emacs

2019-03-26 Thread Alex Branham
Hello -

Is it possible to update Org upstream? Emacs is shipping 9.1.X while the
latest stable org release is 9.2.X.

I ask since I sometimes use emacs -Q (org 9.1), where 

[O] Bug: org-todo calls unbound org-clock-out-if-current

2019-02-14 Thread Alex Branham
Hello -

On the tip of the maint branch
(8fc22d464d2bc4a3397516854375b177835d10bb) any call to functions like
'org-todo' results in an error 'void-function org-clock-out-if-current'.

Here's a sample backtrace:

Debugger entered--Lisp error: (void-function org-clock-out-if-current)
  (org-clock-out-if-current)
  (org-todo "DONE")
  (funcall-interactively org-todo "DONE")
  (call-interactively org-todo)
  (org-agenda-todo "DONE")
  (my/org-agenda-mark-done nil)
  (funcall-interactively my/org-agenda-mark-done nil)
  (call-interactively my/org-agenda-mark-done nil nil)
  (command-execute my/org-agenda-mark-done)



Re: [O] How to use org-protocol with text that includes &?

2018-08-30 Thread Alex Branham


> Would url-encoding help?

Indeed it does, thank you!

Alex



[O] How to use org-protocol with text that includes &?

2018-08-29 Thread Alex Branham
Hello -

I'm struggling with org-protocol capturing text when it includes the symbol &. 
Here's an example of what I'm sending:

emacsclient "org-protocol://capture?url=foo.com=bar=foobar"

but the foobar2 doesn't get captured because of the &. Escaping it doesn't seem 
to help.

How should I format text that includes & so that it gets properly captured?

Thanks,
Alex



[O] Support flymake with org-lint

2018-06-08 Thread Alex Branham
Here's a patch that adds support for flymake in Emacs 26 and greater. It
uses org-lint.el as the backend. It can be pretty slow if you have a
large buffer open, so I don't think I'd recommend enabling it by
default. It's nice to be able to use e.g. flymake-goto-next-error to
navigate around the buffer though.

Alex

>From b53c4068cb64c152c417014916c7d8c11e4651fb Mon Sep 17 00:00:00 2001
From: Alex Branham 
Date: Wed, 6 Jun 2018 14:44:12 -0500
Subject: [PATCH] Add support for flymake

* lisp/org-flymake.el (org-flymake-org-lint-backend): New function
* lisp/org-flymake.el (org-flymake-setup): New function
---
 etc/ORG-NEWS| 10 +++
 lisp/org-flymake.el | 63 +
 2 files changed, 73 insertions(+)
 create mode 100644 lisp/org-flymake.el

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 2a22be0d5..5bf5a2f71 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -311,7 +311,17 @@ You can set an agenda restriction lock with =C-x C-x <= or 
with =<= at the
 beginning of a headline when using Org speed commands.  Now, if there
 is already a restriction at point, hitting =<= again (or =C-x C-x <=) will
 remove it.
+*** Org now supports flymake in Emacs version 26.1 and greater
+To enable it in all org buffers, add:

+#+begin_src emacs-lisp
+(add-hook 'org-mode-hook #'org-flymake-setup)
+#+end_src
+
+to your Emacs configuration file.  This takes care of setting up the
+flymake backend (using ~org-lint~) and enables ~flymake-mode~ in org
+buffers.  Note that ~org-lint~ can be slow in large org buffers, so
+you may not want to enable this in all buffers by default.
 ** New commands and functions

 *** ~org-insert-structure-template~
diff --git a/lisp/org-flymake.el b/lisp/org-flymake.el
new file mode 100644
index 0..7462d98a6
--- /dev/null
+++ b/lisp/org-flymake.el
@@ -0,0 +1,63 @@
+;;; org-flymake.el --- Org support for flymake.el  -*- lexical-binding: t; -*-
+;;
+;; Copyright (C) 2018 Free Software Foundation, Inc.
+;;
+;; This file is a part of GNU Emcas.
+;;
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+;;
+;;
+;;; Commentary:
+;; This file implements support for flymake.el in org mode buffers.
+;; To enable it permanently in all org buffers, add this to your Emacs
+;; configuration file:
+;;
+;; (add-hook 'org-mode-hook #'org-flymake-setup)
+;;
+;; Flymake supports multiple backends.  Currently we use `org-lint' only.
+
+;;; Code:
+
+(eval-when-compile
+  (require 'cl-lib))
+(require 'org-lint)
+(require 'seq)
+
+(defun org-flymake-org-lint-backend (report-fn  _args)
+  "A Flymake backend for `org-lint'.
+Calls REPORT-FN directly."
+  (let* ((report (org-lint--generate-reports
+ (current-buffer) org-lint--checkers))
+(report (mapcar
+ (lambda (c) (seq-into (nth 0 (cdr c)) 'list))
+ report)))
+(funcall report-fn
+(cl-loop
+ for (line _trust description _checkers) in report
+ for (beg . end) = (flymake-diag-region (current-buffer) 
(string-to-number line))
+ collect
+ (flymake-make-diagnostic (current-buffer) beg end :note 
description)))
+report))
+
+;;;###autoload
+(defun org-flymake-setup ()
+  "Add `org-flymake' to `flymake-diagnostic-functions'."
+  (if (< emacs-major-version 26)
+  (user-error "Org-flymake requires Emacs 26.1 or greater")
+(add-hook 'flymake-diagnostic-functions #'org-flymake-org-lint-backend nil 
t)
+(flymake-mode)))
+
+(provide 'org-flymake)
+
+;;; org-flymake.el ends here
--
2.17.1



>From b53c4068cb64c152c417014916c7d8c11e4651fb Mon Sep 17 00:00:00 2001
From: Alex Branham 
Date: Wed, 6 Jun 2018 14:44:12 -0500
Subject: [PATCH] Add support for flymake

* lisp/org-flymake.el (org-flymake-org-lint-backend): New function
* lisp/org-flymake.el (org-flymake-setup): New function
---
 etc/ORG-NEWS| 10 +++
 lisp/org-flymake.el | 63 +
 2 files changed, 73 insertions(+)
 create mode 100644 lisp/org-flymake.el

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 2a22be0d5..5bf5a2f71 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -311,7 +311,17 @@ You can set an agenda restriction lock with =C-x C-x <= or with =<= at the
 beginning of a headline when using Org speed commands.  Now, if there
 is

Re: [O] Trouble with scheduled item with deadline on agenda

2018-04-26 Thread Alex Branham
On Thu 26 Apr 2018 at 20:20, Bastien  wrote:

> Er, indeed - both bugs should now be fixed in maint.

Looks good to me, thanks!



Re: [O] Trouble with scheduled item with deadline on agenda

2018-04-26 Thread Alex Branham

On Thu 26 Apr 2018 at 19:25, Bastien <b...@gnu.org> wrote:

> Hi Alex,
>
> Alex Branham <alex.bran...@gmail.com> writes:
>
>> now deadlines aren't being put into the agenda at all
>> unless they are also scheduled. :-(
>
> Is this a bug or expected?  If this is a bug, can you send an example?

It's a bug. This should show up on today's agenda:

* TODO test
DEADLINE: <2018-04-27 Fri>

because the value of 'org-deadline-warning-days' is 14 and it's due
tomorrow, but it doesn't appear.



Re: [O] Trouble with scheduled item with deadline on agenda

2018-04-26 Thread Alex Branham

On Thu 26 Apr 2018 at 18:34, Bastien  wrote:
>> ** TODO Pay estimated taxes
>> SCHEDULED: <2018-03-31 Sat> DEADLINE: <2018-04-17 Tue -20d>
>>
>> and org-agenda-skip-deadline-prewarning-if-scheduled set to
>> 'prescheduled. Since it is scheduled for a date later than today I
>> would expect that it doesn't appear on my agenda today. However, it
>> looks like the prewarning -20d is causing it to appear anyway.
>>
>> Am I misunderstanding something here or is this a bug?
>
> yes, this is a bug, fixed now in maint, can you double check and let
> me know if things are working okay?

Thanks for the reply. It seems like this might be fixed though it's hard
to tell because now deadlines aren't being put into the agenda at all
unless they are also scheduled. :-(

Alex



Re: [O] Bug: Multiple tag selection broken on maint

2018-04-23 Thread Alex Branham
> Fixed. Thank you.

Thanks!

Alex



Re: [O] Bug: Multiple tag selection broken on maint

2018-04-20 Thread Alex Branham

On Fri 20 Apr 2018 at 04:27, Nicolas Goaziou  wrote:

>> #+BEGIN_EXAMPLE
>>   #+TAGS: office(c) car(C)
>>   * one
>> #+END_EXAMPLE
>
> FWIW, I couldn't reproduce it on master.

It seems to be a problem with org-tag-persistent-alist. I can't
reproduce it if that's nil, but if it's set to

(setq org-tag-persistent-alist '(("jobs" . ?j)
 (:startgroup . nil)
 ("@work" . ?w)
 ("@home" . ?h)
 (:endgroup . nil)))

then I can reproduce it.

Thanks,
Alex



Re: [O] Bug: Multiple tag selection broken on maint

2018-04-20 Thread Alex Branham

On Fri 20 Apr 2018 at 04:27, Nicolas Goaziou  wrote:

>> I'm tracking maint. With the following file:
>>
>> #+BEGIN_EXAMPLE
>>   #+TAGS: office(c) car(C)
>>   * one
>> #+END_EXAMPLE
>
> FWIW, I couldn't reproduce it on master.

That's surprising, since I can reproduce this on maint and master. Maybe
you need to have set `org-tag-persistent-alist'? I'll investigate a bit...



Re: [O] Support showing stars as pretty bullets

2018-04-10 Thread Alex Branham

On Thu 05 Apr 2018 at 07:50, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

Hi, and sorry for the delayed response.

> I don't think users should call M-x prettify-symbols-mode. Instead, they
> could call `org-art-prettify-buffer', an autoloaded function, which
> would properly initialize `prettify-symbols-mode' and so on. What
> mechanism is behind prettification is not important.

But then users of global-prettify-symbols-mode don't see the pretty
symbols in org buffers without knowing about and activating
org-pretty-mode. Anyway, the attached patch moves it to org-pretty.el.

> BTW, we could have a defcustom listings all eye candy
> `org-art-prettify-buffer' -- or simply `org-prettify-buffer' if the
> library is called "org-prettify" -- could do (e.g., headlines,
> bullets...).
>
>> prettify-symbols-alist isn't, so I don't think this should be either.
>
> Of course. But Org users may want to control what symbol is used.
> Anyway, I don't have a strong opinion about it.

I've left it as a defvar since there's no way for us to know about what
people want prettified where. Hopefully the default
prettify-symbols-compose-p function does an OK job, but people will have
to modify that if they customize org-pretty-alist anyway.

>>> Can it be tested somehow?
>>
>> I'll look into it

Can you see if these tests work for you? They work on my end, but I'm
not sure where to put them. Should they go into a new file
testing/lisp/test-org-pretty.el?

(ert-deftest test-org-pretty-mode ()
  "Test `org-pretty-mode'."
  (should
   (equal t
  (org-test-with-temp-text
  "* Test"
(org-pretty-mode)
(org-pretty-compose-p 1 1 "*")
)))
  (should-not
   (equal t
  (org-test-with-temp-text
  "* Test *"
(org-pretty-mode)
(org-pretty-compose-p 8 8 "*")


--------

>From 3278c7dd9d426bf205542c78d51456a96196988b Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Tue, 10 Apr 2018 10:38:09 -0500
Subject: [PATCH] New minor mode org-pretty-mode

* lisp/org-pretty.el: New file
* etc/ORG-NEWS: Document new minor mode
---
 etc/ORG-NEWS   |  9 ++
 lisp/org-pretty.el | 71 ++
 2 files changed, 80 insertions(+)
 create mode 100644 lisp/org-pretty.el

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0edd77115..0339a2df3 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -228,7 +228,16 @@ parameters.  See example bellow.
   select sysdate from dual;
   ,#+END_SRC
 #+END_SRC
+*** New minor mode ~org-pretty-mode~ supports showing prettier characters.
+By default, it replaces asterisks in headings with a utf8 bullet: •

+To enable, either call M-x org-pretty-mode or add
+
+#+BEGIN_SRC elisp
+  (add-hook 'org-mode-hook #'org-pretty-mode)
+#+END_SRC
+
+to your configuration file.
 ** New functions
 *** ~org-insert-structure-template~

diff --git a/lisp/org-pretty.el b/lisp/org-pretty.el
new file mode 100644
index 0..2f2aaa68d
--- /dev/null
+++ b/lisp/org-pretty.el
@@ -0,0 +1,71 @@
+;;; org-pretty.el --- Support for prettify-symbols-mode  -*- lexical-binding: 
t; -*-
+
+;; Copyright (C) 2018 Free Software Foundation, Inc.
+;;
+;; Author: J. Alexander Branham 
+;; Maintainer: emacs-orgmode@gnu.org
+;;
+;; This file is part of GNU Emacs.
+;;
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+;;
+;;; Commentary:
+;;
+;; This file adds support for `prettify-symbols-mode' in Org buffers.
+;; To use, call M-x org-prettify-mode or put
+;;
+;; (add-hook 'org-mode-hook #'org-prettify-mode)
+;;
+;; in your configuration file.
+
+;;; Code:
+
+(require 'org)
+
+(defvar-local org-pretty-alist '(("*" . ?•))
+  "An alist of symbols to prettify, see `prettify-symbols-alist'.
+Whether the symbol actually gets prettified is controlled by
+`org-pretty-compose-p', which see.")
+
+(defun org-pretty-compose-p (start end match)
+  "Return non-nil if the symbol between START and END is to be prettified.
+MATCH is the string match.  See also
+`prettify-symbols-compose-predicate'."
+  (if (string= match "*")
+  ;; Prettify asterisks in headings.
+  (and (org-match-line org-

Re: [O] Support showing stars as pretty bullets

2018-04-04 Thread Alex Branham

On Tue 03 Apr 2018 at 15:33, Nicolas Goaziou  wrote:

>> Fair enough. How about the attached patch instead? It only sets up the
>> two local variables in org.el and puts the rest in org-entities.el since
>> that file is also concerned with replacing characters with "prettier"
>> versions of themselves.
>
> I don't think it belongs to "org-entities.el" either. While it is true
> there is some prettification done there, this is not the sole point of
> the library. IOW, it is more than eye-candy; it affects, e.g., export.
>
> I really think it should go into a new "org-art.el" file.

The issue I see with putting it into org-art.el is that users won't be
able to just call M-x prettify-symbols-mode in an org buffer. They'll
have to do something like

(require 'org-art)
(add-hook 'org-mode-hook #'org-art-prettify)

or something like that. It seems like more work for users than setting
two variables in org-mode. There's also no way for users who prefer M-x
customize to easily activate it (unless we add a defcustom to org.el...)
Or am I missing something?

Let me know, everything else below is relatively minor.

Thanks again!

> More comments follow.
>
>> +;; prettify-mode
>> +(defvar-local org-prettify-alist '(("*" . ?•))
>> +  "An alist of symbols to prettify, see `prettify-symbols-alist'.
>> +Whether the symbol actually gets prettified is controlled by
>> +`org-pretty-compose-p', which see.")
>
> Should this be a defcustom?

prettify-symbols-alist isn't, so I don't think this should be either.

> Also, note that the name space must match library, so if it goes into
> "org-art.el", it ought to be named, e.g., `org-art-prettify-alist'.

Will do

>> +(defun org-pretty-compose-p (start end match)
>> +  "Return t if the symbol should be prettified.
>
> "Non-nil if symbol between START and END should be prettified.
> MATCH is ..."

Sure thing

>> +START and END are the start and end points, MATCH is the string
>> +match.  See also `prettify-symbols-compose-predicate'."
>> +  (if (string= match "*")
>> +  ;; prettify asterisks in headings
>> +  (org-at-heading-p)
>
> Doesn't this mean that any bold object in headline is going to be
> prettified?
>
> Maybe something like this (untested):
>
>   (and (org-match-line org-outline-regexp-bol)
>(< end (match-end 0)))

Thanks, this fixes the bug I mentioned in my first email. Seems to work
well on my end, too!

>> +;; else rely on the default function
>
> Nitpick:
>
>   ";; Else rely on the default function."
>
>> +  ;; Setup prettify mode
>
> Ditto:
>
>   ";; Setup prettify mode."

Sure, I'll fix those

>> +  (setq-local prettify-symbols-alist org-prettify-alist)
>> +  (setq-local prettify-symbols-compose-predicate
>> #'org-pretty-compose-p)
>
> This should also go into "org-art.el", which is an optional library. We
> don't want to activate anything related to it every time Org is loaded.
>
> Can it be tested somehow?

I'll look into it



Re: [O] Support showing stars as pretty bullets

2018-04-03 Thread Alex Branham

On Tue 03 Apr 2018 at 01:39, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

> Hello,
>
> Alex Branham <alex.bran...@gmail.com> writes:
>
>> Why not, if you don't mind me asking? Other major modes (python, elisp,
>> and latex off the top of my head) setup prettify-symbols themselves.
>
> Because "org.el" file is already 23 kloc long, and I'm trying to put it
> on a diet.

Fair enough. How about the attached patch instead? It only sets up the
two local variables in org.el and puts the rest in org-entities.el since
that file is also concerned with replacing characters with "prettier"
versions of themselves.

Alex



>From fda030b62e4cf28e25fd3264472b01f498749d5a Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Tue, 3 Apr 2018 09:25:33 -0500
Subject: [PATCH] Add support for showing stars as UTF bullets

* lisp/org.el(org-mode): Add local variables
* lisp/org-entities.el(org-pretty-compose-p): New function
* lisp/org-entities.el(org-prettify-alist): New variable
* etc/ORG-NEWS: Document new feature.
---
 etc/ORG-NEWS |  4 +++-
 lisp/org-entities.el | 17 +
 lisp/org.el  |  3 +++
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0edd77115..267ab336a 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -228,7 +228,9 @@ parameters.  See example bellow.
   select sysdate from dual;
   ,#+END_SRC
 #+END_SRC
-
+*** Add support for showing header stars as UTF-8 bullets
+This relies on ~prettify-symbols-mode~. To activate, either add this to
+~org-mode-hook~ or enable it globally with ~global-prettify-symbols-mode~.
 ** New functions
 *** ~org-insert-structure-template~

diff --git a/lisp/org-entities.el b/lisp/org-entities.el
index e291b521f..f4bdf9de8 100644
--- a/lisp/org-entities.el
+++ b/lisp/org-entities.el
@@ -29,6 +29,7 @@

 (declare-function org-toggle-pretty-entities "org"   ())
 (declare-function org-table-align"org-table" ())
+(declare-function prettify-symbols-default-compose-p "prog-mode" (start end 
match))

 (defgroup org-entities nil
   "Options concerning entities in Org mode."
@@ -589,6 +590,22 @@ This first checks the user list, then the built-in list."
   (org-toggle-pretty-entities)))
   (select-window (get-buffer-window "*Org Entity Help*")))

+;; prettify-mode
+(defvar-local org-prettify-alist '(("*" . ?•))
+  "An alist of symbols to prettify, see `prettify-symbols-alist'.
+Whether the symbol actually gets prettified is controlled by
+`org-pretty-compose-p', which see.")
+
+(defun org-pretty-compose-p (start end match)
+  "Return t if the symbol should be prettified.
+START and END are the start and end points, MATCH is the string
+match.  See also `prettify-symbols-compose-predicate'."
+  (if (string= match "*")
+  ;; prettify asterisks in headings
+  (org-at-heading-p)
+;; else rely on the default function
+(funcall #'prettify-symbols-default-compose-p start end match)))
+

 (provide 'org-entities)

diff --git a/lisp/org.el b/lisp/org.el
index 5e5087a59..6bf7fef2d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5487,6 +5487,9 @@ The following commands are available:
  (when org-startup-truncated (setq truncate-lines t))
  (when org-startup-indented (require 'org-indent) (org-indent-mode 1))
  (org-refresh-effort-properties)))
+  ;; Setup prettify mode
+  (setq-local prettify-symbols-alist org-prettify-alist)
+  (setq-local prettify-symbols-compose-predicate #'org-pretty-compose-p)
   ;; Try to set `org-hide' face correctly.
   (let ((foreground (org-find-invisible-foreground)))
 (when foreground
--
2.16.3



>From fda030b62e4cf28e25fd3264472b01f498749d5a Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Tue, 3 Apr 2018 09:25:33 -0500
Subject: [PATCH] Add support for showing stars as UTF bullets

* lisp/org.el(org-mode): Add local variables
* lisp/org-entities.el(org-pretty-compose-p): New function
* lisp/org-entities.el(org-prettify-alist): New variable
* etc/ORG-NEWS: Document new feature.
---
 etc/ORG-NEWS |  4 +++-
 lisp/org-entities.el | 17 +
 lisp/org.el  |  3 +++
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0edd77115..267ab336a 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -228,7 +228,9 @@ parameters.  See example bellow.
   select sysdate from dual;
   ,#+END_SRC
 #+END_SRC
-
+*** Add support for showing header stars as UTF-8 bullets
+This relies on ~prettify-symbols-mode~. To activate, either add this to
+~org-mode-hook~ or enable it globally with ~global-prettify-symbols-mode~.
 ** New functions
 *** ~org-insert-structure-template~
 
diff --git a/lisp/org-entities.el b/lisp/org-entities.el
i

Re: [O] Support showing stars as pretty bullets

2018-04-02 Thread Alex Branham

On Mon 02 Apr 2018 at 13:47, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

> Hello,
>
> Alex Branham <alex.bran...@gmail.com> writes:
>
>> I've written this patch that makes use of prettify-symbols-mode to show
>> the stars in org headings as nice UTF bullets. There's already
>> org-bullet-mode[1] but that seems to have been abandoned, plus it isn't
>> included in org mode itself.
>
> Is it abandoned, or simply complete? Org lists haven't changed for
> a while.

Seems abandoned. The author hasn't had any activity on github since May
2015. Several issues and PR's have accumulated. Mind you, it still works
well overall. Looking more into this, there's already been some
discussion about it: https://github.com/sabof/org-bullets/issues/18

> In any case, I don't think this belongs to "org.el" proper.

Why not, if you don't mind me asking? Other major modes (python, elisp,
and latex off the top of my head) setup prettify-symbols themselves.

> It could go into some "org-art.el" library (along with Org bullet mode,
> or something that would auto-number headlines) within the code base, or
> simply in GNU ELPA.

I'm fine putting it into org-XXX.el if you want. I didn't for now since
it's only a few lines of code.

Thanks for the comments!
Alex



[O] Support showing stars as pretty bullets

2018-04-01 Thread Alex Branham
Hello,

I've written this patch that makes use of prettify-symbols-mode to show
the stars in org headings as nice UTF bullets. There's already
org-bullet-mode[1] but that seems to have been abandoned, plus it isn't
included in org mode itself.

The one bug right now is that it'll show an asterisk as a UTF bullet if
it's _anywhere_ on a heading line. Is there an easy way to check if a
character is a part of the beginning stars? If this is something you'd
be interested in adding to org-mode, I can fix this part before the
change gets applied.

I've checked it out with and without org-indent-mode and hiding leading
stars. Everything seems to work well for me.

I've already signed the FSF copyright assignment papers.

Please cc me on replies since I'm not subscribed to the devel list :-)

Thanks,
Alex

Footnotes:
[1]  https://github.com/sabof/org-bullets



>From 8ab48ccd43446bbe447108153c2dbb742d81895b Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Sun, 1 Apr 2018 15:49:31 -0500
Subject: [PATCH] Add support for showing stars as UTF bullets

* lisp/org.el(org-mode): Add local variables
* lisp/org.el(org-pretty-compose-p): New function
* lisp/org.el(org-prettify-alist): New variable
* etc/ORG-NEWS: Document new feature.
---
 etc/ORG-NEWS |  3 +++
 lisp/org.el  | 15 +++
 2 files changed, 18 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0edd77115..bb57e9e82 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -228,6 +228,9 @@ parameters.  See example bellow.
   select sysdate from dual;
   ,#+END_SRC
 #+END_SRC
+*** Add support for showing header stars as UTF-8 bullets
+This relies on ~prettify-symbols-mode~. To activate, either add this to
+~org-mode-hook~ or enable it globally with ~global-prettify-symbols-mode~.

 ** New functions
 *** ~org-insert-structure-template~
diff --git a/lisp/org.el b/lisp/org.el
index 5e5087a59..35cc33c00 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5487,6 +5487,9 @@ The following commands are available:
  (when org-startup-truncated (setq truncate-lines t))
  (when org-startup-indented (require 'org-indent) (org-indent-mode 1))
  (org-refresh-effort-properties)))
+  ;; Setup prettify mode
+  (setq-local prettify-symbols-alist org-prettify-alist)
+  (setq-local prettify-symbols-compose-predicate #'org-pretty-compose-p)
   ;; Try to set `org-hide' face correctly.
   (let ((foreground (org-find-invisible-foreground)))
 (when foreground
@@ -9551,6 +9554,18 @@ The cdr of LINK must be either a link description or 
nil."
 (concat (format "%-45s" (substring desc 0 (min (length desc) 40)))
"<" (car link) ">")))

+(defvar-local org-prettify-alist '(("*" . ?•))
+  "An alist of symbols to prettify, see `prettify-symbols-alist'.
+Whether the symbol actually gets prettified is controlled by
+`org-pretty-compose-p', which see.")
+
+(defun org-pretty-compose-p (_start _end match)
+  "Return t if the symbol should be prettified.
+MATCH is the string match.  See also
+`prettify-symbols-compose-predicate'."
+  (when (string= match "*")
+(org-at-heading-p)))
+
 ;;;###autoload
 (defun org-insert-link-global ()
   "Insert a link like Org mode does.
--
2.16.3


>From 8ab48ccd43446bbe447108153c2dbb742d81895b Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Sun, 1 Apr 2018 15:49:31 -0500
Subject: [PATCH] Add support for showing stars as UTF bullets

* lisp/org.el(org-mode): Add local variables
* lisp/org.el(org-pretty-compose-p): New function
* lisp/org.el(org-prettify-alist): New variable
* etc/ORG-NEWS: Document new feature.
---
 etc/ORG-NEWS |  3 +++
 lisp/org.el  | 15 +++
 2 files changed, 18 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0edd77115..bb57e9e82 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -228,6 +228,9 @@ parameters.  See example bellow.
   select sysdate from dual;
   ,#+END_SRC
 #+END_SRC
+*** Add support for showing header stars as UTF-8 bullets
+This relies on ~prettify-symbols-mode~. To activate, either add this to
+~org-mode-hook~ or enable it globally with ~global-prettify-symbols-mode~.
 
 ** New functions
 *** ~org-insert-structure-template~
diff --git a/lisp/org.el b/lisp/org.el
index 5e5087a59..35cc33c00 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5487,6 +5487,9 @@ The following commands are available:
  (when org-startup-truncated (setq truncate-lines t))
  (when org-startup-indented (require 'org-indent) (org-indent-mode 1))
  (org-refresh-effort-properties)))
+  ;; Setup prettify mode
+  (setq-local prettify-symbols-alist org-prettify-alist)
+  (setq-local prettify-symbols-compose-predicate #'org-pretty-compose-p)
   ;; Try to set `org-hide' face correctly.
   (let ((foreground (org-find-invisible-foreground)))
 (when foreground
@@ -9551,6 +9554,18 @@ The cd

[O] Trouble with scheduled item with deadline on agenda

2018-03-29 Thread Alex Branham
Hello -

I have this item in one of my agenda files:

** TODO Pay estimated taxes
SCHEDULED: <2018-03-31 Sat> DEADLINE: <2018-04-17 Tue -20d>

and org-agenda-skip-deadline-prewarning-if-scheduled set to 'prescheduled. 
Since it is scheduled for a date later than today I would expect that it 
doesn't appear on my agenda today. However, it looks like the prewarning -20d 
is causing it to appear anyway.

Am I misunderstanding something here or is this a bug?

Thanks,
Alex



[O] Bug: Multiple tag selection broken on maint

2018-03-22 Thread Alex Branham

I'm tracking maint. With the following file:

#+BEGIN_EXAMPLE
  #+TAGS: office(c) car(C)
  * one
#+END_EXAMPLE

Doing C-c C-q on the "one" heading will not let me set both office and
car tags. They are highlighted in the little selection popup, but only
the last one selected actually gets added.


Emacs  : GNU Emacs 26.0.91 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d 
scroll bars)
 of 2018-03-20
Package: Org mode version 9.1.7 (release_9.1.7-31-gb5a90a @ 
/home/alex/.emacs.d/lib/org/lisp/)



[O] Broken worg link

2018-02-27 Thread Alex Branham
On this page:

https://orgmode.org/worg/org-tutorials/org-google-sync.html

the link ical2org.awk 404s for me.

Thanks,
Alex



Re: [O] face for upcoming deadlines in agenda

2018-02-26 Thread Alex Branham

On Mon 26 Feb 2018 at 18:30, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

> Hello,
>
> Alex Branham <alex.bran...@gmail.com> writes:
>
>> I've attached a patch which gives a name to the 0.0 face in
>> org-agenda-deadline-faces. This lets themes customize the value more
>> easily. (I've already signed the FSF copyright papers)
>
> Thank you. Could you also provide a short ORG-NEW entry about it?

Done, thanks



>From 66a394b3736306e4039b29393915b4ca1821a86b Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Mon, 26 Feb 2018 18:39:50 -0600
Subject: [PATCH] * lisp/org-faces.el(org-upcoming-distant-deadline-face): new
 face

---
 etc/ORG-NEWS  | 2 +-
 lisp/org-faces.el | 9 +++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index aff372582..a40dd1b9a 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -188,7 +188,7 @@ you should expect to see something like:
 #+BEGIN_EXAMPLE
   ,#+STARTUP: shrink
 #+END_EXAMPLE
-
+*** New face ~org-upcoming-distant-deadline~ which is meant to be used as the 
face for distant deadlines, see ~org-agenda-deadline-faces~
 ** New functions
 *** ~org-insert-structure-template~
 
diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 750ada1e9..ef00f5b2c 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -511,13 +511,18 @@ which days belong to the weekend."
 (((class color) (min-colors 8)  (background light)) (:foreground "red"))
 (((class color) (min-colors 8)  (background dark)) (:foreground "red" 
:bold t))
 (t (:bold t)))
-  "Face for items scheduled previously, and not yet done."
+  "Face for items scheduled previously, and not yet done.
+See also `org-agenda-deadline-faces'."
   :group 'org-faces)
 
+(defface org-upcoming-distant-deadline '((t :inherit org-default))
+  "Face for items scheduled previously, not done, and have a distant deadline.
+See also `org-agenda-deadline-faces'.")
+
 (defcustom org-agenda-deadline-faces
   '((1.0 . org-warning)
 (0.5 . org-upcoming-deadline)
-(0.0 . default))
+(0.0 . org-upcoming-distant-deadline))
   "Faces for showing deadlines in the agenda.
 This is a list of cons cells.  The cdr of each cell is a face to be used,
 and it can also just be like \\='(:foreground \"yellow\").
-- 
2.16.2


>From 66a394b3736306e4039b29393915b4ca1821a86b Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Mon, 26 Feb 2018 18:39:50 -0600
Subject: [PATCH] * lisp/org-faces.el(org-upcoming-distant-deadline-face): new
 face

---
 etc/ORG-NEWS  | 2 +-
 lisp/org-faces.el | 9 +++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index aff372582..a40dd1b9a 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -188,7 +188,7 @@ you should expect to see something like:
 #+BEGIN_EXAMPLE
   ,#+STARTUP: shrink
 #+END_EXAMPLE
-
+*** New face ~org-upcoming-distant-deadline~ which is meant to be used as the face for distant deadlines, see ~org-agenda-deadline-faces~
 ** New functions
 *** ~org-insert-structure-template~
 
diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 750ada1e9..ef00f5b2c 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -511,13 +511,18 @@ which days belong to the weekend."
 (((class color) (min-colors 8)  (background light)) (:foreground "red"))
 (((class color) (min-colors 8)  (background dark)) (:foreground "red" :bold t))
 (t (:bold t)))
-  "Face for items scheduled previously, and not yet done."
+  "Face for items scheduled previously, and not yet done.
+See also `org-agenda-deadline-faces'."
   :group 'org-faces)
 
+(defface org-upcoming-distant-deadline '((t :inherit org-default))
+  "Face for items scheduled previously, not done, and have a distant deadline.
+See also `org-agenda-deadline-faces'.")
+
 (defcustom org-agenda-deadline-faces
   '((1.0 . org-warning)
 (0.5 . org-upcoming-deadline)
-(0.0 . default))
+(0.0 . org-upcoming-distant-deadline))
   "Faces for showing deadlines in the agenda.
 This is a list of cons cells.  The cdr of each cell is a face to be used,
 and it can also just be like \\='(:foreground \"yellow\").
-- 
2.16.2



Re: [O] face for upcoming deadlines in agenda

2018-02-26 Thread Alex Branham
I've attached a patch which gives a name to the 0.0 face in
org-agenda-deadline-faces. This lets themes customize the value more
easily. (I've already signed the FSF copyright papers)

Thanks again!
Alex

--

>From 1a3f167583f9c964b37f92f2f0a4d67840749677 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Mon, 26 Feb 2018 16:41:40 -0600
Subject: [PATCH] * lisp/org-faces.el(org-upcoming-distant-deadline-face): new
 face

---
 lisp/org-faces.el | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 750ada1e9..ef00f5b2c 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -511,13 +511,18 @@ which days belong to the weekend."
 (((class color) (min-colors 8)  (background light)) (:foreground "red"))
 (((class color) (min-colors 8)  (background dark)) (:foreground "red" 
:bold t))
 (t (:bold t)))
-  "Face for items scheduled previously, and not yet done."
+  "Face for items scheduled previously, and not yet done.
+See also `org-agenda-deadline-faces'."
   :group 'org-faces)

+(defface org-upcoming-distant-deadline '((t :inherit org-default))
+  "Face for items scheduled previously, not done, and have a distant deadline.
+See also `org-agenda-deadline-faces'.")
+
 (defcustom org-agenda-deadline-faces
   '((1.0 . org-warning)
 (0.5 . org-upcoming-deadline)
-(0.0 . default))
+(0.0 . org-upcoming-distant-deadline))
   "Faces for showing deadlines in the agenda.
 This is a list of cons cells.  The cdr of each cell is a face to be used,
 and it can also just be like \\='(:foreground \"yellow\").
--
2.16.2


>From 1a3f167583f9c964b37f92f2f0a4d67840749677 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Mon, 26 Feb 2018 16:41:40 -0600
Subject: [PATCH] * lisp/org-faces.el(org-upcoming-distant-deadline-face): new
 face

---
 lisp/org-faces.el | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/org-faces.el b/lisp/org-faces.el
index 750ada1e9..ef00f5b2c 100644
--- a/lisp/org-faces.el
+++ b/lisp/org-faces.el
@@ -511,13 +511,18 @@ which days belong to the weekend."
 (((class color) (min-colors 8)  (background light)) (:foreground "red"))
 (((class color) (min-colors 8)  (background dark)) (:foreground "red" :bold t))
 (t (:bold t)))
-  "Face for items scheduled previously, and not yet done."
+  "Face for items scheduled previously, and not yet done.
+See also `org-agenda-deadline-faces'."
   :group 'org-faces)
 
+(defface org-upcoming-distant-deadline '((t :inherit org-default))
+  "Face for items scheduled previously, not done, and have a distant deadline.
+See also `org-agenda-deadline-faces'.")
+
 (defcustom org-agenda-deadline-faces
   '((1.0 . org-warning)
 (0.5 . org-upcoming-deadline)
-(0.0 . default))
+(0.0 . org-upcoming-distant-deadline))
   "Faces for showing deadlines in the agenda.
 This is a list of cons cells.  The cdr of each cell is a face to be used,
 and it can also just be like \\='(:foreground \"yellow\").
-- 
2.16.2



Re: [O] face for upcoming deadlines in agenda

2018-02-26 Thread Alex Branham

On Mon 26 Feb 2018 at 16:16, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

> Hello,
>
> Alex Branham <alex.bran...@gmail.com> writes:
>
>> Is there a face that controls agenda items with an upcoming deadline are
>> displayed? It seems to just use "default" for me. I'm talking about
>> items with a deadline within 'org-deadline-warning-days' number of days
>> from now.
>
> See `org-agenda-deadline-faces'

Perfect, thanks!

Alex 



[O] face for upcoming deadlines in agenda

2018-02-26 Thread Alex Branham
Is there a face that controls agenda items with an upcoming deadline are
displayed? It seems to just use "default" for me. I'm talking about
items with a deadline within 'org-deadline-warning-days' number of days
from now.

If not, is there any way of getting someone to implement that? I'd do it
myself, but the way Emacs deals with faces is a bit of a mystery to me.

Thanks,
Alex

Emacs  : GNU Emacs 26.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.26)
 of 2018-02-10
Package: Org mode version 9.1.7 (release_9.1.7-1-ga01045 @ 
/home/alex/.emacs.d/lib/org/lisp/)



[O] Error with git-fetch from org repo

2017-12-15 Thread Alex Branham
Hello -

I've been trying to git fetch from the org repo
(git://orgmode.org/org-mode.git) today and keep getting this error:

Fetching origin
fatal: read error: Connection reset by peer
error: Could not fetch origin

Has anyone else had problems connecting?

Thanks,
Alex



Re: [O] [PATCH] make org-comment-dwim comment headings if on a heading

2017-11-29 Thread Alex Branham

On Wed 29 Nov 2017 at 13:46, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:
> I also added TINYCHANGE at the end of the commit message. Please
> consider signing FSF papers if you haven't done so. If you did, let me
> know it so I can update our registry.

I've signed the papers. 

>
> Would you mind writing an entry in ORG-NEWS? It could go in
> "Miscellaneous" section.

Patch attached, thanks!

>
> Thank you!
>
> Regards,

>From 1d62a9c612c97dd35929a40c49d86a5812a853e9 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Wed, 29 Nov 2017 09:21:58 -0600
Subject: [PATCH] ORG-NEWS: Document new behavior of org-comment-dwim on
 headings

---
 etc/ORG-NEWS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index b41804edb..402fc8e52 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -188,6 +188,7 @@ file links, which lead to them being broken in web browsers. Now both
 of these exporters will properly export to =irc:= links, which will
 open properly in irc clients from web browsers.
 
+*** ~org-comment-dwim~ (bound to =M-;=) now comments headings, if point is on a heading
 * Version 9.1
 
 ** Incompatible changes
-- 
2.15.0



Re: [O] [PATCH] make org-comment-dwim comment headings if on a heading

2017-11-26 Thread Alex Branham
Thanks. I've been trying to do that and ran into an issue that you can 
hopefully help me understand.

I've attached the updated patch (with a test), but the test fails because 
calling M-x comment-dwim in an org buffer on a heading results in the old 
behavior of comment-dwim rather than the new behavior. Calling M-x 
org-comment-dwim directly works as I expect (and M-; works like this too). Do 
you have any idea what might be going on? I thought they would behave the same 
since comment-dwim is mapped to org-comment-dwim, but that doesn't seem to be 
the case...

Thanks,
Alex

On Wed 22 Nov 2017 at 23:17, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

> Hello,
>
> Alex Branham <alex.bran...@gmail.com> writes:
>
>> This patch changes the behavior of `org-comment-dwim' so that if point
>> is on a heading, it will toggle the heading.
>
> Thank you. 
>
> Could you add a test to test-org/comment-dwim from "test-org.el"?
>
> Regards,

>From 477d7172f1c93a7162e2daef3578d26731c8 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Sun, 26 Nov 2017 21:02:28 -0600
Subject: [PATCH] Make org-comment-dwim check if on a heading

* lisp/org.el (org-comment-dwim): if on a heading, comment the heading
* testing/lisp/test-org.el: add a test for comment-dwim on org headings
---
 lisp/org.el  | 14 +-
 testing/lisp/test-org.el |  6 ++
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 2b33a2163..b17c96614 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -23324,12 +23324,16 @@ strictly within a source block, use appropriate comment syntax."
 		(forward-line)
 
 (defun org-comment-dwim (_arg)
-  "Call `comment-dwim' within a source edit buffer if needed."
-  (interactive "*P")
-  (if (org-in-src-block-p)
-  (org-babel-do-in-edit-buffer (call-interactively 'comment-dwim))
-(call-interactively 'comment-dwim)))
+  "Call the comment command you mean.
 
+Calls `org-toggle-comment' if on a heading, otherwise call
+`comment-dwim' (within a source edit buffer if needed)."
+  (interactive "*P")
+  (cond ((org-at-heading-p)
+	 (call-interactively #'org-toggle-comment))
+	((org-in-src-block-p)
+	 (org-babel-do-in-edit-buffer (call-interactively #'comment-dwim)))
+	(t (call-interactively #'comment-dwim
 
 ;;; Timestamps API
 
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index d067c04ff..a97384a4e 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -153,6 +153,12 @@
 	  (org-test-with-temp-text "#+KEYWORD: value"
 	(progn (call-interactively 'comment-dwim)
 		   (buffer-string)
+  ;; Comment a heading
+  (should
+   (equal "* COMMENT Test"
+	  (org-test-with-temp-text "* Test"
+	(progn (call-interactively 'comment-dwim)
+		   (buffer-string)
   ;; In a source block, use appropriate syntax.
   (should
(equal "  ;; "
-- 
2.15.0



[O] [PATCH] make org-comment-dwim comment headings if on a heading

2017-11-20 Thread Alex Branham
This patch changes the behavior of `org-comment-dwim' so that if point is on a 
heading, it will toggle the heading.

Alex

>From 655cd7afdfdf28797052952eae0c4e87cd86f445 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Mon, 20 Nov 2017 15:12:34 -0600
Subject: [PATCH] Make org-comment-dwim comment headings if point is at heading

* listp/org.el (org-comment-dwim): If point is on heading, call
  org-toggle-comment.
---
 lisp/org.el | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index f873f1021..25fa3a533 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -22817,11 +22817,16 @@ strictly within a source block, use appropriate 
comment syntax."
(forward-line)
 
 (defun org-comment-dwim (_arg)
-  "Call `comment-dwim' within a source edit buffer if needed."
+  "Call the comment command you mean.
+
+Calls `org-toggle-comment' if on a heading, otherwise call
+`comment-dwim' (within a source edit buffer if needed)."
   (interactive "*P")
-  (if (org-in-src-block-p)
-  (org-babel-do-in-edit-buffer (call-interactively 'comment-dwim))
-(call-interactively 'comment-dwim)))
+  (cond ((org-at-heading-p)
+(call-interactively #'org-toggle-comment))
+   ((org-in-src-block-p)
+(org-babel-do-in-edit-buffer (call-interactively #'comment-dwim)))
+   (t (call-interactively #'comment-dwim
 
 
 ;;; Timestamps API
-- 
2.15.0



>From 43fd460accf071e1c69df5fcbbcce0e4943563f2 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Mon, 20 Nov 2017 15:08:09 -0600
Subject: [PATCH] Make org-comment-dwim check if on a heading

* lisp/org.el (org-comment-dwim): if on a heading, comment the heading
---
 lisp/org.el | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index f873f1021..81bc9278f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -22817,11 +22817,16 @@ strictly within a source block, use appropriate comment syntax."
 		(forward-line)
 
 (defun org-comment-dwim (_arg)
-  "Call `comment-dwim' within a source edit buffer if needed."
+  "Call the comment command you mean.
+
+Calls `org-toggle-comment' if on a heading, otherwise call
+`comment-dwim' (within a source edit buffer if needed)."
   (interactive "*P")
-  (if (org-in-src-block-p)
-  (org-babel-do-in-edit-buffer (call-interactively 'comment-dwim))
-(call-interactively 'comment-dwim)))
+  (cond ((org-on-heading-p)
+	 (call-interactively #'org-toggle-comment))
+	((org-in-src-block-p)
+	 (org-babel-do-in-edit-buffer (call-interactively #'comment-dwim)))
+	(t (call-interactively #'comment-dwim
 
 
 ;;; Timestamps API
-- 
2.15.0



[O] [PATCH] documentation fix

2017-10-31 Thread Alex Branham
Hello,

I tripped myself up by trying to set org-agenda-show-log instead of 
org-agenda-start-with-log, so hopefully this patch will help other people down 
the line.

Alex

>From 47e1c3a9cd66d73c01ec0b4072228c02abbe0450 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Tue, 31 Oct 2017 14:08:00 -0500
Subject: [PATCH] org-agenda: documentation addition

* lisp/org-agenda.el: Add documentation to `org-agenda-show-log'
---
 lisp/org-agenda.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 750221e46..39761121a 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2092,7 +2092,9 @@ evaluate to a string."
 (defvar org-agenda-follow-mode nil)
 (defvar org-agenda-entry-text-mode nil)
 (defvar org-agenda-clockreport-mode nil)
-(defvar org-agenda-show-log nil)
+(defvar org-agenda-show-log nil
+  "If non-nil, show the log in the agenda.
+Do not set this directly; instead use `org-agenda-start-with-log-mode', which see.")
 (defvar org-agenda-redo-command nil)
 (defvar org-agenda-query-string nil)
 (defvar org-agenda-mode-hook nil
-- 
2.15.0



Re: [O] Ediff org files starts folded

2017-10-25 Thread Alex Branham
Thanks, I think this does exactly what I was looking for!

Alex

On Wed 25 Oct 2017 at 18:30, Oleh Krehel  wrote:

> Here's what I use:
>
> (defun ora-ediff-prepare-buffer ()
>   (when (memq major-mode '(org-mode emacs-lisp-mode))
> (outline-show-all)))
>
> (add-hook 'ediff-prepare-buffer-hook 'ora-ediff-prepare-buffer)
>
> regards,
> Oleh




[O] Ediff org files starts folded

2017-10-25 Thread Alex Branham
Hello -

Whenever I ediff an org file, the three windows start with the content folded 
and out of site. I have to navigate to windows A, B, and C and hit S- 
until everything is visible. Does anyone know a way to start org mode files 
unfolded when ediffing them?

Thanks!
Alex



[O] Firefox webextension for org capture

2017-08-17 Thread Alex Branham
Hi all -

Apologies for not replying to the right thread; I couldn't figure out how to 
since I'm not subscribed to the list.

There already exists a Firefox webextension for org capture. Here is the github 
page:  https://github.com/sprig/org-capture-extension

And here is the link to AMO: 
https://addons.mozilla.org/en-US/firefox/addon/org-capture/

Note that there is currently a bug that prevents the keyboard shortcut from 
working. I think that will be fixed within the next week or two.

Also, Mozilla's implementation of webextensions isn't finished yet, so you 
cannot currently change the (nonworking) keyboard shortcut. When it starts 
working again, the default is control-shift-l

Alex



Re: [O] [PATCH] allow users to customize string in org-agenda-time-grid

2017-07-11 Thread Alex Branham
Hi Nicolas,

>> Note that this way, users who have set org-agenda-time-grid to a list
>> with three elements will see a slightly different agenda now (the
>> default ".." will get dropped).
>
> I think this is acceptable if we properly announce it in ORG-NEWS.
>
>> The order of the items in the list is also a bit weird --- they get
>> displayed in the order 3, 4, 2. I've updated the docstring to try to
>> make this a bit clearer.
>
> True. While we're at making an incompatible change on the variable, do
> you think it makes sense to change the order of the parameters?
>
> If so, would you want to update your patch accordingly?

Sure, I've updated that variable so that the items are in the order that they 
get displayed in the agenda.

> You need to specify the variable being changed, i.e.,
>
>   * lisp/org-agenda.el (org-agenda-time-grid): ...
>
> Could you provide an ORG-NEWS entry, too?

Yes, done.

Alex

>From da08983716a275b745288a25995e6c9d4e3104ca Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Tue, 11 Jul 2017 08:08:58 +0200
Subject: [PATCH] org-agenda: change order of items, support custom time grid
 string

* lisp/org-agenda.el (org-agenda-time-grid): Users may now customize
the string to display after the time in the agenda.  The order of
items was updated to reflect the order that they are displayed in the
agenda.

TINYCHANGE
---
 etc/ORG-NEWS   |  6 ++
 lisp/org-agenda.el | 31 +++
 2 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index b7e2a5fad..936ecc36b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -87,6 +87,12 @@ See docstring for details.

 *** Change signature for ~org-time-string-to-time~
 See docstring for changes.
+
+*** Change order of items in ~org-agenda-time-grid~
+~org-agenda-time-grid~ gained an extra item to allow users to customize
+the string displayed after times in the agenda. See docstring for
+details.
+
 ** New features
 *** ~org-attach~ can move directory contents
 When setting a new directory for an entry, org-attach offers to move
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 0ddb8ce1e..9ac4f6583 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1479,11 +1479,12 @@ the variable `org-agenda-time-grid'."

 (defcustom org-agenda-time-grid
   '((daily today require-timed)
-""
-(800 1000 1200 1400 1600 1800 2000))
+(800 1000 1200 1400 1600 1800 2000)
+".."
+"")

   "The settings for time grid for agenda display.
-This is a list of three items.  The first item is again a list.  It contains
+This is a list of four items.  The first item is again a list.  It contains
 symbols specifying conditions when the grid should be displayed:

  daily if the agenda shows a single day
@@ -1492,10 +1493,14 @@ symbols specifying conditions when the grid should be 
displayed:
  require-timed show grid only if at least one item has a time specification
  remove-match  skip grid times already present in an entry

-The second item is a string which will be placed behind the grid time.
+The second item is a list of integers, indicating the times that
+should have a grid line.

-The third item is a list of integers, indicating the times that should have
-a grid line."
+The third item is a string which will be placed right after the
+times that have a grid line.
+
+The fourth item is a string placed after the grid times.  This
+will align with agenda items"
   :group 'org-agenda-time-grid
   :type
   '(list
@@ -1507,8 +1512,9 @@ a grid line."
require-timed)
 (const :tag "Skip grid times already present in an entry"
remove-match))
-(string :tag "Grid String")
-(repeat :tag "Grid Times" (integer :tag "Time"
+(repeat :tag "Grid Times" (integer :tag "Time"))
+(string :tag "Grid String (after agenda times)")
+(string :tag "Grid String (aligns with agenda items)")))

 (defcustom org-agenda-show-current-time-in-grid t
   "Non-nil means show the current time in the time grid."
@@ -6418,6 +6424,7 @@ Any match of REMOVE-RE will be removed from TXT."
  (get-text-property 1 'effort txt)))
 ;; time, tag, effort are needed for the eval of the prefix format
 (tag (if tags (nth (1- (length tags)) tags) ""))
+(time-grid-trailing-characters (nth 2 org-agenda-time-grid))
 time
 (ts (if dotime (concat
 (if (stringp dotime) dotime "")
@@ -6496,8 +6503,8 @@ Any match of REMOVE-RE will be removed from TXT."
 (s1 (concat

Re: [O] [PATCH] allow users to customize string in org-agenda-time-grid

2017-07-11 Thread Alex Branham
Hi Samuel,

`org-agenda-current-time-string' allows users to customize the string 
associated with the current time. It's currently something like, "--- now 
". The patch I'm submitting allows users to customize the string that 
comes after the times displayed in the time-grid (assuming that it displays at 
all). Currently that's hard coded as six periods "..".

Alex

On Mon 10 Jul 2017 at 20:02, Samuel Wales <samolog...@gmail.com> wrote:

> i am confused
>
> org-agenda-current-time-string seems similar
>
> org-agenda-time-grid says "The second item is a string which will be
> placed behind the grid time."
>
>
> On 7/6/17, Alex Branham <bran...@utexas.edu> wrote:
>> Hello,
>>
>> This small patch allows users to customize the string to display after the
>> time in the agenda view.


--
J. Alexander Branham
PhD Candidate
Department of Government
University of Texas at Austin
https://www.jabranham.com



Re: [O] [PATCH] allow users to customize string in org-agenda-time-grid

2017-07-07 Thread Alex Branham
Hi -

On Fri 07 Jul 2017 at 07:32, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

> Would it be better to extend `org-agenda-time-grid' instead? It could,
> e.g., support a fourth element in the list.

Sure, that's possible. Patch attached. Note that this way, users who have set 
org-agenda-time-grid to a list with three elements will see a slightly 
different agenda now (the default ".." will get dropped). The order of the 
items in the list is also a bit weird --- they get displayed in the order 3, 4, 
2. I've updated the docstring to try to make this a bit clearer.

Alex

>From 12e5561b1df1d86a45e7c418dd7dd44763e52423 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Fri, 7 Jul 2017 10:29:28 +0200
Subject: [PATCH] org-agenda.el: Allow users to customize string after
 time-grid

* org-agenda.el: Users may now customize the string to display after
the time in the agenda by using the fourth element of org-agenda-time-grid.

TINYCHANGE
---
 lisp/org-agenda.el | 19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index ddd1b7d11..d479a7f61 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1480,7 +1480,8 @@ the variable `org-agenda-time-grid'."
 (defcustom org-agenda-time-grid
   '((daily today require-timed)
 ""
-(800 1000 1200 1400 1600 1800 2000))
+(800 1000 1200 1400 1600 1800 2000)
+"..")

   "The settings for time grid for agenda display.
 This is a list of three items.  The first item is again a list.  It contains
@@ -1492,10 +1493,12 @@ symbols specifying conditions when the grid should be 
displayed:
  require-timed show grid only if at least one item has a time specification
  remove-match  skip grid times already present in an entry

-The second item is a string which will be placed behind the grid time.
+The second item is a string which will be placed where agenda items are 
displayed.

 The third item is a list of integers, indicating the times that should have
-a grid line."
+a grid line.
+
+The fourth item is a string placed after the grid times and before agenda 
items."
   :group 'org-agenda-time-grid
   :type
   '(list
@@ -1507,8 +1510,9 @@ a grid line."
require-timed)
 (const :tag "Skip grid times already present in an entry"
remove-match))
-(string :tag "Grid String")
-(repeat :tag "Grid Times" (integer :tag "Time"
+(string :tag "Grid String (after)")
+(repeat :tag "Grid Times" (integer :tag "Time"))
+(string :tag "Grid String (before)")))

 (defcustom org-agenda-show-current-time-in-grid t
   "Non-nil means show the current time in the time grid."
@@ -6400,6 +6404,7 @@ Any match of REMOVE-RE will be removed from TXT."
  (get-text-property 1 'effort txt)))
 ;; time, tag, effort are needed for the eval of the prefix format
 (tag (if tags (nth (1- (length tags)) tags) ""))
+(time-grid-trailing-characters (nth 3 org-agenda-time-grid))
 time
 (ts (if dotime (concat
 (if (stringp dotime) dotime "")
@@ -6478,8 +6483,8 @@ Any match of REMOVE-RE will be removed from TXT."
 (s1 (concat
  (org-agenda-time-of-day-to-ampm-maybe s1)
  (if org-agenda-timegrid-use-ampm
- " "
-   "..")))
+  (concat time-grid-trailing-characters " ")
+time-grid-trailing-characters)))
 (t ""))
  extra (or (and (not habitp) extra) "")
  category (if (symbolp category) (symbol-name category) category)
--
2.13.2


>From 12e5561b1df1d86a45e7c418dd7dd44763e52423 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Fri, 7 Jul 2017 10:29:28 +0200
Subject: [PATCH] org-agenda.el: Allow users to customize string after
 time-grid

* org-agenda.el: Users may now customize the string to display after
the time in the agenda by using the fourth element of org-agenda-time-grid.

TINYCHANGE
---
 lisp/org-agenda.el | 19 ---
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index ddd1b7d11..d479a7f61 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1480,7 +1480,8 @@ the variable `org-agenda-time-grid'."
 (defcustom org-agenda-time-grid
   '((daily today require-timed)
 ""
-(800 1000 1200 1400 1600 1800 2000))
+(800 1000 1200 1400 1600 1800 2000)
+"..")
 

[O] [PATCH] allow users to customize string in org-agenda-time-grid

2017-07-07 Thread Alex Branham
Hello,

This small patch allows users to customize the string to display after the time 
in the agenda view.

I think I formatted the patch correctly, but please let me know if I missed 
something,
Alex



>From 3e1a9a4a0cde14e1496c355028c9ef3c8b75b9e2 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Fri, 7 Jul 2017 08:25:38 +0200
Subject: [PATCH] org-agenda.el: Allow users to customize string after
 time-grid

* org-agenda.el: Users may now customize the string to display after
the time in the agenda with the variable
`org-agenda-time-grid-trailing-characters'.

TINYCHANGE
---
 lisp/org-agenda.el | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index ddd1b7d11..43b844cc3 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1510,6 +1510,11 @@ a grid line."
 (string :tag "Grid String")
 (repeat :tag "Grid Times" (integer :tag "Time"

+(defcustom org-agenda-time-grid-trailing-characters ".."
+  "Characters to show after time when `org-agenda-use-time-grid' is non-nil."
+  :group 'org-agenda-time-grid
+  :type 'string)
+
 (defcustom org-agenda-show-current-time-in-grid t
   "Non-nil means show the current time in the time grid."
   :group 'org-agenda-time-grid
@@ -6478,8 +6483,8 @@ Any match of REMOVE-RE will be removed from TXT."
 (s1 (concat
  (org-agenda-time-of-day-to-ampm-maybe s1)
  (if org-agenda-timegrid-use-ampm
- " "
-   "..")))
+  (concat 
org-agenda-time-grid-trailing-characters " ")
+org-agenda-time-grid-trailing-characters)))
 (t ""))
  extra (or (and (not habitp) extra) "")
  category (if (symbolp category) (symbol-name category) category)
--
2.13.2

>From 3e1a9a4a0cde14e1496c355028c9ef3c8b75b9e2 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Fri, 7 Jul 2017 08:25:38 +0200
Subject: [PATCH] org-agenda.el: Allow users to customize string after
 time-grid

* org-agenda.el: Users may now customize the string to display after
the time in the agenda with the variable
`org-agenda-time-grid-trailing-characters'.

TINYCHANGE
---
 lisp/org-agenda.el | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index ddd1b7d11..43b844cc3 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1510,6 +1510,11 @@ a grid line."
 (string :tag "Grid String")
 (repeat :tag "Grid Times" (integer :tag "Time"
 
+(defcustom org-agenda-time-grid-trailing-characters ".."
+  "Characters to show after time when `org-agenda-use-time-grid' is non-nil."
+  :group 'org-agenda-time-grid
+  :type 'string)
+
 (defcustom org-agenda-show-current-time-in-grid t
   "Non-nil means show the current time in the time grid."
   :group 'org-agenda-time-grid
@@ -6478,8 +6483,8 @@ Any match of REMOVE-RE will be removed from TXT."
 			 (s1 (concat
 			  (org-agenda-time-of-day-to-ampm-maybe s1)
 			  (if org-agenda-timegrid-use-ampm
-  " "
-"..")))
+  (concat org-agenda-time-grid-trailing-characters " ")
+org-agenda-time-grid-trailing-characters)))
 			 (t ""))
 	  extra (or (and (not habitp) extra) "")
 	  category (if (symbolp category) (symbol-name category) category)
-- 
2.13.2



Re: [O] [PATCH] protocol: allow users to disable warning about old style links

2017-06-16 Thread Alex Branham
Hi, thanks for the reply.

On Fri 16 Jun 2017 at 06:13, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

> Hello,
>
> Alex Branham <bran...@utexas.edu> writes:
>
>> This patch allows org mode users to disable the warning issued about
>>old org protocol style links. This is important because sometimes (e.g.
>>browser extensions), we don’t have easy control over the format
>>specified.
>
> Thank you.
>
> Wouldn't it be better to report it upstream as a bug? I don't think
> there are many Org protocols applications out there and the conversion
> to the new syntax is easy.

I did report it upstream as a bug. The maintainer is (understandably, I think) 
hesitant to change since 1) old style links continue to be supported and 2) 
there’s no way for a browser extension to detect the version of org-mode to 
install. Since new style links aren’t supported in older org versions (like 
what comes shipped with Emacs), that could create issues.

>
>> Issuing the warning is annoying because it pops up in a new window.
>
> I think this variable should go in "org-compat.el", so that we can
> remove it when we drop old syntax. It also need
> proper :version, :package-version and :safe keywords.
>
> Another option is to make it a simple `defvar' and have the warning
> message suggesting to set it.

I changed it to a defvar and modified the warning. That seems simpler to me.

I wasn’t sure if defvars should go into org-compat.el (that file says it’s for 
compatibility issues with older Emacs versions?) or stay where it is. I’ve left 
it where it is for now but I can move it to org-compat.el if you want me to.

New patch attached and pasted below.

>
> WDYT?
>
>> From 8bfc951308324de8e455128950193c046691f1f8 Mon Sep 17 00:00:00 2001
>> From: Alex Branham <bran...@utexas.edu>
>> Date: Wed, 14 Jun 2017 14:06:18 +0200
>> Subject: [PATCH] protocol: allow user to disable warning about old style 
>> links
>>
>> ---
>>  lisp/org-protocol.el | 11 +--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
>> index 825435674..2eb1094e9 100644
>> --- a/lisp/org-protocol.el
>> +++ b/lisp/org-protocol.el
>> @@ -271,6 +271,12 @@ This should be a single regexp string."
>>:package-version '(Org . "8.0")
>>:type 'string)
>>
>> +(defcustom org-protocol-warn-about-old-links t
>> +  "If non-nil (the default), issue a warning when org protocol
>> +receives old style links."
>
>   When non-nil, warn when Org protocol receives old style link.
>
>
> Regards,

>From 5d04e3a9404b2109751da6e43fba24a7cace00a8 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Fri, 16 Jun 2017 13:24:44 +0200
Subject: [PATCH] org-protocol: add option to surpress warning about old links

---
 lisp/org-protocol.el | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 825435674..531345b58 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -271,6 +271,10 @@ This should be a single regexp string."
   :package-version '(Org . "8.0")
   :type 'string)

+(defvar org-protocol-warn-about-old-links t
+  "If non-nil (the default), issue a warning when org protocol
+receives old style links.")
+
 ;;; Helper functions:

 (defun org-protocol-sanitize-uri (uri)
@@ -618,8 +622,9 @@ CLIENT is ignored."
 (if new-style
 (funcall func (org-protocol-parse-parameters
result new-style))
-  (warn "Please update your Org Protocol handler \
-to deal with new-style links.")
+  (when org-protocol-warn-about-old-links
+(warn "Please update your Org Protocol handler 
\
+to deal with new-style links.\n You may set 
`org-protocol-warn-about-old-links' to nil to surpress this message."))
   (funcall func result))))
;; Greedy protocol handlers are responsible for
;; parsing their own filenames.
--
2.13.1



--
J. Alexander Branham
PhD Candidate
Department of Government
University of Texas at Austin
https://www.jabranham.com
>From 5d04e3a9404b2109751da6e43fba24a7cace00a8 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Fri, 16 Jun 2017 13:24:44 +0200
Subject: [PATCH] org-protocol: add option to surpress warning about old links

---
 lisp/org-protocol.el | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 8254

[O] [PATCH] protocol: allow users to disable warning about old style links

2017-06-14 Thread Alex Branham
Hello,

This patch allows org mode users to disable the warning issued about old org 
protocol style links. This is important because sometimes (e.g. browser 
extensions), we don’t have easy control over the format specified. Issuing the 
warning is annoying because it pops up in a new window.

Thanks,
Alex

>From 8bfc951308324de8e455128950193c046691f1f8 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Wed, 14 Jun 2017 14:06:18 +0200
Subject: [PATCH] protocol: allow user to disable warning about old style links

---
 lisp/org-protocol.el | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 825435674..2eb1094e9 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -271,6 +271,12 @@ This should be a single regexp string."
   :package-version '(Org . "8.0")
   :type 'string)

+(defcustom org-protocol-warn-about-old-links t
+  "If non-nil (the default), issue a warning when org protocol
+receives old style links."
+  :group 'org-protocol
+  :type 'boolean)
+
 ;;; Helper functions:

 (defun org-protocol-sanitize-uri (uri)
@@ -618,8 +624,9 @@ CLIENT is ignored."
 (if new-style
 (funcall func (org-protocol-parse-parameters
result new-style))
-  (warn "Please update your Org Protocol handler \
-to deal with new-style links.")
+  (when org-protocol-warn-about-old-links
+(warn "Please update your Org Protocol handler 
\
+to deal with new-style links."))
   (funcall func result
;; Greedy protocol handlers are responsible for
;; parsing their own filenames.
--
2.13.1

>From 8bfc951308324de8e455128950193c046691f1f8 Mon Sep 17 00:00:00 2001
From: Alex Branham <bran...@utexas.edu>
Date: Wed, 14 Jun 2017 14:06:18 +0200
Subject: [PATCH] protocol: allow user to disable warning about old style links

---
 lisp/org-protocol.el | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 825435674..2eb1094e9 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -271,6 +271,12 @@ This should be a single regexp string."
   :package-version '(Org . "8.0")
   :type 'string)
 
+(defcustom org-protocol-warn-about-old-links t
+  "If non-nil (the default), issue a warning when org protocol
+receives old style links."
+  :group 'org-protocol
+  :type 'boolean)
+
 ;;; Helper functions:
 
 (defun org-protocol-sanitize-uri (uri)
@@ -618,8 +624,9 @@ CLIENT is ignored."
 			 (if new-style
  (funcall func (org-protocol-parse-parameters
 		result new-style))
-			   (warn "Please update your Org Protocol handler \
-to deal with new-style links.")
+			   (when org-protocol-warn-about-old-links
+ (warn "Please update your Org Protocol handler \
+to deal with new-style links."))
 			   (funcall func result
 		;; Greedy protocol handlers are responsible for
 		;; parsing their own filenames.
-- 
2.13.1



[O] Schedule next READY item under heading

2017-03-19 Thread Alex Branham
Hello -

I asked this on stackexchange and didn't get an answer so I figure that I would 
try here, apologies for cross-posting.

I have a situation where I have a lot of similar tasks under a header like so:

* Header 
** READY Task 1
** NREADY Task 2
** READY Task 3
** READY Task 4
** NREADY Task 5

and so on. What I would like is to have the next READY task (the highest READY 
task under Header) appear in my agenda every other day or so. Is that possible?

You can imagine how this would be helpful for (e.g.) keeping track of the state 
of blog posts and when to publish the next one.

Thanks in advance!
Alex



[O] Bug: Errors when saving from babel block [9.0.5 (9.0.5-elpa @ ~/.emacs.d/elpa/org-20170210/)]

2017-03-19 Thread Alex Branham
In the latest org release (9.0.5), I get errors when trying to save a buffer 
while editing inside a babel source block. I can reproduce this using Emacs 
25.1 and 25.2rc2.

Using:

emacs -Q -l ~/org-debug.el

where org-debug.el just consists of (package-initialize) since I've previously 
installed org 9.0.5 using ELPA:

Open an org file,

Try to edit an org file:

#+BEGIN_SRC emacs-lisp
(+ 1 2)
#+END_SRC

Navigate inside the source block, press C-c '

Then try to save: C-x C-s

I get a fontification error at that point and the file does not save. If I use 
my whole config, this apparently snowballs into larger errors which sometimes 
cause Emacs to crash. 

Emacs  : GNU Emacs 25.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.9)
 of 2017-03-09
Package: Org mode version 9.0.5 (9.0.5-elpa @ ~/.emacs.d/elpa/org-20170210/)