Re: [DISCUSSION] Add "Recent News" to orgmode.org

2024-02-04 Thread Sacha Chua
On Sun, Feb 4, 2024, 14:37 Ihor Radchenko  wrote:

>
> What do you think about an idea to modify Org mode front page
> (https://orgmode.org/), adding the most recent blog posts and

discussions about Org mode?

We might use Org-related records from Sacha's news and/or
> https://planet.emacslife.com/ as a source, scrape it regularly (once per
> day/week or on every export), and embed the relevant links into the
> orgweb/index.html
>

If you like, the Org Mode section can be parsed out of
https://github.com/sachac/emacs-news/blob/master/most-recent.org and
included wherever. :)

Sacha


Re: Interest in an Org video meetup?

2023-07-28 Thread Sacha Chua
Hello, Ihor!

Thanks for taking the lead! I've sent you an invite from bbb.emacsverse.org.
Once you decide on a time and date, please let me know a week or two
beforehand so that I can put it in Emacs News. Do you want to go with Aug 9
at 6pm UTC+3?  I can't make it (still focused on kiddo), but maybe if at
least one or two other people confirm, then that could be a good starting
point and we can see who else shows up.


Sacha


On Thu, Jul 27, 2023, 03:52 Ihor Radchenko  wrote:

> Russell Adams  writes:
>
> >> We can make EmacsConf instance of BigBlueButton (BBB) available, as
> >> well.  FWIW I had more success with BBB than Jitsi for larger
> >> meetings.
>
> This thread had no activity for a while.
> Let me take the lead then.
>
> I am now in UTC+3 zone and can host a meetup in the evening my time
> (~6-10pm).
>
> Say, early next month. Like Aug 9. (Alternative suggestions welcome; I
> just randomly selected something no too far and no too close from now.)
>
> I will need a BBB account though.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: Interest in an Org video meetup?

2023-05-17 Thread Sacha Chua
bbb.emacsverse.org should be okay again. Thanks Amin for fixing it, and
thanks to everyone for letting us know!

On Mon, May 15, 2023, 11:43 Sacha Chua  wrote:

> I'll let Amin Bandali know. Thanks for everyone's patience!
>
> On Mon, May 15, 2023, 11:20 Ihor Radchenko  wrote:
>
>> Russell Adams  writes:
>>
>> > I was given an account on https://bbb.emacsverse.org/, and trying to
>> > use it today I get a certificate expired error that cannot be ignored.
>> >
>> > I was hoping to test it to setup a Saturday video session.
>> >
>> > Any ideas?
>>
>> I am also seeing the same error.
>> Looks like they forgot to update the certificate.
>> It expired a month ago.
>>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at <https://orgmode.org/>.
>> Support Org development at <https://liberapay.com/org-mode>,
>> or support my work at <https://liberapay.com/yantar92>
>>
>>


Re: Interest in an Org video meetup?

2023-05-15 Thread Sacha Chua
I'll let Amin Bandali know. Thanks for everyone's patience!

On Mon, May 15, 2023, 11:20 Ihor Radchenko  wrote:

> Russell Adams  writes:
>
> > I was given an account on https://bbb.emacsverse.org/, and trying to
> > use it today I get a certificate expired error that cannot be ignored.
> >
> > I was hoping to test it to setup a Saturday video session.
> >
> > Any ideas?
>
> I am also seeing the same error.
> Looks like they forgot to update the certificate.
> It expired a month ago.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>
>


Re: Interest in an Org video meetup?

2022-11-09 Thread Sacha Chua
On Wed, Nov 9, 2022, 09:08 Quiliro Ordóñez  wrote:

> What do you mean by "a screenshared text editor (Emacs, of course)"? Do
you mean Rudel? There are some options in
https://www.emacswiki.org/emacs/CollaborativeEditing

I meant something even simpler, actually - just someone using BBB's share
screen feature to share whatever people are using (Emacs or Etherpad) to
list the breakout rooms and their topics.

Sacha


Re: Interest in an Org video meetup?

2022-11-08 Thread Sacha Chua
On Tue, Nov 8, 2022, 20:45 Sacha Chua  wrote:

- first 5-15 minutes, people propose topics to talk about while you write
> them down in a screenshared text editor (Emacs, of course). Might have
>

Oh, actually, we can make an Etherpad for you, and then participants can
edit the list themselves. So I think all the moderator needs to do is to
create the breakout rooms and help people figure out what to do, which
could be partially handled by instructions in the pad.

