[O] Happily exporting LaTeX, now want to export to text and HTML, can't figure how to handle latex markup

2017-08-01 Thread Grant Rettke
Good morning,

I'm happily exporting an Org-Mode document to LaTeX using the nifty
`letterine' package. An example is attached. Writing using it has been
so fun that naturally now I want to export it both to text and HTML.
My source document looks like this for reference and all of this works
fine:

> start
#+TITLE: A Poem Title
#+AUTHOR:
#+DATE:
#+OPTIONS: num:nil
#+LATEX: \pagenumbering{gobble}

#+BEGIN_CENTER
@@latex:\lettrine[lines=1]{T}{this}@@ is line 1.

@@latex:\lettrine[lines=1]{H}{ere}@@ is line 2.

@@latex:\lettrine[lines=1]{O}{ver}@@ there is line 3.
#+END_CENTER
> end

Now I'm left be wondering how I can using a single document and export
it correctly to LaTeX, HTML and text. Here are some ideas I came up
with:

- Write the same line two times, one for each exporter. Redundant but
it would work.
- Use a source block that takes a line of text, checks the type of
exporter running, and returns an appropriate markup then on export it
works right.
- Maybe there is a macro for this?
- I'm out of ideas

My Internet search results found a lot of answers about easy stuff.
However this article

https://emacs.stackexchange.com/questions/18636/create-a-custom-block-in-org-mode-that-exports-to-latex-and-html

looked interesting. I haven't started coding anything up yet and I
wanted to talk to you before that.

Thank you.


poem.pdf
Description: Adobe PDF document


Re: [O] [PATCH] Support for 'using namespace *' in ob-C.el

2017-08-01 Thread Jay Kamat
Hi Nicolas,

Sorry for bumping this, but could you apply the patch I made to update
worg for documentation as well (or provide feedback)? I'd like that to
stay updated as well if possible.

If there's another mailing list for worg let me know and I'll post it there.

The patch is re-attached for convenience.

-Jay

On Tue, Aug 1, 2017 at 9:48 AM, Nicolas Goaziou  wrote:
> Hello,
>
> Jay Kamat  writes:
>
>> From 65c8add92842c2e547b13d5c6fb2485e7fdbf2db Mon Sep 17 00:00:00 2001
>> From: Jay Kamat 
>> Date: Mon, 31 Jul 2017 22:47:33 -0700
>> Subject: [PATCH] ORG-NEWS: Fix a small typo in new org babel header example
>>
>> * etc/ORG-NEWS (Using): Fix typo in babel :header-args: conversion
>>
>> TINYCHANGE
>
> Applied. Thank you.
>
> Regards,
> --
> Nicolas Goaziou


0001-Add-documentation-for-ob-C-namespaces.patch
Description: Binary data


Re: [O] Bug: emphasis crosses quotation marks [9.0.9 (release_9.0.9 @ /usr/new/share/emacs/26.0.50/lisp/org/)]

2017-08-01 Thread Mike Kupfer
Nicolas Goaziou wrote:

> Mike Kupfer  writes:

> > I would not expect emphasis to cross quotation marks.
> 
> This was done because it allows to write, e.g., ~C-x "~. See
> .
[...]
> I cannot see a generic solution that can satisfy everyone here.

Agreed.  I'll just turn off fontification.

regards,
mike



Re: [O] [PATCH] ob-vala.el: Add Vala support to Babel

2017-08-01 Thread Nicolas Goaziou
Hello,

Christian Garbs  writes:

> Hello and sorry for the wait!

No problem.

> Looking at the other defcustoms, is the current wording ok?

It is.

> Some of your proposed changes apply to ob-C.el as well.  I could
> prepare a different patch for that (under which topic?),

Depending on the size of the changes, it could be "Tiny changes", "Small
refactoring"...

> but I am not confident that I could test the changes appropriately.
> I don't have proper C/C++/D org files handy that would cover all cases
> (eg. header arguments).

ob-C.el has a couple of tests (BTW, would you want to write some for
"ob-vala.el"?).

> PS: My FSF paperwork is complete.

I overlooked this information. These are great news. I'll push your
patch once updated (see my other mail).

Could you provide an ORG-NEWS entry about the new file?

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.

2017-08-01 Thread Tim Cross

While I totally agree with your sentiments, I don't think we should
worry about how/what the browser renders. We should ensure valid HTML
and leave how this is interpreted/rendered to the browsers.

Alternative is we jump through lots of hoops trying to get something
which looks reasonable in all browsers and then find it all gets broken
after next browser version is released.

I do think the idea of clarifying and perhaps making suggestions in the
manual is a good approach - let the author have as much control as
possible.

Tim

Rasmus writes:

> Hi Kaushal,
>
> Kaushal Modi  writes:
>
>> Your patch to fix printing of h1 title when :with-title is nil looks good.
>>
>> More comments below.
>
> OK I’ll push it then. 
>
>> Here is my attempt to fix it (below is a whitespace ignored diff):
>
> Thanks for looking into this.  That hack really leaves the title on the
> tabs completely blank!  I’ve never seen anything like it.  It’s in line
> with other exporters, so on that front it’s fine.  I do wonder if it’s the
> right thing to do.  When the title is blank Firefox (and I assume other
> browsers) show the path.  With  it’s completely blank.
>
> I am fine with this approach, but I’m not particularly fond about how it
> looks in Firefox and Chromium...
>
>> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
>> index 43e4ef8d48..25a41e1dc4 100644
>> --- a/lisp/ox-html.el
>> +++ b/lisp/ox-html.el
>> @@ -1812,11 +1812,14 @@ INFO is a plist used as a communication channel."
>>  (defun org-html--build-meta-info (info)
>>"Return meta tags for exported document.
>>  INFO is a plist used as a communication channel."
>> -  (let ((protect-string
>> +  (let* ((protect-string
>>(lambda (str)
>>  (replace-regexp-in-string
>>   "\"" "" (org-html-encode-plain-text str
>>   (title (org-export-data (plist-get info :title) info))
>
> Perhaps this would be simpler?
>
> (or (org-string-nw-p (org-export-data (plist-get info :title) info)) 
> "")
>
>> Credit:
>> https://stackoverflow.com/questions/23556255/how-can-i-have-a-blank-title-page#comment67991763_23558385
>>
>> With above, a "blank" title will also result in a valid HTML, correct?
>
> It is indeed valid according to the validator.
>
> Thanks,
> Rasmus


-- 
Tim Cross



Re: [O] Worg -- search mailing list archives on gmane?

2017-08-01 Thread Colin Baxter
Dear Raymond,

> Raymond Zeitler  writes:

> When I visit the URL that you provided at dir.gmane.org, the page
> loads.  However, when I enter a search term in the textbox and
> press enter, I get the same result as before.  This is using
> Chrome.  Cyberfox says simply that it can't find the
> server. Perhaps Chrome is confusing an unresponsive server for a
> DNS failure.

> Thank you for responding.  Apologies for reverse message
> quoting...

> - Ray

> -Original Message- From: Emacs-orgmode
> [mailto:emacs-orgmode-bounces+zeitra=yahoo@gnu.org] On Behalf
> Of Colin Baxter Sent: Tuesday, August 01, 2017 11:24 AM To:
> Raymond Zeitler Cc: 'org-mode mailing list' Subject: Re: [O] Worg
> -- search mailing list archives on gmane?

I rather think it's the site and not your browser. When I enter a
search, I also get the same "can't find the server" error. I've tried
using eww, conkeror and firefox - all give the same error. Should have
tried it before sending you the URL! Umm, I don't really know what to
suggest next.

Best wishes,

Colin.

-- 
--
Colin Baxter
m43...@yandex.com
GnuPG fingerprint: 68A8 799C 0230 16E7 BF68  2A27 BBFA 2492 91F5 41C8



Re: [O] [PATCH v2] ob-vala.el: Add Vala support to Babel

2017-08-01 Thread Nicolas Goaziou
Hello,

Christian Garbs  writes:

> * ob-vala.el: Add support for the Vala language to Babel.
> ---
>  lisp/ob-vala.el | 122 
> 
>  1 file changed, 122 insertions(+)
>  create mode 100644 lisp/ob-vala.el
>
> diff --git a/lisp/ob-vala.el b/lisp/ob-vala.el
> new file mode 100644
> index 000..0375265
> --- /dev/null
> +++ b/lisp/ob-vala.el
> @@ -0,0 +1,122 @@
> +;;; ob-vala.el --- org-babel functions for Vala evaluation

Babel functions for Vala evaluation

Also, could you use lexical binding, i.e., add "-*- lexical-binding:
t; -*-" on the first line of the file and check byte-compilation doesn't
complain.

> +(defcustom org-babel-vala-compiler "valac"
> +  "Command used to compile a C source code file into an executable.
> +May be either a command in the path, like `valac'

