table alignment tags in Org export

2022-08-20 Thread Alex Fenton

Hello,

Trying to export a table with alignment tags, e.g.

#+caption: left, center and right aligned columns
| |   |   |
| a  |b |c |
| aa |  |  |

In, for example, HTML or ODT output, the columns are aligned according 
to the tags in the first row.


If exporting to Org (org-org-export-as-org), the tags disappear - i.e. 
the table is as-was, minus the first row.


Is there a way to retain the alignment information when re-exporting to Org?

cheers
alex



table alignment tags in Org export

2022-08-19 Thread Alex Fenton

Hello,

Trying to export a table with alignment tags, e.g.


#+caption: left-, centre- and right aligned columns
|     |       |   |
| a  |    b |    c |
| aa |  |  |

In, for example, HTML or ODT output, the columns are aligned according 
to the tags in the first row.


If exporting to Org (org-org-export-as-org), the tags disappear - i.e. 
the table is as-was, minus the first row.


Is there a way to retain the alignment information when re-exporting to 
Org? - either a function or some setting somewhere


cheers
alex




Help with assigning org-attach-id-dir using directory local variables

2022-06-10 Thread Alen Alex Ninan

Hi All,

I use org-attach to copy and attach images in my org-mode notes. I would 
like to assign org-attach-id-dir using directory local variable. Please 
find the statements I use in directory local file to define my org-roam 
directory and org-attach-id-dir below for reference.



Directory local configuration:

((nil . ((eval . (setq-local
  org-roam-directory (expand-file-name 
(locate-dominating-file

default-directory ".dir-locals.el"
 (eval . (setq-local
  org-roam-db-location (expand-file-name "org-roam.db"
org-roam-directory)))
 (eval . (setq-local
  org-attach-id-dir (expand-file-name "attachments"
org-roam-directory)))
 )))


My Emacs and Org-mode configuration:

Org: 9.6

Emacs: 28.1 (Doom Emacs)


The org-mode file opened from this directory respects the attachment 
location defined in directory local variable when display of inline 
images during start-up is disabled. Org mode displays the attachments 
once the org file is open, and I toggle display of inline image. The 
same files throw an error when I open the file with inline images 
enabled at startup.


1. Have I made an error in how I define the directory local file?

2. If I have not made and error, Is it possible to define the attachment 
directory in directory local variable and have org mode respect the 
location when display of inline images are enabled during startup?


3. If I did make an error, do you have any recommendation on how I can 
resolve this?


I am new to Emacs, and I am not good at Emacs Lisp currently. It's 
something I am trying to learn. Any suggestions or recommendation would 
help. I am open to testing this out in stock Emacs if that's something 
that will help.



Thanks & Regards,

Alen Alex




[PATCH] two small fixes for org-fast-tag-selection

2022-02-10 Thread Alex Giorev
- The first patch fixes the problem of TODO keywords and tags sharing keys
when they are automatically generated and when
`org-fast-tag-selection-include-todo' is set.
- The problem solved by the second patch is the following: when invoking
the fast selection interface, and pressing the key of a tag, the tag is
highlighted to indicate it has been selected, but pressing the key again
doesn't unhighlight it.
From ec433003b77c17ae150c7c399142d9fad6bc5cab Mon Sep 17 00:00:00 2001
From: alexgiorev 
Date: Thu, 10 Feb 2022 22:14:51 +0200
Subject: [PATCH 2/2] listp/org.el: unhighlight org-fast-tag-selection tag

* lisp/org.el (org-fast-tag-selection): When the key of a tag is
pressed in the fast selection tag interface, the tag is highlighted,
but when it is pressed again it is not unhighlighted. This patch fixes
this issue.

TINYCHANGE
---
 lisp/org.el | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 6fb79f180..c43ac672d 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12408,7 +12408,7 @@ Returns the new tags string, or nil to not change the current settings."
 	 (ncol (/ (- (window-width) 4) fwidth))
 	 (i-face 'org-done)
 	 (c-face 'org-todo)
-	 tg cnt e c char c1 c2 ntable tbl rtn
+	 tg cnt e c char c1 c2 ntable tbl rtn todo-marker
 	 ov-start ov-end ov-prefix
 	 (exit-after-next org-fast-tag-selection-single-key)
 	 (done-keywords org-done-keywords)
@@ -12450,6 +12450,9 @@ Returns the new tags string, or nil to not change the current settings."
 	(unless (zerop cnt)
 	  (setq cnt 0)
 	  (insert "\n"))
+(when (eq tbl (cdr todo-table))
+  (setq todo-marker (point-marker))
+  (set-marker-insertion-type todo-marker nil))
 	(insert (if (cdr e) (format "%s: " (cdr e)) "") "{ "))
 	   ((eq (car e) :endgroup)
 	(setq ingroup nil cnt 0)
@@ -12505,6 +12508,8 @@ Returns the new tags string, or nil to not change the current settings."
 	  (setq cnt 0)
 	(setq ntable (nreverse ntable))
 	(insert "\n")
+(unless todo-marker
+  (setq todo-marker (point-marker)))
 	(goto-char (point-min))
 	(unless expert (org-fit-window-to-buffer))
 	(setq rtn
-- 
2.25.1

From 120c4fd7d9038fdf22dfcfda7f021b0486813464 Mon Sep 17 00:00:00 2001
From: alexgiorev 
Date: Thu, 10 Feb 2022 17:24:36 +0200
Subject: [PATCH 1/2] lisp/org.el: org-tag-fast-selection fix tag/TODO key
 overlap

* lisp/org.el (org-tag-fast-selection): Avoid key duplication for tags
and TODO keywords when the keys are automatically generated.

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

diff --git a/lisp/org.el b/lisp/org.el
index ef8d460e1..6fb79f180 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12480,8 +12480,8 @@ Returns the new tags string, or nil to not change the current settings."
 	  (setq c1 (string-to-char
 			(downcase (substring
    tg (if (= (string-to-char tg) ?@) 1 0)
-	  (if (or (rassoc c1 ntable) (rassoc c1 table))
-		  (while (or (rassoc char ntable) (rassoc char table))
+	  (if (or (rassoc c1 ntable) (rassoc c1 fulltable))
+		  (while (or (rassoc char ntable) (rassoc char fulltable))
 		(setq char (1+ char)))
 		(setq c2 c1))
 	  (setq c (or c2 char)))
-- 
2.25.1



[PATCH] Fix org-set-tags-command active region bug

2022-02-09 Thread Alex Giorev
When `org-loop-over-headlines-in-active-region' is 'start-level, the
command should loop only over the headings having the same level as the
first one, but it loops over all headings in the region. This patch fixes
the issue.
From 289d6bdcb8328554c6dd4136d38f1220d239940e Mon Sep 17 00:00:00 2001
From: alexgiorev 
Date: Wed, 9 Feb 2022 16:22:09 +0200
Subject: [PATCH] lisp/org.el: Fix org-set-tags-command active region bug

* lisp/org.el (org-set-tags-command): When called with an active
region and `org-loop-over-headlines-in-active-region` having a value
`start-level', it is supposed to loop only over the headings at the
same level as the first one, but without this fix it loops over all
headings in the region.
---
 lisp/org.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index ef8d460e1..b2091a4fe 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12183,11 +12183,12 @@ in Lisp code use `org-set-tags' instead."
 (cond
  ((equal '(4) arg) (org-align-tags t))
  ((and (org-region-active-p) org-loop-over-headlines-in-active-region)
-  (let (org-loop-over-headlines-in-active-region) ;  hint: infinite recursion.
+  (let ((original org-loop-over-headlines-in-active-region)
+(org-loop-over-headlines-in-active-region nil)) ;  hint: infinite recursion.
 	(org-map-entries
 	 #'org-set-tags-command
 	 nil
-	 (if (eq org-loop-over-headlines-in-active-region 'start-level)
+	 (if (eq original 'start-level)
 	 'region-start-level
 	   'region)
 	 (lambda () (when (org-invisible-p) (org-end-of-subtree nil t))
-- 
2.25.1



A couple of `org-priority' fixes

2022-02-04 Thread Alex Giorev
I found a couple of problems in org-priority, I think these patches fix
them.
- The first patch is truly minor, it just adds a bit to the docstring
- The problem which prompted the second patch arises when all priorities
are lowercase (you can test this by evaluating (setq org-priority-highest
?a org-priority-lowest ?z org-priority-default ?o) and then trying to set
the priority to some lowercase letter)
- The problem solved by the third patch arises when numerical priorities
are used and 32 is given as the argument, 32 being the character code of
the space character, because that character is used to signal property
removal.
From 4f2b192743e4f8056a1e6682dbffa3d236700b46 Mon Sep 17 00:00:00 2001
From: alexgiorev 
Date: Sat, 5 Feb 2022 00:33:54 +0200
Subject: [PATCH 1/3] lisp/org.el: Add `remove' action in org-priority
 docstring

* lisp/org.el (org-priority): Add `remove' action in org-priority docstring

TINYCHANGE
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index ef8d460e1..2543498de 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11346,7 +11346,7 @@ When called interactively with a `\\[universal-argument]' prefix,
 show the priority in the minibuffer instead of changing it.
 
 When called programmatically, ACTION can be `set', `up', `down',
-or a character."
+`remove', or a character."
   (interactive "P")
   (when show
 ;; Deprecation warning inserted for Org 9.2; once enough time has
-- 
2.25.1

From 524ee9c37c99019b6e700c98919ebb1bd8fd57c7 Mon Sep 17 00:00:00 2001
From: alexgiorev 
Date: Sat, 5 Feb 2022 00:43:40 +0200
Subject: [PATCH 2/3] lisp/org.el: Remove (upcase new) in `org-priority'

* lisp/org.el (org-priority): After the new priority is computed,
when checking if it is within the bounds defined by
`org-priority-highest' and `org-priority-lowest', the priority is
upcased, but this leads to an error when all priorities are lowercase
letters.

TINYCHANGE
---
 lisp/org.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 2543498de..757c306bc 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11391,7 +11391,7 @@ When called programmatically, ACTION can be `set', `up', `down',
 		 (= (upcase org-priority-lowest) org-priority-lowest))
 	(setq new (upcase new)))
 	  (cond ((equal new ?\s) (setq remove t))
-		((or (< (upcase new) org-priority-highest) (> (upcase new) org-priority-lowest))
+		((or (< new org-priority-highest) (> new org-priority-lowest))
 		 (user-error
 		  (if nump
 		  "Priority must be between `%s' and `%s'"
@@ -11418,8 +11418,8 @@ When called programmatically, ACTION can be `set', `up', `down',
 			org-priority-default
 			  (1+ org-priority-default))
 	 (t (user-error "Invalid action")))
-	(when (or (< (upcase new) org-priority-highest)
-		  (> (upcase new) org-priority-lowest))
+	(when (or (< new org-priority-highest)
+		  (> new org-priority-lowest))
 	  (if (and (memq action '(up down))
 		   (not have) (not (eq last-command this-command)))
 	  ;; `new' is from default priority
-- 
2.25.1

From 5aea96e258b694d25aa9ebc0012f499d09b415b6 Mon Sep 17 00:00:00 2001
From: alexgiorev 
Date: Sat, 5 Feb 2022 00:50:26 +0200
Subject: [PATCH 3/3] lisp/org.el: Fix priority 32 removing the cookie in
 org-priority

* lisp/org.el (org-priority): When numerical priorities are used, and
the caller supplies 32 as the new priority value, the priority cookie
is removed because this is the code point of the space character. This
patch fixes this so that supplying 32 will change the priority to 32.

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

diff --git a/lisp/org.el b/lisp/org.el
index 757c306bc..3ffddff94 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11382,21 +11382,23 @@ When called programmatically, ACTION can be `set', `up', `down',
(read-string msg)
  (message msg)
  (char-to-string (read-char-exclusive)
-   (if (equal s " ") ?\s (string-to-number s)))
+   (if (equal s " ")
+   (progn (setq remove t) ?\s)
+ (string-to-number s)))
 	   (progn (message "Priority %c-%c, SPC to remove: "
 			   org-priority-highest org-priority-lowest)
 		  (save-match-data
-			(setq new (read-char-exclusive)))
+			(setq new (read-char-exclusive)
+  remove (= new ?\s)))
 	  (when (and (= (upcase org-priority-highest) org-priority-highest)
 		 (= (upcase org-priority-lowest) org-priority-lowest))
 	(setq new (upcase new)))
-	  (cond ((equal new ?\s) (setq remove t))
-		((or (< new org-priority-highest) (> new org-priority-lowest))
-		 (user-error
-		  (if nump
-		  "Priority must be between `%s' and `%s'"
-		"Priority must be between `%c' and `%c'")
-		  org-priority-highest 

Re: [ANN] ox-pandoc, revived

2021-11-30 Thread Alex Fenton

On 30/11/2021 15:09, Bruce D'Arcus wrote:


Did pandoc get support for org-cite?

There's been basically zero activity on this issue I created awhile back:

https://github.com/jgm/pandoc/issues/7329


AFAIK pandoc still doesn't support the official Org Mode syntax.

ox-pandoc relies on the fact that it first exports to an intermediate 
org file before handing off to pandoc. SRC blocks and citations are 
already resolved by the time pandoc is called.


If exporting with oc-natbib or oc-biblatex, citations are replaced by 
LaTeX commands, which pandoc passes through to the compiler. If 
exporting with oc-csl, citations and bibliographies are "just" formatted 
text by the time pandoc sees it.


I may add an oc-pandoc to massage org citations into pandoc format if 
there is a need to have citations be resolved by pandoc rather than Org 
Mode.


best
alex



[ANN] ox-pandoc, revived

2021-11-30 Thread Alex Fenton

Hello,

ox-pandoc is an exporter for Org Mode that uses pandoc 
(https://pandoc.org/) to export to a very wide variety of text markup 
(e.g. markdown variants), document (ODT, docx) and presentation (e.g. 
html, .pdf) formats. It is available via MELPA and at: 
https://github.com/emacsorphanage/ox-pandoc


pandoc handles almost all org text-markup features and offers many 
options for controlling output. With ox-pandoc, it can also be used with 
Org Mode's code evaluation.


ox-pandoc was originally created by kawabata, but had fallen out of step 
over the past few years with recent pandoc and Org Mode versions. As a 
result, it had a number of serious bugs. Current releases roll up a 
dozen or so fixes and enhancements and with the kind help of the MELPA 
team, the package is now distributed from a maintained repo.


The current version includes initial support for org citations in Org 
9.5. This feature is experimental and I welcome feedback and reports on 
this or any other aspect of the package.


best

alex




Ox-pandoc and Org-cite

2021-10-14 Thread Alex Fenton
Hello,

I have recently forked [1] and tidied up ox-pandoc with some fixes for 
incompatibilities that had arisen with newer versions of pandoc. I'm talking to 
MELPA people about getting this distributed.

Briefly, ox-pandoc exports an .org file to a temporary .org (so that e.g. Babel 
code is resolved) and then calls pandoc to export to any of its many supported 
formats. 

The arrival of citation support in Org is fantastic, but it is a bit tricky for 
ox-pandoc, b/c pandoc itself has csl-based cite processing ability. I'd 
appreciate any pointers on a couple of points:

1) how best to handle an file level option (BIBLIOGRAPHY) that is defined in a 
mode and in some (>9.4) versions of org itself? At the moment it's choking on 
incompatible types with 9.5, because ox-pandoc expects a string but gets a 
list. 

2) how best to allow users to pick between org citation export, pandoc citeproc 
or letting biblatex do something? At the moment, there seems no way to prevent 
citation export (passthrough) or a filter mechanism. 

Should I plan to write a org cite export handler that converts to a format that 
pandoc understands (the new Org citation format is not yet fully supported, 
though an issue [2] is filed)? 

Cheers
 alex

[1] https://github.com/a-fent/ox-pandoc
[2] https://github.com/jgm/pandoc/issues/7329

org-info-store-link uses :desc instead of :description

2021-04-27 Thread Alex
In the definition of |org-info-store-link|, when calling 
|org-link-store-props|, the |:desc| key is given whereas I think 
|:description| was intended.


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



Re: android phone computer and orgmode

2019-12-06 Thread Alex Roper
One thing I forgot to mention in the previous thread (apologies if it
was already mentioned, I didn't see it) is you could try git-annex. The
android version does rely on termux as its runtime, but interacting with
it is through a local web server, so if use of termux for initial setup
is an option for you, it should be usable ongoing without having to
interact with termux directly through the console.

I haven't personally used it, but I was researching it for a personal
project (different goal) at one point. git-annex itself is an extension
that allows for large files to be versioned with git while not
necessarily physically present on a device and is very general, but git
annex assistant is implemented on top of it and acts as a decentralized
sync client.

If you're happy with Dropbox I'm not sure it would add anything for you,
but i meant to mention it alongside Syncthing earlier.

I look forward to hearing more about what you decide on. Personally I'm
very, very excited that orgzly is getting native git support.

Alex

On 12/3/19 2:03 PM, Jude DaShiell wrote:
> Since I use a command line on the computer I got orgsly and dropbox
> working on the phone.
> If I can get rclone working on the computer with dropbox I'll have
> synchronizing capability.
> Other applications on archlinux and slint either don't work or aren't
> accessible for screen reader users like me.
>
> More later when I figure it out.
>
>
> --
>
>



Re: mobile org

2019-11-17 Thread Alex Roper
I meant the standard one in termux, so this probably won't work for you
then.

One other thought, if your only concern with orgzly is Dropbox, you
might consider an open source alternative such as Syncthing. I used to
use that on my computers and phone to sync my org before moving to
termux. By default it does use some sort of cloud locator service for
NAT hole punching etc, but I believe you can turn that off.

In general, though I do wish there were more options in this space.

Alex

On 11/17/19 6:03 PM, Jude DaShiell wrote:
> I can't do that unless termux emacs is a different application from
> termux since I'm using talkback on android and termux and talkback work
> strangely together.
> 
> On Sun, 17 Nov 2019, Alex Roper wrote:
> 
>> Date: Sun, 17 Nov 2019 19:13:48
>> From: Alex Roper 
>> To: Jude DaShiell , emacs-orgmode@gnu.org
>> Subject: Re: mobile org
>>
>> I use termux + emacs personally, and then sync with git from the command
>> line. It's obviously not especially phone-optimized UX, typing on a
>> command line...but depending on your needs and alternatives it may be
>> acceptable.
>>
>> Alex
>>
>> On 11/17/19 4:01 PM, Jude DaShiell wrote:
>>> Will mobile org work in Android PI?  If not, any good alternatives beyond
>>> orgsly available?  I don't like to have to use dropbox and would like to
>>> plug a usb cord into my computer and synchtronize my orgmode files that
>>> way if possible.  Last time mobile org got updated was 2013 according to
>>> google play store unless later updates happened by git or github.  Mobile
>>> org donate also had a 2013 last update in the google play store too and I
>>> wouldn't have minded paying for that if it would work with Android Pi and
>>> would also work with android Q.
>>>
>>>
>>>
>>> --
>>>
>>>
>>
>>
> 



Re: mobile org

2019-11-17 Thread Alex Roper
I use termux + emacs personally, and then sync with git from the command
line. It's obviously not especially phone-optimized UX, typing on a
command line...but depending on your needs and alternatives it may be
acceptable.

Alex

On 11/17/19 4:01 PM, Jude DaShiell wrote:
> Will mobile org work in Android PI?  If not, any good alternatives beyond
> orgsly available?  I don't like to have to use dropbox and would like to
> plug a usb cord into my computer and synchtronize my orgmode files that
> way if possible.  Last time mobile org got updated was 2013 according to
> google play store unless later updates happened by git or github.  Mobile
> org donate also had a 2013 last update in the google play store too and I
> wouldn't have minded paying for that if it would work with Android Pi and
> would also work with android Q.
> 
> 
> 
> --
> 
> 



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



[O] How to add tblname from ob-shell fragments?

2018-10-11 Thread Alex Bennée


Hi,

I'm trying to solve a problem with an ob-shell fragment. I want to emit
a table which other blocks are going to consume. As script takes a while
I don't want to dynamically call it when doing additional work with the
data. In fact in my real example I use ob-async's :async so it can run
and collect the data in the background.

Is there any way to get the results to emit a tblname with the result?

--
Alex Bennée



[O] Highlighting list item bullets

2018-09-18 Thread Alex Helfet
I wanted syntax highlighting for list item bullets (e.g. '-') in my org
mode setup.

I have a very early prototype working and wanted some feedback about
whether you would be interested in this feature upstream, or perhaps
including it in a package would be a better bet.

The code is in a github gist:
https://gist.github.com/fluffysquirrels/1aaec7cab234893bfd46cdad721dda85

The code is rough but very short and readable. I have some test cases
working, with a screenshot of how they look on my machine.

Thanks!

Alex


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] Babel - :export-dir and :file-ext arguments cause all blocks to emit files

2018-05-25 Thread Alex Fenton

Hi Aaron



First of all, no issue arises with :output-dir alone.  It can be
specified as a global header arg without issue.


Yes, now I check again that's true. Thank you for clearing that up.

I designed :file-ext as a direct replacement for :file.  That is, instead
of the above, one would specify:

#+name: foo
#+begin_src R :file-ext pdf
   ...
#+end_src

and get the same result.  IOW, the design was *not* for :file-ext to be
specified globally.
Now I understand how it was intended (a shortcut for people who are 
scrupulous about using #+NAME) it makes sense. I was thinking it was 
meant as an easy way to switch globally between different formats 
(sometimes I want PDF for ease, sometimes I want Tikz for 
publication-quality, sometimes I want SVG for online etc.).




The change Nicolas proposes is how I would make :file-ext work if I were
writing it from scratch today, with the benefit of hindsight.  I worry
that introducing it would break org documents in the wild, but maybe it is
worth it.


You (all) are a better judge of what is a reasonable non-back-compatible 
change.


all the best
alex



Re: [O] Babel - :export-dir and :file-ext arguments cause all blocks to emit files

2018-05-24 Thread Alex Fenton

On 25/05/18 01:13, Nicolas Goaziou wrote:

Hello,

Alex Fenton <a...@pressure.to> writes:


As far I understand it, |:output-dir| and |:file-ext| that were
intended to be used in the global document header, applying to all
blocks.

However, it seems to mean that all blocks regardless of their :results
args then emit a file, and put their output as a [file:] link. It's
not clear from the docs why this happens.

Am I missing something, or does this mean that these arguments are
useless unless a document happens only to emit graphics from blocks?
At the moment, the blocks (R, as it happens) are meant to sometimes
emit scalars, sometimes literal latex, sometimes tables to be
formatted by orgs, and sometimes graphics. But all the non-graphics
are at the moment being stuffed into (non-working) PDF files.

Following a discussion and suggested, but not-working solution at:
https://emacs.stackexchange.com/questions/41618/org-modes-output-dir-and-file-ext-arguments-cause-all-output-to-be-saved-to

I agree something is cheesy here.

According to `org-babel-execute-src-block', if :file is set (it can also
be forged from :file-ext and :output-dir according to
`org-babel-generate-file-param'), results become the filename.

Also, according to `org-babel-merge-params' both :file and :file-ext
trump :results value, i.e., they automatically imply "file" in :results.
and "results" in :exports.

At this point, I'm not sure about :export, but I think it should be the
other way for :results. IOW, :file and :file-ext should be taken into
consideration only when :results contains "file".

WDYT?

Regards,






[O] Babel - :export-dir and :file-ext arguments cause all blocks to emit files

2018-05-24 Thread Alex Fenton

Hi,

As far I understand it, |:output-dir| and |:file-ext| that were intended 
to be used in the global document header, applying to all blocks.


However, it seems to mean that all blocks regardless of their :results 
args then emit a file, and put their output as a [file:] link. It's not 
clear from the docs why this happens.


Am I missing something, or does this mean that these arguments are 
useless unless a document happens only to emit graphics from blocks? At 
the moment, the blocks (R, as it happens) are meant to sometimes emit 
scalars, sometimes literal latex, sometimes tables to be formatted by 
orgs, and sometimes graphics. But all the non-graphics are at the moment 
being stuffed into (non-working) PDF files.


Following a discussion and suggested, but not-working solution at: 
https://emacs.stackexchange.com/questions/41618/org-modes-output-dir-and-file-ext-arguments-cause-all-output-to-be-saved-to


Thanks

alex



[O] Advice for debugging org-export

2018-05-14 Thread Alex Bennée

Hi,

I find debugging my exporters for org-mode a real pain. Consider the
following:

#+name: get-task-list-as-exported-text
#+begin_src emacs-lisp :exports code
  (defun my-filter-out-done-lines (s backend info)
"Filter out lines ending in :done"
(apply 'concat
   (--remove (s-matches? (rx ":done" (zero-or-more blank) eol) it)
 (s-slice-at (rx bol "-") s

  (defun my-filter-out-old-completed-todos (s backend info)
"Filter out DONE items if they where completed over a week ago."
(setq my-debug-items
  (add-to-list 'my-debug-items (list s backend info)))
   s)

  (org-export-define-derived-backend 'my-status-report 'ascii
:options-alist
'((:with-todo-keywords nil)
  (:num nil))
:filters-alist
'((:filter-plain-list . my-filter-out-done-lines)
  (:filter-headline . my-filter-out-old-completed-todos)))

  ;; Snarf the weeks activities
  (save-excursion
(goto-char (point-min))
(when (re-search-forward "* Tasks")
  (goto-char (match-beginning 0))
  (org-export-as 'my-status-report t nil t )))
#+end_src

When I poke around in my-debug-items to work out the correct furtling I
need to do I inevitably lock up Emacs as the pretty printer struggles to
dump the entire org AST in :parent.

Is there anyway of suppressing the :parent and associated data so I can
just concentrate on the data for the actual node I have?

--
Alex Bennée



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 <b...@gnu.org> 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 <m...@nicolasgoaziou.fr> 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 



Re: [O] Hooking document specific src blocks into default actions

2018-02-26 Thread Alex Bennée

Alex Bennée <alex.ben...@linaro.org> writes:

> Hi,
>
> I've been using these for a while but I recently wanted to add a
> function at the head of the ctrl-c-ctrl-c processing:
>
>   (defvar my-org-default-action nil
> "Default action for this document to run on `org-ctrl-c-ctrl-c'.
>   \\
>   This will run via `org-ctrl-c-ctrl-c-hook' and should return a
>   non-nil result if it processed something. As such it can override
>   default `org-mode' behaviour for \\[org-ctrl-c-ctrl-c]. If you
>   want something to run at the end then you need to use
>   `my-org-default-code-block'")
>   (make-variable-buffer-local 'my-org-default-action)
>
>   (defun my-org--do-action (func-or-string)
> "Evaluate a code block or call a function `FUNC-OR-STRING' from org-file."
> (let ((current-point (point)))
>   (cond
>((stringp func-or-string)
> (save-excursion
>   (org-babel-goto-named-src-block func-or-string)
>   (org-babel-when-in-src-block
>(org-babel-eval-wipe-error-buffer)
>(org-babel-execute-src-block current-prefix-arg nil
> '((:called-from . current-point))
> ((functionp func-or-string)
>  (funcall func-or-string))
> (t (error "What to do with: %s" func-or-string)

OK the problem here was org-babel-when-in-src-block wraps the result. So
now I have a simpler:

  (defun my-org--do-action (func-or-string)
"Evaluate a code block or call a function `FUNC-OR-STRING' from org-file."
(let ((action-result))
  (cond
   ((stringp func-or-string)
(save-excursion
  (org-babel-goto-named-src-block func-or-string)
  (when (memq (org-element-type (org-element-context))
  '(inline-src-block src-block))
(org-babel-eval-wipe-error-buffer)
(setq action-result (org-babel-execute-src-block t)
   ((functionp func-or-string)
(setq action-result (funcall func-or-string)))
   (t (error "What to do with: %s" func-or-string)))
  (if action-result
  (message "%s: %s" func-or-string action-result)
nil)))

This works well, so on to the next problem. I have in my org file:

# -*- my-org-default-action: "team-default-action" -*-

with:

#+name: team-default-action
#+begin_src emacs-lisp
  (let ((called-point (car org-mark-ring))
(processed))
(save-excursion
  (message "Checking at: %s" called-point)
  (goto-char called-point)
  (when (org-at-heading-p)
(let ((heading (nth 4 (org-heading-components)))
  (virt-rx (rx "[virt:" (group (one-or-more digit)) "]")))
  (when (string-match virt-rx heading)
(let ((ticket (match-string 1 heading)))
  (message "found: %s with %s" heading ticket)
  (org-sbe "update-ticket"
   (virt-ticket ticket))
  (setq processed (format "Updated ticket: %s/%s" heading 
ticket)))
(unless processed
  (message "No default action"))
processed)
#+end_src

However as this block needs to call the various helper functions I'm
using the org-sbe macro. However I can't work out how to evaluate
"ticket" in a way to keep the macro happy. Obviously it is designed for
use in tables so I'm possibly abusing it beyond what it can do.

Any ideas?

--
Alex Bennée



[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] Hooking document specific src blocks into default actions

2018-02-26 Thread Alex Bennée

Hi,

I've been using these for a while but I recently wanted to add a
function at the head of the ctrl-c-ctrl-c processing:

  (defvar my-org-default-action nil
"Default action for this document to run on `org-ctrl-c-ctrl-c'.
  \\
  This will run via `org-ctrl-c-ctrl-c-hook' and should return a
  non-nil result if it processed something. As such it can override
  default `org-mode' behaviour for \\[org-ctrl-c-ctrl-c]. If you
  want something to run at the end then you need to use
  `my-org-default-code-block'")
  (make-variable-buffer-local 'my-org-default-action)

  (defun my-org--do-action (func-or-string)
"Evaluate a code block or call a function `FUNC-OR-STRING' from org-file."
(let ((current-point (point)))
  (cond
   ((stringp func-or-string)
(save-excursion
  (org-babel-goto-named-src-block func-or-string)
  (org-babel-when-in-src-block
   (org-babel-eval-wipe-error-buffer)
   (org-babel-execute-src-block current-prefix-arg nil
'((:called-from . current-point))
((functionp func-or-string)
 (funcall func-or-string))
(t (error "What to do with: %s" func-or-string)

  (defun my-org-run-default-action ()
"Execute default action for this org file."
(interactive)
(when my-org-default-action
  (my-org--do-action my-org-default-action)))

  (add-to-list 'org-ctrl-c-ctrl-c-hook
   'my-org-run-default-action)

However I've run into a small problem that when I execute the source
block I end up with 't every time as we successfully executed the block
even if it didn't end up doing anything at the time.

Is there a better way to invoke source blocks from the current
org-document than this? One where the eventual result can be returned
into the calling lisp so org-ctrl-c-ctrl-c-hook can move on if we didn't
do anything?

--
Alex Bennée



[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 <ohwoeo...@gmail.com> 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



Re: [O] Table (used a "spreadsheet") org-sbe issues when the value is a string

2017-09-07 Thread Alex Bennée

Alex Bennée <alex.ben...@linaro.org> writes:

> Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:
>
>> Hello,
>>
>> Alex Bennée <alex.ben...@linaro.org> writes:
>>
>>> So calling scramble-string works as expected...
>>>
>>> #+tblname: reversed-strings
>>> | abcde   | #ERROR |
>>>
>>> | flibble | #ERROR |
>>> | dibble  | #ERROR |
>>> | xyzzy   | #ERROR |
>>> | another | #ERROR |
>>>
>>> #+TBLFM: $2='(org-sbe scramble-string (str $$1))
>>
>> I cannot reproduce it. I get:
>
> Hmm it turns out this interferes:
>
> ;; See 
> http://emacs.stackexchange.com/questions/499/finding-and-executing-org-babel-snippets-programatically
> (defun my-babel-hashed-confirm (lang body)

>
> (setq org-confirm-babel-evaluate 'my-babel-hashed-confirm)
>
> Resetting to org-confirm-babel-evaluate to nil and it works.

So more correctly when org-confirm-babel-evaluate is set it breaks due
to info not containing a character position for the TBLFM code. I fixed
this by patching org-babel-check-confirm-evaluate:

modified   lisp/ob-core.el
@@ -242,7 +242,8 @@ should be asked whether to allow evaluation."
(and export (equal eval "query-export"))
(if (functionp org-confirm-babel-evaluate)
(save-excursion
- (goto-char (nth 5 info))
+ (when (nth 5 info)
+   (goto-char (nth 5 info)))
  (funcall org-confirm-babel-evaluate
   ;; language, code block body
   (nth 0 info) (nth 1 info)))

I'm not sure the goto-char is legitimate anyway as the documentation for
org-confirm-babel-evaluate says nothing about point being set while it
executes.

--
Alex Bennée



Re: [O] Table (used a "spreadsheet") org-sbe issues when the value is a string

2017-09-06 Thread Alex Bennée

Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Alex Bennée <alex.ben...@linaro.org> writes:
>
>> So calling scramble-string works as expected...
>>
>> #+tblname: reversed-strings
>> | abcde   | #ERROR |
>>
>> | flibble | #ERROR |
>> | dibble  | #ERROR |
>> | xyzzy   | #ERROR |
>> | another | #ERROR |
>>
>> #+TBLFM: $2='(org-sbe scramble-string (str $$1))
>
> I cannot reproduce it. I get:

Hmm it turns out this interferes:

;; See 
http://emacs.stackexchange.com/questions/499/finding-and-executing-org-babel-snippets-programatically
(defun my-babel-hashed-confirm (lang body)
  "Check against known hashes before prompting for confirmation.
See `org-confirm-babel-evaluate'."
  (let ((check (list lang (md5 body
;; If not hashed, prompt
(if (not (member check my-org-babel-hashes))
;; Ask if you want to hash
(if (yes-or-no-p "Store hash for block? ")
;; Hash is added, proceed with evaluation
(progn
  (add-to-list 'my-org-babel-hashes check)
  'nil)
  ;; Return 't to prompt for evaluation
  't)
  (message "Valid hash auto-confirmed")
  'nil)))

(setq org-confirm-babel-evaluate 'my-babel-hashed-confirm)

Resetting to org-confirm-babel-evaluate to nil and it works.

>
> #+name: reversed-strings
> | abcde   | edcba   |
> | flibble | elbbilf |
> | dibble  | elbbid  |
> | xyzzy   | yzzyx   |
> | another | rehtona |
> #+TBLFM: $2='(org-sbe scramble-string (str $$1))
>
>> Even calling org-sbe directly from a source block:
>>
>> #+name: call-scramble-string-via-sbe
>> #+begin_src emacs-lisp :var val="thing"
>>
>> (org-sbe scramble-string (str val))
>> #+end_src
>
> AFAIK, `org-sbe' is limited to tables.

I was trying to replicate the way TBLFM compiles the macro.

>
> Regards,


--
Alex Bennée



Re: [O] Table (used a "spreadsheet") org-sbe issues when the value is a string

2017-09-06 Thread Alex Bennée

Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Frederick Giasson <f...@fgiasson.com> writes:
>
>> Now, if I put a string in the format column, I al getting the following:
>>
>> 
>>
>> #+NAME: average-dataset-size
>> #+BEGIN_SRC clojure :var f="turtle" :exports none :results value
>> (identity f) #+END_SRC
>>
>> #+RESULTS: average-dataset-size
>> : turtle
>>
>>
>> | Format | Sizes distribution in MB | Average size in MB |
>> |+--+|
>> | turtle |  | #ERROR |
>> #+TBLFM: $3='(org-sbe "average-dataset-size" (f $1))
>>
>> 
>
> According to `org-sbe' docstring, it should be
>
>   #+TBLFM: $3='(org-sbe "average-dataset-size" (f $$1))
>
> Documentation could be drastically improved in that area, the manual is
> not even talking about `org-sbe'.

Even this doesn't seem to work. In my case:

#+name: scramble-string
#+begin_src emacs-lisp :var str="abcde"
  (apply #'string
 (reverse
  (string-to-list str)))
#+end_src

#+RESULTS: scramble-string
: edcba

So far so good

#+call: scramble-string(str="whatever-foo")

#+RESULTS:
: oof-revetahw

So calling scramble-string works as expected...

#+tblname: reversed-strings
| abcde   | #ERROR |
| flibble | #ERROR |
| dibble  | #ERROR |
| xyzzy   | #ERROR |
| another | #ERROR |
#+TBLFM: $2='(org-sbe scramble-string (str $$1))

Hmm no dice... the debugger lists:

Substitution history of formula
Orig:   '(org-sbe scramble-string (str $$1))
$xyz->  '(org-sbe scramble-string (str $$1))
@r$c->  '(org-sbe scramble-string (str $$1))
$1->'(org-sbe scramble-string (str $"abcde"))
Result: #ERROR
Format: NONE
Final:  #ERROR

Even calling org-sbe directly from a source block:

#+name: call-scramble-string-via-sbe
#+begin_src emacs-lisp :var val="thing"
(org-sbe scramble-string (str val))
#+end_src

So is this just broken untested functionality or are there any working
examples from which we could reverse engineer the proper docstring?

--
Alex Bennée



[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/)



Re: [O] ob-async

2017-02-20 Thread Alex Bennée

Ken Mankoff <mank...@gmail.com> writes:

> An RSS feed I follow mentioned ob-async here:
> https://github.com/astahlman/ob-async
>
> I haven't seen it mentioned on the list yet. Perhaps others would be
> interested in asynchronous Babel processing. I've seen the feature
> requested often on this list.

This is not the first attempt to my knowledge. I know of:

  - my hacky attempt https://github.com/stsquad/async-org-babel
  - John Kitchen's python specific version 
http://kitchingroup.cheme.cmu.edu/blog/2015/11/20/Asynchronously-running-python-blocks-in-org-mode/
  - this matlab version 
http://emacs.stackexchange.com/questions/21301/async-execution-in-org-babel

So I think there have been enough proof of concepts of using async.el
and inserting results at a later date. I think what would be really
useful is some feedback from the org-mode maintainers about the various
approaches and if something generic could be included with org-mode
itself.

Any thoughts?

--
Alex Bennée



[O] Capturing the results of shell execution

2017-01-17 Thread Alex Bennée

I'm using org-babel snippets to automate some of my workflow. However
I'm not interested in dumping all of the compile output, I'd rather get
a simple value at the end to see if all was OK:

#+name: build-test
#+begin_src sh :results value
  set -e
  ./configure --cross-prefix=aarch64-linux-gnu- --arch=arm64
  make clean
  make -j9
#+end_src

However there isn't a way to tell the difference between a failing
sequence and a passing one apart from *Org-Babel Error Output* being
popped up. It seems org-babel-eval just slurps up the return code and
blindly returns (buffer-string) regardless of the desires of the
:results keyword.

Is this an intentional limitation of babels sh evaluation?

Redirecting all the compile output in the snippet seems a little clumsy
a solution:

#+name: build-test
#+begin_src sh :results output
  set -e
  ./configure --cross-prefix=aarch64-linux-gnu- --arch=arm64
  make clean > /dev/null
  make -j9 > /dev/null
  echo "Build complete: `date`"
#+end_src

Ideally I'd like #+RESULTS to have a nice 0/1 which can be used to gate
other parts of the process.

Am I missing something?

--
Alex Bennée



[O] Switching buffers from babel snippets

2017-01-14 Thread Alex Bennée
Hi,

I've trying to further automate my maintainer tasks by moving things
into babel snippets. I have one to find a cover letter and edit the
file:

#+name: edit-cover-letter
#+begin_src emacs-lisp :var cover=create-qemu-pull[0]
  (find-file (expand-file-name (concat default-directory (car cover
  (mail-mode)
#+end_src

However when I run the code although the file is loaded and in the right
mode I never see the buffer come up and have to switch to it manually. I
expect this is because the code is running under some sort of
safe-excursion. Is there anyway to pass a final buffer back to org-mode
after the code is run and switch to it?

--
Alex Bennée



Re: [O] latex exporting to different directory with v9.0

2016-11-10 Thread Alex Fenton

Hello,

On 08/11/16 18:49, Nicolas Goaziou wrote:

Per above, you could use latexmk "-C" option and move both ".tex" and
".pdf" file to appropriate directories.


I wasn't aware of the "-C" option, it looks like it could - with some 
settings - blow away the intermediate files that latexmk uses to 
minimise compile passes.



This breaks the export process, because `org-compile-file' can no longer
find, and return, the produced file. `org-compile-file' has to know
where the output is.


Ah, OK. I'm curious, however, how a compiler (eg tex2dvi) cd'd to a 
different working directory can ever resolve links to image files.




One problem is that we already provide compilation commands that do not
set it (e.g., the "texi2dvi" command above). As I wrote, if we leave
default-directory alone, something else has to be fixed.

In any case, I removed default-directory setting and, hopefully, applied
the necessary changes to commands.


I'm very grateful for your help with this and for trying this 
change/reversion. I'll try it with the next release.


Best,
alex



Re: [O] latex exporting to different directory with v9.0

2016-11-06 Thread Alex Fenton

Hello,

On 05/11/16 23:54, Nicolas Goaziou wrote:

Honestly, I'm surprised it worked. I'm also surprised it could be
related to `default-directory' set-up, since links are created during
Org -> LaTeX conversion, whereas `org-compile-file' handles LaTeX ->
PDF. What is that "simple publishing set-up" you are talking about?


Thanks for the reply. The publishing set up defines 
:publishing-directory as "out", and then the publishing function for 
each org file was:


(defun thesis-publish-chapter-to-pdf (plist filename pub-dir)
  "Export a chapter to a LaTeX file in output dir and compile"
  (let ((outfile
  (org-publish-org-to 'latex filename "-chapter.tex" plist 
pub-dir)))

(org-latex-compile (file-relative-name outfile

With org-latex-pdf-process being a standard "latexmk -xelatex 
-interaction=nonstopmode -f -outdir=%o -pdf %f"


With 8.3, the latex process launches in the base (org) directory. Image 
& bibtex links in the tex file (in ./out) are resolved by latex relative 
to the base (working) directory.


With 9.0, the enforced switch of default-directory to "./out" means the 
latex process is launched there instead, and relative links are no 
longer correctly resolved.

Basically, there are three directories to consider: source (".tex")
directory, output (".pdf") directory, and working directory, i.e.,
probably ".org" file directory.

The assumption for `org-compile-file', and before it,
`org-latex-compile', is that source and output directories are the same.
That seems reasonable. All that I'd ideally like to continue to be able 
to do is keep a clean "working" (org) directory with correct relative 
links in the org files, and use a single other directory as "source" 
(tex) and "output" (pdf).

but others clearly require the working directory to be the output
directory (note the absence of output directory in the command below)

   "texi2dvi -p -b -V %f"


I'm conscious that org-mode has to work with a lot of different backends 
and compilers, but that example should still work without switching 
default-directory; only the pdf file would end up not in ./out but ./.



As a consequence, if we do not set `default-directory' to the output
directory, the latter is broken. Note that if we do, "%o" place-holder
becomes useless as it is always "./".

In a nutshell we can either set default-directory to source/output
directory or leave it as-is. In all cases, it seems to break something
anyway.


I imagine the case for the vast majority of the time is that working, 
source and output directories are the same. I'm just wondering whether, 
for the cases where that's not true (calling a compiler from one 
directory to compile a file somewhere else), the responsibility for 
setting the correct default-directory, if necessary, could be left to 
the calling function, rather than having an enforced switch hard-coded 
in the core org-compile-file function.


Thanks again,
alex



[O] latex exporting to different directory with v9.0

2016-11-05 Thread Alex Fenton
Firstly, congratulations and thanks to all the contributors to the new 
release.


One thing that has unfortunately stopped working is my setup for 
exporting to pdf, putting all the intermediary  (.tex, .aux, .bbl, etc) 
and output files in a different directory to the source .org files. My 
setup is basically


project/
- images/
- out/

with all the .org files in the project base directory. A simple 
publishing set-up exported .tex to out/ then called org-latex-compile.


With 9.0, org-latex-compile hands off to org-compile-file, in which (as 
documented) "`default-directory' is set to SOURCE directory during the whole
process." This means, however, that all the image and bibliograpy links 
in the .org files are now broken, since they point to ./img/foo.png and 
not ../img/foo.png


It is easy enough to continue to compile from the base directory with 
latexmk and --output-directory, but how is it now intended to do this 
within org's export/publishing framework?


symlinks are not an option since I'm sometimes working on Windows.

thanks
alex



Re: [O] Emacs movement keys

2016-08-24 Thread Alex Recker

> "You know you're an Emacs user when..."

You try to M-f your way through a URI and accidentally turn it into an
integral.



Re: [O] Emacs movement keys

2016-08-23 Thread Alex Recker
> And did you know that even outside Emacs you can move/delete wordwise by
> pressing ctrl togeter with the right/left arrows or delete or backspace?

I'm always surprised by how often C-a/C-e and M-f/M-b work in programs
that aren't Emacs.  Of course there is probably some historical reason
behind this (as much as I'd like to think Google and Slack had emacs
users in mind).




[O] bug#23917: bug#23917: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-20 Thread Alex Bennée

Eli Zaretskii <e...@gnu.org> writes:

>> From: Alex Bennée <alex.ben...@linaro.org>
>> Cc: monn...@iro.umontreal.ca, 23...@debbugs.gnu.org, rpl...@gmail.com, 
>> jwieg...@gmail.com, nljlistb...@gmail.com, m...@lunaryorn.com
>> Date: Tue, 19 Jul 2016 18:45:44 +0100
>>
>>   ;; Save and restore the match data, as recommended in (elisp)Change Hooks
>>   (save-match-data
>> (when flycheck-mode
>>   ;; The buffer was changed, thus clear the idle timer
>>   (flycheck-clear-idle-change-timer)
>>   (if (string-match-p (rx "\n") (buffer-substring beg end))
>>   (flycheck-buffer-automatically 'new-line 'force-deferred)
>> (setq flycheck-idle-change-timer
>>   (run-at-time flycheck-idle-change-delay nil
>>#'flycheck-handle-idle-change))
>>
>> However it doesn't look as though it tweaks the buffer until idle timer
>> has run. Weird
>
> Tweaking the buffer is not what causes the problem.  It's the call to
> save-match-data itself.  It doesn't matter at all what the code inside
> save-match-data does.

Ahh I misunderstood the description of the problem. I thought it was a
changing of the buffer underneath that meant the match data wasn't
updated and hence got out of sync. So is the match data already out of
sync by the time the save-match-data call is made?

--
Alex Bennée





[O] bug#23917: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-19 Thread Alex Bennée

Eli Zaretskii <e...@gnu.org> writes:

>> From: Alex Bennée <alex.ben...@linaro.org>
>> Cc: Stefan Monnier <monn...@iro.umontreal.ca>, 23...@debbugs.gnu.org, 
>> rpl...@gmail.com, jwieg...@gmail.com, nljlistb...@gmail.com
>> Date: Tue, 19 Jul 2016 18:05:37 +0100
>>
>> > Do we care that using save-match-data in every call to replace-match
>> > might mean a performance hit?  If it will, then this will again punish
>> > most of the users for the benefit of those few who (1) have
>> > buffer-modification hooks, and (2) those hooks call save-match-data.
>>
>> I care unless there is an easy way to identify which buffer modification
>> hooks are responsible so I can take steps as a user to mitigate the
>> problems.
>
> Any hook in before-change-functions or after-change-functions that
> calls save-match-data.
>
> If we care about the performance hit, we need to come up with a
> different solution for this problem (or measure the performance hit
> and convince ourselves it is not a big deal).

Thanks for the hint. So in my case it was flycheck-handle-change which
was triggering the problem:

(defun flycheck-handle-change (beg end _len)
  "Handle a buffer change between BEG and END.

BEG and END mark the beginning and end of the change text.  _LEN
is ignored.

Start a syntax check if a new line has been inserted into the
buffer."
  ;; Save and restore the match data, as recommended in (elisp)Change Hooks
  (save-match-data
(when flycheck-mode
  ;; The buffer was changed, thus clear the idle timer
  (flycheck-clear-idle-change-timer)
  (if (string-match-p (rx "\n") (buffer-substring beg end))
  (flycheck-buffer-automatically 'new-line 'force-deferred)
(setq flycheck-idle-change-timer
  (run-at-time flycheck-idle-change-delay nil
   #'flycheck-handle-idle-change))

However it doesn't look as though it tweaks the buffer until idle timer
has run. Weird

--
Alex Bennée





[O] bug#23917: bug#23917: Please consider making Bug #23917 a blocker for 25.1 (was Re: org-capture: Capture template ‘g’: Match data clobbered by buffer modification hooks)

2016-07-19 Thread Alex Bennée

Eli Zaretskii <e...@gnu.org> writes:

>> From: Stefan Monnier <monn...@iro.umontreal.ca>
>> Cc: rpl...@gmail.com,  23...@debbugs.gnu.org,  alex.ben...@linaro.org,  
>> jwieg...@gmail.com,  nljlistb...@gmail.com
>> Date: Tue, 19 Jul 2016 12:03:51 -0400
>>
>> I guess the next best thing is:
>> - copy search_regs.start and search_regs.end before calling replace_range.
>> - use that copy when adjusting the match data.
>> Or equivalently, use save-match-data.  IOW go back to your original patch.
>> Duh!
>
> Do we care that using save-match-data in every call to replace-match
> might mean a performance hit?  If it will, then this will again punish
> most of the users for the benefit of those few who (1) have
> buffer-modification hooks, and (2) those hooks call save-match-data.

I care unless there is an easy way to identify which buffer modification
hooks are responsible so I can take steps as a user to mitigate the
problems.

--
Alex Bennée





[O] Best approaches for implementing a developer workflow using ORG?

2016-07-08 Thread Alex Bennée
eview Comments")
  "  - [ ] %a")))
#+end_src

But that seemed to cause problems when capturing multiple checkbox
links in a row. Maybe there is some way to stuff some meta-data in the
link?

However ideally I'd like to solve the problem of programitically
following org-links as I'd like to automate the bringing up of review
comments when I doing re-basing.

It is of course possible that I'm abusing org-mode a bit too much using
it in this way and I should use something more database like to store
this stuff. However I would appreciate any suggestions of ways to tackle
this problem.

Regards,


--
Alex Bennée



[O] Some functions not being autoloaded in ELPA Org-mode

2016-05-21 Thread Alex

As an example, see `orgtbl-mode'. While this function has an autoload
cookie, it is not being autoloaded in the org-autoloads.el file.

However this function's autoload form is in org-loaddefs.el. Is
org-autoloads.el not being updated correctly?




Re: [O] Bug: orgtbl-self-insert-command does not overwrite whitespace [8.3.4 (8.3.4-50-g83e373-elpa @ /home/alex/.emacs.d/elpa/org-20160509/)]

2016-05-21 Thread Alex
Hello,

Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Alex G <agram...@gmail.com> writes:
>
>> Oh, it seems like backspace works fine in text modes like
>> fundamental-mode and message-mode, but not prog-derived modes. I'd say
>> that's another bug.
>>
>> A git bisect says that this commit by Bastien Guerry is the culprit:
>> f0a64ab3b5c46c8c7b1c838de2ed20511357e43d
>
> Fixed. Thank you.
>
> Regards,

Thank you for the fixes. However, the fix in 4914f89 does not work for
me. When I run it (type backspace) in a graphical Emacs I get:

user-error: This key has no function outside tables

When I run it in a terminal Emacs the command is not rebound at all.

Replacing [(del)] with (kbd "DEL") fixed the issue for me.



Re: [O] Bug: orgtbl-self-insert-command does not overwrite whitespace [8.3.4 (8.3.4-50-g83e373-elpa @ /home/alex/.emacs.d/elpa/org-20160509/)]

2016-05-20 Thread Alex
Alex G <agram...@gmail.com> writes:

>> > Backspace works as expected, however.
>> I'm afraid that as of org-20160516 on ELPA, backspace also does not
>> overwrite whitespace.
>
> Oh, it seems like backspace works fine in text modes like
> fundamental-mode and message-mode, but not prog-derived modes. I'd say
> that's another bug.
>
> A git bisect says that this commit by Bastien Guerry is the culprit:
> f0a64ab3b5c46c8c7b1c838de2ed20511357e43d
>
> Does anyone know why it also affects orgtbl-self-insert-command?

I believe I have figured out the issue for both problems:

a) orgtbl-self-insert-command wasn't updated along with
org-self-insert-command in the commit
73a5c27cc1751721344886e7518f20ff382265b5. Changing it accordingly fixes
the issue.


b) Backspace doesn't work in prog-derived modes as orgtbl-mode seems to
just remap delete-backward-char to orgtbl, but in prog modes backspace
is bound to backward-delete-char-untabify.

Perhaps something extra should be done about backspace in orgtbl-mode
instead of just a simple remapping?




Re: [O] Bug: orgtbl-self-insert-command does not overwrite whitespace [8.3.4 (8.3.4-50-g83e373-elpa @ /home/alex/.emacs.d/elpa/org-20160509/)]

2016-05-19 Thread Alex G
> > Backspace works as expected, however.
> I'm afraid that as of org-20160516 on ELPA, backspace also does not
> overwrite whitespace.


Oh, it seems like backspace works fine in text modes like
fundamental-mode and message-mode, but not prog-derived modes. I'd say
that's another bug.

A git bisect says that this commit by Bastien Guerry is the culprit:
f0a64ab3b5c46c8c7b1c838de2ed20511357e43d

Does anyone know why it also affects orgtbl-self-insert-command?


Re: [O] Bug: orgtbl-self-insert-command does not overwrite whitespace [8.3.4 (8.3.4-50-g83e373-elpa @ /home/alex/.emacs.d/elpa/org-20160509/)]

2016-05-18 Thread Alex
The following message is a courtesy copy of an article
that has been posted to gmane.emacs.orgmode as well.

> Backspace works as expected, however.
I'm afraid that as of org-20160516 on ELPA, backspace also does not
overwrite whitespace.



[O] Bug: orgtbl-self-insert-command does not overwrite whitespace [8.3.4 (8.3.4-50-g83e373-elpa @ /home/alex/.emacs.d/elpa/org-20160509/)]

2016-05-16 Thread Alex
As per the title, orgtbl-mode doesn't overwrite whitespace in tables
like it does normally in org-mode. Backspace works as expected, however.

This was produced in emacs -Q in fundamental-mode.

Emacs  : GNU Emacs 24.5.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.18.9)
 of 2016-04-11 on buildvm-25.phx2.fedoraproject.org
Package: Org-mode version 8.3.4 (8.3.4-50-g83e373-elpa @ 
/home/alex/.emacs.d/elpa/org-20160509/)

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 '(#[nil "\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-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)
 )



Re: [O] pandoc-style citations

2016-04-27 Thread Alex Fenton

On 27/04/16 21:41, John Kitchin wrote:

you might also checkout helm-bibtex. A recent note indicated "Support
for pre- and postnotes for pandoc-citeproc citations."


Thanks, I already use helm-bibtex together with org-ref so will have a look.

this exports out of the org-ref box to:
blah blah blah \cite[][, p.23]{ref1}, also \cite{ref2}, for a contrary
view see \cite[][ pp148-152]{ref3}.

I don't use this style of citations, so I don't know if it is right.


Not quite unfortunately, this would mean that in the two styles I use, 
Harvard (common in social science) referencing, the references appear in 
separate parentheses, or footnote (common in e.g. history) in separate 
footnotes, when they should be together in a single one. I appreciate 
that the style in medicine and many natural sciences is often just an 
author/year abbreviation or number, which works much better plopped into 
normal running text.


best
alex



Re: [O] pandoc-style citations

2016-04-27 Thread Alex Fenton

Hi Richard

On 27/04/16 16:09, Richard Lawrence wrote:

As far as Elisp implementations go, I know of no specific parser for
Pandoc citation syntax.  But there is support for a Pandoc-like syntax
(discussed in the threads you read) in the wip-cite branch of Org's
repository.



https://github.com/wyleyr/org-mode/


Thanks for your reply, and for all your work on specifying and 
developing this. It looks like that for now I can adapt some of the 
parsing in org-element.el (org-element-citation-reference-parser and 
org-element-citation-parser etc) to get something that works for now in 
standard mainline org.




Export is where efforts stalled last year.


That's understandable, given that, as you say, it's a complex problem 
given the range of citation styles and output formats. It's still a 
shame given the work that you (pl.) have put into integrating citations 
into the org parser & element tree so they are first class objects.


I don't know whether it's conceivable that the data structures and 
parsing could be integrated into org, with the (presumably) relatively 
easy latex output, which I suspect is the commonest use case, and then 
with some kind of "adequate" output for other targets (html, text, odt) 
- perhaps an output that would require further post-processing by a 
third-party tool such as citeproc or pandoc.


Latex-outputters would be better off and other targets no worse off than 
present, and it might act as a spur to solve the other target formats 
one by one way. But I can see that this has been to some extent 
considered and can also see the arguments against.




You may also want to look at John Kitchin's org-ref, which I believe
works similar to your homebrew link solution, but has a lot of features
and may provide a better interface for what you're trying to do:


Org-ref does a lot of nice things, but on this particular point is not 
very helpful, and has nothing to add for the case of multiple cites with 
overall and individual pre/posts. The package states that this is low 
priority b/c this style of citation is rare in scientific publishing (by 
which I guess is meant natural sciences; footnotes with multiple 
citations and linking text are of common in humanities and some social 
sciences).


thanks again and best wishes
alex



[O] pandoc-style citations

2016-04-26 Thread Alex Fenton

Hello,

I see that there were several extensive and fruitful discussions on this 
list last year on citation syntax. There seemed to be a reasonable 
degree of consensus that pandoc-style citation syntax was at the least a 
good model.


I'd like to know if there are any implementations out there of elisp to 
parse pandoc citation syntax and turn it into latex \cites. My question 
is not so much "when/if this will be in org mode" but rather whether 
there's something I can drop in now (likely as a link type).


I have a lot of longish citations with multiple references each with 
their own pre- and post- ("'blah blah blah @ref1, p.23, also @ref2, for 
a contrary view see @ref3 pp148-152") that end up as \cites. However my 
home-brew link solution, stuffing the multiple pre- and posts- with 
separator into the link description is unwieldy - difficult to write, 
hard to read and easy to get wrong or breaking output.


thanks
alex



Re: [O] Change in ox export for #+DATE keywords

2015-08-08 Thread Alex Bennée

Peter Salazar cycleofs...@gmail.com writes:

 As I mentioned, I'm getting that same error, not just with #+DATE but also
 with #+TITLE, #+AUTHOR, etc. Any one of these is sufficient to break export
 for me.

Yeah further poking has shown they have all broken. I can't quite follow
the logic of the patch as to what the new parse is expecting.


 On Fri, Aug 7, 2015 at 3:59 PM, Alex Bennée alex.ben...@linaro.org wrote:

 Hi,

 I've been using org-mode as a source for my presentations but exporting
 broke today following an ELPA update. It seems the line:

 #+DATE: KVM Forum 2015

 Is no longer acceptable. I think this changed as of:

 ae9db17482a183e5613428c3abf1c691f86b4ac0

 I'm not quite sure what the new parse is expecting. If I change it to
 a datestamp I see breakage on other lines like the title:

 apply: Wrong type argument: listp, #(My presentation title 0 26 (:parent
 (#0)))

 So what form am I meant to be using for these options and why the change?

 --
 Alex Bennée



-- 
Alex Bennée



Re: [O] Change in ox export for #+DATE keywords

2015-08-08 Thread Alex Bennée

Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Hello,

 Alex Bennée alex.ben...@linaro.org writes:

 I've been using org-mode as a source for my presentations but exporting
 broke today following an ELPA update. It seems the line:

 #+DATE: KVM Forum 2015

 Is no longer acceptable.

 FWIW, I export it without an error. Do you use a custom export
 back-end?

I'm using ox-reveal (for Reveal.js). I'm finding it hard to trigger an
actual backtrace so maybe the problem is there.



 Regards,

-- 
Alex Bennée



Re: [O] Change in ox export for #+DATE keywords

2015-08-08 Thread Alex Bennée

Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Alex Bennée alex.ben...@linaro.org writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Hello,

 Alex Bennée alex.ben...@linaro.org writes:

 I've been using org-mode as a source for my presentations but exporting
 broke today following an ELPA update. It seems the line:

 #+DATE: KVM Forum 2015

 Is no longer acceptable.

 FWIW, I export it without an error. Do you use a custom export
 back-end?

 I'm using ox-reveal (for Reveal.js). I'm finding it hard to trigger an
 actual backtrace so maybe the problem is there.

 I've had a cursory look at ox-reveal.el[fn:1]. There is a strange thing,
 indeed. In `org-reveal-template', line 888, (plist-get info :author)
 should be wrapped within (org-export-data ...).

 However, it is not related to your error. Therefore, I suspect an
 installation problem on your side.

I've tried re-building all my elpa packages as well as doing a plaing
HTML export and I can now get a backtrace:

Debugger entered--Lisp error: (wrong-type-argument listp #(Towards 
multi-threaded TCG 0 26 (:parent (#1
  org-element-set-contents(#(Towards multi-threaded TCG 0 26 (:parent (#0
  apply(org-element-set-contents #(Towards multi-threaded TCG 0 26 (:parent 
(#0))) nil)
  #[(s) \306\307\310#\311\312   
\211:\204\313\202\@9\203!AA\202\)\\210\314\315\n 
\211:\2043\313\202@@9\203?AA\202@)#\210  
\316\211\n;\203V\317\320\f#\202\\\321A@\f\*\211;\203n\322\313\f$\202zA\323A@\f#\240\210+\210\nA
   A@\240\210\n@\240*\207 [s new old element property value 
replace-regexp-in-string \n   mapc #[(blob) \305
\211;\203\306\f\307\n$\202 \fA\310\fA@\n#\240\210\f+\207 [blob old value 
property element :parent org-add-props nil plist-put] 6] nil apply 
org-element-set-contents :parent get-text-property 0 plist-get org-add-props 
plist-put] 6](#(Towards multi-threaded TCG 0 26 (:parent (#0
  #[(--data) \211:\204   ;\205\306\202 @9\205 
@)?\206\337\203,\307\310\\206\337\n\2047\311\f\\202\337\n\312=\203\\\311\f\211:\204J\313\202W
  @9\203V AA\202W 
)\\202\337\n\203\202!\211\203\201\203z\314\315\\210\202\201B)\316=\203\312;\204\312\n\236A\313\211\203\311@\f
  ;\203\266\317\320  #\202\275\307   
A@\*!\210A\211\204\234*\203\202\316=\203\202\n\203\202\313 
\211\203\201@\211 @ A  ;\203\317\320 #\202\307  
A@\*!\!\203w\#\235\203_\$\235\203P\321!!\313%\211\203L@%\f%A!\210\f%@!\210A\211\2042*\202w\f!A!\210\f!@!\210\202w\$\235\203r\311\f\321!!\\210\202w\f!!\210*A\211\204\350*\n\206\337\211:\204\224\313\202\241
 @9\203\240  AA\202\241  
)?\206\337\322=\203\265\n'?\206\337\323=\203\303\n(\206\337\311\f\211:\204\320\313\202\335
 @9\203\334  AA\202\335  )\)\207 [--data element --type info 
--walk-tree types plain-text plist-get :ignore-list mapc org-data nil throw 
--map-first-match objects get-text-property 0 reverse greater-elements elements 
fun result first-match --acc --category org-element-secondary-value-alist p 
--dolist-tail-- property with-affiliated org-element-all-elements 
org-element--parsed-properties-alist kwd-pair value kwd 
org-element-dual-keywords org-element-multiple-keywords line no-recursion 
org-element-greater-elements org-element-all-objects] 6](#(Towards 
multi-threaded TCG 0 26 (:parent (#0
  mapc(#[(--data) \211:\204  ;\205\306\202 @9\205 
@)?\206\337\203,\307\310\\206\337\n\2047\311\f\\202\337\n\312=\203\\\311\f\211:\204J\313\202W
  @9\203V AA\202W 
)\\202\337\n\203\202!\211\203\201\203z\314\315\\210\202\201B)\316=\203\312;\204\312\n\236A\313\211\203\311@\f
  ;\203\266\317\320  #\202\275\307   
A@\*!\210A\211\204\234*\203\202\316=\203\202\n\203\202\313 
\211\203\201@\211 @ A  ;\203\317\320 #\202\307  
A@\*!\!\203w\#\235\203_\$\235\203P\321!!\313%\211\203L@%\f%A!\210\f%@!\210A\211\2042*\202w\f!A!\210\f!@!\210\202w\$\235\203r\311\f\321!!\\210\202w\f!!\210*A\211\204\350*\n\206\337\211:\204\224\313\202\241
 @9\203\240  AA\202\241  
)?\206\337\322=\203\265\n'?\206\337\323=\203\303\n(\206\337\311\f\211:\204\320\313\202\335
 @9\203\334  AA\202\335  )\)\207 [--data element --type info 
--walk-tree types plain-text plist-get :ignore-list mapc org-data nil throw 
--map-first-match objects get-text-property 0 reverse greater-elements elements 
fun result first-match --acc --category org-element-secondary-value-alist p 
--dolist-tail-- property with-affiliated org-element-all-elements 
org-element--parsed-properties-alist kwd-pair value kwd 
org-element-dual-keywords org-element-multiple-keywords line no-recursion 
org-element-greater-elements org-element-all-objects] 6] (#(Towards 
multi-threaded TCG 0 26 (:parent #0
  #[(--data) \211:\204   ;\205\306\202 @9\205 
@)?\206\337\203,\307\310\\206\337\n\2047\311\f\\202\337\n\312=\203\\\311\f\211:\204J\313\202W
  @9\203V AA\202W 
)\\202\337\n\203\202

Re: [O] Change in ox export for #+DATE keywords

2015-08-08 Thread Alex Bennée

Alex Bennée alex.ben...@linaro.org writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:

 Alex Bennée alex.ben...@linaro.org writes:

 Nicolas Goaziou m...@nicolasgoaziou.fr writes:
snip
 FWIW, I export it without an error. Do you use a custom export
 back-end?

 I'm using ox-reveal (for Reveal.js). I'm finding it hard to trigger an
 actual backtrace so maybe the problem is there.

 I've had a cursory look at ox-reveal.el[fn:1]. There is a strange thing,
 indeed. In `org-reveal-template', line 888, (plist-get info :author)
 should be wrapped within (org-export-data ...).

 However, it is not related to your error. Therefore, I suspect an
 installation problem on your side.

 I've tried re-building all my elpa packages as well as doing a plaing
 HTML export and I can now get a backtrace:

snip

OK ignore that. If I do a -q -l mininit.el I get a more useful backtrace
that reveals problems with ox-reveal.el which I can address.

-- 
Alex Bennée



[O] Change in ox export for #+DATE keywords

2015-08-07 Thread Alex Bennée
Hi,

I've been using org-mode as a source for my presentations but exporting
broke today following an ELPA update. It seems the line:

#+DATE: KVM Forum 2015

Is no longer acceptable. I think this changed as of:

ae9db17482a183e5613428c3abf1c691f86b4ac0

I'm not quite sure what the new parse is expecting. If I change it to
a datestamp I see breakage on other lines like the title:

apply: Wrong type argument: listp, #(My presentation title 0 26 (:parent 
(#0)))

So what form am I meant to be using for these options and why the change?

-- 
Alex Bennée



Re: [O] Correct way to insert results

2015-05-14 Thread Alex Bennée

Alex Bennée alex.ben...@linaro.org writes:

 Hi,

 I'm working on adding async call functionality to org-babel blocks so I
 don't need to block my main Emacs for long running calculations. However
 I'm having problems with the insertion of the results once handled.

Ping? Is this something I should just write a custom routine for to
replace a token generated at the initial call?

 My
 code looks like this:

 (defmacro async-org-call (async-form)
   Expands `ASYNC-FORM' as an asynchronus org-bable function.
 If executed inside an org file will insert the results into the src
   blocks results.  Otherwise the result will be echoed to the Message
   buffer.

   (let ((result-buffer (buffer-name))
 (result-org-name (nth 4 (org-babel-get-src-block-info

 `(async-start

   ;; The result of the async-sexp is returned to the handler
   ;; as result.
   (lambda ()
 ,(async-inject-variables async-form)
 (eval async-form))

   ;; This code runs in the current emacs process.
   (lambda (result)
 (let ((buf ,result-buffer)
   (org ,result-org-name))
   
   ;; Send the results somewhere
   (if (and buf org)
   (save-excursion
 (with-current-buffer buf
   (org-babel-goto-named-result org)
   (org-babel-insert-result (format %s result
 (message (pp (format async-result: %s result)

 However the insert result seems to keep skipping the named result I'm
 aiming for (I was calling basic-async-test, the results end up after
 async-with-delay in a fresh RESULTS: drawer):

 ** Basic async

 #+name: basic-async-test
 #+begin_src emacs-lisp 
 (async-org-call (format this is in inferior))
 #+end_src

 #+RESULTS: basic-async-test
 : #process emacs

 #+name: async-with-delay
 #+begin_src emacs-lisp 
 (async-org-call ((sleep-for 3) (format woken up)))
 #+end_src

 #+RESULTS:
 =this is in inferior
 =: this is in inferior

 #+RESULTS: async-with-delay
 : #process emacs

 Any idea how I can do this better?

-- 
Alex Bennée



[O] Correct way to insert results

2015-05-11 Thread Alex Bennée
Hi,

I'm working on adding async call functionality to org-babel blocks so I
don't need to block my main Emacs for long running calculations. However
I'm having problems with the insertion of the results once handled. My
code looks like this:

(defmacro async-org-call (async-form)
  Expands `ASYNC-FORM' as an asynchronus org-bable function.
If executed inside an org file will insert the results into the src
  blocks results.  Otherwise the result will be echoed to the Message
  buffer.

  (let ((result-buffer (buffer-name))
(result-org-name (nth 4 (org-babel-get-src-block-info

`(async-start

  ;; The result of the async-sexp is returned to the handler
  ;; as result.
  (lambda ()
,(async-inject-variables async-form)
(eval async-form))

  ;; This code runs in the current emacs process.
  (lambda (result)
(let ((buf ,result-buffer)
  (org ,result-org-name))
  
  ;; Send the results somewhere
  (if (and buf org)
  (save-excursion
(with-current-buffer buf
  (org-babel-goto-named-result org)
  (org-babel-insert-result (format %s result
(message (pp (format async-result: %s result)

However the insert result seems to keep skipping the named result I'm
aiming for (I was calling basic-async-test, the results end up after
async-with-delay in a fresh RESULTS: drawer):

** Basic async

#+name: basic-async-test
#+begin_src emacs-lisp 
(async-org-call (format this is in inferior))
#+end_src

#+RESULTS: basic-async-test
: #process emacs

#+name: async-with-delay
#+begin_src emacs-lisp 
(async-org-call ((sleep-for 3) (format woken up)))
#+end_src

#+RESULTS:
=this is in inferior
=: this is in inferior

#+RESULTS: async-with-delay
: #process emacs

Any idea how I can do this better?


-- 
Alex Bennée



Re: [O] xml-rpc-request error for wordpress

2015-01-21 Thread Alex Kost
Shiyuan (2015-01-18 03:23 +0300) wrote:

 Hi all,
 I have been using org2blog/wp package to manage my wordpress blog. It had
 been woking very well until last week when things started to fail.
  org2blog/wp uses xml-rpc-request to connect to wordpress.com which returns
 the 301 Error.  I haven't changed my emacs config for quite a long time. So
 I guess something might have happened on the wordpress side or some emacs
 packages break something.  I have googled around but cannot find any
 relevant info.  I don't have too much experience about xml-rpc. Any help
 about debugging this issue would be appreciated. The traceback is attached.
 I can login wordpress and maintain my blog through the browser and web
 interface.  Thanks.

Not sure, but as I saw POST and Error during request: 301 in your
backtrace, I think it may be the same as the bug 16960: 
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16960.

-- 
Alex



Re: [O] stuck project definition bug?

2014-10-19 Thread Alex Scherbanov
  (setq org-stuck-projects '(PROJECT (NEXT) nil nil))
 This means that everything with a tag :PROJECT: without NEXT subtask is a 
 stuck project.
 
 I’d like this stuck project to be shown in the stuck project list:
 
 * TODO my stuck project :PROJECT:
 ** TODO subtask
 
 But it is not shown there.
 
 I cannot reproduce it on latest Org, i.e., both tasks appear in the
 stuck projects list.

Hi, Nicolas.
I found the cause.
   (setq org-enforce-todo-dependencies t)
   (setq org-agenda-dim-blocked-tasks ‘invisible)
This hides my stuck project from the list because it depends on a subtask.

I set it to dim, not to hide, that’s enough for now.
Thanks.




Re: [O] stuck project definition bug?

2014-10-18 Thread Alex Scherbanov

  (setq org-stuck-projects '(PROJECT (NEXT) nil nil))
 This means that everything with a tag :PROJECT: without NEXT subtask is a 
 stuck project.
 
 * TODO my stuck project :PROJECT:
 ** TODO subtask
 
 But it is not shown there.
 
 I cannot reproduce it on latest Org, i.e., both tasks appear in the
 stuck projects list.


Hi, Nicolas.
I’sorry, I forgot to mention I’m on the maint branch.
I ran emacs -q and executed only lines that are needed for reproducing this 
problem.
And this definition of stuck projects worked indeed.

I’m trying to find what could break it for me.
Any ideas? Thanks.

   Alex Scherbanov




[O] stuck project definition bug?

2014-10-15 Thread Alex Scherbanov
Hi.
I’ve written a simple definition of a stuck project:
  (setq org-stuck-projects '(PROJECT (NEXT) nil nil))

This means that everything with a tag :PROJECT: without NEXT subtask is a stuck 
project.

I’d like this stuck project to be shown in the stuck project list:

* TODO my stuck project :PROJECT:
** TODO subtask

But it is not shown there.


The interesting thing is that it is shown in the list if I remove the todo 
state from my stuck project.
Did I miss something while matching the tag or is it a project definition bug?
Thanks.

   Alex Scherbanov




[O] project definition issue

2014-09-20 Thread Alex Scherbanov
Hi.
I'm trying to write a simple definition of project:
   (setq org-stuck-projects '(PROJECT (NEXT) nil nil))
This means that everything with a tag :PROJECT: without NEXT task is stuck.

But my stuck project is not shown in the list if it is a nested project and it 
has a todo state.

* unstuck 1 -- because has next:test:PROJECT:
** NEXT next in 1
** this stuck project _without_ todo state is shown in the list :PROJECT:
*** TODO whatever 1

* unstuck 2:test:PROJECT:
** NEXT next in 2
** TODO stuck project is not shown  :PROJECT:
*** TODO whatever 2


Next actions:
  Test:   NEXT next in 1
   :test::
  Test:   NEXT next in 2
   :test::

Stuck projects:
  Test:   this stuck project _without_ todo state is shown in the list  
   :test::PROJECT:




And what is interesting: when I’m trying to copy the whole line above, it 
actually copies two lines:
  Test:   this stuck project _without_ todo state is shown in the list  
   :test::PROJECT:
  Test:   TODO stuck project is not shown   
   :test::PROJECT:


I tried, but I didn’t find out why it works this way.
Could you help me?




Re: [O] [PATCH] Fix capture to make it save the point location

2014-05-23 Thread Alex Kosorukoff
Bastien:

did you mean the reply on the Capture Abort thread? This is a different
bug, unrelated to that the Capture Abort one. In this case capture doesn't
abort, but returns to a different place in buffer than the one it was
invoked from.

Thanks,
Alex


On Fri, May 23, 2014 at 5:30 AM, Bastien b...@gnu.org wrote:

 Hi Alex,

 Alex Kosorukoff a...@3form.com writes:

  sorry, I accidentally sent my previous patch. This is the one that
  belongs here.

 See my other reply for this bug and let me know if it's fixed.

 Thanks,

 --
  Bastien



Re: [O] [PATCH] Fix capture to make it save the point location

2014-05-23 Thread Alex Kosorukoff
Bastien:

yes, I can reproduce the bug using capmove.el with the latest master. It is
less salient in the small file that capmove makes, but very obvious in big
files where you get to a completely different place after capture finished.

Description of the steps:
1. open the same org file in two frames
2. make sure the positions in those frames are different
3. try to capture something from one of those frames
4. after capture finished, the positions in those frames become the same,
i.e. the frame where capture was invoked copied the position from another
frame and lost its context that was there before capture.

Best,
Alex



On Fri, May 23, 2014 at 8:39 AM, Bastien b...@altern.org wrote:

 Hi Alex,

 Alex Kosorukoff a...@3form.com writes:

  did you mean the reply on the Capture Abort thread? This is a
  different bug, unrelated to that the Capture Abort one. In this case
  capture doesn't abort, but returns to a different place in buffer
  than the one it was invoked from.

 Indeed, sorry for the confusion.

 The thing is: I can't reproduce the problem, even when following the
 capmove.el instructions.

 Can you reproduce the bug using latest maint or master branch?

 If so, a simple description of the steps will be easier than a
 file like capmove.el.

 Thanks,

 --
  Bastien



Re: [O] [PATCH] Fix: Capture abort: (error: The mark is not set now, so there is no region)

2014-05-23 Thread Alex Kosorukoff
On Fri, May 23, 2014 at 5:03 AM, Bastien b...@gnu.org wrote:

 Hi Alex,

 Alex Kosorukoff a...@3form.com writes:

  After I replaced my patch and merged Bastien's fix, I started seeing
  the error though less frequently than before. It didn't occur in the
  template I posted, but I started seeing it again in another template.
 
  (w org-protocol tag entry (file ~/org/bookmarks.org)
 * %:description %(org-set-tags)\n  %i\n\n  %:link\n%?
  
 :prepend t :empty-lines-after 1 :clock-in t
  :clock-resume t)

 If I may ask, why using %(org-set-tags) instead of %^g or %^G?


I am using org-set-tags to avoid autocompletion, both %^g and %^G take too
much time because my org files have many tagged items. Capture should be
fast to be effective.

 I switched back to my initial patch that was checking if the mark was
  set before trying to access the region. This worked: the errors
  disappeared.

 I think the right fix is to exclude `mark-active' from the local
 variable that are imported through `org-capture-steal-local-variables'.
 I installed such a fix in maint, please update Org and let me know if
 this works for you.


Excluding mark-active will work, the result will be the same as after my
patch, except performance will not be the same. Excluding variable requires
filtering the list of variables which takes O(n) whereas my patch takes
O(1). Mark-active is nil before org-capture-steal-local-variables because
this is a new buffer. It seems in this case setting it back to nil is
faster than trying to preserve its original value nil.


 Thanks,

 --
  Bastien



  1   2   >