[O] Org not registering tags as links to modified agenda

2017-07-10 Thread William Horne


Org mode is not registering tags as links to a modified agenda. When I revert 
to an old version of org mode (8.2.10), the tags link me to a modified agenda.

Will




Re: [O] Babel support for Vala

2017-07-10 Thread Christian Garbs

Am 10.07.2017 um 11:03 schrieb Nicolas Goaziou:

Christian Garbs  writes:


I have written a minimal Babel mode supporting the Vala[1][2] language
based on both ob-template.el and ob-C.el.

I would like to contribute it to lisp/contrib if you deem it useful.



Would you want to add it to Org core base? If so, you need to sign FSF
papers if you haven't. See 
for details.


Originally I only wanted to contribute to lisp/contrib without the FSF 
papers ("too much of a hassle"), but your question made me reconsider :-)


I'll send the mail to ass...@gnu.org and while waiting for the process, 
I'll write some documentation based on ob-doc-template.org


so long,
Mitch
--
Christian.Garbshttps://www.cgarbs.de
"Riko?" "Hmm?" "Did I ever tell you how beautiful you are?"
She smiled. "You tried once, but gave up."
 (Hammer Time, Book One by Martin Rose)



Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Tim Cross

Having seen the other posts on this, I think I'll need to spend more
time thinking about this and the various use cases. There is something
I'm having trouble putting my finger on which doesn't feel quite right,
but I feel I need to look more deeply into the whole idea of how to
export links generally. Originally, I was thinking just about HTML
export and just file:// vs site context specific links.

Based on what you have provided, this certainly does seem to address the
specific use case I was thinking of, but others have pointed out
additional considerations, so I'm now not sure if the suggested approach
won't improve one case while making others more difficult/restricted.

Tim

Nicolas Goaziou writes:

> Hello,
>
> Tim Cross  writes:
>
>> Perhaps we need a way to easily set a context for web exports. If the
>> context is set, then use it, otherwise, use file:/// (actually, I
>> thought this was already there, but it has been a while since I did html
>> exports where links were necessary).
>
> The following patch implements `org-html-root', which allows to export
> file links as root-relative URL. I'm not sure the docstring is clear
> enough, tho.
>
> Also, HTML publishing process always bind the above to publishing
> directory, without user intervention.
>
> So, basically, upon exporting the following document to HTML:
>
>   #+html_link_root: /tmp/
>   [[/tmp/unicorn.jpg]]
>
> the link becomes
>
>   
>
>
> WDYT?
>
> Regards,


-- 
Tim Cross



Re: [O] [RFC] Shrink columns dynamically

2017-07-10 Thread Kaushal Modi
On Mon, Jul 10, 2017 at 10:44 AM Nicolas Goaziou 
wrote:

> Hello,
>
> Uwe Brauer  writes:
>
> > This is the patch I applied and tested? If so, I think it is a very good
> > thing and should be in master.
>
> This is the same patch, along with the complete removal of old column
> narrowing using width cookies.
>

The feature works nicely as explained, but please do not remove the width
cookie!

The new feature supports only completely hiding a column. But what we lose
by removal of width cookie is:

- Ability to truncate text in columns to a particular width (like 10) so
that I can at least know what the content of that cell is about. And then
to edit the cell, I would do C-c ` (org-table-edit-field). This is very
useful for cells with verbose texts. That way, I can fit all the columns in
a single screen width.
- Also heavily missed will be retaining the narrowed/hidden state of the
columns.
-- 

Kaushal Modi


Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Kaushal Modi
Hello,

On Mon, Jul 10, 2017 at 3:54 PM Kaushal Modi  wrote:

> Hi Nicolas,
>
> I tried out the patch, and my comments are in the MWE below.
>
> I have this MWE that explains the "would like to have" vs "what this patch
> gives us":
>
> =
> #+TITLE: ox-html root dir
> #+OPTIONS: toc:nil
> #+STARTUP: inlineimages
> #+HTML_LINK_ROOT: /tmp/site/static/
>
> An =image.png= exists as =/tmp/site/static/images/image.png=.
>
> * This is how the image links should have worked with the link root
> already specified
> [[/images/image.png]]
> - The =HTML_LINK_ROOT= should to appended to the front of the above link
> if that
>   concatenated path is a valid one.
> - Would also like =C-x C-o=, inline image display, etc. to work.
> - So a thought.. should the link root specification be made exporter
> agnostic?
>

To expand on my MWE:

I have this patch on top of Nicolas's patch:

=
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 9e710e3e0a..410bb42eec 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -3011,11 +3011,12 @@ INFO is a plist holding contextual information.  See
  ((file-name-absolute-p raw-path)
   (let ((root (plist-get info :html-link-root)))
  (setq raw-path
-  (if (and root (file-in-directory-p raw-path root))
-  (concat "/"
-  (file-relative-name
-   (expand-file-name raw-path)
-   root))
+  (if (and root
+   (file-exists-p
+ (concat (file-name-as-directory root)
+ (replace-regexp-in-string
+ "\\`/" "" raw-path
+  raw-path
  (org-export-file-uri raw-path)
  ((and home use-abs-url)
   (setq raw-path (expand-file-name raw-path home
 =

This adds the root and link instead of having the root be a subset of link
(hope that makes sense).

With that, here is the updated MEW:

=
#+TITLE: ox-html root dir
#+OPTIONS: toc:nil
#+STARTUP: inlineimages
#+HTML_LINK_ROOT: /tmp/site/static/

An =image.png= exists at =/tmp/site/static/images/image.png=.

* TODO [1/2] This is how the image links should have worked with the link
root already specified
[[/images/image.png]]
- [X] The =HTML_LINK_ROOT= should to appended to the front of the above
link if
  that concatenated path is a valid one.
- [ ] Would also like =C-x C-o=, inline image display, etc. to work.
  - So a thought.. should the link root specification be made exporter
  agnostic?
=
-- 

Kaushal Modi


Re: [O] [RFC] Shrink columns dynamically

2017-07-10 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> I just was faced with a table which just contained 3 columns but very
> many rows. In second column however was very wide, it contained titled
> of journals. So 'cutting' them to half was sufficient to identify them
> but allowed me to see the third column. So I say narrowing and hiding
> are two useful features. I would not say one can substitute the other.
> Hiding is useful if I have very many small columns but narrowing for
> very wide columns.
>
>
> So please do not remove narrowing.

There is much overlapping between the two features. I'd rather implement
so sort of narrowing using shrunk columns than have the two features in
the code base.

Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Shrink columns dynamically

2017-07-10 Thread Nick Dokos
Uwe Brauer  writes:

 "Nicolas" == Nicolas Goaziou  writes:
>
> > Hello,
> > Uwe Brauer  writes:
>
> >> This is the patch I applied and tested? If so, I think it is a very 
> good
> >> thing and should be in master.
>
> > This is the same patch, along with the complete removal of old column
> > narrowing using width cookies.
>
> Removing, oh oops
>
>
> I just was faced with a table which just contained 3 columns but very
> many rows. In second column however was very wide, it contained titled
> of journals. So 'cutting' them to half was sufficient to identify them
> but allowed me to see the third column. So I say narrowing and hiding
> are two useful features. I would not say one can substitute the other.
> Hiding is useful if I have very many small columns but narrowing for
> very wide columns.
>
>
> So please do not remove narrowing.
>
> Uwe Brauer 
>

I would agree with that: I haven't tried the patch and column hiding,
but I have used narrowing in the past, in exactly the context that Uwe
describes.

-- 
Nick




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

2017-07-10 Thread Samuel Wales
i am confused

org-agenda-current-time-string seems similar

org-agenda-time-grid says "The second item is a string which will be
placed behind the grid time."


On 7/6/17, Alex Branham  wrote:
> Hello,
>
> This small patch allows users to customize the string to display after the
> time in the agenda view.

-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Kaushal Modi
Hi Nicolas,

I tried out the patch, and my comments are in the MWE below.

On Mon, Jul 10, 2017 at 9:59 AM Brett Viren  wrote:

> Is this saying "subtract the value of 'html_link_root' from the Org link
> to make its URL"?
>
> If so, I think this would not be general enough to help some cases.  For
> example, with Nikola+orgmode and with Nikola's "pretty URLs" option the
> relative location between either the Org source or its generated HTML
> and an image that they both link will differ.
>

Good point. I overlooked that.

I have this MWE that explains the "would like to have" vs "what this patch
gives us":

=
#+TITLE: ox-html root dir
#+OPTIONS: toc:nil
#+STARTUP: inlineimages
#+HTML_LINK_ROOT: /tmp/site/static/

An =image.png= exists as =/tmp/site/static/images/image.png=.

* This is how the image links should have worked with the link root already
specified
[[/images/image.png]]
- The =HTML_LINK_ROOT= should to appended to the front of the above link if
that
  concatenated path is a valid one.
- Would also like =C-x C-o=, inline image display, etc. to work.
- So a thought.. should the link root specification be made exporter
agnostic?
* This works after adding support for =HTML_LINK_ROOT= ..
.. but
- The link path becomes too long.
- Need to hard-code the full path to the site/blog root directory before
each of
  such links.
[[file:/tmp/site/static/images/image.png]]
=



> Some details:
>
> Nikola source wants this layout:
>
>   /path/to/my/nikola/posts/my-blog-post.org
>   /path/to/my/nikola/images/unicorn.jpg
>
> The Org source generates to HTML which will be found at this URL path:
>
>   /mysiteroot/posts/my-blog-post/index.html
>

The organization for Hugo posts is something similar. So hopefully we can
have a solution that works for such blogging platforms in general.

In comparsion, the hugo paths would be:

  /path/to/my/hugo/content/posts/my-blog-post.org
  /path/to/my/hugo/static/images/unicorn.jpg

So, right now, either the Org link to the image must be written to be
> invalid (for Org):
>
>   [[../../images/unicorn.jpg]]
>

 Yeah, this is a problem and can probably be fixed if a support for
something like "#+LINK_ROOT" can be made in Org and not specific to an
exporter backend.

Or, some mechanism needs to turn the valid Org link:
>
>   [[../images/unicorn.jpg]]
>
> into either:
>
>   
>
> or:
>
>   
>
> I guess I could use html_link_root set to "/path/to/my/nikola" but then
> my Org source loses portability.
>
> I think better would be able to explicitly state the desired URL path
> for the HTML  like:
>
>   #+html_url_path: /mysiteroot/images/unicorn.jpg
>   [[../images/unicorn.jpg]]
>

As I mention in my MWE, I am actually looking for a solution so that we do
not need to specify the "mysiteroot" for each link.. may be just one as a
"#+LINK_ROOT".
-- 

Kaushal Modi


Re: [O] [RFC] Shrink columns dynamically

2017-07-10 Thread Uwe Brauer
>>> "Nicolas" == Nicolas Goaziou  writes:

> Hello,
> Uwe Brauer  writes:

>> This is the patch I applied and tested? If so, I think it is a very good
>> thing and should be in master.

> This is the same patch, along with the complete removal of old column
> narrowing using width cookies.

Removing, oh oops


I just was faced with a table which just contained 3 columns but very
many rows. In second column however was very wide, it contained titled
of journals. So 'cutting' them to half was sufficient to identify them
but allowed me to see the third column. So I say narrowing and hiding
are two useful features. I would not say one can substitute the other.
Hiding is useful if I have very many small columns but narrowing for
very wide columns.


So please do not remove narrowing.

Uwe Brauer 
> Regards,




Re: [O] template problem in latest master, but not in stable

2017-07-10 Thread Uwe Brauer
>>> "Nicolas" == Nicolas Goaziou  writes:

> Hello,
> Uwe Brauer  writes:

>> I am using the following template without problem in the latest stable
>> org version I just upgraded via the package system.
>> 
>> (setq org-capture-templates
>> '(
>> ("G" "Generic README.org file (table format)" table-line (file+headline 
(expand-file-name (read-file-name "Name of file (curr dir;table format)!: ")) 
"Overview")
>> "|%f| %U|%A|" :prepend t)
>> ("w" "Web site" entry
>> (file "")
>> "* %a :website:\n\n%U %?\n\n%:initial")
>> ))
>> 
>> However when I use the latest master from git I obtain an error I attach

> See ORG-NEWS, Incompatible changes.


Thanks

According to that file

: (file (sexp))

into

: (file (lambda () (sexp)))

So 
(setq org-capture-templates
  '(
("G" "Generic README.org file (table format)" table-line (file+headline (lambda 
() (expand-file-name (read-file-name "Name of file (curr dir;table format)!: 
"))) "Overview")
 "|%f| %U|%A|" :prepend t)))

Worked, thanks

Uwe 




Re: [O] org-plus-contrib, where is library-of-babel.org?

2017-07-10 Thread Thomas S. Dye
Aloha Rasmus,

Rasmus writes:
>
> It will be in the next release (in /emacs/etc/org/).  If there's a license
> issue it needs to be removed.
>
> http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/org

Good news.  Thanks!

All the best,
Tom

--
Thomas S. Dye
http://www.tsdye.com



Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Brett Viren
Hi Nicolas,

Nicolas Goaziou  writes:

> So, basically, upon exporting the following document to HTML:
>
>   #+html_link_root: /tmp/
>   [[/tmp/unicorn.jpg]]
>
> the link becomes
>
>   

Is this saying "subtract the value of 'html_link_root' from the Org link
to make its URL"?

If so, I think this would not be general enough to help some cases.  For
example, with Nikola+orgmode and with Nikola's "pretty URLs" option the
relative location between either the Org source or its generated HTML
and an image that they both link will differ.

Some details:

Nikola source wants this layout:

  /path/to/my/nikola/posts/my-blog-post.org
  /path/to/my/nikola/images/unicorn.jpg

The Org source generates to HTML which will be found at this URL path:

  /mysiteroot/posts/my-blog-post/index.html

So, right now, either the Org link to the image must be written to be
invalid (for Org):

  [[../../images/unicorn.jpg]]

Or, some mechanism needs to turn the valid Org link:

  [[../images/unicorn.jpg]]

into either:

  

or:

  

I guess I could use html_link_root set to "/path/to/my/nikola" but then
my Org source loses portability.

I think better would be able to explicitly state the desired URL path
for the HTML  like:

  #+html_url_path: /mysiteroot/images/unicorn.jpg
  [[../images/unicorn.jpg]]


-Brett.

PS: imo, in this example, I think the real solution is to make Nikola
allow for keeping org+img source together and to output org+img+html all
together in one web directory.


signature.asc
Description: PGP signature


Re: [O] [RFC] Shrink columns dynamically

2017-07-10 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> This is the patch I applied and tested? If so, I think it is a very good
> thing and should be in master.

This is the same patch, along with the complete removal of old column
narrowing using width cookies.

Regards,

-- 
Nicolas Goaziou



Re: [O] template problem in latest master, but not in stable

2017-07-10 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> I am using the following template without problem in the latest stable
> org version I just upgraded via the package system.
>
> (setq org-capture-templates
>   '(
>   ("G" "Generic README.org file (table format)" table-line (file+headline 
> (expand-file-name (read-file-name "Name of file (curr dir;table format)!: ")) 
> "Overview")
>"|%f| %U|%A|" :prepend t)
> ("w" "Web site" entry
>  (file "")
>  "* %a :website:\n\n%U %?\n\n%:initial")
>   ))
>
> However when I use the latest master from git I obtain an error I attach

See ORG-NEWS, Incompatible changes.

Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Shrink columns dynamically

2017-07-10 Thread Uwe Brauer
>>> "Nicolas" == Nicolas Goaziou  writes:

   > Hello,
   > I'd like to replace the visual effect of width cookies (not
   > interpretation by export back-ends) with a more dynamic one. To that
   > effect, I pushed a "hide-table-column" branch in the repository. 

This is the patch I applied and tested? If so, I think it is a very good
thing and should be in master.

Uwe Brauer 




[O] template problem in latest master, but not in stable

2017-07-10 Thread Uwe Brauer
Hi

I am using the following template without problem in the latest stable
org version I just upgraded via the package system.

(setq org-capture-templates
  '(
("G" "Generic README.org file (table format)" table-line (file+headline 
(expand-file-name (read-file-name "Name of file (curr dir;table format)!: ")) 
"Overview")
 "|%f| %U|%A|" :prepend t)
("w" "Web site" entry
 (file "")
 "* %a :website:\n\n%U %?\n\n%:initial")
))

However when I use the latest master from git I obtain an error I attach



Debugger entered--Lisp error: (error "Invalid file location: nil")
  signal(error ("Invalid file location: nil"))
  error("Invalid file location: %S" nil)
  org-capture-expand-file((expand-file-name (read-file-name "Name of file (curr 
dir;table format)!: ")))
  org-capture-target-buffer((expand-file-name (read-file-name "Name of file 
(curr dir;table format)!: ")))
  org-capture-set-target-location()
  org-capture(nil)
  funcall-interactively(org-capture nil)
  call-interactively(org-capture nil nil)
  command-execute(org-capture)


Re: [O] org-plus-contrib, where is library-of-babel.org?

2017-07-10 Thread Kyle Meyer
Hi Bastien,

Bastien Guerry  writes:

> Kyle Meyer  writes:

Note that that's not me writing any of that :)

 Apparently, library-of-babel.org is not distributed with the Org mode
 that ships with emacs.  Not sure why that is.  I'm guessing it's a
 license issue?
>>>
>>> It will be in the next release (in /emacs/etc/org/).  If there's a license
>>> issue it needs to be removed.
>
> The reason why this library-of-babel.org was not in Emacs is not
> because of its lack of license.  I guess it's because Carsten and
> Eric didn't think of it as something that should land in Emacs.
>
> Hence my will to clarify this by moving it to Worg, where it will
> be more easily accessed.

Sounds reasonable to me.  I don't have a good understanding of
library-of-babel.org and have never used it, though, so my opinion
shouldn't count for much either way.

Thanks.

-- 
Kyle



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

2017-07-10 Thread Nicolas Goaziou
Hello,

Alex Branham  writes:

> Sure, that's possible. Patch attached. 

Thank you.

> Note that this way, users who have set org-agenda-time-grid to a list
> with three elements will see a slightly different agenda now (the
> default ".." will get dropped).

I think this is acceptable if we properly announce it in ORG-NEWS.

> The order of the items in the list is also a bit weird --- they get
> displayed in the order 3, 4, 2. I've updated the docstring to try to
> make this a bit clearer.

True. While we're at making an incompatible change on the variable, do
you think it makes sense to change the order of the parameters?

If so, would you want to update your patch accordingly?

>
> From 12e5561b1df1d86a45e7c418dd7dd44763e52423 Mon Sep 17 00:00:00 2001
> From: Alex Branham 
> Date: Fri, 7 Jul 2017 10:29:28 +0200
> Subject: [PATCH] org-agenda.el: Allow users to customize string after
>  time-grid
>
> * org-agenda.el: Users may now customize the string to display after

You need to specify the variable being changed, i.e.,

  * lisp/org-agenda.el (org-agenda-time-grid): ...
  
Could you provide an ORG-NEWS entry, too?


Regards,

-- 
Nicolas Goaziou



Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> Can you please attach the patch?

Oops. Here it is.


Regards,

-- 
Nicolas Goaziou
>From 6eed5dcd4e585dd32e52571189cf395b1a532310 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Sun, 9 Jul 2017 12:40:49 +0200
Subject: [PATCH] ox-html: Implement root directory for absolute links

* lisp/ox-html.el (org-html-link-root): New variable.
(org-html-link): Use new variable.
(org-html-publish-to-html): Set root to base directory.
---
 lisp/ox-html.el | 42 +-
 1 file changed, 33 insertions(+), 9 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 2ceaf0722..edaec4df7 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -118,6 +118,7 @@
 (:keywords "KEYWORDS" nil nil space)
 (:html-html5-fancy nil "html5-fancy" org-html-html5-fancy)
 (:html-link-use-abs-url nil "html-link-use-abs-url" org-html-link-use-abs-url)
+(:html-link-root "HTML_LINK_ROOT" nil org-html-link-root)
 (:html-link-home "HTML_LINK_HOME" nil org-html-link-home)
 (:html-link-up "HTML_LINK_UP" nil org-html-link-up)
 (:html-mathjax "HTML_MATHJAX" nil "" space)
@@ -1403,6 +1404,18 @@ example."
   :package-version '(Org . "8.1")
   :type 'boolean)
 
+(defcustom org-html-link-root nil
+  "Directory considered as web root.
+When non-nil, all links to absolute file names belonging to this
+directory become root-relative URL.  Otherwise, such links keep
+the \"file:\" scheme."
+  :group 'org-export-html
+  :version "26.1"
+  :package-version '(Org . "9.1")
+  :type '(choice (const :tag "No root directory" nil)
+		 (directory :tag "Local web root"))
+  :safe #'string-or-null-p)
+
 (defcustom org-html-home/up-format
   "
   UP 
@@ -2993,12 +3006,19 @@ INFO is a plist holding contextual information.  See
 	(setq raw-path
 		  (funcall link-org-files-as-html-maybe raw-path info))
 	;; If file path is absolute, prepend it with protocol
-	;; component - "file://".
+	;; component - "file://" or make it a root-relative URL.
 	(cond
 	 ((file-name-absolute-p raw-path)
-	  (setq raw-path (org-export-file-uri raw-path)))
+	  (let ((root (plist-get info :html-link-root)))
+		(setq raw-path
+		  (if (and root (file-in-directory-p raw-path root))
+			  (concat "/"
+  (file-relative-name
+   (expand-file-name raw-path)
+   root))
+			(org-export-file-uri raw-path)
 	 ((and home use-abs-url)
-	  (setq raw-path (concat (file-name-as-directory home) raw-path
+	  (setq raw-path (expand-file-name raw-path home
 	;; Add search option, if any.  A search option can be
 	;; relative to a custom-id, a headline title, a name or
 	;; a target.
@@ -3762,18 +3782,22 @@ Return output file's name."
 
 ;;;###autoload
 (defun org-html-publish-to-html (plist filename pub-dir)
-  "Publish an org file to HTML.
+  "Publish an Org file to HTML.
 
 FILENAME is the filename of the Org file to be published.  PLIST
 is the property list for the given project.  PUB-DIR is the
 publishing directory.
 
 Return output file name."
-  (org-publish-org-to 'html filename
-		  (concat "." (or (plist-get plist :html-extension)
-  org-html-extension
-  "html"))
-		  plist pub-dir))
+  (org-publish-org-to
+   'html
+   filename
+   (concat "." (or (plist-get plist :html-extension)
+		   org-html-extension
+		   "html"))
+   (org-combine-plists `(:html-link-root ,(plist-get plist :base-directory))
+		   plist)
+   pub-dir))
 
 
 (provide 'ox-html)
-- 
2.13.2



Re: [O] why prepend "file://" to abs paths in html output?

2017-07-10 Thread Kaushal Modi
Hello,


On Sun, Jul 9, 2017, 6:45 AM Nicolas Goaziou  wrote:

>
> The following patch implements `org-html-root', which allows to export
> file links as root-relative URL.


Can you please attach the patch?

I'm

 not sure the docstring is clear
> enough, tho.
>

Also, HTML publishing process always bind the above to publishing
> directory, without user intervention.
>

Matt and I are working on an exporter backend for Hugo, ox-hugo. We are
exporting Org to a flavor of Markdown compatible with Hugo. The HTML
exporter has some contribution in this exporter.

If a link is "/foo/bar" in the Markdown file, Hugo assumes "foo" to be
present in the "static/" dir in the site root. So the Markdown link auto
expands to "example.org/static/foo/bar".

But if the link was "/foo/bar" in the Org file to begin, with it would
become "file:///foo/bar" in Markdown (as it is a derivation of ox-md).
Though, we got around that by overriding the org-md-link function in
ox-hugo.

The complication arose when we needed to support "#+ATTR_HTML: :class
something" above figure links. We then needed to let the html link exporter
take up the link translation job instead of having ox-hugo do that directly
(it is OK to have HTML snippets in Markdown). And thus this request.

So, basically, upon exporting the following document to HTML:
>
>   #+html_link_root: /tmp/
>   [[/tmp/unicorn.jpg]]
>
> the link becomes
>
>   
>

Based on the example, that patch might work!

=

Reply to an earlier email:

On Sat, Jul 8, 2017 at 3:14 PM Nicolas Goaziou 
wrote:

> Hello,
>
> Carsten Dominik  writes:
>
> > I think it can be useful to write file: in the org-mode file, to make a
> > clear distinction from internal links.  But once it is clear that
> something
> > is a link to a file, I guess you are right  that it might not be needed
> in
> > HTML.  We will see what breaks.
>
> Thinking about it, we should probably not remove the "file://" prefix.
>

It depends.. if people are using Org files exported as HTML to open
referenced files in their browser (though that would work only if they open
those HTML pages only on that machine). But at least in one browser
(Firefox), I noticed that the browser auto-added the "file://" prefix if
user tried to access "/static/images/unicorn.jpg" directly from the address
bar.

I cannot think of any situation where [[/absolute/path/to/file]] would
> match something like "", because "/"
> never matches web root directory.
>

As mentioned above, one example is Hugo, which auto-interprets the presence
of absolute links in the Markdown files (whether they are of Markdown or
HTML style).

Note that that "file:///static/images/unicorn.jpg" is not useful either,
> but at least it is logical.
>

 I can see the benefit if a browser does not support auto-detection of
local links. But if the patch works, all should be good :)

The only situation where we might do something is during publishing,
> when we know what web root directory – i.e., base directory – is. In
> that case, we could replace absolute file names starting with web root
> dir as root-relative URL.
>

In our case, we are delegating that step to Hugo. So Org does the job of
content translation from Org to Markdown (plus inline HTML code for
figures, etc) "as it is", and Hugo does the job of HTML, RSS, etc.
generation, content management (what goes in what directory), link
resolution, etc.

> --

Kaushal Modi


[O] [RFC] Shrink columns dynamically

2017-07-10 Thread Nicolas Goaziou
Hello,

Currently, the only way to shrink an Org table column is to use
a so-called width cookie (e.g., "" or "<10>") so that aligning
table forces the column to fit within the specified number of
characters. When the width is less than the number of characters in the
field, contents is hidden with "=>" string.

Besides, width cookies are interpreted by some export back-ends.

I think this situation is not good for two major reasons:
  - width cookies have two orthogonal uses,
  - hiding a column implies modifying the table.

I'd like to replace the visual effect of width cookies (not
interpretation by export back-ends) with a more dynamic one. To that
effect, I pushed a "hide-table-column" branch in the repository. 

There, the single user-facing function is
`org-table-toggle-column-visibility'. Its docstring is

  Shrink or expand current column in an Org table.

When optional argument ARG is a string, use it as white space
separated list of column ranges.  A column range can be one of
the following patterns:

  Ncolumn N only
  N-M  every column between N and M (both inclusive)
  N-   every column between N (inclusive) and the last column
  -M   every column between the first one and M (inclusive)
  -every column

When called with `\\[universal-argument]' prefix, ask for the \
range specification.

When called with `\\[universal-argument] \\[universal-argument]' \
prefix, expand all columns.

It allows to quickly shrink or expand one of more columns in a table,
e.g., "1 3-4 6-". A shrunk column is only 1 character wide, not counting
vertical bars:

  | 123 |=>   |…|

The character used for display (here "…"), is customizable with
`org-table-shrunk-column-display' variable.

A shrunk column expands whenever an interactive change happens in some
of its fields. Thus, re-calculating a table does not count.

Unlike to width cookies, no column is shrunk upon opening the buffer.
Due to its dynamic state, shrunk columns are not restored across
sessions either. I thought about "fixing" the first point with a new
STARTUP value that would shrink any column with a width cookie, but that
conflicts with the first motivation given earlier.

Feedback welcome. In particular, please test it and report if this is
a viable replacement for width cookies. Also, the
`org-table-toggle-column-visibility' function current misses a binding.
Suggestions welcome.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Adding a LAST_REPEAT property without logging

2017-07-10 Thread Nicolas Goaziou
Hello,

Luke  writes:

> I have a number of repeated tasks in my Org-mode file. As a general
> rule I don't require logging of TODO state changes (which I've
> disabled by setting org-log-repeat to nil).
>
> However, while I don't need the full history of TODO state changes, it
> would be useful for me to know the last time that a task was repeated.
> The LAST_REPEAT property is ideal for this, but when I disable logging
> this property is no longer added/updated for any repeated tasks.
>
> Is there an easy way to have the LAST_REPEAT property, but without
> a history of TODO state changes?

It is not possible anymore, since
12e73e58af9881faf5aba52db68798c16cff22c0 (Apr. 2010).

The commit message is

Only record LAST_REPEAT if it makes sense.

The definition of "makes sense is here:

- either the user is logging repeats (org-log-repeat)
- or the entry contains clock data, in which case the LAST_REPEAT is
  needed to display clocking time properly.

Request by Dan Griswold, with some support from Bernt Hansen


As your message suggets, we might extend the "makes sense" definition.
Maybe Carsten (Cc'ed) has an opinion about this old change.

Regards,

-- 
Nicolas Goaziou



Re: [O] Babel support for Vala

2017-07-10 Thread Nicolas Goaziou
Hello,

Christian Garbs  writes:

> I have written a minimal Babel mode supporting the Vala[1][2] language
> based on both ob-template.el and ob-C.el.
>
> I would like to contribute it to lisp/contrib if you deem it useful.

Thank you. 

Would you want to add it to Org core base? If so, you need to sign FSF
papers if you haven't. See 
for details.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: clocktable interprets tstart/tend incorrectly, maybe? [9.0.9 (9.0.9-636-gd39ccc-elpaplus @ /tmp/emacs/.emacs.d/elpa/org-plus-contrib-20170709/)]

2017-07-10 Thread Nicolas Goaziou
Hello,

Dale Sedivec  writes:

> Hi!  I think clocktables may be parsing time zones incorrectly in :tstart
> and :tend, leading to incorrect output.  Steps to reproduce:
>
> 1. Start a fresh Emacs within that same along the lines of:
>
> ~~
> mkdir /tmp/emacs
> TZ=America/Chicago HOME=/tmp/emacs /path/to/emacs
> ~~
>
> I *think* setting TZ to a non-UTC time zone is important to reproduce this.
>
> 2. Install latest org-mode from Git.  I did this via package-install-file
> on a package I built from a Git checkout of the org-mode repository.
>
> 3. Open an org-mode buffer, e.g. C-x C-f ~/test.org RET.
>
> 4. Insert:
>
> ~~
>
> #+BEGIN: clocktable :maxlevel 2 :scope file :step day :tstart "<2017-07-02
> Sun>" :tend "<2017-07-09 Sun>"
>
> #+END:
> ~~
>
> 5. Save the buffer.
>
> 6. Move point to the start of that dblock and C-c C-c to update it.
>
> Expected results: First step is "Daily report: [2017-07-02 Sun]" which
> matches the :tstart.
>
> Actual results: First step is "Daily report: [2017-07-01 Sat]", the day
> before the :tstart date.  The last step is also 2017-07-07, not 2017-07-08
> as I was expecting.
>
> I notice that as of 112c5ba479d, org-clocktable-steps parses :tstart and
> :tend with the ZONE argument to org-parse-time-string as T.  I think this
> is causing org-parse-time-string to parse these user-entered dates as UTC
> rather than the user's local time as I would have expected.  Changing
> org-clocktable-steps from doing (org-parse-time-string ts nil t)
> to (org-parse-time-string ts nil nil), and then the same for te as well,
> seems to fix this problem.

Fixed. Thank you for the report and the analysis.

Regards,

-- 
Nicolas Goaziou



Re: [O] Fixing mailto and irc links in ox-md.el

2017-07-10 Thread Nicolas Goaziou
Hello,

Jay Kamat  writes:

> Subject: [PATCH] ox-md.el: Fix export of irc and mailto links
>
> * lisp/ox-md.el (org-md-link): Add mailto and irc to links that pass
> their types through to markdown export
>
> See: https://github.com/larstvei/ox-gfm/issues/17  for an external
> bug report

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] org-plus-contrib, where is library-of-babel.org?

2017-07-10 Thread Bastien Guerry
Kyle Meyer  writes:

>>> Apparently, library-of-babel.org is not distributed with the Org mode
>>> that ships with emacs.  Not sure why that is.  I'm guessing it's a
>>> license issue?
>>
>> It will be in the next release (in /emacs/etc/org/).  If there's a license
>> issue it needs to be removed.

The reason why this library-of-babel.org was not in Emacs is not
because of its lack of license.  I guess it's because Carsten and
Eric didn't think of it as something that should land in Emacs.

Hence my will to clarify this by moving it to Worg, where it will
be more easily accessed.

-- 
 Bastien



Re: [O] org-plus-contrib, where is library-of-babel.org?

2017-07-10 Thread Bastien Guerry
Hi Kyle,

Kyle Meyer  writes:

> On the Emacs list, Glenn asked us to add a license to
> library-of-babel.org:
>
> https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00169.html

thanks for the heads up -- I'm focusing on my work this week and I
won't have time to deal with orgmode requests until this week-end,
but I will then.

> At the time, I wondered whether that file had any contributors without
> copyright assignment.  I briefly looked through the list of authors
> touching library-of-babel.org in the Org repo and the worg repo, and I
> didn't find any contributors that aren't included in the assignment list
> at http://orgmode.org/worg/org-contribute.html

Thanks for checking this.

In general, if some contributors are not listed on org-contribute.html
I can also check on the GNU server for the list of people with copyright
assignment.

I suggest using the same copyright conditions than the one we have for
Worg documentation:

  Documentation from the http://orgmode.org/worg/ website (either in
  its HTML format or in its Org format) is licensed under the GNU Free
  Documentation License version 1.3 or later.  The code examples and
  css stylesheets are licensed under the GNU General Public License v3
  or later.

But: I would first consider whether this file should be part of Emacs
and Org's core.  I think it should be on Worg instead, to get a chance
to be maintained by more contributors.

What do you think?

-- 
 Bastien



[O] Adding a LAST_REPEAT property without logging

2017-07-10 Thread Luke
I have a number of repeated tasks in my Org-mode file. As a general rule 
I don't require logging of TODO state changes (which I've disabled by 
setting org-log-repeat to nil).


However, while I don't need the full history of TODO state changes, it 
would be useful for me to know the last time that a task was repeated. 
The LAST_REPEAT property is ideal for this, but when I disable logging 
this property is no longer added/updated for any repeated tasks.


Is there an easy way to have the LAST_REPEAT property, but without a 
history of TODO state changes?


--
Luke