like \"valac\"

> +or an absolute path name, like `/usr/local/bin/valac'.

an absolute file name, like \"/usr/local/bin/valac\".

> +Parameters may be used like this: `valac -v'"

like this: \"valac -c\""

> +  :group 'org-babel
> +  :version "24.3"
> +  :type 'string)

Some keywords are missing:

  :version "26.1"
  :package-version '(Org . "9.1")

Barring the suggestions above, your patch looks good. I think we can
apply it as soon as the FSF process is complete.

Thank you!

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.

2017-08-01 Thread Tim Cross

I think I agree. All HTML documents should have a title tag. Not all
HTML documents need a h1-title. I think the easy solution is to just
default to document name when no title is set and don't add a
h1-title. If a title block is set, then do as is now the case.

tim

Rasmus writes:

> Kaushal Modi  writes:
>
>> This patch fixes this:
>>
>> From e57e9e798dd1a54cae7a633fc67e2f825b967eea Mon Sep 17 00:00:00 2001
>> From: Kaushal Modi 
>> Date: Mon, 31 Jul 2017 14:30:40 -0400
>> Subject: [PATCH] Respect :with-title in ox-html
>>
>> * lisp/ox-html.el (org-html--build-meta-info): Do not insert 
>>   tag in HTML export if :with-title property is nil.  Example: by
>>   setting #+OPTIONS: title:nil
>>
>> Reported by: Ian 
>> ---
>>  lisp/ox-html.el | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
>> index aeb38ebc10..08381d0c19 100644
>> --- a/lisp/ox-html.el
>> +++ b/lisp/ox-html.el
>> @@ -1812,7 +1812,8 @@ INFO is a plist used as a communication channel."
>> viewport-options ", "))
>>info)
>>   "\n")))
>> - (format "%s\n" title)
>> + (when (plist-get info :with-title)
>> +   (format "%s\n" title))
>>   (org-html-close-tag "meta" "name=\"generator\" content=\"Org mode\""
>> info)
>>   "\n"
>>   (and (org-string-nw-p author)
>
> That is wrong IMO.  Title is mandatory in at least HTML{4,5}.
>
> https://www.w3schools.com/tags/tag_title.asp
>
> AFAIR Org already allows invalid HTML document to be produced when the
> TITLE is empty, as it’s translated into an empty quote.
>
> The right approach IMO is not printing the h1-title block, as in the
> attached patch.
>
> (In general generating the title block should be moved to something like
> ‘org-html-preamble-format’, though it probably shouldn’t depend on the
> language of the document...)
>
> Rasmus
>
> -- 
> Er du tosset for noge' lårt!
> From dace1586373df27863934675967eef8c56747a82 Mon Sep 17 00:00:00 2001
> From: Rasmus 
> Date: Tue, 1 Aug 2017 11:32:44 +0200
> Subject: [PATCH] ox-html: Respect the "title" option
>
> * lisp/ox-html.el (org-html-template): Respect :with-title.
>
> Reported-by: li...@wilkesley.net
> 
> ---
>  lisp/ox-html.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
> index 06dee3af6..43e4ef8d4 100644
> --- a/lisp/ox-html.el
> +++ b/lisp/ox-html.el
> @@ -2068,7 +2068,8 @@ holding export options."
>   (format "<%s id=\"%s\">\n" (nth 1 div) (nth 2 div)))
> ;; Document title.
> (when (plist-get info :with-title)
> - (let ((title (plist-get info :title))
> + (let ((title (and (plist-get info :with-title)
> +(plist-get info :title)))
>  (subtitle (plist-get info :subtitle))
>  (html5-fancy (org-html--html5-fancy-p info)))
> (when title


-- 
Tim Cross



Re: [O] [PATCH] ob-vala.el: Add Vala support to Babel

2017-08-01 Thread Christian Garbs
Hello and sorry for the wait!

On Sun, Jul 23, 2017 at 11:05:02AM +0200, Nicolas Goaziou wrote:
> Christian Garbs  writes:
> 
> > * ob-vala.el: Add support for the Vala language to Babel.

> > +(defvar org-babel-vala-compiler "valac"
> > +  "Command used to compile a Vala source code file into an
> > +executable.")
> 
> The first line of a docstring should be a full sentence.
> 
> Also, shouldn't this be a defcustom?

Yes, it should.

Looking at the other defcustoms, is the current wording ok?
Or should it still be full a sentence?

> > +(defun org-babel-vala-table-or-string (results)
> > +  "If the results look like a table, then convert them into an
> > +Emacs-lisp table, otherwise return the results as a string."
> > +  )
> 
> The body of the function is missing.

Not only is the body missing, the function is also not used at all, so
I have removed it altogether.  Same for org-babel-vala-var-to-vala.

> Could you send an updated patch?

Incoming :-)

Some of your proposed changes apply to ob-C.el as well.  I could
prepare a different patch for that (under which topic?), but I am not
confident that I could test the changes appropriately.  I don't have
proper C/C++/D org files handy that would cover all cases (eg. header
arguments).

Regards
Christian

PS: My FSF paperwork is complete.
-- 
Christian.Garbshttps://www.cgarbs.de

Wie packt man Styroporkügelchen ein, wenn man sie verschickt?



[O] [PATCH v2] ob-vala.el: Add Vala support to Babel

2017-08-01 Thread Christian Garbs
* ob-vala.el: Add support for the Vala language to Babel.
---
 lisp/ob-vala.el | 122 
 1 file changed, 122 insertions(+)
 create mode 100644 lisp/ob-vala.el

diff --git a/lisp/ob-vala.el b/lisp/ob-vala.el
new file mode 100644
index 000..0375265
--- /dev/null
+++ b/lisp/ob-vala.el
@@ -0,0 +1,122 @@
+;;; ob-vala.el --- org-babel functions for Vala evaluation
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Christian Garbs 
+;; Keywords: literate programming, reproducible research
+;; Homepage: http://orgmode.org
+
+;;; License:
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+;;; Commentary:
+
+;; ob-vala.el provides Babel support for the Vala language
+;; (see http://live.gnome.org/Vala for details)
+
+;;; Requirements:
+
+;; - Vala compiler binary (valac)
+;; - Vala development environment (Vala libraries etc.)
+;;
+;; vala-mode.el is nice to have for code formatting, but is not needed
+;; for ob-vala.el
+
+;;; Code:
+
+(require 'ob)
+
+(declare-function org-trim "org" (s  keep-lead))
+
+;; File extension.
+(add-to-list 'org-babel-tangle-lang-exts '("vala" . "vala"))
+
+;; Header arguments empty by default.
+(defvar org-babel-default-header-args:vala '())
+
+(defcustom org-babel-vala-compiler "valac"
+  "Command used to compile a C source code file into an executable.
+May be either a command in the path, like `valac'
+or an absolute path name, like `/usr/local/bin/valac'.
+Parameters may be used like this: `valac -v'"
+  :group 'org-babel
+  :version "24.3"
+  :type 'string)
+
+(defun org-babel-expand-body:vala (body params  processed-params)
+  "Expand BODY: does nothing, returns original BODY while ignoring PARAMS."
+  body ;; TODO: expand params?
+  )
+
+;; This is the main function which is called to evaluate a code
+;; block.
+;;
+;; - run Vala compiler and create a binary in a temporary file
+;;   - compiler/linker flags can be set via :flags header argument
+;; - if compilation succeeded, run the binary
+;;   - commandline parameters to the binary can be set via :cmdline
+;; header argument
+;;   - stdout will be parsed as RESULT (control via :result-params
+;; header argument)
+;;
+;; There is no session support because Vala is a compiled language.
+;;
+;; This function is heavily based on ob-C.el
+(defun org-babel-execute:vala (body params)
+  "Execute a block of Vala code with Babel.
+This function is called by `org-babel-execute-src-block'."
+  (message "executing Vala source code block")
+  (let* ((tmp-src-file (org-babel-temp-file
+   "vala-src-"
+   ".vala"))
+ (tmp-bin-file (org-babel-temp-file "vala-bin-" org-babel-exeext))
+ (cmdline (cdr (assq :cmdline params)))
+ (flags (cdr (assq :flags params)))
+ (full-body (org-babel-expand-body:vala body params))
+ (compile
+ (progn
+   (with-temp-file tmp-src-file (insert full-body))
+   (org-babel-eval
+(format "%s %s -o %s %s"
+org-babel-vala-compiler
+(mapconcat #'identity
+   (if (listp flags) flags (list flags)) " ")
+(org-babel-process-file-name tmp-bin-file)
+(org-babel-process-file-name tmp-src-file)) ""
+(when (file-executable-p tmp-bin-file)
+   (let ((results
+  (org-trim
+   (org-babel-eval
+(concat tmp-bin-file (if cmdline (concat " " cmdline) "")) 
""
+ (org-babel-reassemble-table
+  (org-babel-result-cond (cdr (assq :result-params params))
+(org-babel-read results)
+(let ((tmp-file (org-babel-temp-file "vala-")))
+  (with-temp-file tmp-file (insert results))
+  (org-babel-import-elisp-from-file tmp-file)))
+  (org-babel-pick-name
+   (cdr (assq :colname-names params)) (cdr (assq :colnames params)))
+  (org-babel-pick-name
+   (cdr (assq :rowname-names params)) (cdr (assoc :rownames 
params
+
+(defun org-babel-prep-session:vala (session params)
+  "Prepare a session.
+This function does nothing as Vala is a compiled language with no
+support for sessions."
+  (error "Vala is a compiled language -- no support for sessions"))
+
+(provide 'ob-vala)
+
+;;; ob-vala.el 

Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.

2017-08-01 Thread Kaushal Modi
On Tue, Aug 1, 2017 at 4:48 PM Rasmus  wrote:

> Thanks for looking into this.  That hack really leaves the title on the
> tabs completely blank!


That was the idea.. If someone sets "#+TITLE:", they expect *no* title :)


> I’ve never seen anything like it.  It’s in line
> with other exporters, so on that front it’s fine.  I do wonder if it’s the
> right thing to do.  When the title is blank Firefox (and I assume other
> browsers) show the path.  With  it’s completely blank.
>

I liked seeing that was possible.


> Perhaps this would be simpler?
>
> (or (org-string-nw-p (org-export-data (plist-get info :title) info))
> "")
>

Of course. I thought I was missing out on something. Thanks.


>
> > Credit:
> >
> https://stackoverflow.com/questions/23556255/how-can-i-have-a-blank-title-page#comment67991763_23558385
> >
> > With above, a "blank" title will also result in a valid HTML, correct?
>
> It is indeed valid according to the validator.
>

Thanks for checking. The validator (the default one in org-html-postamble)
never worked for me, probably because of something being blocked at work..
I get this when I click the validator link:

=
Sorry! This document cannot be checked.
No Referer header found!

You have requested we check the referring page, but your browser did not
send the HTTP "Referer" header field. This can be for several reasons, but
most commonly it is because your browser does not know about this header,
has been configured not to send one, transferred the referring document
over a secure protocol such as https but is accessing the validator over
ordinary non-secure http, or is behind a proxy or firewall that strips it
out of the request before it reaches us.

This is not an error in the referring page!
=

Being able to set the title to blank is really cool. I have never needed to
do that. But if someone (OP? OP's list email bounces back, so assuming they
are subscribed to this ML) wants that, we now know how.
-- 

Kaushal Modi


Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.

2017-08-01 Thread Rasmus
Hi Kaushal,

Kaushal Modi  writes:

> Your patch to fix printing of h1 title when :with-title is nil looks good.
>
> More comments below.

OK I’ll push it then. 

> Here is my attempt to fix it (below is a whitespace ignored diff):

Thanks for looking into this.  That hack really leaves the title on the
tabs completely blank!  I’ve never seen anything like it.  It’s in line
with other exporters, so on that front it’s fine.  I do wonder if it’s the
right thing to do.  When the title is blank Firefox (and I assume other
browsers) show the path.  With  it’s completely blank.

I am fine with this approach, but I’m not particularly fond about how it
looks in Firefox and Chromium...

> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
> index 43e4ef8d48..25a41e1dc4 100644
> --- a/lisp/ox-html.el
> +++ b/lisp/ox-html.el
> @@ -1812,11 +1812,14 @@ INFO is a plist used as a communication channel."
>  (defun org-html--build-meta-info (info)
>"Return meta tags for exported document.
>  INFO is a plist used as a communication channel."
> -  (let ((protect-string
> +  (let* ((protect-string
>(lambda (str)
>  (replace-regexp-in-string
>   "\"" "" (org-html-encode-plain-text str
>   (title (org-export-data (plist-get info :title) info))

Perhaps this would be simpler?

(or (org-string-nw-p (org-export-data (plist-get info :title) info)) 
"")

> Credit:
> https://stackoverflow.com/questions/23556255/how-can-i-have-a-blank-title-page#comment67991763_23558385
>
> With above, a "blank" title will also result in a valid HTML, correct?

It is indeed valid according to the validator.

Thanks,
Rasmus


-- 
Summon the Mothership!



Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.

2017-08-01 Thread Kaushal Modi
Hi Rasmus,

Your patch to fix printing of h1 title when :with-title is nil looks good.

More comments below.

On Tue, Aug 1, 2017 at 7:18 AM Rasmus  wrote:

> Yes, but that’s a feature.  It’s how ox-{latex,odt} works as well (via
> hyperref).
>

OK, I agree that the title being made blank not be tied with `:with-title`.


> > So I was going to suggest to set title tag to empty string "" or
> something
> > generic like "HTML". I don't think I would use the title:nil option.
>
> You can do this by setting title to an empty quote and Org will export it,
> but you produce invalid HTML.  It’s actually a bug in ox-html IMO.
>

Here is my attempt to fix it (below is a whitespace ignored diff):

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 43e4ef8d48..25a41e1dc4 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -1812,11 +1812,14 @@ INFO is a plist used as a communication channel."
 (defun org-html--build-meta-info (info)
   "Return meta tags for exported document.
 INFO is a plist used as a communication channel."
-  (let ((protect-string
+  (let* ((protect-string
   (lambda (str)
 (replace-regexp-in-string
  "\"" "" (org-html-encode-plain-text str
  (title (org-export-data (plist-get info :title) info))
+ ;; Set title to an invisible character instead of leaving it
+ ;; empty, which is invalid.
+ (title (if (org-string-nw-p title) title ""))
  (author (and (plist-get info :with-author)
   (let ((auth (plist-get info :author)))
  (and auth

Credit:
https://stackoverflow.com/questions/23556255/how-can-i-have-a-blank-title-page#comment67991763_23558385

With above, a "blank" title will also result in a valid HTML, correct?


-- 

Kaushal Modi


Re: [O] Bug: Blank line when logging state changes [9.0.9 (9.0.9-692-gfbf31d.dirty-elpaplus @ /tmp/emacs/.emacs.d/elpa/org-plus-contrib-20170801/)]

2017-08-01 Thread Nicolas Goaziou
Hello,

Dale Sedivec  writes:

> I think a recent change to org-split-string in master may have made logging
> of state changes a little uglier, adding "\\" and an empty line with
> trailing whitespace.  Steps to reproduce:
>

[...]

> IMHO the new behavior of org-split-string actually seems correct to me
> (splitting a string should arguably never result in nil), so I've fixed
> this by patching org-store-log-note as demonstrated in the attached
> patch.

I agree the current behaviour is correct, since `org-split-string' does
not trim null strings. I applied a patch morally equivalent to yours.

Thank you for the report and the analysis.


Regards,

-- 
Nicolas Goaziou



Re: [O] Worg -- search mailing list archives on gmane?

2017-08-01 Thread Nick Dokos
"Raymond Zeitler"  writes:

> When attempting to use the mailing list search tool on Worg, the web browser 
> says:
>
> "search.gmane.org’s server DNS address could not be found."
>
> Here's a link to the Worg page with the search button:
>
> http://orgmode.org/worg/org-mailing-list.html
>
>
Gmane went down last summer, changed hands and has not been
completely resurrected yet: the nntp portion works but the
search capability is not. See

   http://home.gmane.org/

Disappointingly, there has been no update since last September.

> Why does it search gmane and not the archives on list.gnu.org?
>

IME, searching list.gnu.org is an exercise in frustration. I think the
hope was that gmane search would be back shortly, but that
increasingly looks like a pipe dream.

FWIW: Although I read the mailing list through the gmane newsgroup, I
did not turn off the mailing list completely: I subscribe to the
digests which I save locally. That's what I use for searching.

-- 
Nick




Re: [O] Worg -- search mailing list archives on gmane?

2017-08-01 Thread Colin Baxter
> Raymond Zeitler  writes:

> When attempting to use the mailing list search tool on Worg, the
> web browser says: "search.gmane.org’s server DNS address could not
> be found."

Is http://dir.gmane.org/gmane.emacs.orgmode any good?

Best wishes

-- 
--
Colin Baxter
m43...@yandex.com
GnuPG fingerprint: 68A8 799C 0230 16E7 BF68  2A27 BBFA 2492 91F5 41C8



Re: [O] Worg -- search mailing list archives on gmane?

2017-08-01 Thread Raymond Zeitler
When I visit the URL that you provided at dir.gmane.org, the page loads.  
However, when I enter a search term in the textbox and press enter, I get the 
same result as before.  This is using Chrome.  Cyberfox says simply that it 
can't find the server. Perhaps Chrome is confusing an unresponsive server for a 
DNS failure.

Thank you for responding.  Apologies for reverse message quoting...

- Ray

-Original Message-
From: Emacs-orgmode [mailto:emacs-orgmode-bounces+zeitra=yahoo@gnu.org] On 
Behalf Of Colin Baxter
Sent: Tuesday, August 01, 2017 11:24 AM
To: Raymond Zeitler
Cc: 'org-mode mailing list'
Subject: Re: [O] Worg -- search mailing list archives on gmane?

> Raymond Zeitler  writes:

> When attempting to use the mailing list search tool on Worg, the
> web browser says: "search.gmane.org’s server DNS address could not
> be found."

Is http://dir.gmane.org/gmane.emacs.orgmode any good?

Best wishes

-- 
--
Colin Baxter
m43...@yandex.com
GnuPG fingerprint: 68A8 799C 0230 16E7 BF68  2A27 BBFA 2492 91F5 41C8




Re: [O] Bug: emphasis crosses quotation marks [9.0.9 (release_9.0.9 @ /usr/new/share/emacs/26.0.50/lisp/org/)]

2017-08-01 Thread Nicolas Goaziou
Hello,

Mike Kupfer  writes:

> In Emacs master ("GNU Emacs 26.0.50 (build 3, x86_64-pc-linux-gnu, X
> toolkit, Xaw scroll bars) of 2017-07-30", git changeset c8f44e4b; Org
> mode 9.0.9), I get strikeout text from "+" to "+" in
>
> "+" word "+"
>
> (I also see the strikeout with "emacs -Q".)
>
> In Emacs 25.2 (Org mode 8.2.10), that line does not get strikeout text.
>
> I would not expect emphasis to cross quotation marks.

This was done because it allows to write, e.g., ~C-x "~. See
.

> Please restore the (single and double) quotation marks that used to be
> in the "border" section of org-emphasis-regexp-components.  And perhaps
> the comma should be restored, too?

You could use \quot entity, e.g., "+\quot word \quot+".

I cannot see a generic solution that can satisfy everyone here.


Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Support for 'using namespace *' in ob-C.el

2017-08-01 Thread Nicolas Goaziou
Hello,

Jay Kamat  writes:

> From 65c8add92842c2e547b13d5c6fb2485e7fdbf2db Mon Sep 17 00:00:00 2001
> From: Jay Kamat 
> Date: Mon, 31 Jul 2017 22:47:33 -0700
> Subject: [PATCH] ORG-NEWS: Fix a small typo in new org babel header example
>
> * etc/ORG-NEWS (Using): Fix typo in babel :header-args: conversion
>
> TINYCHANGE

Applied. Thank you.

Regards,
-- 
Nicolas Goaziou



Re: [O] [PATCH] Support for 'using namespace *' in ob-C.el

2017-08-01 Thread Nicolas Goaziou
Jay Kamat  writes:

> Hi Chuck,
>
> Thanks for pointing that out, this all makes a lot more sense now.
> Prior to this patch ':includes' and ':defines' seem to work in the
> property list (as described in the old version of the org manual), so
> (I think) the updated version of this patch also removes those usages
> (for :defines, :includes), so you must use the new format described in
> the manual.
>
> Speaking of the manual, that entry managed to get me very confused at
> first, as it didn't seem to work for me, but then I realized that
> there is actually a typo in the NEWS entry, the second line should be:
>
> :header-args+: :var a=1 b=2
>
> I'm not sure what the policy is on changing old NEWS entries, but I've
> attached a small patch to fix the typo.
>
> Let me know if  you have any other feedback! :)
>
> -Jay
>
>
> On Mon, Jul 31, 2017 at 8:34 AM, Charles C. Berry  wrote:
>> On Mon, 31 Jul 2017, Jay Kamat wrote:
>>
>>> Hello!
>>>
>>> Sorry for the late reply, I was pretty busy last week. An updated
>>> patch is attached!
>>>
>>
>> [snip]
>>
>>>
 Using `org-entry-get' is no longer supported. You can replace the `or'
 with

   (cdr (assq :namespaces params))
>>>
>>>
>>> Done, I also replaced the other uses of 'org-entry-get' around the one
>>> I modified
>>>
>>
>> I don't think Nicolas meant that `org-entry-get' is no longer supported
>> literally. I think he was referring to using it to enable using Babel header
>> arguments as property names (as it did in your code). See:
>>
>> http://orgmode.org/Changes.html#org343de47
>>
>>
>> HTH,
>>
>> Chuck
>
>

-- 
Nicolas Goaziou



Re: [O] Help resolving CUSTOM_ID based links that point to outside current subtree scope

2017-08-01 Thread Nicolas Goaziou
Kaushal Modi  writes:

> Also, I am working on implementing this in an exporter backend. So what
> would be the canonical way to do that in ox-foo.el?

I think I would do something like this: in a parse tree filter, find
every custom ID link then expand current buffer, find real destination,
and replace the original ID link with an external link generated from
the aforementioned destination.

Regards,



[O] Bug: Blank line when logging state changes [9.0.9 (9.0.9-692-gfbf31d.dirty-elpaplus @ /tmp/emacs/.emacs.d/elpa/org-plus-contrib-20170801/)]

2017-08-01 Thread Dale Sedivec
Hi!

I think a recent change to org-split-string in master may have made logging
of state changes a little uglier, adding "\\" and an empty line with
trailing whitespace.  Steps to reproduce:

1. Start fresh Emacs with no local configuration (e.g. mkdir /tmp/emacs &&
HOME=/tmp/emacs emacs)

2. Install org-plus-contrib package dated 20170731

3. Create an org file with the following two lines:

~~
#+TODO: TODO(!) DONE(!)
* Test
~~

4. Move point to the beginning of the "* Test" headline and call org-todo
with C-c C-t to change it to a TODO item

Expected result:

~~
* TODO Test
  - State "TODO"   from  [2017-08-01 Tue 11:18]
~~

Actual result:

~~
* TODO Test
  - State "TODO"   from  [2017-08-01 Tue 11:18] \\

~~

Note the " \\" and blank line with trailing whitespace in the actual result.

I strongly suspect this is a result of a change in behavior of
org-split-string in f776e65373.  Before that commit, calling

(org-split-string "" "\n")

as org-store-log-note is doing returned nil.  After f776e65373 it returns
'("").

IMHO the new behavior of org-split-string actually seems correct to me
(splitting a string should arguably never result in nil), so I've fixed
this by patching org-store-log-note as demonstrated in the attached patch.

Regards,
Dale
--- org.el.orig 2017-08-01 10:58:56.0 -0500
+++ org.el  2017-08-01 11:26:12.0 -0500
@@ -13640,7 +13640,9 @@
   (setq txt (replace-match "" t t txt)))
 (when (string-match "\\s-+\\'" txt)
   (setq txt (replace-match "" t t txt)))
-(setq lines (org-split-string txt "\n"))
+(setq lines (if (zerop (length txt))
+   nil
+ (org-split-string txt "\n")))
 (when (org-string-nw-p note)
   (setq note
(org-replace-escapes


Re: [O] Donating money to mobile org.

2017-08-01 Thread Julien Cubizolles
Rasmus  writes:


> I am not sure Mobileorg for android is still developed.

According to
https://github.com/matburt/mobileorg-android/commit/646cec8c82c77b02134b0fc01407859e1d31fa7d,
it's not anymore.



Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.

2017-08-01 Thread Rasmus
Hi,

Kaushal Modi  writes:

> With the new patch, wouldn't the title, that was not intended to be shown,
> still show up in places like browser tabs and bookmarks? I have to yet try
> it.

Yes, but that’s a feature.  It’s how ox-{latex,odt} works as well (via
hyperref).

> So I was going to suggest to set title tag to empty string "" or something
> generic like "HTML". I don't think I would use the title:nil option.

You can do this by setting title to an empty quote and Org will export it,
but you produce invalid HTML.  It’s actually a bug in ox-html IMO.

> But if one needs to hide the title, I think it should not leak out of
> the Org document.

This is inconsistent compared to ox-odt and ox-latex cf. above.  While the
two are not entire consistent in general, they are consistent in keeping
the title as meta data, while not printing it.

> That would be fine if that prevents the title from showing up in browser
> tabs, etc.

It does not.  We could change the manual to be more clear about this (it
says title "toggle[s] inclusion of title").

Rasmus

-- 
History is what should never happen again



Re: [O] Help resolving CUSTOM_ID based links that point to outside current subtree scope

2017-08-01 Thread Kaushal Modi
On Tue, Aug 1, 2017, 4:26 AM Nicolas Goaziou  wrote:

>
> I guess you could write a function that changes custom ID links into
> external links prior to export, e.g., within
> `org-export-before-parsing-hook'.
>


If I understand correctly, it would mean replacing "[[#link]]" with
"[[./current-file.org::#link]]"? (I haven't yet verified if that
#+INCLUDE-like syntax works for links too.)

Also, I am working on implementing this in an exporter backend. So what
would be the canonical way to do that in ox-foo.el?

Thanks.

> --

Kaushal Modi


Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.

2017-08-01 Thread Kaushal Modi
On Tue, Aug 1, 2017, 5:52 AM Rasmus  wrote:

>
> That is wrong IMO.  Title is mandatory in at least HTML{4,5}.
>
> https://www.w3schools.com/tags/tag_title.asp


Thanks, I was not aware of that.

AFAIR Org already allows invalid HTML document to be produced when the
> TITLE is empty, as it’s translated into an empty quote.
>

With the new patch, wouldn't the title, that was not intended to be shown,
still show up in places like browser tabs and bookmarks? I have to yet try
it.

So I was going to suggest to set title tag to empty string "" or something
generic like "HTML". I don't think I would use the title:nil option. But if
one needs to hide the title, I think it should not leak out of the Org
document.

The right approach IMO is not printing the h1-title block, as in the

attached patch.
>

That would be fine if that prevents the title from showing up in browser
tabs, etc.

(In general generating the title block should be moved to something like
> ‘org-html-preamble-format’, though it probably shouldn’t depend on the
> language of the document...)
>
-- 

Kaushal Modi


Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.

2017-08-01 Thread Rasmus
Kaushal Modi  writes:

> This patch fixes this:
>
> From e57e9e798dd1a54cae7a633fc67e2f825b967eea Mon Sep 17 00:00:00 2001
> From: Kaushal Modi 
> Date: Mon, 31 Jul 2017 14:30:40 -0400
> Subject: [PATCH] Respect :with-title in ox-html
>
> * lisp/ox-html.el (org-html--build-meta-info): Do not insert 
>   tag in HTML export if :with-title property is nil.  Example: by
>   setting #+OPTIONS: title:nil
>
> Reported by: Ian 
> ---
>  lisp/ox-html.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
> index aeb38ebc10..08381d0c19 100644
> --- a/lisp/ox-html.el
> +++ b/lisp/ox-html.el
> @@ -1812,7 +1812,8 @@ INFO is a plist used as a communication channel."
> viewport-options ", "))
>info)
>   "\n")))
> - (format "%s\n" title)
> + (when (plist-get info :with-title)
> +   (format "%s\n" title))
>   (org-html-close-tag "meta" "name=\"generator\" content=\"Org mode\""
> info)
>   "\n"
>   (and (org-string-nw-p author)

That is wrong IMO.  Title is mandatory in at least HTML{4,5}.

https://www.w3schools.com/tags/tag_title.asp

AFAIR Org already allows invalid HTML document to be produced when the
TITLE is empty, as it’s translated into an empty quote.

The right approach IMO is not printing the h1-title block, as in the
attached patch.

(In general generating the title block should be moved to something like
‘org-html-preamble-format’, though it probably shouldn’t depend on the
language of the document...)

Rasmus

-- 
Er du tosset for noge' lårt!
>From dace1586373df27863934675967eef8c56747a82 Mon Sep 17 00:00:00 2001
From: Rasmus 
Date: Tue, 1 Aug 2017 11:32:44 +0200
Subject: [PATCH] ox-html: Respect the "title" option

* lisp/ox-html.el (org-html-template): Respect :with-title.

Reported-by: li...@wilkesley.net

---
 lisp/ox-html.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 06dee3af6..43e4ef8d4 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2068,7 +2068,8 @@ holding export options."
  (format "<%s id=\"%s\">\n" (nth 1 div) (nth 2 div)))
;; Document title.
(when (plist-get info :with-title)
- (let ((title (plist-get info :title))
+ (let ((title (and (plist-get info :with-title)
+		   (plist-get info :title)))
 	   (subtitle (plist-get info :subtitle))
 	   (html5-fancy (org-html--html5-fancy-p info)))
(when title
-- 
2.13.3



Re: [O] [PATCH] org-depend: multi-file TRIGGER and BLOCKER tasks

2017-08-01 Thread Nicolas Goaziou
Hello,

Adrian Bradd  writes:

> I have attached an amended version. Let me know if there are any other
> changes that need to be made.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou0x80A93738



Re: [O] Help resolving CUSTOM_ID based links that point to outside current subtree scope

2017-08-01 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> Ah! I made a typo in the example above; here's the corrected one:
>
> * Link source
> :PROPERTIES:
> :EXPORT_FILE_NAME: link-source
> :END:
> - Link to [[#link-dest][Link dest]]
> * Link dest
> :PROPERTIES:
> :EXPORT_FILE_NAME: link-dest
> :CUSTOM_ID: link-dest
> :END:
>
> ("Link source" and "Link dest" subtrees are at the same level. So exporting
> just "Link source" subtree does not 'see' the "Link dest" subtree.)

I guess you could write a function that changes custom ID links into
external links prior to export, e.g., within
`org-export-before-parsing-hook'.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Support for 'using namespace *' in ob-C.el

2017-08-01 Thread Nicolas Goaziou
Hello,

Jay Kamat  writes:

> Let me know if you spot anything fishy or wrong.

It's good, thank you. I applied your patch.
>
> Also, RE: Copyright, this is the form I need to send, correct?
> http://orgmode.org/request-assign-future.txt

It is. Please let me know when the process is done.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug? Setting #+OPTIONS: title:nil Seems to Be Ignored in HTML Export.

2017-08-01 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> From e57e9e798dd1a54cae7a633fc67e2f825b967eea Mon Sep 17 00:00:00 2001
> From: Kaushal Modi 
> Date: Mon, 31 Jul 2017 14:30:40 -0400
> Subject: [PATCH] Respect :with-title in ox-html
>
> * lisp/ox-html.el (org-html--build-meta-info): Do not insert 
>   tag in HTML export if :with-title property is nil.  Example: by
>   setting #+OPTIONS: title:nil

[...]

> + (when (plist-get info :with-title)
> +   (format "%s\n" title))

I would use `and' instead of `when' to stress the fact that we're
interested in the return value. Otherwise, LGTM.

Thank you.

-- 
Nicolas Goaziou



Re: [O] ANN: org-super-agenda

2017-08-01 Thread Adam Porter
FYI, I just pushed an update to org-super-agenda that lets you
automatically sort agenda items into groups based on an "agenda-group"
Org property, which can be set for entire subtrees with inheritance
(which is enabled by default).  This makes configuration very easy, as
you only need one selector, like:

#+BEGIN_SRC elisp
(let ((org-super-agenda-groups '((:auto-groups t
  (org-agenda-list))
#+END_SRC

I should be able to do something similar for categories, which would
provide another way to easily sort automatically.

Everything still seems to be working, but please let me know if you find
any bugs.  Thanks.