Alternatively, LibrePlanet experimented with LibreAdventure (based on
https://workadventu.re/) and minetest for more of that "walking around near
interesting things" feeling. Is that potentially interesting too?

Sacha

>


Re: Interest in an Org video meetup?

2022-11-08 Thread Sacha Chua
Hello, Russell, all!

>
> > That's making a time and place for everyone to meet, but then do as
> > they like among each other.
> This is an interesting idea to try. (I am more used to presentation +
> free-for-all discussions.)
> > I'm happy to give a presentation, but would rather encourage a regular
> > meeting which is more of a group workshop.
>

Russell, are you available at some point during EmacsConf? Testing breakout
rooms in a group workshop / unconference thing might be fun with more
participants. Based on last year's Q experience, you might get 30 people
or so (or maybe more, if you run it over lunch break or next to a more
niche talk). I can probably figure out how to add it to the schedule
whenever you want.

It could work like this:
- first 5-15 minutes, people propose topics to talk about while you write
them down in a screenshared text editor (Emacs, of course). Might have an
informal show of virtual hands (not webcam, that makes the performance bad
if there are lots of people; just use the raise hands thing) to make sure
people aren't going to be waiting by themselves
- you create the breakout rooms and people join the ones they want
- they discuss; people can come back to the main room and join other things
- you can check in on them if you want
- maybe a report back if people want?

Could be a peer-to-peer help thing, could be an Org thing, could be
last-minute demos, could be whatever the participants want...

If you or anyone wants to experiment with this, let me know what time you
want to schedule it!

Sacha

>


Re: Interest in an Org video meetup?

2022-11-07 Thread Sacha Chua
On Mon, Nov 7, 2022, 07:42 Russell Adams  wrote:

Does anyone know an open conferencing solution that allows smaller
> workgroups within a larger unit?
>

BBB has breakout rooms. I haven't experimented with them, but it looks like
you can set them up so that people can join the one they want, be randomly
assigned, or be manually assigned to one.
https://support.blindsidenetworks.com/hc/en-us/articles/360024516512-Create-and-manage-breakout-rooms
describes features and limitations. Might be something to play with on
bbb.emacsverse.org? Maybe we'll give it a try at EmacsConf too, like having
a general hangout during lunch break. Might be fun!

Sacha


Re: Interest in an Org video meetup?

2022-11-07 Thread Sacha Chua
Let's pick a Saturday one or two weeks after EmacsConf. Then we can
announce it either during Timothy's talk or during the live Q after
Timothy's talk in case the details don't get ironed out this weekend.
People can share what they picked up at the conference, and I can show the
Org files I use to manage EmacsConf behind the scenes. (Babel, SVG, mail
merge, todo state hooks, ...)

I am probably more available at 8 AM EST than in the afternoon (kiddo likes
to sleep in), but I might be able to swing 1-3 PM EST especially if it'll
be Dec 17 instead of Dec 10. Would either Dec 10 or 17 work for anyone, and
can I get away with 8 AM (good for Europe and Asia, doable for Eastern,
tough for Pacific time) or do we need 1-3pm EST?

Sacha

On Mon, Nov 7, 2022, 06:29 Russell Adams  wrote:

> On Mon, Nov 07, 2022 at 01:28:29PM +0800, Timothy wrote:
> > Hi Ihor,
> >
> > > To clarify, Timothy’s presentation is going to be in December.
> > > It would be great if you finalize how committed you can be to this by
> > > then. Both from technical point of view and from your free time
> > > availability.
> >
> > For the sake of the talk, it would have to be worked out a bit sooner
> actually.
> > I’ll most likely be submitting a recording next weekend.
>
> I hadn't intended this to conflict with anything else. I was hoping to
> start a routine meeting, and like I said my time was constrained where
> I hadn't started yet.
>
> Would it be better to wait and schedule something after Emacsconf?
>
>
> --
> Russell Adamsrlad...@adamsinfoserv.com
> https://www.adamsinfoserv.com/
>
>


Re: [PATCH] org-list-send-item: allow dest to be a buffer position

2022-02-06 Thread Sacha Chua
Ihor Radchenko  writes:

>> Passing an integer representing a buffer position to org-list-send-item
>> was failing because of the string-match-p, so here's something that lets
>> integers skip that part. I have copyright assignment papers on file.
> LGTM! Would you mind supplying a test for this function?

Sure! Here's the new patch that includes the change and tests for the
different kinds of input accepted by org-list-send-item.

Sacha

lisp/org-list.el: org-list-send-item: allow dest to be a buffer position

* lisp/org-list.el (org-list-send-item): Check if dest is a string
before matching it, to allow dest to be a buffer position.
* testing/lisp/test-org-list.el (test-org-list/send-item): Add tests
---
 lisp/org-list.el  |  2 +-
 testing/lisp/test-org-list.el | 64 +++
 2 files changed, 65 insertions(+), 1 deletion(-)

diff --git a/lisp/org-list.el b/lisp/org-list.el
index 3533c8319..f1ab2ca76 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -1442,7 +1442,7 @@ (defun org-list-send-item (item dest struct)
  (save-excursion
(goto-char (org-list-get-last-item item struct prevs))
(point-at-eol)))
-((string-match-p "\\`[0-9]+\\'" dest)
+((and (stringp dest) (string-match-p "\\`[0-9]+\\'" dest))
  (let* ((all (org-list-get-all-items item struct prevs))
 (len (length all))
 (index (mod (string-to-number dest) len)))
diff --git a/testing/lisp/test-org-list.el b/testing/lisp/test-org-list.el
index 3689a172f..e21409ca5 100644
--- a/testing/lisp/test-org-list.el
+++ b/testing/lisp/test-org-list.el
@@ -900,6 +900,70 @@ (ert-deftest test-org-list/insert-item ()
   (org-insert-item)
   (buffer-string)
 
+(ert-deftest test-org-list/send-item ()
+  "Test `org-list-send-item' specifications."
+  ;; Move to beginning
+  (should
+   (equal "- item3\n- item1\n- item2\n"
+  (org-test-with-temp-text
+  "- item1\n- item2\n- item3\n"
+(org-list-send-item (caar (last (org-list-struct)))
+'begin (org-list-struct))
+(buffer-string
+  ;; Move to beginning with child item
+  (should
+   (equal "- item3\n  - item4\n- item1\n- item2\n"
+  (org-test-with-temp-text
+  "- item1\n- item2\n- item3\n  - item4\n"
+(org-list-send-item (car (nth 2 (org-list-struct)))
+'begin (org-list-struct))
+(buffer-string
+  ;; Move to end
+  (should
+   (equal "- item2\n- item3\n  - item4\n- item1\n  - item1child\n"
+  (org-test-with-temp-text
+  "- item1\n  - item1child\n- item2\n- item3\n  - item4\n"
+(org-list-send-item (car (nth 0 (org-list-struct)))
+'end (org-list-struct))
+(buffer-string
+  ;; Move to item number by string should move the item before the specified 
one
+  (should
+   (equal "- item2\n- item1\n  - item1child\n- item3\n- item4\n- item5\n"
+  (org-test-with-temp-text
+  "- item1\n  - item1child\n- item2\n- item3\n- item4\n- item5\n"
+(org-list-send-item (car (nth 0 (org-list-struct)))
+"3" (org-list-struct))
+(buffer-string
+  ;; Move to item number by position should move the item before the specified 
one
+  (should
+   (equal "- item2\n- item1\n  - item1child\n- item3\n- item4\n- item5\n"
+  (org-test-with-temp-text
+  "- item1\n  - item1child\n- item2\n- item3\n- item4\n- item5\n"
+(re-search-forward "item3")
+(org-list-send-item (car (nth 0 (org-list-struct)))
+(point-at-bol) (org-list-struct))
+(buffer-string
+  ;; Delete
+  (should
+   (equal "- item1\n  - item1child\n- item2\n- item4\n- item5\n"
+  (org-test-with-temp-text
+  "- item1\n  - item1child\n- item2\n- item3\n- item4\n- item5\n"
+(re-search-forward "item3")
+(org-list-send-item (point-at-bol)
+'delete (org-list-struct))
+(buffer-string
+  ;; Kill
+  (let ((kill-ring nil))
+(org-test-with-temp-text
+"- item1\n  - item1child\n- item2\n- item3\n  - item3child\n- item4\n- 
item5\n"
+  (re-search-forward "item3")
+  (org-list-send-item (point-at-bol)
+  'kill (org-list-struct))
+  (should (equal "- item1\n  - item1child\n- item2\n- item4\n- item5\n"
+ (buffer-string)))
+  (should (equal "item3\n  - item3child"
+ (current-kill 0 t))
+
 (ert-deftest test-org-list/repair ()
   "Test `org-list-repair' specifications."
   ;; Repair indentation.
-- 
2.25.1





[PATCH] org-list-send-item: allow dest to be a buffer position

2022-02-05 Thread Sacha Chua
Passing an integer representing a buffer position to org-list-send-item
was failing because of the string-match-p, so here's something that lets
integers skip that part. I have copyright assignment papers on file.

Sacha


lisp/org-list.el: org-list-send-item: allow dest to be a buffer position

* lisp/org-list.el (org-list-send-item): Check if dest is a string
before matching it, to allow dest to be a buffer position.
---
 lisp/org-list.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-list.el b/lisp/org-list.el
index 3533c8319..f1ab2ca76 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -1442,7 +1442,7 @@ (defun org-list-send-item (item dest struct)
  (save-excursion
(goto-char (org-list-get-last-item item struct prevs))
(point-at-eol)))
-((string-match-p "\\`[0-9]+\\'" dest)
+((and (stringp dest) (string-match-p "\\`[0-9]+\\'" dest))
  (let* ((all (org-list-get-all-items item struct prevs))
 (len (length all))
 (index (mod (string-to-number dest) len)))
-- 
2.25.1





Re: [O] Agenda: Display projects and 3 todo subtasks

2019-07-31 Thread Sacha Chua
Hmm, you're right, that project subtask snippet isn't working any more. I
don't think I can sort that out while I'm away from my computer, so it may
take me a few weeks until I can poke around. If anyone happens to have a
better config, please feel free to share!

On Wed., Jul. 31, 2019, 10:37 Nathan Neff,  wrote:

> I forgot to mention that I have PROJECT tag as not inheritable:
> (setq org-tags-exclude-from-inheritance (quote ("PROJECT")))
>
> And here's the agenda custom-command addition:
>  ("2" "List projects with tasks" my/org-agenda-projects-and-tasks
>  "+PROJECT"
>  ((org-agenda-max-entries 3))
>
>
>
> On Tue, Jul 30, 2019 at 9:32 PM Nathan Neff  wrote:
>
>> Hello all,
>>
>> I found this cool snippet at Sacha Chua's website: [1].
>>
>> It creates an agenda view with headings marked with tag "project",
>> and for each of those headings, it displays up to 3 sub headings marked
>> TODO.
>>
>> I like this idea of seeing my projects (plus a few TODO entries under
>> each project)
>> in the agenda is a cool idea, so I copy/pasted the snippet at [1].
>>
>> I created an example org file:
>> * Project 1:PROJECT:
>> ** todo task 1.1
>> ** todo task 1.2
>> ** todo task 1.3
>> ** todo task 1.4
>> * Project 2:PROJECT:
>> ** todo task 2.1
>> ** todo task 2.2
>> ** todo task 2.3
>> ** todo task 2.4
>>
>> And ran the custom agenda command on only that file.
>>
>> The output which is produced lists each project correctly.
>> However the sub-tasks under each project are the *same 3 subtasks*
>> from Project 1
>>
>>   foo:Project 1
>>   foo:todo task 1.1
>>   foo:todo task 1.2
>>   foo:todo task 1.3
>>   foo:Project 2
>>   foo:todo task 1.1
>>   foo:todo task 1.2
>>   foo:todo task 1.3
>>
>> The snippet at [1] is a bit more complex than I thought would be
>> necessary for such
>> an agenda view.  Does someone have any snippets or suggestions for how to
>> accomplish the idea above?  Is there something obvious that I'm missing
>> about
>> the setup of my test org file?
>>
>> Thanks,
>> --Nate
>>
>> [1]
>> https://github.com/sachac/.emacs.d/blob/gh-pages/Sacha.org#display-projects-with-associated-subtasks
>> The associated blog entry is:
>>
>> https://sachachua.com/blog/2013/01/emacs-org-display-projects-with-a-few-subtasks-in-the-agenda-view/
>>
>>
>>
>>


Re: [O] [PATCH] Add :target option for the TOC keyword

2019-06-05 Thread Sacha Chua
Whoops, I'm so sorry - I accidentally used org-make-link-string instead of
org-link-make-string. Tiny patch fixing it attached.

Sacha Chua - sa...@sachachua.com - Blog: sachachua.com - Mobile: +1 416 823
2669


On Fri, May 31, 2019 at 12:30 PM Nicolas Goaziou 
wrote:

> Hello,
>
> Sacha Chua  writes:
>
> > - catch the signal raised by org-export-resolve-fuzzy-link and then
> check for the
> > special case of "local"
> > - always handle :target "local" as a local TOC
> > - or just leave the behaviour as it is. What would you recommend?
>
> The latter is fine.
>
> I applied you patch. Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>
From 265886aedf202cce3cc7ab4f88bab318dd69ca86 Mon Sep 17 00:00:00 2001
From: Sacha Chua 
Date: Wed, 5 Jun 2019 15:17:57 -0400
Subject: [PATCH] org-export-resolve-link: Use org-link-make-string

* lisp/ox.el (org-export-resolve-link): Use org-link-make-string
  instead of org-make-link-string.
---
 lisp/ox.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index e989b37c6..05c8daebc 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -4478,7 +4478,7 @@ Return value can be an object or an element:
   (when (stringp link)
 (setq link (with-temp-buffer
 		 (save-excursion
-		   (insert (org-make-link-string link)))
+		   (insert (org-link-make-string link)))
 		 (org-element-link-parser
   (pcase (org-element-property :type link)
 ((or "custom-id" "id") (org-export-resolve-id-link link info))
-- 
2.17.1



Re: [O] [PATCH] Add :target option for the TOC keyword

2019-05-29 Thread Sacha Chua
Nicolas Goaziou  writes:

Hello, Nicolas!

> Thank you! I cannot guess the use case, but you certainly have one :)

I'm guessing DC Toedt likes to make Org files that have some kind of
overview TOC in a different section. I haven't used it myself, but it
seems like a potentially handy thing to have.

> Even if this doesn't sound like a very common need, it doesn't add too
> much overhead to the code base either. It would be nice if it really
> generalized "local" keyword, i.e., with ":target local", "local" variant
> being supported but not documented.

The old way just did a simple regular expression search for local, so
:target local actually already works. :target "local" tries to do a
fuzzy search for a headline with "local" text in it, though. Is that
what you mean? I'm not sure if the best approach would be to:

- catch the signal raised by org-export-resolve-fuzzy-link and then check for 
the
special case of "local"
- always handle :target "local" as a local TOC
- or just leave the behaviour as it is. What would you recommend?

> Also, there seems to be much code duplication in the export back-ends.
> Would it make sense to factor this out into a function in "ox.el". For
> example, `org-export-resolve-link-string' or some such? With some tests
> for bonus points.

I made an org-export-resolve-link that can take string or link objects.
It doesn't handle all the potential link types, though, just id and
fuzzy.

>From be360242b00a079afb110b019c6dd9ff6ebc36c3 Mon Sep 17 00:00:00 2001
From: Sacha Chua 
Date: Wed, 15 May 2019 14:22:05 -0400
Subject: [PATCH] Add :target option for the TOC keyword

* doc/org-manual.org, etc/ORG_NEWS: Document :target option
  for the TOC keyword.

* lisp/ox.el (org-export-resolve-link): New function.

* lisp/ox-ascii.el (org-ascii-keyword): Added :target to the TOC
  keyword.
  (org-ascii--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-html.el (org-html-keyword): Added :target to the TOC keyword.

* lisp/ox-md.el (org-md-keyword): Added :target to the TOC keyword.
  (org-md--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-odt.el (org-odt-keyword): Added :target to the TOC keyword.

* testing/lisp/test-ox.el (test-org-export/collect-headlines): Added
  tests for specifying scope by CUSTOM_ID or by fuzzy matching.
  (test-org-export/resolve-link): New test.
---
 doc/org-manual.org  | 16 
 etc/ORG-NEWS| 16 
 lisp/ox-ascii.el| 20 ++
 lisp/ox-html.el | 10 -
 lisp/ox-md.el   | 20 ++
 lisp/ox-odt.el  | 10 -
 lisp/ox.el  | 28 ++
 testing/lisp/test-ox.el | 84 +
 8 files changed, 186 insertions(+), 18 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 54b89e5bf..9f3fae308 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -11551,6 +11551,22 @@ file requires the inclusion of the titletoc package.  Because of
 compatibility issues, titletoc has to be loaded /before/ hyperref.
 Customize the ~org-latex-default-packages-alist~ variable.
 
+The following example inserts a table of contents that links to the
+children of the specified target.
+
+#+begin_example
+,* Target
+  :PROPERTIES:
+  :CUSTOM_ID: TargetSection
+  :END:
+,** Heading A
+,** Heading B
+,* Another section
+,#+TOC: headlines 1 :target "#TargetSection"
+#+end_example
+
+The =:target= attribute is supported in HTML, Markdown, ODT, and ASCII export.
+
 Use the =TOC= keyword to generate list of tables---respectively, all
 listings---with captions.
 
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 541559e64..95358ca7b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -212,6 +212,22 @@ This attribute overrides the =:width= and =:height= attributes.
 [[https://orgmode.org/img/org-mode-unicorn-logo.png]]
 #+end_example
 
+*** Allow specifying the target for a table of contents
+
+The =+TOC= keyword now accepts a =:target:= attribute that specifies
+the headline to use for making the table of contents.
+
+#+begin_example
+,* Target
+  :PROPERTIES:
+  :CUSTOM_ID: TargetSection
+  :END:
+,** Heading A
+,** Heading B
+,* Another section
+,#+TOC: headlines 1 :target "#TargetSection"
+#+end_example
+
 ** New functions
 *** ~org-dynamic-block-insert-dblock~
 
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index 7917e3dad..20327169b 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -731,7 +731,7 @@ caption keyword."
 		 (org-export-data caption info))
 	 (org-ascii--current-text-width element info) info)
 
-(defun org-ascii--build-toc (info  n keyword local)
+(defun org-ascii--build-toc (info  n keyword scope)
   "Return a table of contents.
 
 INFO is a plist used as a communication channel.
@@ -742,10 +742,10 @@ depth of the table.
 Optional argument KEYWORD specifies the TOC keyword, if 

[O] [PATCH] Add :target option for the TOC keyword

2019-05-15 Thread Sacha Chua
Hi! Here's a patch to allow table of contents to target a specified
headline. I've added tests for HTML, ASCII, Markdown, and ODT export.
I should have copyright assignment papers already on file.

Does it work for anyone other than me? =)

>From 81035b85a10ec62d7a8ddc594349189e97346960 Mon Sep 17 00:00:00 2001
From: Sacha Chua 
Date: Wed, 15 May 2019 14:22:05 -0400
Subject: [PATCH 1/1] Add :target option for the TOC keyword

* doc/org-manual.org, etc/ORG_NEWS: Document :target option
  for the TOC keyword.

* lisp/ox-ascii.el (org-ascii-keyword): Added :target to the TOC
  keyword.
  (org-ascii--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-html.el (org-html-keyword): Added :target to the TOC keyword.

* lisp/ox-md.el (org-md-keyword): Added :target to the TOC keyword.
  (org-md--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-odt.el (org-odt-keyword): Added :target to the TOC keyword.

* testing/examples/toc-with-fuzzy-target.org: New example file for
  testing target headlines by fuzzy matching.

* testing/examples/toc-with-target.org: New example file for testing
  target headlines by CUSTOM_ID.

* testing/lisp/test-ox-html.el: New file.

* testing/lisp/test-ox-md.el: New file.

* testing/lisp/test-ox-odt.el: New file.

* testing/lisp/test-ox.el (test-org-export/collect-headlines): Added
  tests for specifying scope by CUSTOM_ID or by fuzzy matching.

* testing/org-test.el (org-test-toc-with-target-file): New.
  (org-test-toc-with-fuzzy-target-file): New.
---
 doc/org-manual.org | 16 +++
 etc/ORG-NEWS   | 16 +++
 lisp/ox-ascii.el   | 27 +---
 lisp/ox-html.el| 17 +++-
 lisp/ox-md.el  | 27 +---
 lisp/ox-odt.el | 17 +++-
 testing/examples/toc-with-fuzzy-target.org | 12 +
 testing/examples/toc-with-target.org   | 12 +
 testing/lisp/test-ox-html.el   | 51 ++
 testing/lisp/test-ox-md.el | 51 ++
 testing/lisp/test-ox-odt.el| 51 ++
 testing/lisp/test-ox.el| 50 +
 testing/org-test.el|  6 +++
 13 files changed, 335 insertions(+), 18 deletions(-)
 create mode 100644 testing/examples/toc-with-fuzzy-target.org
 create mode 100644 testing/examples/toc-with-target.org
 create mode 100644 testing/lisp/test-ox-html.el
 create mode 100644 testing/lisp/test-ox-md.el
 create mode 100644 testing/lisp/test-ox-odt.el

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 54b89e5bf..9f3fae308 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -11551,6 +11551,22 @@ file requires the inclusion of the titletoc package.  Because of
 compatibility issues, titletoc has to be loaded /before/ hyperref.
 Customize the ~org-latex-default-packages-alist~ variable.
 
+The following example inserts a table of contents that links to the
+children of the specified target.
+
+#+begin_example
+,* Target
+  :PROPERTIES:
+  :CUSTOM_ID: TargetSection
+  :END:
+,** Heading A
+,** Heading B
+,* Another section
+,#+TOC: headlines 1 :target "#TargetSection"
+#+end_example
+
+The =:target= attribute is supported in HTML, Markdown, ODT, and ASCII export.
+
 Use the =TOC= keyword to generate list of tables---respectively, all
 listings---with captions.
 
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 541559e64..95358ca7b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -212,6 +212,22 @@ This attribute overrides the =:width= and =:height= attributes.
 [[https://orgmode.org/img/org-mode-unicorn-logo.png]]
 #+end_example
 
+*** Allow specifying the target for a table of contents
+
+The =+TOC= keyword now accepts a =:target:= attribute that specifies
+the headline to use for making the table of contents.
+
+#+begin_example
+,* Target
+  :PROPERTIES:
+  :CUSTOM_ID: TargetSection
+  :END:
+,** Heading A
+,** Heading B
+,* Another section
+,#+TOC: headlines 1 :target "#TargetSection"
+#+end_example
+
 ** New functions
 *** ~org-dynamic-block-insert-dblock~
 
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index 7917e3dad..969f632b0 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -731,7 +731,7 @@ caption keyword."
 		 (org-export-data caption info))
 	 (org-ascii--current-text-width element info) info)
 
-(defun org-ascii--build-toc (info  n keyword local)
+(defun org-ascii--build-toc (info  n keyword scope)
   "Return a table of contents.
 
 INFO is a plist used as a communication channel.
@@ -742,10 +742,10 @@ depth of the table.
 Optional argument KEYWORD specifies the TOC keyword, if any, from
 which the table of contents generation has been initiated.
 
-When optional argument LOCAL is non-nil, build a table of
-contents according to the current headline."
+When optional argument SCOPE is non-nil

[O] Add :target option for the TOC keyword

2019-05-15 Thread Sacha Chua
Hi! Here's a patch to allow table of contents to target a specified
headline. I've added tests for HTML, ASCII, Markdown, and ODT export.
I should have copyright assignment papers already on file.

Does it work for anyone other than me? =)

>From 81035b85a10ec62d7a8ddc594349189e97346960 Mon Sep 17 00:00:00 2001
From: Sacha Chua 
Date: Wed, 15 May 2019 14:22:05 -0400
Subject: [PATCH 1/1] Add :target option for the TOC keyword

* doc/org-manual.org, etc/ORG_NEWS: Document :target option
  for the TOC keyword.

* lisp/ox-ascii.el (org-ascii-keyword): Added :target to the TOC
  keyword.
  (org-ascii--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-html.el (org-html-keyword): Added :target to the TOC keyword.

* lisp/ox-md.el (org-md-keyword): Added :target to the TOC keyword.
  (org-md--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-odt.el (org-odt-keyword): Added :target to the TOC keyword.

* testing/examples/toc-with-fuzzy-target.org: New example file for
  testing target headlines by fuzzy matching.

* testing/examples/toc-with-target.org: New example file for testing
  target headlines by CUSTOM_ID.

* testing/lisp/test-ox-html.el: New file.

* testing/lisp/test-ox-md.el: New file.

* testing/lisp/test-ox-odt.el: New file.

* testing/lisp/test-ox.el (test-org-export/collect-headlines): Added
  tests for specifying scope by CUSTOM_ID or by fuzzy matching.

* testing/org-test.el (org-test-toc-with-target-file): New.
  (org-test-toc-with-fuzzy-target-file): New.
---
 doc/org-manual.org | 16 +++
 etc/ORG-NEWS   | 16 +++
 lisp/ox-ascii.el   | 27 +---
 lisp/ox-html.el| 17 +++-
 lisp/ox-md.el  | 27 +---
 lisp/ox-odt.el | 17 +++-
 testing/examples/toc-with-fuzzy-target.org | 12 +
 testing/examples/toc-with-target.org   | 12 +
 testing/lisp/test-ox-html.el   | 51 ++
 testing/lisp/test-ox-md.el | 51 ++
 testing/lisp/test-ox-odt.el| 51 ++
 testing/lisp/test-ox.el| 50 +
 testing/org-test.el|  6 +++
 13 files changed, 335 insertions(+), 18 deletions(-)
 create mode 100644 testing/examples/toc-with-fuzzy-target.org
 create mode 100644 testing/examples/toc-with-target.org
 create mode 100644 testing/lisp/test-ox-html.el
 create mode 100644 testing/lisp/test-ox-md.el
 create mode 100644 testing/lisp/test-ox-odt.el

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 54b89e5bf..9f3fae308 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -11551,6 +11551,22 @@ file requires the inclusion of the titletoc package.  Because of
 compatibility issues, titletoc has to be loaded /before/ hyperref.
 Customize the ~org-latex-default-packages-alist~ variable.
 
+The following example inserts a table of contents that links to the
+children of the specified target.
+
+#+begin_example
+,* Target
+  :PROPERTIES:
+  :CUSTOM_ID: TargetSection
+  :END:
+,** Heading A
+,** Heading B
+,* Another section
+,#+TOC: headlines 1 :target "#TargetSection"
+#+end_example
+
+The =:target= attribute is supported in HTML, Markdown, ODT, and ASCII export.
+
 Use the =TOC= keyword to generate list of tables---respectively, all
 listings---with captions.
 
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 541559e64..95358ca7b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -212,6 +212,22 @@ This attribute overrides the =:width= and =:height= attributes.
 [[https://orgmode.org/img/org-mode-unicorn-logo.png]]
 #+end_example
 
+*** Allow specifying the target for a table of contents
+
+The =+TOC= keyword now accepts a =:target:= attribute that specifies
+the headline to use for making the table of contents.
+
+#+begin_example
+,* Target
+  :PROPERTIES:
+  :CUSTOM_ID: TargetSection
+  :END:
+,** Heading A
+,** Heading B
+,* Another section
+,#+TOC: headlines 1 :target "#TargetSection"
+#+end_example
+
 ** New functions
 *** ~org-dynamic-block-insert-dblock~
 
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index 7917e3dad..969f632b0 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -731,7 +731,7 @@ caption keyword."
 		 (org-export-data caption info))
 	 (org-ascii--current-text-width element info) info)
 
-(defun org-ascii--build-toc (info  n keyword local)
+(defun org-ascii--build-toc (info  n keyword scope)
   "Return a table of contents.
 
 INFO is a plist used as a communication channel.
@@ -742,10 +742,10 @@ depth of the table.
 Optional argument KEYWORD specifies the TOC keyword, if any, from
 which the table of contents generation has been initiated.
 
-When optional argument LOCAL is non-nil, build a table of
-contents according to the current headline."
+When optional argument SCOPE is non-nil

Re: [O] An Org-based productivity tool

2018-10-29 Thread Sacha Chua
On Mon, Oct 29, 2018, 05:19 Marcin Borkowski,  wrote:

>
> Well, I think I have something even better -
> https://github.com/akirak/counsel-org-clock (I find Counsel/Ivy
> interface much superior to the default refiling one).  I have my
>

Oh, I should switch to that! Thanks for the recommendation.

Definitely!  As of now, the main use is to make sure I don't get
> distracted too much at work so that I can actually make ends meet (I'm
> paid by an hour), so this is a crucial part of my work infrastructure.
> Also, this means it /must/ be a harsh taskmaster (at least for some
> time).
>

I remember liking the combination of org-capture (for ideas and tasks that
might otherwise interrupt my flow), effort estimates, looking at the
current clocked task in the modeline, and making myself take notes along
the way using org-babel. You probably already have a more sophisticated
workflow, but in case any of those habits could use practising or tweaking,
maybe that could help.

I wonder if it makes sense to set up pomodoros, so you have the time
structure to accommodate interruptions/distractions as well as a regular
reminder to check if you're still on-task.

I look forward to reading your usual awesome blog post about whatever
workflow you figure out! :)

Sacha


Re: [O] An Org-based productivity tool

2018-10-16 Thread Sacha Chua
Thanks for bringing me into the conversation! :) I'm so far from that
sort of thing right now. Rough activity tracking by buttons and voice
shortcuts on my phone is all I can manage with a toddler around.

Marcin, I wonder if you might like to adapt some code from
sachachua.com/dotemacs for clocking into a task by taking advantage of the
org refiling system, and the idea of setting up a hydra or other shortcuts
for common tasks. The code might need to be updated, not sure. If you're
using Org and another time tracking system that might have better reports,
you might like to set up something like what I have, where I can use a
single key to clock into both Org and Quantified Awesome with a pre-defined
or prompted category.

I find time analysis useful for things like calibrating my estimates and
expectations, learning about my revealed preferences and trends over time,
and feeling more satisfied about my days/weeks/months. I liked using the
data to build on my strengths and work around my limits instead of giving
in to the temptation to use it as a harsh taskmaster. :) I wonder if
something similar might be helpful for you.

Have fun!

On Tue, Oct 16, 2018, 16:42 Adam Porter,  wrote:

> Hi Marcin,
>
> That sounds very geekily interesting.  :)  I imagine Sacha Chua might be
> interested as well, although she already has a sophisticated system for
> her Quantified Life stuff.
>
> I'd be interested in looking at your code.  For several years I've used
> a "pomodoro"-like shell script to help stay on-task.  It would be nice
> to do it in Org instead (I know about org-pomodoro, but it doesn't do as
> much as my script does).
>
>
>


Re: [O] dynamic date arithmetic in a macro or otherwise (simulating a "date counter")?

2017-08-22 Thread Sacha Chua
org-clone-subtree-with-time-shift might be a good starting point, too. It
could be interesting to be able to replace dates within text and
priorities. Good luck!

On Aug 22, 2017 7:10 PM, "Matt Price"  wrote:

>
>
> On Thu, Aug 17, 2017 at 3:25 PM, Matt Price  wrote:
>
>> I'd love to be able generate dates dynamically using the {{{n}}} org
>> macro, or some other mechanism.  I don't immediately see how that would be
>> possible but maybe someone can guide me.  I'd want to do something
>> equivalent to this pseudo-elisp:
>>
>> (let ((base-date 2017-09-05))
>>   (+ base-date (* 7 {{{n}}}))
>>
>> I haven't looked into how date objects are parsed in org-mode, though, so
>> I have no idea how hard it would be to actually implement something like
>> this.
>>
>
> I made some progress on this (but not much).
>
> I defined a simple macro that adds times together and creates a timestamp
> that org can read -- in fact, this one adds some text as well:
>
> #+MACRO: w (eval (format-time-string "Week {{{n(week)}}} (<%Y-%m-%d %a>)"
> (time-add (encode-time 0 0 0 17 9 2017) (days-to-time (* 7 1 )
>
> This does everything that I want *except* dynamically adding time to the
> previous macro call.  I tried defining a dynamic version:
>
> #+MACRO: w (eval (format-time-string "Week {{{n(week)}}} (<%Y-%m-%d %a>)"
> (time-add (encode-time 0 0 0 17 9 2017) (days-to-time (* 7 $1 ))
>
> And then calling it with
>
> {{{w({{{n}}})}}}
>
> But unsurprisingly and appropriately, that didn't work.
>
> I also took a look at the patch Nicolas used to implement the {{{n}}}
> macro (I've reattached it here for convenience only!).  It defines
> `org-macro--counter-initialize` and calls it from inside
> `org-macro-templates-initialize`.  I guess I could copy that strategy but
> then I'd be maintaining my own copy of org-macro-templates-initialize,
> which seems like a terrible idea.
>
> So, I'm not sure how best to proceed. For my specific use-case, something
> like this would be a huge timesaver when multiplied over semesters/years.
> But I also wonder whether maybe other people would enjoy being able to do
> date arithmetic inside org files (and outside of tables -- I know from
> Sacha's 2015 blog post  that this is possible inside a table --
> http://sachachua.com/blog/2015/06/using-your-own-emacs-
> lisp-functions-in-org-mode-table-calculations-easier-dosage-totals/).  If
> other people would also use such code, I could try to hack something
> together for submission. Generalizable functions will be hard for me to
> write because I am sometimes a bit dense. I would love to hear suggestions
> from the group...
>
>
>> Thank you everyone!
>>
>
> ^^ this still applies!
> Matt
>
>


[O] [PATCH] ob-sql: Don't print out the command

2015-12-24 Thread Sacha Chua
Out of curiosity, is there a particular reason why ob-sql messages the
whole command, aside from debugging/development purposes? funnykitty on
#emacs said that executing a long command set was rather slow because of
the message. I've attached a tiny patch to remove the (message ...) in
case it's left over from debugging, and I've suggested that funnykitty
either use cl-flet to override message or redefine org-babel-execute:sql
in the meantime.

>From 04da1fb280847613290e11ce494ba58f17e951ac Mon Sep 17 00:00:00 2001
From: Sacha Chua <sa...@sachachua.com>
Date: Thu, 24 Dec 2015 12:36:40 -0500
Subject: [PATCH] ob-sql: Don't print out the command

* lisp/ob-sql.el (org-babel-execute:sql): Don't print out the command
  in the echo area, since it could be very long.
---
 lisp/ob-sql.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 275370e..14d5c61 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -175,7 +175,6 @@ SET COLSEP '|'
 ")
 	 (_ ""))
(org-babel-expand-body:sql body params)))
-(message command)
 (org-babel-eval command "")
 (org-babel-result-cond result-params
   (with-temp-buffer
-- 
2.6.3


Sacha


Re: [O] [PATCH] org-protocol: Allow key=val=value2-style URLs

2015-12-21 Thread Sacha Chua
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

Hello, Nicolas!

> Apparently, there is no more feedback, so I think it's good to go. 
> One minor issue, however: could you check that sentences (in comments
> and docstrings) are always separated by two spaces?
> Also, would you mind providing an entry for ORG-NEWS?

Sure! Revised patch attached updates docstrings and adds ORG-NEWS.

I also added more test cases and fixed a few small edge cases (ex:
org-capture with just a template, no links). I reworded the
documentation strings to pass M-x checkdoc as well. =)

>From 6045c5856c9f411ae4c337cef1a30848b8e7975e Mon Sep 17 00:00:00 2001
From: Sacha Chua <sa...@sachachua.com>
Date: Wed, 2 Dec 2015 10:53:07 -0500
Subject: [PATCH] org-protocol: Allow key=val=val2-style URLs

* lisp/org-protocol.el: Update documentation.
  (org-protocol-store-link, org-protocol-capture,
  org-protocol-open-source): Accept new-style links.
  (org-protocol-check-filename-for-protocol): Update documentation.
  (org-protocol-parse-parameters, org-protocol-assign-parameters):
  New functions.

  This allows the use of org-protocol on KDE 5 and makes org-protocol
  links more URI-like.  New-style links are of the form:
  org-protocol://store-link?title=TITLE=URL

* testing/lisp/test-org-protocol.el: New file.

* etc/NEWS: Add org-protocol new-style links.
---
 etc/ORG-NEWS  |  19 +++
 lisp/org-protocol.el  | 283 +-
 testing/lisp/test-org-protocol.el | 191 +
 3 files changed, 396 insertions(+), 97 deletions(-)
 create mode 100644 testing/lisp/test-org-protocol.el

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 0422ff1..9d7178e 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -11,6 +11,25 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
 * Version 9.0
 
 ** New features
+*** New org-protocol key=value syntax
+
+Org-protocol can now handle query-style parameters such as:
+
+#+begin_example
+org-protocol://store-link?url=http:%2F%2Flocalhost%2Findex.html=The%20title
+org-protocol://capture?template=x=Hello=World=http:%2F%2Fexample.com
+#+end_example
+
+Old-style links such as
+=org-protocol://store-link:/http:%2F%2Flocalhost%2Findex.html/The%20title=
+continue to be supported.
+
+If you have defined your own handler functions for
+~org-protocol-protocol-alist~, change them to accept either a property
+list (for new-style links) or a string (for old-style links).  Use
+~org-protocol-parse-parameters~ to convert old-style links into
+property lists.
+
 *** Org linter
 ~org-lint~ can check syntax and report common issues in Org documents.
 *** New option ~date-tree-last~ for ~org-agenda-insert-diary-strategy~
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 339f2b7..6ee9163 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -49,7 +49,7 @@
 ;;   4.) Try this from the command line (adjust the URL as needed):
 ;;
 ;;   $ emacsclient \
-;; org-protocol://store-link://http:%2F%2Flocalhost%2Findex.html/The%20title
+;; org-protocol://store-link?url=http:%2F%2Flocalhost%2Findex.html=The%20title
 ;;
 ;;   5.) Optionally add custom sub-protocols and handlers:
 ;;
@@ -60,7 +60,7 @@
 ;;
 ;;   A "sub-protocol" will be found in URLs like this:
 ;;
-;;   org-protocol://sub-protocol://data
+;;   org-protocol://sub-protocol?key=val=val2
 ;;
 ;; If it works, you can now setup other applications for using this feature.
 ;;
@@ -94,20 +94,20 @@
 ;; You may use the same bookmark URL for all those standard handlers and just
 ;; adjust the sub-protocol used:
 ;;
-;; location.href='org-protocol://sub-protocol://'+
-;;   encodeURIComponent(location.href)+'/'+
-;;   encodeURIComponent(document.title)+'/'+
+;; location.href='org-protocol://sub-protocol?url='+
+;;   encodeURIComponent(location.href)+'='+
+;;   encodeURIComponent(document.title)+'='+
 ;;   encodeURIComponent(window.getSelection())
 ;;
 ;; The handler for the sub-protocol \"capture\" detects an optional template
 ;; char that, if present, triggers the use of a special template.
 ;; Example:
 ;;
-;; location.href='org-protocol://sub-protocol://x/'+ ...
+;; location.href='org-protocol://capture?template=x'+ ...
 ;;
-;;  use template ?x.
+;;  uses template ?x.
 ;;
-;; Note, that using double slashes is optional from org-protocol.el's point of
+;; Note that using double slashes is optional from org-protocol.el's point of
 ;; view because emacsclient squashes the slashes to one.
 ;;
 ;;
@@ -225,27 +225,36 @@ Each element of this list must be of the form:
 
   (module-name :protocol protocol :function func :kill-client nil)
 
-protocol - protocol to detect in a filename without trailing colon and slashes.
-   See rfc1738 section 2.1 for more on this.
-   If you define a protocol \"my-protocol\", `org-prot

Re: [O] [PATCH] org-protocol: Allow key=val=value2-style URLs

2015-12-18 Thread Sacha Chua
Sacha Chua <sa...@sachachua.com> writes:

Hello, all!

> On second thought, your suggestion for always unhexifying makes the
> calls from the other handlers simpler, so I've attached a corrected patch.

Following up on this patch. Do you need anything else from me before you
merge this? What happens next? =)

Sacha




Re: [O] [PATCH] org-protocol: Allow key=val=value2-style URLs

2015-12-07 Thread Sacha Chua
Sacha Chua <sa...@sachachua.com> writes:

Hello, Aaron, all!

> Beats me, but the previous implementation made it a separate parameter
> for org-protocol-split-data, so I figured I'd carry it upwards into this
...
> Same notes as for hexify. Probably okay either way, but I don't know
> enough about who else uses this code to say. =) I can change it if you'd
> like to make that decision.

On second thought, your suggestion for always unhexifying makes the
calls from the other handlers simpler, so I've attached a corrected patch.
(In fact, my previous implementation forgot to unhexify something!
)

>From 080642a2452995f67709becc37e76ee5dd1dc8d3 Mon Sep 17 00:00:00 2001
From: Sacha Chua <sa...@sachachua.com>
Date: Wed, 2 Dec 2015 10:53:07 -0500
Subject: [PATCH] org-protocol: Allow key=val=val2-style URLs

* lisp/org-protocol.el: Update documentation.
  (org-protocol-store-link, org-protocol-capture,
  org-protocol-open-source): Accept new-style links.
  (org-protocol-check-filename-for-protocol): Updated documentation.
  (org-protocol-parse-parameters, org-protocol-assign-parameters):
  New functions.

  This allows the use of org-protocol on KDE 5 and makes org-protocol
  links more URI-like. New-style links are of the form:
  org-protocol://store-link?title=TITLE=URL

* testing/lisp/test-org-protocol.el: New file.
---
 lisp/org-protocol.el  | 191 ++
 testing/lisp/test-org-protocol.el | 181 
 2 files changed, 315 insertions(+), 57 deletions(-)
 create mode 100644 testing/lisp/test-org-protocol.el

diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 339f2b7..ce7cb36 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -49,7 +49,7 @@
 ;;   4.) Try this from the command line (adjust the URL as needed):
 ;;
 ;;   $ emacsclient \
-;; org-protocol://store-link://http:%2F%2Flocalhost%2Findex.html/The%20title
+;; org-protocol://store-link?url=http:%2F%2Flocalhost%2Findex.html=The%20title
 ;;
 ;;   5.) Optionally add custom sub-protocols and handlers:
 ;;
@@ -60,7 +60,7 @@
 ;;
 ;;   A "sub-protocol" will be found in URLs like this:
 ;;
-;;   org-protocol://sub-protocol://data
+;;   org-protocol://sub-protocol?key=val=val2
 ;;
 ;; If it works, you can now setup other applications for using this feature.
 ;;
@@ -94,20 +94,20 @@
 ;; You may use the same bookmark URL for all those standard handlers and just
 ;; adjust the sub-protocol used:
 ;;
-;; location.href='org-protocol://sub-protocol://'+
-;;   encodeURIComponent(location.href)+'/'+
-;;   encodeURIComponent(document.title)+'/'+
+;; location.href='org-protocol://sub-protocol?url='+
+;;   encodeURIComponent(location.href)+'='+
+;;   encodeURIComponent(document.title)+'='+
 ;;   encodeURIComponent(window.getSelection())
 ;;
 ;; The handler for the sub-protocol \"capture\" detects an optional template
 ;; char that, if present, triggers the use of a special template.
 ;; Example:
 ;;
-;; location.href='org-protocol://sub-protocol://x/'+ ...
+;; location.href='org-protocol://capture?template=x'+ ...
 ;;
-;;  use template ?x.
+;;  uses template ?x.
 ;;
-;; Note, that using double slashes is optional from org-protocol.el's point of
+;; Note that using double slashes is optional from org-protocol.el's point of
 ;; view because emacsclient squashes the slashes to one.
 ;;
 ;;
@@ -233,19 +233,27 @@ protocol - protocol to detect in a filename without trailing colon and slashes.
`org-protocol-the-protocol'.  Double and triple slashes are compressed
to one by emacsclient.
 
-function - function that handles requests with protocol and takes exactly one
-   argument: the filename with all protocols stripped.  If the function
-   returns nil, emacsclient and -server do nothing.  Any non-nil return
-   value is considered a valid filename and thus passed to the server.
+function - function that handles requests with protocol and takes
+   one argument. If a new-style link (key=val=val2)
+   is given, the argument will be a property list with
+   the values from the link. If an old-style link is
+   given (val1/val2), the argument will be the filename
+   with all protocols stripped.
 
-   `org-protocol.el provides some support for handling those filenames,
-   if you stay with the conventions used for the standard handlers in
-   `org-protocol-protocol-alist-default'.  See `org-protocol-split-data'.
+   If the function returns nil, emacsclient and -server
+   do nothing.  Any non-nil return value is considered a
+   valid filename and thus passed to the server.
+
+   `org-protocol.el' provides some support for handling
+   old-style filenames, if you stay with the conv

Re: [O] [PATCH] org-protocol: Allow key=val=value2-style URLs

2015-12-07 Thread Sacha Chua
Aaron Ecay <aarone...@gmail.com> writes:

Hello, Aaron, all!

> API change to remove the ‘new-style’ arguments from these functions.
> I don’t have any clever ideas to solve this, and it’s not an objection

How about this approach? If it's new-style, we pass the new-style
property list as the only parameter to the org-protocol function. Since
the standard org-protocol handlers have been updated to deal with
property lists, they should cover maybe 95% of use cases. I've changed
the condition-case to a more general error handler, so anyone with
custom functions (who presumably uses old-style links too) will get the
old-style behaviour and a warning.

> (org-protocol-parse-parameters, org-protocol-assign-parameters): New
> functions.

Done.

> I also think the convention in Changelogs is not to put in details, but
> just to say “New function” or “Accept new-style links”.  A narrative
> explanation can be put in the git commit message below the changelog

I have no idea either. I've simplified the changelog message, though.

>> +(defun org-protocol-parse-parameters (info new-style  
>> default-order unhexify separator)
> Is there ever a case where we would want unhexify to be something other
> than t?  Hexification is imposed by the URL format, there is no optionality

Beats me, but the previous implementation made it a separate parameter
for org-protocol-split-data, so I figured I'd carry it upwards into this
new wrapper function. The previous implementation of
org-protocol-open-source unhexified after parsing the parameters instead
of passing the unhexify parameter to org-protocol-split-data directly.
I'm not sure if anyone's relying on the nuances of that, so I left it
roughly the same.

> about it.  Handler functions get access to the raw string if they need it
> for some reason, I don’t think our helper functions need to bother

Now that I've changed handler functions to use only one parameter, they
don't get the raw strings unless they're greedy handler functions or
they use old-style links... Hmm.

> unhexify != t case. Similarly, I would not have a separator argument,
> but use the value of ‘org-protocol-data-separator’ directly. In the
> rare case that a caller needs to influence the separator, they can
> let-bind that variable. TLDR: can we get rid of unhexify and separator
> arguments?

Same notes as for hexify. Probably okay either way, but I don't know
enough about who else uses this code to say. =) I can change it if you'd
like to make that decision.

>From dbe56d80028da9d335d91673c7871b6ebac0e6e7 Mon Sep 17 00:00:00 2001
From: Sacha Chua <sa...@sachachua.com>
Date: Wed, 2 Dec 2015 10:53:07 -0500
Subject: [PATCH] org-protocol: Allow key=val=val2-style URLs

* lisp/org-protocol.el: Update documentation.
  (org-protocol-store-link, org-protocol-capture,
  org-protocol-open-source): Accept new-style links.
  (org-protocol-check-filename-for-protocol): Updated documentation.
  (org-protocol-parse-parameters, org-protocol-assign-parameters):
  New functions.

  This allows the use of org-protocol on KDE 5 and makes org-protocol
  links more URI-like. New-style links are of the form:
  org-protocol://store-link?title=TITLE=URL

* testing/lisp/test-org-protocol.el: New file.
---
 lisp/org-protocol.el  | 204 +++---
 testing/lisp/test-org-protocol.el | 181 +
 2 files changed, 328 insertions(+), 57 deletions(-)
 create mode 100644 testing/lisp/test-org-protocol.el

diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 339f2b7..b350d40 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -49,7 +49,7 @@
 ;;   4.) Try this from the command line (adjust the URL as needed):
 ;;
 ;;   $ emacsclient \
-;; org-protocol://store-link://http:%2F%2Flocalhost%2Findex.html/The%20title
+;; org-protocol://store-link?url=http:%2F%2Flocalhost%2Findex.html=The%20title
 ;;
 ;;   5.) Optionally add custom sub-protocols and handlers:
 ;;
@@ -60,7 +60,7 @@
 ;;
 ;;   A "sub-protocol" will be found in URLs like this:
 ;;
-;;   org-protocol://sub-protocol://data
+;;   org-protocol://sub-protocol?key=val=val2
 ;;
 ;; If it works, you can now setup other applications for using this feature.
 ;;
@@ -94,20 +94,20 @@
 ;; You may use the same bookmark URL for all those standard handlers and just
 ;; adjust the sub-protocol used:
 ;;
-;; location.href='org-protocol://sub-protocol://'+
-;;   encodeURIComponent(location.href)+'/'+
-;;   encodeURIComponent(document.title)+'/'+
+;; location.href='org-protocol://sub-protocol?url='+
+;;   encodeURIComponent(location.href)+'='+
+;;   encodeURIComponent(document.title)+'='+
 ;;   encodeURIComponent(window.getSelection())
 ;;
 ;; The handler for the sub-protocol \"capture\" detects an optional template
 ;; char that, 

[O] [PATCH] org-protocol: Allow key=val=value2-style URLs

2015-12-04 Thread Sacha Chua
Aaron Ecay <aarone...@gmail.com> writes:

Hello, Aaron, Rasmus, all!

> better solution IMO would be to make org-protocol links valid urls in
> another way, using the query string format:
> org-protocol://store-link?url=[...]=[...]

Aaron: Great point! I've changed my code to support this style of
org-protocol link, and I think the tests I've added to
test-org-protocol.el double-check that old links are still supported.
I've added an extra argument to the functions defined in
org-protocol-protocol-alist and org-protocol-protocol-alist-default, but
I have a condition-case around the funcall so that old functions should
continue to work. I've updated the documentation to encourage new-style
links. What do you think of this patch? I've changed the subject to
reflect the new focus.

Rasmus: that means fiddling with ports is no longer needed, yay. I've
also added the test dependency and lexical binding cookie to
test-org-protocol, as you suggested. Since the missing-test-dependency
signal means that the test isn't run as part of make test, is there
anything I should do to get it to be included in automated tests, or is
it fine leaving it as is?

Sacha

>From aff151930a73c22bb3fdf3ae9b442cecc08aaa67 Mon Sep 17 00:00:00 2001
From: Sacha Chua <sa...@sachachua.com>
Date: Wed, 2 Dec 2015 10:53:07 -0500
Subject: [PATCH] org-protocol: Allow key=val=val2-style URLs

* lisp/org-protocol.el: Update documentation.
  (org-protocol-parse-parameters): New function to simplify handling of
  old- or new-style links.
  (org-protocol-assign-parameters): New function to simplify handling of
  old- or new-style links.
  (org-protocol-store-link): Accept new-style links like
  org-protocol://store-link?title=TITLE=URL
  (org-protocol-capture): Accept new-style links like
  org-protocol://capture?title=TITLE=URL=x=BODY
  (org-protocol-do-capture): Update to accept new-style links.
  (org-protocol-open-source): Accept new-style links like
  org-protocol://open-source?url=URL
  (org-protocol-check-filename-for-protocol): Updated documentation.

  This allows the use of org-protocol on KDE 5 and makes org-protocol
  links more URI-like.

* testing/lisp/test-org-protocol.el: New file.
---
 lisp/org-protocol.el  | 194 +++---
 testing/lisp/test-org-protocol.el | 170 +
 2 files changed, 307 insertions(+), 57 deletions(-)
 create mode 100644 testing/lisp/test-org-protocol.el

diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 339f2b7..7f301e4 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -49,7 +49,7 @@
 ;;   4.) Try this from the command line (adjust the URL as needed):
 ;;
 ;;   $ emacsclient \
-;; org-protocol://store-link://http:%2F%2Flocalhost%2Findex.html/The%20title
+;; org-protocol://store-link?url=http:%2F%2Flocalhost%2Findex.html=The%20title
 ;;
 ;;   5.) Optionally add custom sub-protocols and handlers:
 ;;
@@ -60,7 +60,7 @@
 ;;
 ;;   A "sub-protocol" will be found in URLs like this:
 ;;
-;;   org-protocol://sub-protocol://data
+;;   org-protocol://sub-protocol?key=val=val2
 ;;
 ;; If it works, you can now setup other applications for using this feature.
 ;;
@@ -94,20 +94,20 @@
 ;; You may use the same bookmark URL for all those standard handlers and just
 ;; adjust the sub-protocol used:
 ;;
-;; location.href='org-protocol://sub-protocol://'+
-;;   encodeURIComponent(location.href)+'/'+
-;;   encodeURIComponent(document.title)+'/'+
+;; location.href='org-protocol://sub-protocol?url='+
+;;   encodeURIComponent(location.href)+'='+
+;;   encodeURIComponent(document.title)+'='+
 ;;   encodeURIComponent(window.getSelection())
 ;;
 ;; The handler for the sub-protocol \"capture\" detects an optional template
 ;; char that, if present, triggers the use of a special template.
 ;; Example:
 ;;
-;; location.href='org-protocol://sub-protocol://x/'+ ...
+;; location.href='org-protocol://capture?template=x'+ ...
 ;;
-;;  use template ?x.
+;;  uses template ?x.
 ;;
-;; Note, that using double slashes is optional from org-protocol.el's point of
+;; Note that using double slashes is optional from org-protocol.el's point of
 ;; view because emacsclient squashes the slashes to one.
 ;;
 ;;
@@ -233,19 +233,21 @@ protocol - protocol to detect in a filename without trailing colon and slashes.
`org-protocol-the-protocol'.  Double and triple slashes are compressed
to one by emacsclient.
 
-function - function that handles requests with protocol and takes exactly one
-   argument: the filename with all protocols stripped.  If the function
+function - function that handles requests with protocol and takes two
+   arguments: the filename with all protocols stripped, and a new-style
+   argument that indicates whether new-style arguments (key=val=val2)
+  

[O] [PATCH] org-protocol: Allow optional port specification

2015-12-02 Thread Sacha Chua
I was trying to get org-protocol to work on KDE Plasma 5.4.2. I set up
my ~/.kde/share/kde4/services/org.protocol, but the standard
org-protocol sample syntax:

   org-protocol://store-link://URL/TITLE

resulted in the error:

   Malformed URL
   Port field was empty; source was "..."; scheme = "org-protocol",
   host = "store-link", path = "// ..."

Modifying my Javascript to create links of the form:

   org-protocol://store-link:0//URL/TITLE

made org-protocol correctly pass the link to emacsclient KDE 5.4.2. This
patch allows the optional specification of a port in the URI. What do
you think?

>From 0533b2e76a9cb965ea8f4ea5b3804d17c2bd3b5d Mon Sep 17 00:00:00 2001
From: Sacha Chua <sa...@sachachua.com>
Date: Wed, 2 Dec 2015 10:53:07 -0500
Subject: [PATCH] org-protocol: Allow optional port specification

* lisp/org-protocol.el (org-protocol-check-filename-for-protocol):
  Recognize and ignore ports specified as part of the protocol or
  sub-protocol. This seems to be necessary to avoid "Port field was
  empty" errors in newer versions of KDE.
* testing/lisp/test-org-protocol.el: New file with a test for
  `org-protocol-check-filename-for-protocol'.
---
 lisp/org-protocol.el  |  2 +-
 testing/lisp/test-org-protocol.el | 39 +++
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 testing/lisp/test-org-protocol.el

diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 339f2b7..150f458 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -532,7 +532,7 @@ as filename."
 (when (string-match the-protocol fname)
   (dolist (prolist sub-protocols)
 (let ((proto (concat the-protocol
- (regexp-quote (plist-get (cdr prolist) :protocol)) ":/+")))
+ (regexp-quote (plist-get (cdr prolist) :protocol)) ":[^/]*/+")))
   (when (string-match proto fname)
 (let* ((func (plist-get (cdr prolist) :function))
(greedy (plist-get (cdr prolist) :greedy))
diff --git a/testing/lisp/test-org-protocol.el b/testing/lisp/test-org-protocol.el
new file mode 100644
index 000..94be520
--- /dev/null
+++ b/testing/lisp/test-org-protocol.el
@@ -0,0 +1,39 @@
+;;; test-org-protocol.el --- tests for org-protocol.el
+
+;; Copyright (c)  Sacha Chua
+;; Authors: Sacha Chua
+
+;; This file is not part of GNU Emacs.
+
+;; This program 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.
+
+;; This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(ert-deftest test-org-protocol/org-protocol-check-filename-for-protocol ()
+  "Test `org-protocol-check-filename-for-protocol' specifications."
+  ;; Store link
+  (let ((uri "/some/directory/org-protocol:/store-link:/URL/TITLE"))
+(should (null (org-protocol-check-filename-for-protocol uri (list uri) nil
+  (should (equal (car org-stored-links) '("URL" "TITLE")))
+  ;; Handle multiple slashes
+  (let ((uri "/some/directory/org-protocol://store-link://URL2//TITLE2"))
+(should (null (org-protocol-check-filename-for-protocol uri (list uri) nil
+  (should (equal (car org-stored-links) '("URL2" "TITLE2")))
+  ;; Ignore port - useful for KDE
+  (let ((uri "/some/directory/org-protocol:/store-link:0//URL3//TITLE3"))
+(should (null (org-protocol-check-filename-for-protocol uri (list uri) nil
+  (should (equal (car org-stored-links) '("URL3" "TITLE3"
+
+
+;;; test-org-protocol.el ends here
-- 
2.6.3


(Copyright papers are on file.)

Sacha


Re: [O] TOC local for specified heading and its subheadings (in HTML export)?

2015-11-29 Thread Sacha Chua
Rasmus  writes:

Hello, Rasmus, all!

> "id:headline" is a special type of links (see org-id.el).  A reference to
> a custom-ids is typically prefixed by "#" in Org, e.g. ’[[#heading]]’ or

Excellent point. I picked id: as a quick and dirty regexp match, but
:headline makes more sense. :headline "#headline" will later permit the
use of :headline "file.org::#headline" if someone is inclined. =)

>> + (and (string= (org-element-property 
>> :CUSTOM_ID element) local-id)
>> +  element)
> Wouldn’t it better to use org-link-search and get the element at
> point?

That would definitely be better. I wasn't sure if I could reuse that
function at that point, but I'll look into it if I find myself
revisiting this hack.

> We’d need support across all backends where it makes sense, so I guess at
> least, latex, beamer, odt, html, ascii, texinfo (if possible).

I might not get to all of those (I'll tell the list if I do), so
consider this open season for anyone who wants to implement it! =) I'll
see if I have some time to explore all those backends over the next
while. I've just shifted back to dual-booting Linux (was formerly just
on Windows), so it'll be a little easier for me to try things out.

Sacha



Re: [O] TOC local for specified heading and its subheadings (in HTML export)?

2015-11-28 Thread Sacha Chua
Sacha Chua <sa...@sachachua.com> writes:

Hello, all!

> This is totally a partial implementation since I've only bothered to
> make it work for HTML export, but someone can make it work nicely for
> everything else. =)
> I think it will permit the use of lines like:
> #+TOC: headlines 1 id:ConfInfoClauses
...
> D. C., are you okay with applying patches to your local copy, or do
> you need someone to clean it up and merge it into core?

I confirmed with D. C. that the modification works for him, yay! =) He
sends his compliments and thanks. And I learned how to work with
org-element-*, so that's a bonus. Neat!

Is this a long-term capability we'd like to add? I can look into getting
it to work with the other Org export options, if we're cool with the
syntax. =)

Sacha




Re: [O] TOC local for specified heading and its subheadings (in HTML export)?

2015-11-27 Thread Sacha Chua
"D. C. Toedt"  writes:

Hello, D. C., all!

> # = The next line is the desired feature: Generate a TOC list
> (with links) of all subheadings in the specified heading
> =
> #+TOC: headlines 1 local ConfInfoClauses

This is totally a partial implementation since I've only bothered to
make it work for HTML export, but someone can make it work nicely for
everything else. =)

I think it will permit the use of lines like:

#+TOC: headlines 1 id:ConfInfoClauses

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index effd387..3b0e239 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2651,8 +2651,18 @@ CONTENTS is nil.  INFO is a plist holding contextual 
information."
 ((string-match "\\" value)
  (let ((depth (and (string-match "\\<[0-9]+\\>" value)
(string-to-number (match-string 0 value
-   (localp (org-string-match-p "\\" value)))
-   (org-html-toc depth info (and localp keyword
+   (localp (org-string-match-p "\\" value))
+   (local-id (and (string-match "\\" value)
+  (match-string 1 value
+   (org-html-toc depth info
+ (or
+  (and local-id
+   (car (org-element-map (plist-get info 
:parse-tree)
+'headline
+  (lambda (element)
+(and (string= (org-element-property 
:CUSTOM_ID element) local-id)
+ element)
+  (and localp keyword)
 ((string= "listings" value) (org-html-list-of-listings info))
 ((string= "tables" value) (org-html-list-of-tables info
 
D. C., are you okay with applying patches to your local copy, or do
you need someone to clean it up and merge it into core?

I have copyright assignment papers on file. Feel free to do what you
want with the code!

Sacha




Re: [O] fetching the description from a link string

2015-11-27 Thread Sacha Chua
Alan Schmitt  writes:

> Thank you for the suggestion. I'm already doing something similar:
> #+begin_src emacs-lisp
> (let ((link (org-store-link nil))
>   (name (org-element-property :raw-value (org-element-at-point
> ...)
> #+end_src

You can also use org-bracket-link-regexp, if you want:

(let ((link "[[http://example.com][Description]];))
  (and (string-match org-bracket-link-regexp link)
   (match-string 3 link)))

Sacha
   
  




Re: [O] [PATCH] Recognize property blocks even after text

2015-02-17 Thread Sacha Chua
Rasmus ras...@gmx.us writes:

 Hi! I noticed that the refactored org-get-property-block no longer
 allows for any text (aside from the SCHEDULED / DEADLINE / CLOSED) text
 between the heading and the property drawer, which gave me problems when
 Did you see this discussion?  I think it's a feature.
 http://permalink.gmane.org/gmane.emacs.orgmode/91752

Ah, that makes perfect sense. I'll try to train myself out of adding
stuff everywhere, then. Thank you!

Sacha



[O] [PATCH] Recognize property blocks even after text

2015-02-11 Thread Sacha Chua
Hi! I noticed that the refactored org-get-property-block no longer
allows for any text (aside from the SCHEDULED / DEADLINE / CLOSED) text
between the heading and the property drawer, which gave me problems when
I accidentally added text or timestamps or things like that. Also, it
means org-gcal's default format (which puts the timestamp before the
property drawer) doesn't work, so maybe a bunch of other things rely on
the old behavior. If that part of the change was unintentional, would
you consider the patch below? It seems to be okay with my Org files, but
maybe that flexibility was removed for performance reasons. Hope this is
useful!


Subject: [PATCH] Recognize property blocks even after text

* lisp/org.el (org-get-property-block): Search for the property drawer
anywhere before the next heading or the end of the buffer.

* testing/lisp/test-org.el (test-org/property-blocks-are-flexible):
Check if property blocks can be defined after text.
---
 lisp/org.el  | 25 +++--
 testing/lisp/test-org.el | 17 +
 2 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 64b546f..dac7390 100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15422,16 +15422,21 @@ return nil.
  (t (org-with-limited-levels (org-back-to-heading t))
(forward-line)
(when (org-looking-at-p org-planning-line-re) (forward-line))
-   (cond ((looking-at org-property-drawer-re)
- (forward-line)
- (cons (point) (progn (goto-char (match-end 0))
-  (line-beginning-position
-(force
- (goto-char beg)
- (org-insert-property-drawer)
- (let ((pos (save-excursion (search-forward :END:)
-(line-beginning-position
-   (cons pos pos
+   (cond ((re-search-forward
+   org-property-drawer-re
+   (save-excursion (save-match-data (outline-next-heading))
+   (point)) t)
+  (progn
+(goto-char (match-beginning 0))
+(forward-line)
+(cons (point) (progn (goto-char (match-end 0))
+ (line-beginning-position)
+ (force
+  (goto-char beg)
+  (org-insert-property-drawer)
+  (let ((pos (save-excursion (search-forward :END:)
+ (line-beginning-position
+(cons pos pos
 
 (defun org-at-property-p ()
   Non-nil when point is inside a property drawer.
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index ce1d519..800cffc 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -2618,6 +2618,23 @@ Text.
  * H\n:PROPERTIES:\n:COLUMNS: %25ITEM %A %20B\n:END:
(org-buffer-property-keys nil nil t)
 
+(ert-deftest test-org/property-blocks-are-flexible ()
+  Test if properties can be specified with some information before them.
+  ;; Retrieve properties accross siblings.
+  (should
+   (equal '(A B)
+ (org-test-with-temp-text 
+* H1
+Some text goes here.
+:PROPERTIES:
+:A: 1
+:END:
+* H2
+:PROPERTIES:
+:B: 1
+:END:
+   (org-buffer-property-keys)
+
 (ert-deftest test-org/property-values ()
   Test `org-property-values' specifications.
   ;; Regular test.
-- 
2.1.4





Re: [O] Lack of availability

2014-09-20 Thread Sacha Chua
I'm sorry to hear you've been going through hard times, and have sent a
donation through the Support Org button on the orgmode website as a token
of appreciation for all the good work you've done. Please feel free to use
my contribution for personal expenses, not just Org-related stuff. You've
spent so much time and effort taking care of this community, it's time for
us to help you!

If there's anything else that could make your life better, please feel free
to reach out.

Sacha Chua - sachachua.com - Mobile: +1-416-823-2669
On Sep 17, 2014 2:03 AM, Bastien b...@gnu.org wrote:

 Dear all,

 I'm sorry for my current lack of availability.  I wanted
 to hack back since late august but I was not able to.

 I'm going through hard times since the summer and I need
 to focus on securing a basic environment for my daily life.

 I hope I can sort this out soon enough.

 I'm thankful to everyone who actively contribute with bug
 fixes, questions and answers.  It's great to see this.

 All best,

 --
  Bastien





Re: [O] Display only latest sub notes in agenda

2014-06-15 Thread Sacha Chua
Steffen Heilmann heilmann.stef...@gmail.com writes:

Hello, Steffen, all!

 I am looking for an easy way to see when I had the last interaction
 with everybody (preferably sorted by date). I want to use this to
 quickly see whom I have not contacted for some time and then can
 reach-out to them.

Something like this, maybe?

(defun sacha/org-update-with-last-meeting ()
  (interactive)
  (goto-char (point-max))
  (let (last-meeting)
(while (re-search-backward
(concat \\( org-outline-regexp \\)\\|\\(
org-maybe-keyword-time-regexp \\)) nil t)
  (cond
   ((and (match-string 1)
 (= (nth 1 (save-match-data (org-heading-components))) 1)
 last-meeting)
;; heading
(save-excursion (org-set-property LASTMEETING last-meeting))
(setq last-meeting nil))
   ((and (match-string 2))
(if (or (null last-meeting) (string last-meeting (match-string 2)))
(setq last-meeting (match-string 2

It turns:

* John Smith
** DONE Conversation
[2014-01-20]
** DONE E-mail
[2014-01-15]
* Jane Smith
** DONE Conversation
[2014-01-07]

into:

* John Smith
  :PROPERTIES:
  :LASTMEETING: [2014-01-20]
  :END:
** DONE E-mail
[2014-01-15]
** DONE Conversation
[2014-01-20]
* Someone without a meeting
* Jane Smith
  :PROPERTIES:
  :LASTMEETING: [2014-01-07]
  :END:
** DONE Conversation
[2014-01-07]

You can then use something like:

#+COLUMNS: %25ITEM %LASTMEETING %TAGS %PRIORITY %TODO

#+BEGIN: columnview :maxlevel 1
| ITEM| LASTMEETING  | TAGS | PRIORITY | TODO |
|-+--+--+--+--|
| * John Smith| [2014-01-20] |  |  |  |
| * Someone without a meeting |  |  |  |  |
| * Jane Smith| 2014-01-07 |  |  |  |
#+END:

or even sort the entries by the LASTMEETING property (R will
reverse-sort by property).

Sacha




Re: [O] Single Search Hit and Quick Jump

2014-06-15 Thread Sacha Chua
Esben Stien b...@esben-stien.name writes:

Hello, Esben!

(Digging up old thread, sorry!)

 Now, If I f.ex do C-c a s corge, I get multiple hits, but I really only
 search for level 3 items always. Is there any way to restrict the search
 to only level 3 items?

Would you consider defining org-refile-targets and then using C-u M-x
org-refile (which you can bind to a handy keyboard shortcut, of
course)? org-refile-targets lets you specify the level or maxlevel to
consider, and C-u for org-refile jumps instead of refiling.

 Also, when I find a result, I want to jump to the last item in that
 tree, so if I search for corge, I want to end up with point on the
 level 4 item  garply

Something like (org-end-of-subtree) and (org-back-to-heading), maybe
in a custom function or in a hook?

Sacha




Re: [O] [babel] Setting python interpreter version on per-block or per-subtree basis

2014-04-24 Thread Sacha Chua
William Henney when...@gmail.com writes:

Hello, Will!

 Is there an easy way to specify the python version to use for a particular
 block or sub-tree?

Is it something you can define an inherited property or a tag for, and
then add some advice around org-babel-execute:python to check that
property and use let to bind org-babel-python-comand?

Maybe something like this, for example:

#+begin_src emacs-lisp
(defadvice org-babel-execute:python (around will activate)
  (if (member python2 (org-get-tags-at))
(let ((org-babel-python-command /path/to/python2))
  ad-do-it)
ad-do-it))
#+end_src

* Test :python2:
#+begin_src python
return 1 + 3
#+end_src

Sacha




Re: [O] Cool trick on how to eval bash/zsh babel blocks in emacs

2014-04-21 Thread Sacha Chua
Xebar Saram zelt...@gmail.com writes:

Hello, all!

 Thanks to the always amazing sacha chua here is a neat way to evaluate/run
 bash/zsh command line commands inside the emacs term. i find this very
 useful for collecting multiple bash snippets and quickly running them
 here is the code
 #+begin_src emacs-lisp
 (defadvice org-babel-execute:sh (around sacha activate)
   (if (assoc-default :term (ad-get-arg 1) nil)
 (let ((buffer (make-term babel /bin/zsh)))
   (with-current-buffer buffer
 (insert (org-babel-expand-body:generic
  body params (org-babel-variable-assignments:sh params)))
 (term-send-input))
 (pop-to-buffer buffer))
 ad-do-it))
 #+end_src

To use this:

#+begin_src sh :term t
ls -l
echo Hello world
#+end_src

Probably good to replace the /bin/zsh call with
(or explicit-shell-file-name (getenv ESHELL) (getenv SHELL)
/bin/sh))

So the original context of this was that zeltak wanted a way to run sh
babel blocks in a separate term so that he could interact with the
results of the process instead of having the output go into a results
block. I'm not sure if there's already a proper way to do this (didn't
seem like it from org-babel-execute:sh), so I added a custom :term
parameter and advised the execution of org-babel-execute.sh. Seems to
work.

Of course, proper implementation would get rid of the advice, and also
maybe use :results term or something like that. Anyway, before we dig
into implementation details and documentation updates: Is interacting
with babel output something that might be interesting to include? If so,
how should it behave?

Sacha




Re: [O] Counting number of children under heading

2014-04-20 Thread Sacha Chua
Sebastien Vauban sva-n...@mygooglest.com
writes:

Hello, Seb, all!

 Yes, I almost remembered what you wrote in
 http://sachachua.com/blog/2008/01/outlining-your-notes-with-org/,
 section Getting a Sense of Progress. Still, it is about counting
 headlines, but with a special cookie you add.

Wow, I totally forgot about that. =) Good thing you remembered!

Anyway, Marvin, you (or someone) will probably be able to update that
code and get it to work for you, if you don't mind having checkboxes
instead of TODO. If you want it to work for plain headings, we could
probably figure out a custom function that updates numbers in
parentheses with the number of child headings. (Assuming you don't have
numbers in parentheses generally, or maybe we should use curly braces
instead? Decisions, decisions...) It's likely to be code that's going to
be in your custom config, since the need seems uncommon. =)

Sacha




Re: [O] Can ELPA package split contrib part?

2014-04-18 Thread Sacha Chua
Bastien b...@gnu.org writes:

Hello, Bastien, all!

 While I use org-plus-contrib package from orgmode ELPA,
 With other package which requires (updated) org, it isn't
 recognized as I expect.
 You should really not have both installed, I'd recommend using
 `org-plus-contrib' only.
 If that's not feasible because of some compatibility constraint
 you have, then use git or the .tar.gz/.zip archives, it's easy
 enough.

I find that the following snippet seems to load Org fine even if I'm
mixing org-plus-contrib (which is needed for some of the other Org
packages like org-drill-table) with Org from git:

;; Set up load path, but don't actually load packages yet
(package-initialize nil)
;; Override the packages with the git version of Org and other packages
(add-to-list 'load-path ~/elisp/org-mode/lisp)
(add-to-list 'load-path ~/elisp/org-mode/contrib/lisp)
;; Load the rest of the packages
(package-initialize t)

Sacha




Re: [O] Counting number of children under heading

2014-04-18 Thread Sacha Chua
Sebastien Vauban sva-n...@mygooglest.com
writes:

 I would like to automatically count the number of children under a
 given heading. For example, I would like to have
 * Cars (2)
 ** BMW
 ** Escort
 There is no such feature in Org, but I seem to remember someone
 hack something similar -- maybe someone else with a better memory
 can tell.
 IIRC, Sacha Chua had made such a hack -- must be found on her impressive
 blog.

I don't remember doing something like that - I tend to use [X] for
automatically counted cookies...

Do you need the number of children to be part of the text, or is it okay
for that to be temporarily displayed? 

Sacha




Re: [O] (OT) How to follow a mailing list with very high activity (like this one here)?

2014-04-17 Thread Sacha Chua
Igor Sosa Mayor joseleopoldo1...@gmail.com writes:

 I also have some more rules that score things up if they mention my name
 or other things I'm interested in. =)
 Hope that helps!
 yes, it helps a lot. At least me... 
 But I'm still unsure how to use it exactly... Is your config visible
 anywhere? 

There's not much more to my Gnus config aside from the snippet I
included earlier. Maybe a score file with this in it?
((Body (sacha 10 nil s)))
which theoretically adds a score based on that keyword, but I haven't
tested it and it slows loading groups down a bit.

Maybe you can check out the adaptive scoring section in the Gnus manual
and go from there? I'm dusting off my Gnus config too, since it's been
years since I last relied on it.

Sacha




Re: [O] Sorting nodes by clocked time

2014-04-17 Thread Sacha Chua
Noah Slater nsla...@tumbolia.org writes:

Hello, Noah, all!

 Using this a bit, it doesn't quite do what I want it to do.
 Is there any way to sort recursively?
 At the moment, calling org-sort-entries on the whole buffer only sorts the
 top level nodes.

Here's a rather inefficient hack (but hey, it seems to work =) ):

(defun sacha/org-sort-recursively (type)
(org-map-entries
 (lambda ()
 (condition-case nil
 (org-sort-entries nil type)
 (error nil)

Call with M-: (sacha/org-sort-recursively ?K) or merge the code into
your own.

Sacha




Re: [O] Possible to always show items in clocktable?

2014-04-16 Thread Sacha Chua
Noah Slater nsla...@tumbolia.org writes:

Hello, Noah!

 I would like to my clocktable include a line for every node, regardless of
 whether there is any time clocked, or whether the time clocked is 0:00.
 My intention here is to highlight notes that have received no attention. I
 want them to show up on my report so that I can see that I need to work on
 them.

On a slightly different note, how about using Org column tables instead?
You can set your column table format to include the time clocked.
I use this in one of my files:
#+COLUMNS: %40ITEM %17Effort(Estimated effort){:} %CLOCKSUM

And then I use

#+BEGIN: columnview :hlines 1
#+END:

to get a table that has my estimated effort and clocked time for each
item, whether or not it has any clocked time in it.

Sacha




Re: [O] (OT) How to follow a mailing list with very high activity (like this one here)?

2014-04-16 Thread Sacha Chua
Alexander Baier lexi.ba...@gmail.com writes:

Hello, Alexander, Martin!

 you might want to have a look at gnus - an news/email client for
 emacs. It has something called scoring (I believe this is a concept from
 usenet/nntp). It allowes to do exactly what you want to do and even
 more. You can tell gnus to hide a particular thread, so you do not have

I vote for Gnus and scoring, too. Here's how I've set mine up:

In ~/.gnus:

(setq gnus-select-method '(nntp news.gmane.org))
(setq gnus-treat-hide-citation t)
(setq gnus-use-adaptive-scoring t)
(setq gnus-default-adaptive-score-alist
 '((gnus-unread-mark)
 (gnus-ticked-mark (subject 10))
 (gnus-killed-mark (subject -5))
 (gnus-catchup-mark (subject -1
; change this to real address, of course
(setq user-mail-address exam...@example.com) 

After you set up your ~/.gnus, use M-x gnus to start. Go into the
news.gmane.org server (use ^ to see the list of servers if you don't see
the gmane server listed) and find gmane.emacs.orgmode. I think you can use
u to toggle subscription/unsubscription.

Adaptive scoring means that if you kill a thread you're not particularly
interested in, it lowers the score on that one, so any replies are shown
with a negative score. You can also configure it to hide messages with
scores below a certain threshold, so you don't even see replies.

I also have some more rules that score things up if they mention my name
or other things I'm interested in. =)

Hope that helps!

Sacha




Re: [O] total time spent on a task

2014-04-14 Thread Sacha Chua
Christoph Groth christ...@grothesque.org writes:

Hello, Christoph!

 I’m looking for a quick way to check the total time spent on a task.  I
 bet I’m missing something obvious.  (I have set
 org-clock-mode-line-total to today, so I do not see the total time of a
 clocked-in task in the mode line.)

C-c C-x C-d (org-clock-display) will show the task times as overlays on
the headings. If you want something exportable, you can use C-c C-x C-r
(org-clock-report) - see the info page for The clock table for lots of
options. If you want the number of minutes in Emacs Lisp, use
(org-clock-sum-current-item) for the current item or (org-clock-sum) to
add totals to all, then go to the heading and get the :org-clock-minutes
property.

Hope that helps!

Sacha




Re: [O] total time spent on a task

2014-04-14 Thread Sacha Chua
Christoph Groth christ...@grothesque.org writes:

Hello, Christoph!

 C-c C-x C-d (org-clock-display) will show the task times as overlays
 on the headings.
 That seems to be exactly what I need.  It works, but only shows times
 for top-level headings (i.e. for example miscellaneous but not the
 TODO items underneath).  Is this the way this is supposed to work?
 I can see that overlays are added for all the headings that were clocked
 on lower levels as well, but that overlays contain only spaces.

Hmm, mine shows clock overlays for all headings with clock entries,
including TODO headings. I'm on Org 8.2.5h. By any chance, could those
overlays have invisible text? You can customize-face org-clock-overlay.
I remember that had been a problem for some people before.

Sacha




Re: [O] how to debug Archive view in custom agenda

2014-04-13 Thread Sacha Chua
Ken Mankoff mank...@gmail.com writes:

Hello, Ken!

 Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
   put-text-property(28799 nil org-effort :15)
   org-refresh-properties(Effort org-effort)
   byte-code(\306!\203\f.q\210\202.

I think Bastien has just committed a patch fixing this in the maint branch.
Hope that helps! =)

Sacha




Re: [O] Tangling Bernt Hansen's Org-Mode.Org file..?

2014-04-08 Thread Sacha Chua
David Masterson dsmaster...@gmail.com writes:

Hello, David!

 I've installed a full version of Cygwin on a Windows 8.1 system.  I'm,
 therefore, using Emacs 24.3 but I've added the org-mode 8.2.5h package.
...
 org-with-silent-modifications being an invalid function (from
 org-refresh-category-properties).  However, immediately doing the C-c
 C-v C-t again correctly tangles the file and produces the expected
 Org-Mode.el file.
 Did I mis-setup org-mode??

The org-with-silent-modifications error tends to happen when Org 7 files
are loaded and mixed up with Org 8 ones. If you've installed Org 8 from
ELPA without taking any special precautions, chances are that you
installed it when the previous version of Org was already loaded.

You may want to start with emacs -q, then set up your package-archives
(if you've added any sources), and then reinstall Org (so that it
recompiles in a clean environment). Make sure that you do this before
loading any Org files or org-related code.

It might be partially addressed by org-reload, but I'm not sure.

http://lists.gnu.org/archive/html/emacs-orgmode/2013-09/msg01128.html

Hope that helps!

Sacha




Re: [O] Redshank gets loaded when exporting ELisp code blocks to HTML!?

2014-04-07 Thread Sacha Chua
Sebastien Vauban sva-n...@mygooglest.com
writes:

Hello, Sebastien!

 Why are Emacs Lisp minor modes loaded for exporting
 the Org document to HTML?
 If not necessary, this seems suboptimal (performance-wise).

org-export-format-source-code-or-example loads the mode associated with
the language in org-src-lang-modes in order to fontify the block. You
could check if org-export-current-backend is nil before loading anything
that you want to use only interactively.

Maybe like so?

  (add-hook 'emacs-lisp-mode-hook (lambda ()
(unless org-export-current-backend
  (turn-on-redshank-mode

Sacha




Re: [O] Exporting to multiple files

2014-04-06 Thread Sacha Chua
Marcin Borkowski mb...@wmi.amu.edu.pl writes:

Hello, Marcin, all!

  I'd like to export an Org-mode file to /multiple/ HTML files.  For
  instance, I might want to convert all first and second level
...
 Thanks a lot!  Your code seems inspiring - I've only skimmed through it
 now, but e.g. the org-map-entries is something very useful I had no
 idea existed...

This might also be useful: https://github.com/iani/org-publish-meta
It seems to allow you to export subtrees to different projects. Hope
that helps!

Sacha




[O] [PATCH] Re: Bug: `org-agenda-prepare-buffers' fails at (org-refresh-properties APPT_WARNTIME 'org-appt-warntime) [8.2.5h (8.2.5h-82-gd91d4b-elpaplus @ /home/wgg/.emacs.d/elpa/org-plus-contrib-20

2014-04-05 Thread Sacha Chua
w...@member.fsf.org writes:

 On the latest `org-plus-contrib' build from the org package.el repo, my
 Agenda buffers (for any Agenda command) fail to render properly, with
 these pertinent lines from *Backtrace*:
 Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
   put-text-property(28484 nil org-appt-warntime 60)
...
 I then isolated this to the following lines of function
 `org-agenda-prepare-buffers':
   (or (memq 'appt org-agenda-ignore-drawer-properties)
   (org-refresh-properties APPT_WARNTIME 'org-appt-warntime))

I ran into a similar problem with org-agenda-prepare-buffers and the
EFFORT property. This change to org-refresh-properties seems to fix it:

diff --git a/lisp/org.el b/lisp/org.el
index f8615a2..bd9c05e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9393,7 +9393,7 @@ property to set.
   (save-excursion
 (org-back-to-heading t)
 (put-text-property
- (point-at-bol) (outline-next-heading) tprop p
+ (point-at-bol) (or (outline-next-heading) (point-max)) tprop 
p
 
 
  Link Stuff

The previous version by Bastien used (org-end-of-subtree t t), which had
checked for (eobp) in it, but outline-next-heading returns nil if there
are no further headings.

Sacha Chua




[O] [PATCH] Change relative weekday specifications (ex: fri or -tue) to exclude today

2013-04-12 Thread Sacha Chua
I use the weekday specifiers for org-read-date a lot when scheduling tasks.
For example, I frequently use things like +sat - the + isn't needed for
this, but I still do it out of habit (sat works just as well). Sometimes
I want to postpone tasks to the same day next week. I think of fri as
the next upcoming Friday, so I tend to use that to postpone things.

Then I get thoroughly confused, because it ends up on the same day, and
then I grumble and reschedule it to either 2fri or +w. You see, if
today is Friday, fri gets you today, even if org-read-date-prefer-future
is true. It's the correct behaviour according to the documentation, but it
was driving me a little crazy, so I propose the attached change. It makes
fri and -fri exclude today, so if today is Friday, fri means next
Friday (procrastinate away!) and -fri means last Friday.

What do people think?


0001-Change-relative-weekday-specifications-ex-fri-or-tue.patch
Description: Binary data


Re: [O] Local subtree view

2012-06-10 Thread Sacha Chua
Rebel Neurofog rebelneuro...@gmail.com writes:

Hello, Rebel!

 I'm finally beginning to integrate Org mode into my way of thinking.
 But one thing really bothers me: local subtree view.
 The closest thing I'd like to have is (org-tree-to-indirect-buffer),
...
 Second, I'd rather edit selected subtree in local mode and then
 go back to global (normal) mode instead of dealing with 2 windows.

Have you considered M-x org-narrow-to-subtree? You can use M-x widen to
get back to the full view.

Sacha Chua




Re: [O] date added into logbook?

2012-05-31 Thread Sacha Chua
Michael Gilbert m...@gilbert.org writes:

Hello, Michael!

 one of them involves a piece that I've wanted for a while: a way to
 keep the data that is lost when I refile an item from my default
 date-tree file ― the date the item was created/added.

Have you considered using org-capture with the clock options? I like
using this because it automatically grabs the timestamp as well, and
when I press C-c C-c, it clocks out. Handy - I've been using it to
calculate my words per minute (dismally low for blog posts sometimes!).

Here's a snippet from my config:

(setq org-capture-templates '(
 ;; Lots of other lines here 
 (r Notes entry
  (file+datetree ~/personal/organizer.org Inbox)
  * %?\n\n%i\n :clock-in :clock-resume)
  ))

(global-set-key (kbd C-c r) 'org-capture)

Anyway, if you happen to use org-capture a lot, then it's a good way of
capturing creation times too. =)

Hope that helps!

Sacha




Re: [O] Org-mode as a Quantified Self platform

2012-05-07 Thread Sacha Chua
John Hendy jw.he...@gmail.com writes:

 -- On that note, what's the best way to get data out of
 org-habit/headlines and into something a bit more usable like csv? I'm
 looking for something more than just looking through headlines for
 missed days. I'm going to need full access to the time stamps in a
 usable format (say, R) and everything agglomerated into one single
 data file.

A different approach might be to use org-capture with type table-line,
which inserts a new line in the first table at the target location. You
can then use org-capture to automatically capture the timestamp, prompt
you for the type of drink (you can define a completion table) and any
other notes you want to add, and file it automatically. Drink coffee
and Drink tea aren't really TODOs or habits, so this might be better
for you.

Sacha Chua




Re: [O] Org-mode as a Quantified Self platform

2012-05-04 Thread Sacha Chua
John Hendy jw.he...@gmail.com writes:

 3) The habit family of features -- set up some initial goals
 (recurring todo headlines) and then just got to the headline and mark
 done (possibly with a note) to record the event.

org-agenda is a handy way of marking tasks as complete, too. I have an
Org subtree with my daily, weekly, monthly, and yearly routines, and
another section for In case of... lists that cover event-driven
routines.

 -- Has anyone done something like this? I see it as very similar to
 habit tracking. To give an example, I've had a bit of a persistent

I've been using Emacs and Ledger to keep track of my finances since
2005. I've also been tracking miscellaneous things (clothes, time, etc.)
on quantifiedawesome.com . I share my notes at
http://sachachua.com/blog/category/quantified . 

I often go back and use data from notes that I've taken using
org-capture. For example, if you set it to clock in and out
automatically, you can tell how long it takes to write a blog post. It's
easy to write a function that counts the words in a subtree and
calculates your WPM.

Effort / time elapsed information might also be very interesting for
self-tracking. You can use org-set-effort to estimate the time it takes
to complete a task, clock into a task when you start working on it, have
it clock out when you're done, and then check how accurate your
estimates are. Bonus: you get a modeline reminder of time elapsed vs
time estimated, and it turns a different colour when you go overtime.

I'm working on using org-contacts to quantify my social interactions
like the way that I was using BBDB to do so before.

I tracked e-mail interactions (# of days this message waited for a
reply, # of messages I've sent to people) when I used Gnus to do my
mail, but mail setup is a bit more complicated with Gmail and a Windows
system, so I haven't done this for a while.

I have some basic Emacs integration with QuantifiedAwesome - I can post
some records to my system from Emacs using the REST API. I've been
thinking about having it update my time tracking system when I clock in
and out of tasks, as that would be cool.

 -- I see I can insert [inactive] timestamps in mobile-org. Making
 something a TODO seems to require manual input? I find the

One option might be to use a different app like Tap Log Records to
capture timestamped records and generate a CSV, then write some code to
parse the CSV and update your Org file. It's totally a hack, though.

Sacha Chua




[Orgmode] Re: Literal Blocks in Org-mode

2010-11-26 Thread Sacha Chua
On Wed, Nov 24, 2010 at 6:25 AM, Carsten Dominik carsten.domi...@gmail.com
 wrote:


 I hear you had a problem with Org not publishing Literal code blocks
 correctly in a blog post?

http://sachachua.com/blog/2010/11/emacs-recording-ledger-entries-with-org-capture-templates/#comments


Oh! That was entirely user error. =) I used #+BEGIN_SRC and forgot the
emacs-lisp after, so it gave me nil. Thanks for checking!

Sacha Chua
http://sachachua.com
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode