Re: [PATCH] manual: Fix minor typo

2020-07-05 Thread Arun Isaac

>> To make the handling of patches easier please use "format-patch".
>
> It looks like this was sent with git-send-email (which is fed
> format-patch output either explicitly or underneath), and it applied
> cleanly for me.
>
> My understanding is that, even though this project accepts patches as
> attachments [*], inline patches are fine as well (and very much my
> personal preference).  git-send-email is explicitly mentioned at
> .

Indeed, I used `git format-patch` to create the patch and `git
send-email` to send it. I don't mind sending attachments, but I used
`git send-email` since it was allowed by the contribution guidelines.

Thanks for applying the fix. Cheers!


signature.asc
Description: PGP signature


[PATCH] manual: Fix minor typo

2020-07-05 Thread Arun Isaac
* doc/org-manual.org (Clocking Work Time): Replace "to that you can"
with "so that you can".
---
 doc/org-manual.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index b14c28807..b61644626 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -6379,7 +6379,7 @@ clock.  When you stop working on that task, or when you 
mark the task
 done, the clock is stopped and the corresponding time interval is
 recorded.  It also computes the total time spent on each
 subtree[fn:71] of a project.  And it remembers a history or tasks
-recently clocked, to that you can jump quickly between a number of
+recently clocked, so that you can jump quickly between a number of
 tasks absorbing your time.
 
 To save the clock history across Emacs sessions, use:
-- 
2.26.2




Re: [O] Link type for HTML5 videos

2017-01-22 Thread Arun Isaac

I was thinking of something like

#+ATTR_HTML: controls
#+POSTER: quadratic.png
video:quadratic.webm

exporting to the following HTML.



> That looks too rich for a link to me unless alot of it is always the
> same, or derived, e.g. the id tags.

It is quite rich. But, note that even img tags, especially with the
newer 'srcset' and 'sizes' attributes, are quite rich. Yet, we use links
to insert inline images. If videos cannot be properly handled by links,
neither can images.

> Something like this is what a link would look like:
>
> video:quadratic.webm
>
> and the html export could certainly generate what you put in the html
> block below.
>
> See
> http://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/
> for how to make a link, try it and report back if it is useful.

I can use the new link features to develop something that works for my
particular use case. No issues with that. But, I was wondering if a more
general video link type can be developed for inclusion into org mode itself.


signature.asc
Description: PGP signature


[O] Link type for HTML5 videos

2017-01-22 Thread Arun Isaac

It would be nice to have a link type to export HTML5 videos. Currently,
the only way to insert videos is to use the #+BEGIN_video, #+END_video
block with literal #+HTML in them. This seems a little kludgy. Thoughts?

Thanks,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] Bug: org-publish-get-project-from-filename raises (wrong-type-argument sequencep any)

2017-01-01 Thread Arun Isaac

>> Perhaps, `org-publish-get-project-from-filename' can be rewritten
>> without `catch' and `throw' using `cl-some' or `seq-some'. This is not a
>> bug. But, it might help improve readability of the logic.
>
> Done.

Nice. Looks good.

> Note that `seq-some' is not an option since we support Emacs 24.3
> and onwards.

Yeah, I guessed.


signature.asc
Description: PGP signature


Re: [O] Bug: org-publish-get-project-from-filename raises (wrong-type-argument sequencep any)

2016-12-29 Thread Arun Isaac

Nicolas Goaziou writes:

> Hello,
>
> Arun Isaac <arunis...@systemreboot.net> writes:
>
>> On list elements of `org-publish-project-alist' with :base-extension any
>> `org-publish-get-project-from-filename' fails with error
>> (wrong-type-argument sequencep any). This is due to the `concat' call in
>> `org-publish-get-project-from-filename' where it attempts to construct a
>> regex by concatenating several strings together. When extension `x' is
>> any (a symbol), this step fails.
>
> Fixed. Thank you.

Perhaps, `org-publish-get-project-from-filename' can be rewritten
without `catch' and `throw' using `cl-some' or `seq-some'. This is not a
bug. But, it might help improve readability of the logic.

Thanks,
Arun Isaac.


signature.asc
Description: PGP signature


[O] Bug: org-publish-get-project-from-filename raises (wrong-type-argument sequencep any)

2016-12-29 Thread Arun Isaac

On list elements of `org-publish-project-alist' with :base-extension any
`org-publish-get-project-from-filename' fails with error
(wrong-type-argument sequencep any). This is due to the `concat' call in
`org-publish-get-project-from-filename' where it attempts to construct a
regex by concatenating several strings together. When extension `x' is
any (a symbol), this step fails.

Regards,
Arun Isaac.


signature.asc
Description: PGP signature


[O] A couple of trivial improvements

2016-12-26 Thread Arun Isaac

In line 374 of ox-publish.el in `org-publish-needed-p', there are 3
spaces between "message" and "Skipping". It should better be just 1
space.

In the comments in line 624 of ox-publish.el, "excepted" should be
"except".

I found these while reading the code. Sorry if I am nitpicking too much.

Regards,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] Defining macros globally

2016-12-20 Thread Arun Isaac

> I added `org-export-global-macros' in master. It's Christmas, after all.

Thanks! And, Merry Christmas! :-)


signature.asc
Description: PGP signature


[O] Defining macros globally

2016-12-19 Thread Arun Isaac

Is it possible to define macros globally, probably in the ~/.emacs init
file with some elisp, instead of on a per-file basis using the #+MACRO
keyword?

Thanks,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] Accessing the communication channel from a link exporter

2016-09-03 Thread Arun Isaac

John Kitchin writes:

> then the preprocessing hook sounds better. You can just replace the
> links with generated html, and then export the buffer.
>
> For example, here is a function that goes through an org file and
> replaces links that are file times with image or urls, and copies the
> file contents to a media-directory.

Thank you. I'll try to adapt this to my use case.



Re: [O] Accessing the communication channel from a link exporter

2016-09-02 Thread Arun Isaac

> I think this is the kind of thing you can use a filter for

But, it gets more complicated than that. I have XMP metadata (license,
caption, etc.)  stored in the image files as well. And, in order to
export that, I need the path to the source image file. So, my image link
exporter needs the :base-directory to find the source image file. If I
try to get the XMP metadata from the published image file, then I
introduce a race condition with the export of the org file becoming
dependent on the image file already being published.

Perhaps, filters could be useful. I need to think about it. So far, I
have generally stayed away from filters because they can only get the
HTML as text, and have to use some kind of regex to operate on it. HTML
is structured data, and it would have been good if it was available in
some kind of S-form tree structure. It would have saved me the trouble
of parsing the HTML, and I could have used a library like xmlgen to
generate it.

Regards,
Arun Isaac


signature.asc
Description: PGP signature


Re: [O] Accessing the communication channel from a link exporter

2016-09-01 Thread Arun Isaac

> Out of curiosity, what kind of link are you using, that is dependant
> about context ?

Actually, I don't need the context of the link in the org document. I
need some properties defined in the plist of the component in
org-publish-project-alist. So, I use the info communication channel to
access these properties.

I maintain a few websites with org mode. When I publish an image link
with org, the exported HTML contains the full filesystem path of the
image. The page wouldn't work if I published it on the web. My link type
needs to know the path of the web server's docroot to remove that
component from the full filesystem path. This path is defined in one of
the properties in org-publish-project-alist, and I need the info
communication channel to access it.


signature.asc
Description: PGP signature


[O] [BUG] :html-link-use-abs-url defined twice for the html backend

2016-08-31 Thread Arun Isaac

In the options-alist of the html backend definition,
:html-link-use-abs-url is defined twice (in lines 119 and 123). This is
possibly a typo.

Regards,
Arun Isaac.


signature.asc
Description: PGP signature


[O] Accessing the communication channel from a link exporter

2016-08-31 Thread Arun Isaac

When adding a new hyperlink type using `org-add-link-type', how do I
access the info communication channel from the link exporter function?

Not being able to access the communication channel limits what I can do
with `org-add-link-type', and I end up creating a derived backend with
my own link transcoder function. Is that the recommended way to do it?

Regards,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] Footnotes in image captions

2016-08-28 Thread Arun Isaac

> In a nutshell, I'm sure that it will work in your use case, and I can
> even perceive the interest in having footnotes within captions. However,
> handling all the implied corner cases is going to be some tedious work,
> if doable at all. We might try, nonetheless, to introduce footnotes in
> captions as an experimental feature, but not before 9.0 release, and not
> without some developer support to handle the issues that would arise (as
> a reminder I'm an expert neither in LaTeX nor in HTML).
>
> WDYT?

I totally agree. No objections. When I brought up this matter, I thought
it might be just a little tweak to the org export code. I didn't realize
that there would be this many complications.

As for my use case, I can handle it easily enough without using
footnotes. So, I don't really need footnote support in image captions. I
only brought it up because I thought it might be a more generally useful
feature than my specific use case. So, this feature, if implemented, can
definitely wait. No hurry.

Regards,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] Footnotes in image captions

2016-08-26 Thread Arun Isaac

> I think it is a can of worms. For example, you cannot properly number
> footnotes anymore since there's no guarantee a caption is going to be
> exported.

In my use case, I can guarantee that all captions will be exported. So,
could footnotes in captions be implemented as an optional feature that
the user can enable by setting some variable? Or will that be too much
trouble?

Regards,
Arun Isaac.


signature.asc
Description: PGP signature


[O] Footnotes in image captions

2016-08-25 Thread Arun Isaac

Footnotes in image captions are not picked up and published. Is this
intended behaviour? If it is intended behaviour, would it not be nice to
allow footnotes in image captions too?

I am using the html backend, and the following org code:

#+CAPTION: Foo [fn::bar]
[[./foo.png]]

Regards,
Arun Isaac


signature.asc
Description: PGP signature


[O] [BUG] External unicode links without a description in ox-html

2016-07-20 Thread Arun Isaac

For external links without a description, `org-html-link' resuses the
`path' as the inner text of the exported  element. However, the
`path' variable contains the URL encoded version of the `raw-path'. It
would be more appropriate to put the actual unescaped unicode URL in the
inner text of the  element.

Regards,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] Why no secure code retrieval

2016-06-29 Thread Arun Isaac

> However, gpg signing release tag commits is dead simple and would
> take a total of maybe 10 minutes of work over the lifetime of the project
> (please correct me if I'm wrong).

I second this statement. GPG signing sounds good to me. We should do this.

> I know that https can be a bit tedious to setup so I am not asking for it
> (though I do think it would be great if it was enabled on the site in some
> fashion).

HTTPS is not so tedious these days with Let's Encrypt.

https://letsencrypt.org/

We should set up HTTPS as well.


signature.asc
Description: PGP signature


Re: [O] Programmatically constructing org documents

2016-06-27 Thread Arun Isaac

> https://github.com/tj64/org-dp

I've seen org-dp before, but I'm confused about how it is different from
org-element functions like `org-element-interpret-data'.

Does it just add more convenience functions? If so, why not integrate
org-dp into org-mode itself? Surely, convenience functions such as those
provided by org-dp are useful enough to be part of org-mode.


signature.asc
Description: PGP signature


Re: [O] Programmatically constructing org documents

2016-06-26 Thread Arun Isaac

> I don't know if there is a "correct" way. It might depend on how
> sophisticated the document is. I usually use strings and format.
> Sometimes that is a pain though, if there is a lot of conditional
> formatting. So the question is which is easier for your situation, and I
> would say easier is "correct" ;)

Fair enough. Sounds good. Thank you.



Re: [O] new syntax of completion and preparation functions for publishing

2016-06-25 Thread Arun Isaac

> I've never played with plists before, could you please provide a code
> sample?

Do read the following section in the "GNU Emacs Lisp Reference Manual" about
property lists.

https://www.gnu.org/software/emacs/manual/html_node/elisp/Property-Lists.html


signature.asc
Description: PGP signature


[O] Programmatically constructing org documents

2016-06-24 Thread Arun Isaac

What is the "correct" way to programmatically construct org documents?

Should I construct a parse tree, and then use
`org-element-interpret-data' to convert it org syntax?

Or, should I use string and buffer functions (such as `format' and
`insert') to construct org syntax directly?

Thank you,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] new syntax of completion and preparation functions for publishing

2016-06-24 Thread Arun Isaac

> I'd like to try to improve on my configuration of projects but I'm
> unsure hot to use this new feature. How do you use it?

I maintain my blog with org mode. One of my preparation functions
generates an atom feed for my blog. This function uses
`org-publish-get-base-files' to get the path to the org source files
corresponding to my blog posts. In order to supply the PROJECT argument
of `org-publish-get-base-files', I need to know the project-plist.

In general, the preparation function having access to project-plist is a
very useful feature. Many a time, it avoids the need to get the plist
indirectly by accessing org-publish-project-alist or by some other means.


signature.asc
Description: PGP signature


Re: [O] [BUG] Dynamic scoping of project-plist in preparation-function

2016-06-22 Thread Arun Isaac

> Done in 5cd793c.

After 5cd793c, the documentation for the preparation function says
"Each preparation function is called with a single argument, the project
property". This could be clearer if it is "... the project property
list", as it is in the documentation for the completion function.


signature.asc
Description: PGP signature


Re: [O] [BUG] Dynamic scoping of project-plist in preparation-function

2016-06-22 Thread Arun Isaac

> 2. Require preparation functions to accept one parameter, the project
>plist.

I think adding project-plist as a parameter to preparation functions is
definitely more elegant.

But, I also came across this old thread where it was noted that making
project-plist a proper parameter, instead of it being dynamically scoped
into the preparation function, would break a lot of code.

https://lists.gnu.org/archive/html/emacs-orgmode/2010-03/msg00016.html

But now, with org moving to lexical binding, I think it is time to make
project-plist a proper parameter, despite the costs of doing so.


signature.asc
Description: PGP signature


[O] [BUG] Dynamic scoping of project-plist in preparation-function

2016-06-21 Thread Arun Isaac

The org mode manual says "The project property list is scoped into this
call as the variable project-plist". But, ox-publish.el has lexical
binding enabled, and the variable project-plist doesn't seem to be
accessible from the executed preparation-function. When I try to access
the variable, I get a (void-variable project-plist) error.

Please find attached a minimal elisp file to reproduce the bug.

emacs -Q -l preparation-function-dynamic-scoping.el

My understanding of dynamic and lexical binding is a little foggy. So,
do let me know if I'm missing something.

Regards,
Arun Isaac.



preparation-function-dynamic-scoping.el
Description: application/emacs-lisp


signature.asc
Description: PGP signature


Re: [O] Exporting FILETAGS

2016-06-21 Thread Arun Isaac

> Do you mean that you want to export inherited filetags on each headline?
> If so, it is not possible out of the box.

No, I would like to export the FILETAGS to say, below the title. I am
maintaining my blog in org mode, and I am hoping to use FILETAGS to tag
my blog posts. So, I am interested in tags for the entire file itself,
not inherited tags on each headline.

Currently, I have written some code to do this, but I am wondering if
this is available out of the box.


signature.asc
Description: PGP signature


[O] Exporting FILETAGS

2016-06-20 Thread Arun Isaac

When org-export-with-tags is set to t, tags on headlines are
exported. Is there a similar way to export FILETAGS as well?

Thanks,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] Tagging an entire org file

2016-06-14 Thread Arun Isaac

> #+FILETAGS: foo

That's just what I was looking for. Thank you!


signature.asc
Description: PGP signature


[O] Tagging an entire org file

2016-06-13 Thread Arun Isaac

Is there a way to tag an entire org document, and not just the
headlines? I mean, something like:

#+TAGS: tag1, tag2, tag3, ...

This is much like #+CATEGORY, but something that can take multiple values.

I am maintaining my blog with org mode, and would like to tag my blog
posts with various tags.

Regards,
Arun Isaac.


signature.asc
Description: PGP signature


[O] [BUG] [PATCH] ox-rss: Put email address in element

2016-06-13 Thread Arun Isaac

The RSS specification requires the email address and the name of the
author to be provided in the  element in the format
"em...@domain.com (Name)".

http://www.rssboard.org/rss-specification#ltauthorgtSubelementOfLtitemgt

Currently, only the author's name is provided. This is invalid
RSS. Please find attached a patch fixing this.

Regards,
Arun Isaac.

From f5e2bf625cc14efd35dcd77340b4ab380b2f3dc8 Mon Sep 17 00:00:00 2001
From: Arun Isaac <arunis...@systemreboot.net>
Date: Tue, 14 Jun 2016 01:18:55 +0530
Subject: [PATCH] ox-rss: Put email address in  element

* contrib/lisp/ox-rss.el (org-rss-headline): Put author's email
  address in  element.

The RSS specification requires the email address and the name of the
author to be provided in the  element in the format
"em...@domain.com (Name)". Currently, only the author's name is
provided. This is invalid RSS.
---
 contrib/lisp/ox-rss.el | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 44ee8db..a3ba274 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -231,7 +231,8 @@ communication channel."
   (if (> (org-export-get-relative-level headline info) 1)
   (org-export-data-with-backend headline 'html info)
 (unless (org-element-property :footnote-section-p headline)
-  (let* ((author (and (plist-get info :with-author)
+  (let* ((email (org-export-data (plist-get info :email) info))
+	 (author (and (plist-get info :with-author)
 			  (let ((auth (plist-get info :author)))
 			(and auth (org-export-data auth info)
 	 (htmlext (plist-get info :html-extension))
@@ -275,13 +276,13 @@ communication channel."
 	"\n"
 	"%s\n"
 	"%s\n"
-	"%s\n"
+	"%s (%s)\n"
 	"%s\n"
 	"%s\n"
 	(org-rss-build-categories headline info) "\n"
 	"\n"
 	"\n")
-	   title publink author guid pubdate contents))
+	   title publink email author guid pubdate contents))
 
 (defun org-rss-build-categories (headline info)
   "Build categories for the RSS item."
-- 
2.8.3



signature.asc
Description: PGP signature


Re: [O] Bug: XML entities in the ox-rss exporter

2016-05-26 Thread Arun Isaac

> I think my patch introduces a bug in `org-rss-build-channel-info'. I'll
> fix this and send a new patch soon.

I didn't realize (plist-get info :title) returns a list, and not a
string.  I have now fixed the bug. Please find attached a new patch.



signature.asc
Description: PGP signature
>From 58c290c9308f07e44bf893331ccf9d9c5d255e04 Mon Sep 17 00:00:00 2001
From: Arun Isaac <theroarofthedra...@gmail.com>
Date: Thu, 26 May 2016 17:24:29 +0530
Subject: [PATCH] ox-rss: Encode characters to their XML entities

* contrib/lisp/ox-rss.el (org-rss-build-channel-info, org-rss-headline):
  Encode disallowed characters in `title' to their XML entities

The `title' field is user specified and may contain characters such as
"&", "<" or ">" that are disallowed in XML. These characters should be
encoded into their corresponding XML entities.
---
 contrib/lisp/ox-rss.el | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 0c4a2f2..44ee8db 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -248,12 +248,13 @@ communication channel."
 			(format-time-string
 			 "%a, %d %b %Y %H:%M:%S %z"
 			 (org-time-string-to-time pubdate0)
-	 (title (or (org-element-property :RSS_TITLE headline)
-			(replace-regexp-in-string
-			 org-bracket-link-regexp
-			 (lambda (m) (or (match-string 3 m)
-	 (match-string 1 m)))
-			 (org-element-property :raw-value headline
+	 (title (org-rss-plain-text
+		 (or (org-element-property :RSS_TITLE headline)
+			 (replace-regexp-in-string
+			  org-bracket-link-regexp
+			  (lambda (m) (or (match-string 3 m)
+	  (match-string 1 m)))
+			  (org-element-property :raw-value headline))) info))
 	 (publink
 	  (or (and hl-perm (concat (or hl-home hl-pdir) hl-perm))
 		  (concat
@@ -318,7 +319,7 @@ as a communication channel."
 (defun org-rss-build-channel-info (info)
   "Build the RSS channel information."
   (let* ((system-time-locale "C")
-	 (title (plist-get info :title))
+	 (title (org-export-data (plist-get info :title) info))
 	 (email (org-export-data (plist-get info :email) info))
 	 (author (and (plist-get info :with-author)
 		  (let ((auth (plist-get info :author)))
-- 
2.8.2



Re: [O] Bug: XML entities in the ox-rss exporter

2016-05-26 Thread Arun Isaac

> Please find attached the patch.

I think my patch introduces a bug in `org-rss-build-channel-info'. I'll
fix this and send a new patch soon.


signature.asc
Description: PGP signature


Re: [O] Bug: XML entities in the ox-rss exporter

2016-05-25 Thread Arun Isaac

>> I can provide a patch for this. 

Please find attached the patch.

> Since "ox-rss.el" loads "ox-html", could you re-use code in the latter?

I think even ox-html could benefit from using an XML/HTML generation
library that can convert s-expressions to XML/HTML. xml.el has
`xml-parse-region' to convert XML strings to an s-expression tree, but
unfortunately has no function to do the inverse, that is, convert an
s-expression tree to an XML string. If it had such a function, we
needn't have to depend on an external library such as xmlgen, and things
would have been more convenient.

Anyways, for now, I have implemented a patch which uses
`org-rss-plain-text' (which, in turn uses `org-html-encode-plain-text')
to encode the disallowed characters to their XML entities.



signature.asc
Description: PGP signature
>From 2b310b32234e6193154c9850d51aaa8ed312f2df Mon Sep 17 00:00:00 2001
From: Arun Isaac <theroarofthedra...@gmail.com>
Date: Wed, 25 May 2016 15:11:34 +0530
Subject: [PATCH] ox-rss: Encode characters to their XML entities

* contrib/lisp/ox-rss.el (org-rss-build-channel-info, org-rss-headline):
  Encode disallowed characters in `title' to their XML entities

The `title' field is user specified and may contain characters such as
"&", "<" or ">" that are disallowed in XML. These characters should be
encoded into their corresponding XML entities.
---
 contrib/lisp/ox-rss.el | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 0c4a2f2..95d20ec 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -248,12 +248,13 @@ communication channel."
 			(format-time-string
 			 "%a, %d %b %Y %H:%M:%S %z"
 			 (org-time-string-to-time pubdate0)
-	 (title (or (org-element-property :RSS_TITLE headline)
-			(replace-regexp-in-string
-			 org-bracket-link-regexp
-			 (lambda (m) (or (match-string 3 m)
-	 (match-string 1 m)))
-			 (org-element-property :raw-value headline
+	 (title (org-rss-plain-text
+		 (or (org-element-property :RSS_TITLE headline)
+			 (replace-regexp-in-string
+			  org-bracket-link-regexp
+			  (lambda (m) (or (match-string 3 m)
+	  (match-string 1 m)))
+			  (org-element-property :raw-value headline))) info))
 	 (publink
 	  (or (and hl-perm (concat (or hl-home hl-pdir) hl-perm))
 		  (concat
@@ -318,7 +319,7 @@ as a communication channel."
 (defun org-rss-build-channel-info (info)
   "Build the RSS channel information."
   (let* ((system-time-locale "C")
-	 (title (plist-get info :title))
+	 (title (org-rss-plain-text (or (plist-get info :title) "") info))
 	 (email (org-export-data (plist-get info :email) info))
 	 (author (and (plist-get info :with-author)
 		  (let ((auth (plist-get info :author)))
-- 
2.8.2



[O] Bug: XML entities in the ox-rss exporter

2016-05-17 Thread Arun Isaac

The ox-rss exporter does not replace characters (such as < , > , etc.)
by their corresponding XML entities ( ,  , etc.) in the 
field of the generated XML.

For example, the following org file, when exported, will produce invalid
XML where the  field still contains the disallowed "<" character.

- org file begins here -
* Foo <- Bar

Some text
- org file ends here -

I'm guessing the ox-rss backend similarly fails to handle XML entities
in other fields as well.

I can provide a patch for this. But, do I use an external library like
xmlgen (https://github.com/philjackson/xmlgen), or do I write my own
find and replace functions like those in ox-html? I think the xmlgen
based approach provides better abstraction and avoids reinventing XML
generation. But, it will introduce an additional dependency.

Please provide thoughts and suggestions.

Thank you,
Arun Isaac.



Re: [O] [PATCH] Prevent org-rss-headline dropping lower level headlines

2016-05-11 Thread Arun Isaac

> I mean that the HTML back-end adds data that may not be useful for the
> RSS back-end.

Yes, things like the  tags are not useful. But, technically,
they aren't wrong either. And, the alternative is to modify ox-rss so it
depends less on ox-html. That is a bigger modification, not within the
scope of this patch, I think.

> My remark about `org-export-data-with-backend' is orthogonal to the
> output of the function. It is usually better because it doesn't depend
> on the name of the translators in HTML back-end.

I have made this modification.

> Could you send an updated patch? Thank you.

Please find attached an updated patch.

Thank you.

>From a8fd0b0f4eca51a38a432ad942b695b9e565d4fe Mon Sep 17 00:00:00 2001
From: Arun Isaac <theroarofthedra...@gmail.com>
Date: Thu, 12 May 2016 09:21:18 +0530
Subject: [PATCH] ox-rss: Prevent dropping lower level headlines

* contrib/lisp/ox-rss.el (org-rss-headline): Transcode lower level
  headlines (headlines with level > 1) using the html backend.  Do not
  drop them.

Previously, lower level headlines were dropped and did not appear in the
exported RSS output.
---
 contrib/lisp/ox-rss.el | 106 -
 1 file changed, 53 insertions(+), 53 deletions(-)

diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 39fce30..0c4a2f2 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -228,59 +228,59 @@ Return output file name."
   "Transcode HEADLINE element into RSS format.
 CONTENTS is the headline contents.  INFO is a plist used as a
 communication channel."
-  (unless (or (org-element-property :footnote-section-p headline)
-	  ;; Only consider first-level headlines
-	  (> (org-export-get-relative-level headline info) 1))
-(let* ((author (and (plist-get info :with-author)
-			(let ((auth (plist-get info :author)))
-			  (and auth (org-export-data auth info)
-	   (htmlext (plist-get info :html-extension))
-	   (hl-number (org-export-get-headline-number headline info))
-	   (hl-home (file-name-as-directory (plist-get info :html-link-home)))
-	   (hl-pdir (plist-get info :publishing-directory))
-	   (hl-perm (org-element-property :RSS_PERMALINK headline))
-	   (anchor (org-export-get-reference headline info))
-	   (category (org-rss-plain-text
-		  (or (org-element-property :CATEGORY headline) "") info))
-	   (pubdate0 (org-element-property :PUBDATE headline))
-	   (pubdate (let ((system-time-locale "C"))
-		  (if pubdate0
-			  (format-time-string
-			   "%a, %d %b %Y %H:%M:%S %z"
-			   (org-time-string-to-time pubdate0)
-	   (title (or (org-element-property :RSS_TITLE headline)
-		  (replace-regexp-in-string
-		   org-bracket-link-regexp
-		   (lambda (m) (or (match-string 3 m)
-  (match-string 1 m)))
-		   (org-element-property :raw-value headline
-	   (publink
-	(or (and hl-perm (concat (or hl-home hl-pdir) hl-perm))
-		(concat
-		 (or hl-home hl-pdir)
-		 (file-name-nondirectory
-		  (file-name-sans-extension
-		   (plist-get info :input-file))) "." htmlext "#" anchor)))
-	   (guid (if org-rss-use-entry-url-as-guid
-		 publink
-		   (org-rss-plain-text
-		(or (org-element-property :ID headline)
-			(org-element-property :CUSTOM_ID headline)
-			publink)
-		info
-  (if (not pubdate0) "" ;; Skip entries with no PUBDATE prop
-	(format
-	 (concat
-	  "\n"
-	  "%s\n"
-	  "%s\n"
-	  "%s\n"
-	  "%s\n"
-	  "%s\n"
-	  (org-rss-build-categories headline info) "\n"
-	  "\n"
-	  "\n")
-	 title publink author guid pubdate contents)
+  (if (> (org-export-get-relative-level headline info) 1)
+  (org-export-data-with-backend headline 'html info)
+(unless (org-element-property :footnote-section-p headline)
+  (let* ((author (and (plist-get info :with-author)
+			  (let ((auth (plist-get info :author)))
+			(and auth (org-export-data auth info)
+	 (htmlext (plist-get info :html-extension))
+	 (hl-number (org-export-get-headline-number headline info))
+	 (hl-home (file-name-as-directory (plist-get info :html-link-home)))
+	 (hl-pdir (plist-get info :publishing-directory))
+	 (hl-perm (org-element-property :RSS_PERMALINK headline))
+	 (anchor (org-export-get-reference headline info))
+	 (category (org-rss-plain-text
+			(or (org-element-property :CATEGORY headline) "") info))
+	 (pubdate0 (org-element-property :PUBDATE headline))
+	 (pubdate (let ((system-time-locale "C"))
+			(if pubdate0
+			(format-time-string
+			 "%a, %d %b %Y %H:%M:%S %z"
+			 (org-time-string-to-time pubdate0)
+	 (title (or (org-element-property :RSS_TITLE headline)
+			(replace-regexp-in-string
+			 org-bracket-link-regexp
+			 (lambda (m) (or (match-string 3 

Re: [O] [PATCH] Prevent org-rss-headline dropping lower level headlines

2016-05-10 Thread Arun Isaac

> This is a contributed package. I don't mind patching it but those have,
> usually, a maintainer.

Is there some other maintainer I should contact? I mean, should I be
posting bug reports and patches to contributed packages on some other
mailing list?

> Are you sure it is a bug? There's a comment about it in
> `org-rss-headline' so maybe it is intended.

The comment says "Only consider first level headlines". I took that to
mean that only first level headlines will become individual RSS items,
but that all contents under that first level headline will be included
into the corresponding RSS item. Therefore, I concluded that dropping
lower level headlines was a bug.

But, even if it isn't a bug, I think it makes more sense to include all
content within the first level headline in the RSS item. I don't see a
use case where you would want to drop lower level headlines. Please
correct me if I'm wrong.

> Also, isn't the output of `org-html-headline'
> (`org-export-data-with-backend' is better IMO) a bit verbose? You are
> going to insert "...

I'm not sure what you mean by verbose. The RSS specification does allow
HTML within a CDATA section.  Besides, org-export-data-with-backend
(with the html backend) also inserts the "" things, doesn't it?



Re: [O] [PATCH] Prevent org-rss-headline dropping lower level headlines

2016-05-09 Thread Arun Isaac

Hi,

Sorry for reposting. Could somebody check out this patch (sent on April
19), and consider for inclusion?

Thanks.

> Hi,
>
> Currently, the RSS exporter (org-rss-headline) drops lower level
> headlines (headlines with level > 1), and therefore they do not appear
> in the exported RSS. This is a bug.
>
> For example, if the following file were exported to RSS, "Headline level
> 2" would not appear in the output.
>
> = file begins here =
> * Headline level 1
>
> foo
>
> ** Headline level 2
>
> bar
> = file end here =
>
> Please find attached a patch fixing this.
>
> Regards,
> Arun Isaac.



[O] [PATCH] Prevent org-rss-headline dropping lower level headlines

2016-04-19 Thread Arun Isaac

Hi,

Currently, the RSS exporter (org-rss-headline) drops lower level
headlines (headlines with level > 1), and therefore they do not appear
in the exported RSS. This is a bug.

For example, if the following file were exported to RSS, "Headline level
2" would not appear in the output.

= file begins here =
* Headline level 1

foo

** Headline level 2

bar
= file end here =

Please find attached a patch fixing this.

Regards,
Arun Isaac.



signature.asc
Description: PGP signature
>From e000940d29b4bf5f63274e82f6a7341021000fd2 Mon Sep 17 00:00:00 2001
From: Arun Isaac <theroarofthedra...@gmail.com>
Date: Tue, 19 Apr 2016 13:53:50 +0530
Subject: [PATCH] ox-rss: Prevent dropping lower level headlines

* contrib/lisp/ox-rss.el (org-rss-headline): Transcode lower level
  headlines (headlines with level > 1) with org-html-headline. Do not
  drop them.

Previously, lower level headlines were dropped and did not appear in the
exported RSS output.
---
 contrib/lisp/ox-rss.el | 106 -
 1 file changed, 53 insertions(+), 53 deletions(-)

diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 39fce30..eba461d 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -228,59 +228,59 @@ Return output file name."
   "Transcode HEADLINE element into RSS format.
 CONTENTS is the headline contents.  INFO is a plist used as a
 communication channel."
-  (unless (or (org-element-property :footnote-section-p headline)
-	  ;; Only consider first-level headlines
-	  (> (org-export-get-relative-level headline info) 1))
-(let* ((author (and (plist-get info :with-author)
-			(let ((auth (plist-get info :author)))
-			  (and auth (org-export-data auth info)
-	   (htmlext (plist-get info :html-extension))
-	   (hl-number (org-export-get-headline-number headline info))
-	   (hl-home (file-name-as-directory (plist-get info :html-link-home)))
-	   (hl-pdir (plist-get info :publishing-directory))
-	   (hl-perm (org-element-property :RSS_PERMALINK headline))
-	   (anchor (org-export-get-reference headline info))
-	   (category (org-rss-plain-text
-		  (or (org-element-property :CATEGORY headline) "") info))
-	   (pubdate0 (org-element-property :PUBDATE headline))
-	   (pubdate (let ((system-time-locale "C"))
-		  (if pubdate0
-			  (format-time-string
-			   "%a, %d %b %Y %H:%M:%S %z"
-			   (org-time-string-to-time pubdate0)
-	   (title (or (org-element-property :RSS_TITLE headline)
-		  (replace-regexp-in-string
-		   org-bracket-link-regexp
-		   (lambda (m) (or (match-string 3 m)
-  (match-string 1 m)))
-		   (org-element-property :raw-value headline
-	   (publink
-	(or (and hl-perm (concat (or hl-home hl-pdir) hl-perm))
-		(concat
-		 (or hl-home hl-pdir)
-		 (file-name-nondirectory
-		  (file-name-sans-extension
-		   (plist-get info :input-file))) "." htmlext "#" anchor)))
-	   (guid (if org-rss-use-entry-url-as-guid
-		 publink
-		   (org-rss-plain-text
-		(or (org-element-property :ID headline)
-			(org-element-property :CUSTOM_ID headline)
-			publink)
-		info
-  (if (not pubdate0) "" ;; Skip entries with no PUBDATE prop
-	(format
-	 (concat
-	  "\n"
-	  "%s\n"
-	  "%s\n"
-	  "%s\n"
-	  "%s\n"
-	  "%s\n"
-	  (org-rss-build-categories headline info) "\n"
-	  "\n"
-	  "\n")
-	 title publink author guid pubdate contents)
+  (if (> (org-export-get-relative-level headline info) 1)
+  (org-html-headline headline contents info)
+(unless (org-element-property :footnote-section-p headline)
+  (let* ((author (and (plist-get info :with-author)
+			  (let ((auth (plist-get info :author)))
+			(and auth (org-export-data auth info)
+	 (htmlext (plist-get info :html-extension))
+	 (hl-number (org-export-get-headline-number headline info))
+	 (hl-home (file-name-as-directory (plist-get info :html-link-home)))
+	 (hl-pdir (plist-get info :publishing-directory))
+	 (hl-perm (org-element-property :RSS_PERMALINK headline))
+	 (anchor (org-export-get-reference headline info))
+	 (category (org-rss-plain-text
+			(or (org-element-property :CATEGORY headline) "") info))
+	 (pubdate0 (org-element-property :PUBDATE headline))
+	 (pubdate (let ((system-time-locale "C"))
+			(if pubdate0
+			(format-time-string
+			 "%a, %d %b %Y %H:%M:%S %z"
+			 (org-time-string-to-time pubdate0)
+	 (title (or (org-element-property :RSS_TITLE headline)
+			(replace-regexp-in-string
+			 org-bracket-link-regexp
+			 (lambda (m) (or (match-string 3 m)
+	 (match-string 1 m)))
+			 (org-element-property :raw-value headline
+	 (publink
+	  (or (and hl-perm (concat (or hl-home hl-pdir

Re: [O] scheme SRC blocks

2016-03-22 Thread Arun Isaac
> the org-babel-execute:scheme function looks for a :scheme header
> argument (otherwise uses the geiser-default-implementation).

You're right. I went through ob-scheme.el. org-babel-execute:scheme does
look for a :scheme header argument.

But, my original problem was different. I was looking for a way to get
rid of the "Scheme implementation: " prompt when the org file was
opened, not when the src block was executed.

When the org file is opened, some org function is being called that
ends up prompting for the Scheme implementation. I'm not sure which
function is doing that.

> This may depend on your org version, mine is 8.3beta.

I am using org release_8.3.1-933-g809a83 -- the latest version on branch
master of the git repo.


signature.asc
Description: PGP signature


Re: [O] scheme SRC blocks

2016-03-21 Thread Arun Isaac

> In addition to requiring 'geiser-install you have to set the
> geiser-active-implementations variable, e.g.:

Customizing the geiser-active-implementations variable works for
me. Thank you.

> alternatively there is a :scheme header argument for src blocks:
>
> #begin_src scheme :scheme guile

Unfortunately, this doesn't work for me. Is this header argument
documented somewhere in the manual?

This approach seems more self-contained to the org file, and it'll be
good to have this, in case I want to send my org file to someone else,
or if I decide to try out more scheme implementations.



signature.asc
Description: PGP signature


[O] scheme SRC blocks

2016-03-20 Thread Arun Isaac

I have an org file with scheme SRC blocks like so.

#+BEGIN_SRC scheme
  (some-code-here)
#+END_SRC

Every time, I open the org file, I get prompted for the "Scheme
implementation" and I need to choose an implementation (guile, in my
case) before continuing. Similarly, I am also prompted for the same when
publishing the org file, or opening up the SRC block using
org-edit-special (C-c ') for editing. This happens because of the
behaviour of the command "scheme-mode" which prompts for the required
scheme implementation.

Manually choosing the scheme implementation every time is tedious and
annoying. Is there some way to circumvent this issue?

Thanks,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] [PATCH] Implement RSS_FEED_URL option keyword

2016-02-22 Thread Arun Isaac
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Arun Isaac <theroarofthedra...@gmail.com> writes:
>
>> I have implemented a new option keyword, RSS_FEED_URL, for the RSS
>> exporter backend.

This is a patch I submitted some time back.

> Although it is not strictly necessary for applying patches to contrib
> libraries, did you sign FSF papers already? It can matter if we consider
> moving this library into core some day.

My FSF copyright assignment process is now complete. What details should
I submit here to have my patch included in org mode? Do let me know.

Thanks,
Arun I.


signature.asc
Description: PGP signature


[O] FSF copyright assignment

2016-01-12 Thread Arun Isaac

How long does FSF copyright assignment typically take? I sent a request
around 2 weeks ago (on December 26), but haven't received a reply yet.

Does it usually take this long? Should I resend my copyright
assignment request?


signature.asc
Description: PGP signature


Re: [O] [PATCH] Implement RSS_FEED_URL option keyword

2015-12-26 Thread Arun Isaac

> Although it is not strictly necessary for applying patches to contrib
> libraries, did you sign FSF papers already? It can matter if we consider
> moving this library into core some day.

I have initiated the process. I will get back to you once it is
complete.



signature.asc
Description: PGP signature


Re: [O] Publishing images to various sizes

2015-12-26 Thread Arun Isaac

John Kitchin <jkitc...@andrew.cmu.edu> writes:
> (defun my-link-format (link contents info)
>   (let ((type (org-element-property :type link))
> (path (org-element-property :path link)))
> (cond
>  ((and
>(string= type "file")
>(string-match "\.pdf" path))
>   (shell-command
>(format
> "convert %s %s"
> path
> (replace-regexp-in-string "\.pdf" ".png" path)))
>   (format "" (replace-regexp-in-string "\.pdf" ".png" 
> path)))
>  ;; anything else, we just do the regular thing
>  (t
>   (org-html-link link contents info)
>
> (org-export-define-derived-backend 'my-html 'html
>   :translate-alist '((link . my-link-format)))
>
> (browse-url (org-export-to-file 'my-html "custom-link.html"))

Thank you. I'll adapt this to my needs.

Regards,
Arun Isaac



[O] https link for MathJax

2015-12-25 Thread Arun Isaac

Hi,

Can we use the https link for MathJax as the default?

https://cdn.mathjax.org/mathjax/latest/MathJax.js

Currently, the default is the http link. Wouldn't having encryption by
default be nice?

Regards,
Arun Isaac


signature.asc
Description: PGP signature


[O] Publishing images to various sizes

2015-12-24 Thread Arun Isaac

Hi,

Is there some package that provides a publishing function I can use to
automatically publish images to various sizes? Probably something that
wraps around imagemagick's 'convert' command?

When I publish images to my website, I want them to be available in
various sizes, so that I can choose the appropriate image for the
context in which it appears, and thus optimize bandwidth usage.

Thanks,
Arun Isaac.


signature.asc
Description: PGP signature


[O] [PATCH] Implement RSS_FEED_URL option keyword

2015-12-10 Thread Arun Isaac

Hi,

I have implemented a new option keyword, RSS_FEED_URL, for the RSS
exporter backend.

The RSS_FEED_URL goes into the atom:link element that identifies the
feed's own URL.

http://www.rssboard.org/rss-profile#namespace-elements-atom-link

Currently, the feed URL is assumed to be html-link-home or
publishing-directory concatenated with the output filename of the
feed. This need not necessarily be so. So, the RSS_FEED_URL option
keyword is introduced to let the user customize the feed URL.

Please review the patch and consider for inclusion.

Thanks,
Arun Isaac.



signature.asc
Description: PGP signature
>From c0447601cd77ae8877f7ea42bdadcc4179cd0113 Mon Sep 17 00:00:00 2001
From: Arun Isaac <theroarofthedra...@gmail.com>
Date: Fri, 11 Dec 2015 02:12:59 +0530
Subject: [PATCH] ox-rss: Implement RSS_FEED_URL option keyword

* contrib/lisp/ox-rss.el (org-rss-build-channel-info): Try to use the
  specified RSS_FEED_URL option keyword as publink before resorting to
  concatenating blogurl with output filename.

The RSS_FEED_URL goes into the atom:link element that identifies the
feed's own URL. Currently, the feed URL is assumed to be html-link-home
or publishing-directory concatenated with the output filename of the
feed. This need not always be so. So, the RSS_FEED_URL option keyword
is introduced to let the user customize the feed URL.
---
 contrib/lisp/ox-rss.el | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 4cdfe0e..39fce30 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -31,10 +31,11 @@
 ;; `org-rss-export-as-rss' (temporary buffer) and `org-rss-export-to-rss'
 ;; (as a ".xml" file).
 ;;
-;; This backend understands two new option keywords:
+;; This backend understands three new option keywords:
 ;;
 ;; #+RSS_EXTENSION: xml
 ;; #+RSS_IMAGE_URL: http://myblog.org/mypicture.jpg
+;; #+RSS_FEED_URL: http://myblog.org/feeds/blog.xml
 ;;
 ;; It uses #+HTML_LINK_HOME: to set the base url of the feed.
 ;;
@@ -127,6 +128,7 @@ When nil, Org will create ids using `org-icalendar-create-uid'."
 (:with-toc nil nil nil) ;; Never include HTML's toc
 (:rss-extension "RSS_EXTENSION" nil org-rss-extension)
 (:rss-image-url "RSS_IMAGE_URL" nil org-rss-image-url)
+(:rss-feed-url "RSS_FEED_URL" nil nil t)
 (:rss-categories nil nil org-rss-categories))
   :filters-alist '((:filter-final-output . org-rss-final-function))
   :translate-alist '((headline . org-rss-headline)
@@ -331,10 +333,11 @@ as a communication channel."
 	 (image (url-encode-url (plist-get info :rss-image-url)))
 	 (ifile (plist-get info :input-file))
 	 (publink
-	  (concat (file-name-as-directory blogurl)
-		  (file-name-nondirectory
-		   (file-name-sans-extension ifile))
-		  "." rssext)))
+	  (or (plist-get info :rss-feed-url)
+	  (concat (file-name-as-directory blogurl)
+		  (file-name-nondirectory
+		   (file-name-sans-extension ifile))
+		  "." rssext
 (format
  "\n%s
 
-- 
2.6.3



Re: [O] [PATCH] Implement RSS_FEED_URL option keyword

2015-12-10 Thread Arun Isaac
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Arun Isaac <theroarofthedra...@gmail.com> writes:

> Currently, the feed URL is assumed to be html-link-home or
> publishing-directory concatenated with the output filename of the
> feed. This need not necessarily be so. So, the RSS_FEED_URL option
> keyword is introduced to let the user customize the feed URL.

Elaborating on this:

Currently, the feed is always assumed to be on the root of the server,
and the generated feed URL is something like
"http://foo.org/blog.xml;. But, the user might want to have the feed in
some subdirectory on the server (something like
"http://foo.org/feeds/blog.xml;).

As far as I understand, there is currently no way to do this. Hence, I
implemented RSS_FEED_URL to fill this void.
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAEBCAAGBQJWae+eAAoJEC4l7othgCuzpEwH/jSzkCt5529C6gGP3pMY7qb2
CgH7PaY86z3mmZWtcEysb0yGd/yQEPDezG3y2NMrUvnJthT0S1XCWTvzgtPrSYGn
+fRpoSLVDc+EIbC6WahAEXk5fAEi569EWEByfkCERvhqV5qSAeOfwelLmtaS5zAJ
j2aNHe0//+bCBNI1pKzOucQ2roY4nFQ8TRHDVLbM092Fm9pD093adMHpOILA/5vm
L88NHBz7Qm15zaDKyDFMwSHybjYk3V4bTF4m+VV7LE/W07aiq5tDHQsDRu0wo4jI
pGUWcJb9EdLdNwKavvzMKBGmdkCJp64iUwmbT7c/tozv+rU5l3bWalQ1ZI2klc0=
=v8WT
-END PGP SIGNATURE-



Re: [O] Bug: org-publish-find-title called before cache initialization signals "no cache present" [8.3.1 (release_8.3.1-505-g6b2c38 @ /home/arunisaac/.emacs.d/org-mode/lisp/)]

2015-12-07 Thread Arun Isaac
Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> IIUC, you are responsible for calling `org-publish-find-title', an
> internal "ox-publish" function, before `org-publish-cache' is
> initialized. In this case I tend to think that you are also responsible
> for taking care of the cache.

Is org-publish-find-title an internal function? If so, expecting the
user to be responsible for initializing the cache is acceptable.

But, is there some "external function" to find the title of an org file?
I couldn't find any, and hence resorted to using org-publish-find-title.

> You can suggest a patch, if you want to.
>
> The problem is that functions calling
> `org-publish-cache-get-file-property' do not usually know about the
> current project name. Calling `org-publish-get-project-from-filename'
> each time is a bit expensive, IMO.

How about initializing the cache before the execution of the preparation
function? I am calling org-publish-find-title in the preparation
function, and this would address my use case. If you think this is a
good idea, I can come up with a patch.

Else, we can close this issue. It's not really a major problem.

Regards,
Arun Isaac


signature.asc
Description: PGP signature


[O] Bug: org-publish-find-title called before cache initialization signals "no cache present" [8.3.1 (release_8.3.1-505-g6b2c38 @ /home/arunisaac/.emacs.d/org-mode/lisp/)]

2015-12-02 Thread Arun Isaac

If org-publish-find-title is called before org-publish-cache is
initialized (by some routine calling org-publish-initialize-cache), a
"no cache present" error is signalled.

This happens because org-publish-find-title does not pass a PROJECT-NAME
argument to org-publish-cache-get-file-property. Only if a PROJECT-NAME
argument is passed to org-publish-cache-get-file-property does it
initialize the cache.

Can this be considered a bug? Is org-publish-cache-get-file-property
supposed to automatically initialize the cache if it is not present? Or
is the user supposed to initialize the cache manually if required?

In my use case, my preparation-function calls
org-publish-find-title. However org-publish-projects initializes the
cache only after executing the preparation function. Hence I get a "no
cache present" error.

I could work around this problem by simply initializing the cache on my
own. But, I'm wondering if this can be fixed at a more fundamental
level.

Thank you,
Arun Isaac.

Emacs  : GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
 of 2015-09-10 on foutrelis
Package: Org-mode version 8.3.1 (release_8.3.1-505-g6b2c38 @ 
/home/arunisaac/.emacs.d/org-mode/lisp/)



[O] Bug: RSS exporter fails when buffer has no filename [8.3.1 (release_8.3.1-495-gbd7908)]

2015-11-28 Thread Arun Isaac

Exporting to RSS (using say, org-export-to-buffer) fails when the org
buffer has no filename. If the same contents are saved to a file on
disk, then exporting works normally.

Is this expected and normal behaviour? Or can it be considered a bug?

Please find attached a tarball with the backtrace of the error, and a
minimal init file to reproduce the bug. To reproduce the bug, just
extract the tarball, and run

emacs -Q -l minimal-org.el

Thanks,
Arun Isaac.

Emacs  : GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
 of 2015-09-10 on foutrelis
Package: Org-mode version 8.3.1 (release_8.3.1-495-gbd7908)



signature.asc
Description: PGP signature


ox-rss-bug.tar.gz
Description: Binary data


Re: [O] [wish] Execute preparation-function before getting base files

2015-10-14 Thread Arun Isaac

It works now. Thanks!


signature.asc
Description: PGP signature


Re: [O] [wish] Execute preparation-function before getting base files

2015-10-14 Thread Arun Isaac
Nicolas Goaziou  writes:

> I made the change in master.

I think a bug has been introduced by your change.

In org-publish-projects, the variable project-plist is accessed (to get
the preparation-function) before it is bound. So, I am getting a
(void-variable project-plist) error.



Re: [O] [wish] Execute preparation-function before getting base files

2015-10-12 Thread Arun Isaac

org-export-before-{processing,parsing} hooks are only useful when I have
existing source files and I want to modify them in some way before I
{process,parse} them. In my case, the source files don't exist at all,
before my preparation-function is run.

Regarding the preparation-function, the use case described in the manual
is for running make to update files before publishing.

http://orgmode.org/manual/Sources-and-destinations.html

Therefore, I think it makes sense only if the source filenames are collected
using org-publish-get-base-files after the preparation-function is run.

With the above logic, maybe the order of execution can actually be
considered a bug?


signature.asc
Description: PGP signature


[O] [wish] Execute preparation-function before getting base files

2015-10-10 Thread Arun Isaac

In org-publish-projects, it would be good if the preparation-function is
executed before getting base files using org-publish-get-base-files.

In one of my use cases, my preparation-function generates some source
files which are then to be published by the publishing-function. But,
since the base filenames are collected before the preparation-function
is executed, the publishing-function does not see the generated source
files.

Right now, I'm calling my preparation-function manually before calling
org-publish-project, but it would be nice if I didn't have to do it this
way.

Thanks,
Arun Isaac.


signature.asc
Description: PGP signature


Re: [O] Bug: org-babel-tangle-publish fails in copy-file step [8.3.1 (release_8.3.1-241-gea7ac0 @ /home/arunisaac/.emacs.d/org-mode/lisp/)]

2015-10-03 Thread Arun Isaac

Kyle Meyer  writes:
> Fixed in 2c349cc65.

Everything works as expected now. Thanks a lot!



signature.asc
Description: PGP signature


Re: [O] Refile: refile to any open file.

2014-08-14 Thread Isaac
Kyle Meyer kyle at kyleam.com writes:



 

 Nick Dokos ndokos at gmail.com wrote:

  jorge.alfaro-murillo at yale.edu (Jorge A. Alfaro-Murillo) writes:

 [...]

  Perhaps you should return instead only the org mode files that are

  opened, something like this:

 

 

  Excellent idea: refiling to an arbitrary non-org-mode file will either

  skip the file (if you are lucky, in which case you just pay a

  performance penalty) or it will try to use it in which case you'll end

  up with an error. There is no point in including arbitrary files into

  the refile list.

 [...]

  It might be better to check the major mode of the buffer, rather than

  its filename: it is not necessarily true that foo.org is an org-mode

  file, or foo.txt is not.

 

 There's a built-in Org function that does this.

 

 #+begin_src elisp

   (org-buffer-list 'files)  

 #+end_src

 

 



Thanks Kyle, Jorge, Nick and everybody!



Below is the working piece, I take pieces here and there,

grateful to everyone's help:



(defun ixp/org-buffer-files ()

  Return list of opened orgmode buffer files

  (mapcar (function buffer-file-name)

  (org-buffer-list 'files)))



(setq org-refile-targets

  (quote ((nil :maxlevel . 3)

  (ixp/org-buffer-files :maxlevel . 1)

  (org-agenda-files :maxlevel . 3



It's posted on emacs wiki as well 
http://www.emacswiki.org/emacs/OrgMode#toc20








Re: [O] Refile: refile to any open file.

2014-08-13 Thread Isaac
suvayu ali fatkasuvayu+linux at gmail.com writes:

 
 On Sun, Feb 26, 2012 at 02:16,  lngndvs at gmail.com wrote:
  I have been using the function oog in org-occur-goto.el to search any
  open file, so somewhere in that file is a way to find  open files.  What
  remains is to use some condition from this file to declare
  org-refile-targets.   I understand that a function can be used as a
  value of this variable.
 
 Look at the function oog-check-input. I believe it checks buffer-list
 and the major-mode for each buffer to determine whether to include it
 in the search.
 
 GL
 

Dear All,

Similar to this previous post, I am trying to file orgmode items to 
files/buffers currently opened. Being elisp rookie, I tried and came up with 
the following:

(defun opened-buffer-files ()
  Return the list of files currently opened in emacs
  (delq nil (mapcar (function buffer-file-name) (buffer-list)))
  )

(setq org-refile-targets (quote ((opened-buffer-files :maxlevel . 5)
 (org-agenda-files :maxlevel . 5

Not suprisingly, it's not working ... I still can not get to the opened 
file/orgmode files, as target for filing. Can you help point out where I did 
it all wrong?

Simiarly, I would like to add all opened buffers to agenda files list. I 
would really appreciate your inputs.


Thanks, 
Isaac





[O] use # instead of * to signal different levels of headlines? is it possible?

2014-04-04 Thread isaac
Hello,

As a heavy user of orgmode, I am wondering if it's possible to use # instead 
of * to signal the level of outline in orgmode?

I am guessing maybe there's an easy configuration that we can change the 
character used from * to #?

if that's the case, then I can just start to use this setup in orgmode to 
write my R code, integrated with outlines - comments (or python code, or ruby 
code)

Thanks!

Isaac




Re: [O] use # instead of * to signal different levels of headlines? is it possible?

2014-04-04 Thread Isaac
Thorsten Jolitz tjolitz at gmail.com 
writes:

 
 Josiah Schwab jschwab at gmail.com 
writes:
 
  On Apr 4, 2014, at 3:34 PM, isaac wrote:
 
  As a heavy user of orgmode, I am 
wondering if it's possible to use #
  instead
  of * to signal the level of outline in 
orgmode?
 
  No.  See
  http://orgmode.org/worg/org-
faq.html#sec-8-12
 
 Yes. Use outshine.el with outcommented 
Org-mode headers. Here is an
 example: 
 

Thanks! This solves it










Re: [O] proposal for a tool to translate orgmode outlines into programs

2013-10-05 Thread Isaac

Eric Schulte schulte.eric at gmail.com writes:

 
 Isaac isaacpei at gmail.com writes:
 
  proposal for a tool to translate orgmode outlines into programs
 
 
 Hi Isaac,
 
 This is a hard problem and an area of active research.  Search for
 program synthesis [1] to see a selection of work in this field.
 Generally programs are built from descriptions in formal languages which
 are much more structured than Org-mode, although some have also tried to
 automatically write programs from man pages [2].
 
 Armando Solar-Lezama's work [3] is related if we are including code
 snippets in Org-mode code blocks, namely program sketching [4] which
 attempts to build programs from incomplete program-language sketches and
 test cases.
 
 Best,
 
 Footnotes: 
 [1]  http://scholar.google.com/scholar?q=program%20synthesis
 
 [2]  https://www.usenix.org/conference/hotosxiii/macho-programming-man-
pages
 
 [3]  http://people.csail.mit.edu/asolar/
 
 [4]  http://people.csail.mit.edu/asolar/papers/thesis.pdf
 


Thanks everybody for the references and knowledge of the parser!

related, I happen to see this today from coffeescript site, which is 
somewhat related (orgmode export to markdown format) - and coffeescript 
literate is can use markdown as codes -maybe it's a direction  ... (but 
javascript!)

=
Literate CoffeeScript

Besides being used as an ordinary programming language, CoffeeScript may 
also be written in literate mode. If you name your file with a  .litcoffee 
extension, you can write it as a Markdown document — a document that also 
happens to be executable CoffeeScript code. The compiler will treat any 
indented blocks (Markdown's way of indicating source code) as code, and 
ignore the rest as comments.

Just for kicks, a little bit of the compiler is currently implemented in 
this fashion: See it as a document, raw, and properly highlighted in a text 
editor.

I'm fairly excited about this direction for the language, and am looking 
forward to writing (and more importantly, reading) more programs in this 
style. More information about Literate CoffeeScript, including an example 
program, are available in this blog post.
http://coffeescript.org/


best, Isaac






[O] proposal for a tool to translate orgmode outlines into programs

2013-10-04 Thread Isaac
proposal for a tool to translate orgmode outlines into programs

Idea: 
a program to translate orgmode note into script/programs which can be 
used as a template/starting point for a real program after debugging, 
refactoring. 

Background and reasons: 
As I am accumulating more orgmode notes for problem solving, task 
planning, project coordination,  I think it would be nice if a tool can 
translate the orgmode (especially those problem solving ones) into programs 
(as much as it can)- at least a program skeleton, where after 
ideas(outlines) are done, we can generate a corresponding program which can 
be quickly edited/debugged/re factored/tightened up to be useful running 
programs - to facilitate problem solving and task repetition in the future.


Questions and Discussions:
1. whether this would be a worthwhile idea, or such idea has been tried 
before?

2. do we have alternative solutions?

3. if indeed this idea is interesting, what programming language it 
would e worthwhile to translate to?  
currently I am thinking more along of the line of python, as its 
indenting structure more or less resemble outlines. (though my personal take 
for writing script is in ruby, lua is another interesting choice). this 3rd 
question is what I don't know for sure, I found for me ruby is more 
productive for scripting, and python has better supports ... 
ruby could be another attractive choice - level 1 headlines maybe 
translated to a class, while other levels translate to methods ...


Welcome your comments and ideas

thanks, Isaac

(while I am doing some search, found 
1. the reverse direction of this is: https://github.com/bjonnh/PyOrgMode 
- python reading and writing orgmode, but would I would prefer is orgmode = 
python/ruby instead.
2. another candidate is tangle - but idea here is different, not to 
export codes written in orgmode, but to translate/turn orgmode text directly 
into codes.
3. an interesting node.js parser for orgmode: 
https://github.com/daitangio/org-mode-parser

Some further elaboration:
1. say if a headline is an action:
translate to def ... a function
2. say if a headline is some description:
translate to class ...
3. some long lines can be simply turned to comments/docstring
4. ... maybe ... some NLP can be used to decide what actions to 
take?





Re: [O] proposal for a tool to translate orgmode outlines into programs

2013-10-04 Thread Isaac
Thomas S. Dye tsd at tsdye.com writes:

 
 Aloha Isaac,
 
 This sounds to me a lot like literate programming, which can be
 accomplished in Org with very many languages, including ruby and python
 (but not lua, yet).  See
 http://orgmode.org/worg/org-contrib/babel/languages.html. An advantage
 of literate programming is that it generates documentation in addition
 to the program code.
 
 hth,
 Tom
 

yes and no - it's literate programming, but rather than programming in orgmode 
- it's translating orgmode (thoughts) to build a skeleton of codes for code 
generation ... not sure if someone has done something similar before? it would 
be good to know. 

Thanks,
Isaac




[O] orgmode header issue with emacs themes

2013-05-05 Thread Isaac
Hello,

I am cycling my emacs themes (through out the day) to adapt
my eyes' contrast/tiredness during the day. 

However, as I cycled through themes, many times over the dark
color themes, there's an addition for font background -
especially for those 'org-mode' header lines (and comment lines),
which is annoying.

some suggestions to fix this behavior (I am just thinking delete
 those org related lines
 in the themes for
 now)?

thanks a lot

isaac




[Orgmode] Re: Wiki-like creating links on the fly for org

2011-01-15 Thread Isaac
I encounter the same issue as a wikidpad user migrated to emacs
It would be fantastic, if emacs org can have a visual tree display of its 
headings in a sperate window, something like the speedbar?

file linking can be fairly easily done in org, However, wikidpad is more of a 
database approach (possible to use sqlite as backend), whereas emacs org is a 
single file based mode: my guess is that implementing wikidpad feature in emacs 
would would end as a different application, other than what emacs is intended - 
a mighty text editor




___
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