Re: [O] Feedback on changes to org-id

2016-09-22 Thread Rasmus
Adam Porter  writes:

> Aaron Ecay  writes:
>
>> The API has the following two functions already:
>> - org-id-find-file-for: id -> file-name
>> - org-id-find-id-in-file: id file -> position
>>
>> Imagine I add to this API org-id-find-marker: id -> marker.  Then I
>> think we can deprecate (and eventually delete) org-id-find, since all its
>> uses can be replaced by some combination of the other 3 functions.  (We
>> could also keep it as a convenience function wrapping the other 3, but
>> it hardly seems worth it: the marker case just adds the overhead of
>> another funcall, whereas a significant proportion of the non-marker
>> calls in the codebase actually only care about the file name, so it is a
>> waste of effort to calculate the buffer position only to throw it away.)
>
> Personally, I wish org-id-find would not be removed, because I use it in
> org-bookmark-heading, e.g.:
>
> https://github.com/alphapapa/org-bookmark-heading/blob/master/org-bookmark-heading.el#L126
>
> On the other hand, maybe this is a good time to see about getting
> org-bookmark-heading into org itself, in which case whoever changes the
> API would be responsible for updating it... ;)  WDYT?

I didn't try your package, but from the description it simply allows one
to use the standard Emacs bookmark system, correct?  (I’m surprised it
doesn’t work with org files out of the box).

Such a feature does belong in Org IMO so feel free to start a new thread.

Rasmus

-- 
Not everything that goes around comes back around, you know




Re: [O] apply attr_html to a whole figure?

2016-09-22 Thread Christian Moe

I don't think Org syntax provides any way to do this at present, but
ignore the rest of this message if anyone knows better.

Possible workarounds:

1. Wrap your figure in a #+BEGIN_ADDITIONALCLASS...#+END_ADDITIONALCLASS
block, to wrap the div.figure in a div.additionalclass. Not exactly what
you wanted, and a pain in the neck if you have many such figures, but
gives you enough to work with in CSS.

2. Add javascript to move the extra class attribute from the img to
the containing div. 

3. Write an export filter.

Yours,
Christian


Matt Price writes:

> When exporting images with captions, ox-html currently creates a strucuture 
> like this:
>
>
> 
>

alt="hlevel.png"> >

>

Figure 1: > "test"

>
> > (I've tried setting org-html-html5-fancy" to t, but for whatever > reason this doesn't result in the useo f the
tag. I tried > with emacs -q with no luck). > > I would like to be able to give an additional class to the enclosing
class="figure">. Any idea how i might be able to do that? As far > as I can see, org-html--wrap-image does not have access to the org link > element and so can't query for attributes. > > I really appreciate any ideas! Thanks, > Matt > >

Re: [O] [org-src, patch] colored source blocks

2016-09-22 Thread Rasmus
Hi Aaron,

Thanks for the feedback.

Aaron Ecay  writes:

> The patch in general LGTM.  One comment/question, though:
>
> 2016ko irailak 21an, Rasmus-ek idatzi zuen:
>
> [...]
>
>
>> +(defcustom org-src-block-faces nil
>> +  "Alist of faces to be used for source-block.
>> +Each element is a cell of the format
>> +
>> + (\"language\" FACE-OR-BACKGROUND)
>> +
>> +Where FACE-OR-BACKGROUND is either a face, an anonymous face, or
>> +a string corresponding to a background color.
>
> Why do you support a background color string here?

Over-engineering?

> I think that it’s easy to specify faces which consist of a background
> color only both in lisp [(:background "XXX") vs. "XXX"] and via the
> customize interface.  So this flexibility seems to just introduce
> additional complications for virtually no benefit in usability.  But
> maybe I’m missing something...?

The "only" reason was that I imagine that some might prefer not to get
into anonymous faces.  But then, there’s an example right there in the
docstring so maybe it’s assuming too little of our friends...

I’ll remove -OR-BACKGROUND and push.

Thanks,
Rasmus

-- 
This is the kind of tedious nonsense up with which I will not put




Re: [O] [patch] more Beamer properties

2016-09-22 Thread Rasmus
Nicolas Goaziou  writes:

>>> I think
>>>
>>>   #+TITLEGRAPHICS: [[file:link.pdf]]
>>>
>>> would be cleaner.
>>
>> I dropped this.  One might need to add attributes to the graphic.  The
>> #+titlegraphics approach wouldn’t allow it.
>
> Well, wouldn't the following work?
>
>   #+attr_beamer: :attribute1 value1 :attribute2 value2
>
>   #+TITLEGRAPHICS: [[file:link.pdf]]
>
>> +(:beamer-short-title "SHORT_TITLE" nil nil parse)
>> +(:beamer-short-subtitle "SHORT_SUBTITLE" nil nil parse)
>> +(:beamer-short-author "SHORT_AUTHOR" nil nil parse)
>> +(:beamer-short-date "SHORT_DATE" nil nil parse)
>> +(:beamer-institute "INSTITUTE" nil nil parse)
>> +(:beamer-short-institute "SHORT_INSTITUTE" nil nil parse)
>
> Per above, would the following be cleaner?
>
>   #+attr_beamer: :short shortdate
>
>   #+date: longdate
>
> Ditto for title, institute, author...

Looks good, but how do I get the element representation of a parsed
keyword in the :options-alist?

In the buffer, I can do

   (org-export-read-attribute :attr_beamer (org-element-at-point))

But this does not work with what is stored in the info list.

I’m probably missing something obvious here...

Thanks,
Rasmus

-- 
History is what should never happen again




Re: [O] Capture Bug?

2016-09-22 Thread Ian Barton
On Wed, Sep 21, 2016 at 10:51:46PM +0200, Nicolas Goaziou wrote:
> Hello,
>
> li...@wilkesley.net writes:
>
> > commit 5485170263a46fa17db67b0324c4c4e48bcdfe49
> > Author: Nicolas Goaziou 
> > Date:   Fri Jun 24 01:11:49 2016 +0200
> >
> > org-capture: Remove forbidden value type from "file" templates
> >
> Try wrapping `capture-pelican-draft-file' call within a function instead
> of putting a raw sexp.
>

I have tried:

("g"
   "New blog post (ianbarton.net)"
  plain
 (file (funcall(capture-pelican-draft-file
   "~/Documents/emacs/web_sites/ianbarton.net/org/_posts")))
  "#+AUTHOR: Ian Barton\n#+DATE: %u\n#+PROPERTY: MODIFIED:
   \n#+TITLE\n#+CATEGORY: Blog \n#+PROPERTY: TAGS \n#+PROPERTY:
   SUMMARY \n#+SETUPFILE: ../setup.org\n\n")

Not sure if that's what you meant. It didn't work.

--
Best wishes,

Ian.



Re: [O] apply attr_html to a whole figure?

2016-09-22 Thread Eric Abrahamsen
Matt Price  writes:

> When exporting images with captions, ox-html currently creates a
> strucuture like this:
>
> 
> 
> 
> Figure 1: "test"
> 
>
> (I've tried setting org-html-html5-fancy" to t, but for whatever
> reason this doesn't result in the useo f the  tag. I tried
> with emacs -q with no luck).

It looks like `org-html--wrap-image' should be responsible for using a
proper "figure" element, maybe try edebugging it and see what it's
doing? This may be obvious, but the document has to be exported as html5
before html5-fancy has any effect!

Eric




Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Colin Baxter
On Wed, Sep 21 2016, William Denton wrote:

> On 22 September 2016, Xi Shen wrote:
>
>> #+BEGIN_SRC sh :dir /sshx:openwrt:/mnt/sda1
>> ls -al
>> #+END_SRC
>
> Just use ssh, not sshx, and it should work.
>
> Bill

In babel it is now (shell . t). The form (sh . t) is depreciated as from
org-mode version 8.2.10 at least.

Best wishes.



Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Xi Shen
Hi,

I just tried with:

#+BEGIN_SRC shell :dir /ssh:openwrt:/mnt/sda1
ls -al
#+END_SRC

But still got the same error. I wonder on which end threw me this error.
Maybe it is because I am using Emacs on Windows, and some thing is missing?
Or maybe it is because the remote system is OpenWRT which has limited
function?


On Thu, Sep 22, 2016 at 4:57 PM Colin Baxter  wrote:

> On Wed, Sep 21 2016, William Denton wrote:
>
> > On 22 September 2016, Xi Shen wrote:
> >
> >> #+BEGIN_SRC sh :dir /sshx:openwrt:/mnt/sda1
> >> ls -al
> >> #+END_SRC
> >
> > Just use ssh, not sshx, and it should work.
> >
> > Bill
>
> In babel it is now (shell . t). The form (sh . t) is depreciated as from
> org-mode version 8.2.10 at least.
>
> Best wishes.
>
-- 


Thanks,
David S.


Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Xi Shen
Instead of using ssh, I tried with scp. This time I got a different error.

#+BEGIN_SRC shell :dir /scp:openwrt:/mnt/sda1
ls -al
#+END_SRC

The error, I think, is from the remote end.

/bin/sh: /bin/zsh: not found

Clearly, I am using zsh on my Windows, but my remote OpenWRT system only
has ash installed. Is there's way to specify the shell to use on the remote
end?


On Thu, Sep 22, 2016 at 8:15 PM Xi Shen  wrote:

> Hi,
>
> I just tried with:
>
> #+BEGIN_SRC shell :dir /ssh:openwrt:/mnt/sda1
> ls -al
> #+END_SRC
>
> But still got the same error. I wonder on which end threw me this error.
> Maybe it is because I am using Emacs on Windows, and some thing is missing?
> Or maybe it is because the remote system is OpenWRT which has limited
> function?
>
>
> On Thu, Sep 22, 2016 at 4:57 PM Colin Baxter  wrote:
>
>> On Wed, Sep 21 2016, William Denton wrote:
>>
>> > On 22 September 2016, Xi Shen wrote:
>> >
>> >> #+BEGIN_SRC sh :dir /sshx:openwrt:/mnt/sda1
>> >> ls -al
>> >> #+END_SRC
>> >
>> > Just use ssh, not sshx, and it should work.
>> >
>> > Bill
>>
>> In babel it is now (shell . t). The form (sh . t) is depreciated as from
>> org-mode version 8.2.10 at least.
>>
>> Best wishes.
>>
> --
>
>
> Thanks,
> David S.
>
-- 


Thanks,
David S.


Re: [O] [PATCH] custom port for postgresql

2016-09-22 Thread Jakob Lombacher
Hi Nicolas,

sure, here you go.

All the best

Jakob

2016-09-17 10:39 GMT+02:00 Nicolas Goaziou :

> Hello,
>
> Jakob Lombacher  writes:
>
> > I changed the dbport as optional argument and added the dbpassword option
> > as well.
>
> I applied your patch with the modifications below:
>
> - I added a proper commit message
>
> - I added TINYCHANGE cookie
>
> - I reordered dbport argument as in your initial patch. Although the
>   recommendation of making it optional makes sense, it breaks
>   consistency with other "dbstring" functions, and this is an internal
>   function anyway.
>
> Could you provide an entry for ORG-NEWS file?
>
> Thank you for the patch.
>
> Regards,
>
> --
> Nicolas Goaziou
>
From dd964b7af9ea082a5d8d71630565899dabf7a116 Mon Sep 17 00:00:00 2001
From: Jakob Lombacher 
Date: Thu, 22 Sep 2016 15:59:35 +0200
Subject: [PATCH] ORG-NEWS support of header argument for postgresql

---
 etc/ORG-NEWS | 5 +
 1 file changed, 5 insertions(+)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index eda018f..de99f7b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -317,6 +317,11 @@ Alice <-- Bob: another authentication Response
 Please note that *pdf* *does not work out of the box* and needss
 additional setup in addition to plantuml. See
 [[http://plantuml.com/pdf.html]] for details and setup information.
+ Improved support of header arguments for postgresql 
+ The postgresql engine in a sql code block supports now *:dbport*
+ and *:dbpassword* as header arguments.
+ 
+ 
 *** Rewrite of radio lists
 Radio lists, i.e, Org plain lists in foreign buffers, have been
 rewritten to be on par with Radio tables.  You can use a large set of
-- 
2.8.1



Re: [O] Feedback on changes to org-id

2016-09-22 Thread Adam Porter
Rasmus  writes:

> I didn't try your package, but from the description it simply allows one
> to use the standard Emacs bookmark system, correct?  (I’m surprised it
> doesn’t work with org files out of the box).

Yes, that's right.  I was surprised as well, that's why I did it.  :)

> Such a feature does belong in Org IMO so feel free to start a new
> thread.

Will do.




Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Nick Dokos
Xi Shen  writes:

> Instead of using ssh, I tried with scp. This time I got a different error.
>
> #+BEGIN_SRC shell :dir /scp:openwrt:/mnt/sda1
> ls -al
> #+END_SRC
>
Try opening the file in tramp directly - that should tell you where the error
lies: tramp or org?

> The error, I think, is from the remote end.
>
> /bin/sh: /bin/zsh: not found
>
> Clearly, I am using zsh on my Windows, but my remote OpenWRT system only has 
> ash installed. Is there's way to specify the shell to use on the remote end?
>

Even more: try ssh to your box from the command line. Once you figure out
how that works, then you can teach tramp to use that method.

> On Thu, Sep 22, 2016 at 8:15 PM Xi Shen  wrote:
>
> Hi,
>
> I just tried with:
>
> #+BEGIN_SRC shell :dir /ssh:openwrt:/mnt/sda1
> ls -al
> #+END_SRC
>
> But still got the same error. I wonder on which end threw me this error. 
> Maybe it is because I am using Emacs on Windows, and some thing is missing? 
> Or maybe it is because the remote
> system is OpenWRT which has limited function?
>
> On Thu, Sep 22, 2016 at 4:57 PM Colin Baxter  wrote:
>
> On Wed, Sep 21 2016, William Denton wrote:
>
> > On 22 September 2016, Xi Shen wrote:
> >
> >> #+BEGIN_SRC sh :dir /sshx:openwrt:/mnt/sda1
> >> ls -al
> >> #+END_SRC
> >
> > Just use ssh, not sshx, and it should work.
> >
> > Bill
>
> In babel it is now (shell . t). The form (sh . t) is depreciated as 
> from
> org-mode version 8.2.10 at least.
>
> Best wishes.
>
> --
>
> Thanks,
> David S.
>
> --
>
> Thanks,
> David S.
>

-- 
Nick




Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread David A. Gershman
I'm not familiar with remote execution like this, but are you specifying
/zsh/ on the Windows side or is it somehow inherently being assumed for
the remote?  A quick little hack to try may be to copy the /zsh/
executable on Windows to /ash/ and see if it fools the remote side.

On 09/22/2016 07:00 AM, Colin Baxter wrote:
> On Thu, Sep 22 2016, Xi Shen wrote:
>
>> Instead of using ssh, I tried with scp. This time I got a different error.
>>
>> #+BEGIN_SRC shell :dir /scp:openwrt:/mnt/sda1
>> ls -al
>> #+END_SRC
>>
>> The error, I think, is from the remote end.
>>
>> /bin/sh: /bin/zsh: not found
>>
>> Clearly, I am using zsh on my Windows, but my remote OpenWRT system only has 
>> ash installed. Is
>> there's way to specify the shell to use on the remote end?
>>
> I can't help you here. I've never used openwrt. All I can suggest is to
> search openwrt documentation or try with cgywin.
>
> Good luck.



[O] Add org-bookmark-heading to Org proper?

2016-09-22 Thread Adam Porter
As mentioned in <87oa3gs8tc@gmx.us>, some changes to the org-id
functions are being proposed.  My org-bookmark-heading package uses
org-id-find, so if that function changes or is removed, I'd have to
change the package for newer Org versions.

Given that, now might be a good time to consider merging the package
into Org proper.  It seems like something that should be in Org already,
being able to make Emacs bookmarks that point to Org headings.  It's
actually just three functions, so not much of a "package" really.

https://github.com/alphapapa/org-bookmark-heading

Thoughts?  :)




Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Nick Dokos
Colin Baxter  writes:


>> #+BEGIN_SRC shell :dir /scp:openwrt:/mnt/sda1
>> ls -al
>> #+END_SRC
>>
>> The error, I think, is from the remote end.
>>
>> /bin/sh: /bin/zsh: not found
>>
>> Clearly, I am using zsh on my Windows, but my remote OpenWRT system only has 
>> ash installed. Is
>> there's way to specify the shell to use on the remote end?
>>
>
> I can't help you here. I've never used openwrt. All I can suggest is to
> search openwrt documentation or try with cgywin.
>

IIUC, openwrt is the name of the remote node - nothing to do with OpenWrt 
(except of course, that
the remote node may be a router which has been flashed with OpenWrt, but that 
should make no
difference to ssh/tramp).

-- 
Nick




Re: [O] Add org-bookmark-heading to Org proper?

2016-09-22 Thread Xebar Saram
I *highly* support this. i use

org-bookmark-heading extensivly and its very much part of my base org mode
workflow

thx


best

Z

On Thu, Sep 22, 2016 at 5:33 PM, Adam Porter  wrote:

> As mentioned in <87oa3gs8tc@gmx.us>, some changes to the org-id
> functions are being proposed.  My org-bookmark-heading package uses
> org-id-find, so if that function changes or is removed, I'd have to
> change the package for newer Org versions.
>
> Given that, now might be a good time to consider merging the package
> into Org proper.  It seems like something that should be in Org already,
> being able to make Emacs bookmarks that point to Org headings.  It's
> actually just three functions, so not much of a "package" really.
>
> https://github.com/alphapapa/org-bookmark-heading
>
> Thoughts?  :)
>
>
>


Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Colin Baxter
On Thu, Sep 22 2016, Xi Shen wrote:

> Instead of using ssh, I tried with scp. This time I got a different error.
>
> #+BEGIN_SRC shell :dir /scp:openwrt:/mnt/sda1
> ls -al
> #+END_SRC
>
> The error, I think, is from the remote end.
>
> /bin/sh: /bin/zsh: not found
>
> Clearly, I am using zsh on my Windows, but my remote OpenWRT system only has 
> ash installed. Is
> there's way to specify the shell to use on the remote end?
>

I can't help you here. I've never used openwrt. All I can suggest is to
search openwrt documentation or try with cgywin.

Good luck.



Re: [O] Add org-bookmark-heading to Org proper?

2016-09-22 Thread Kaushal Modi
I have seen mailing list references like the one below a couple of times.
But they have never worked for me. Email clients in browser like
gmail/inbox treat them as email addresses. So when I click them, I get a
compose window with To: email set to "87oa3gs8tc@gmx.us". Do such links
work only in gnus and such? If so, it would be useful to have a generic
usual http format link.

Note that even
http://lists.gnu.org/archive/html/emacs-orgmode/2016-09/msg00359.html shows
that as:

> As mentioned in , some changes to the org-id



On Thu, Sep 22, 2016 at 11:08 AM Adam Porter  wrote:

> As mentioned in <87oa3gs8tc@gmx.us>,
>
-- 

Kaushal Modi


Re: [O] Babel Export - Getting asked for coding system

2016-09-22 Thread Aaron Ecay
Hi David,

The way you have this code set up, perl will print a string to its
stdout.  Emacs will read that string into a buffer, then write it to a
file.

It would be simpler to write the file directly from perl.  Note that
this will require specifying the file name twice (in the :file header
and in the perl code).  This is because ob-perl does not support the
:results graphics syntax (which could be classed as a wishlist-type
bug).

-- 
Aaron Ecay



Re: [O] Feedback on changes to org-id

2016-09-22 Thread Aaron Ecay
Hi Adam,

2016ko irailak 22an, Adam Porter-ek idatzi zuen:
> 
> Personally, I wish org-id-find would not be removed, because I use it in
> org-bookmark-heading, e.g.:

Any change to the API would leave in place a compatibility alias for a
significant period of time (at least one major version of Org), and
there would be deprecation warnings to encourage package authors to
switch to the new API.  So packages like yours would continue to work
without interruption, and they could eventually move to the new API at
the appropriate time (as judged by their authors).

-- 
Aaron Ecay



Re: [O] XML dump of org file?

2016-09-22 Thread Aaron Ecay
Hi Norman,

Have a look at the org-element library, which can produce an sexp
representation of the structure of an org document.  (In particular the
function ‘org-element-parse-buffer’).  You’ll need to convert the sexps
to XML, but that’s a comparatively minor task.

HTH,

-- 
Aaron Ecay



Re: [O] Add org-bookmark-heading to Org proper?

2016-09-22 Thread Aaron Ecay
Hi Adam,

The package looks useful, and we ought to have this functionality as
part of org.  The first question that arises is whether you have
completed the copyright assignment process described at
: an
assignment is necessary for any patches to org-mode core.

The assignment process takes some time, so (if the assignment is
something you want to do) you can go ahead and get started.  You only
have to go through the process once, and you’re covered for this and
all future contributions to org mode/emacs.

-- 
Aaron Ecay



Re: [O] Add org-bookmark-heading to Org proper?

2016-09-22 Thread Adam Porter
Aaron Ecay  writes:

> The first question that arises is whether you have
> completed the copyright assignment process described at
> : an
> assignment is necessary for any patches to org-mode core.

I was expecting that to be the next question.  ;)  I haven't done so
yet, but I'd be glad to.  I'll put it on my todo list and report back
when it's done.




Re: [O] Add org-bookmark-heading to Org proper?

2016-09-22 Thread Adam Porter
Kaushal Modi  writes:

> I have seen mailing list references like the one below a couple of
> times. But they have never worked for me. Email clients in browser
> like gmail/inbox treat them as email addresses. So when I click them,
> I get a compose window with To: email set to "87oa3gs8tc@gmx.us".
> Do such links work only in gnus and such? If so, it would be useful to
> have a generic usual http format link.
>
> Note that even
> http://lists.gnu.org/archive/html/emacs-orgmode/2016-09/msg00359.html
> shows that as:

Sorry about that.  I read the list with Gnus through Gmane, and I don't
know of a better way to do it, other than going to the list archive site
and digging up the URL, which seems like a lot of trouble...  ;) AFAIK
you can google the message-ID and get to the thread in question,
although it might be a few days before Google indexes it.
Alternatively, Gnus should be able to access it directly through Gmane
NNTP, and when the new Gmane web interface comes online, that should
work too.




Re: [O] Feedback on changes to org-id

2016-09-22 Thread Adam Porter
Aaron Ecay  writes:

> Any change to the API would leave in place a compatibility alias for a
> significant period of time (at least one major version of Org), and
> there would be deprecation warnings to encourage package authors to
> switch to the new API.  So packages like yours would continue to work
> without interruption, and they could eventually move to the new API at
> the appropriate time (as judged by their authors).

That's one of the reasons I appreciate Org so much (and the Emacs
community in general): stability.  I know that no one will yank the rug
out from under me like that.  :)  I'm not really so concerned about this
proposed change, it just seemed like a good time to mention it.

Just curious, by "major version of Org", do you mean the first digit,
e.g. 8.x.x->9.x.x, or the second digit, like 8.1->8.2?  I guess you mean
the first, semver-style, but Org's been around longer than that spec's
been a "spec", so I thought I'd ask to be sure.




Re: [O] Babel Export - Getting asked for coding system

2016-09-22 Thread David A. Gershman
Thank you for the explanation.  It turns out I did find a work-around which is 
exactly what you mentioned.  The only difference is instead of specifying the 
file name twice, I was able to get it only once and use the 'file' option to 
:results:

#+BEGIN_SRC perl :results output file :exports results :var fname=image.png
  use GD;
  my $image = build_pic();
  open( F, ">$fname" );
  binmode F
  print F $image;
  close( F );
  print $fname;
#+END_SRC

As you say, this uses Perl to output the file but with the 'file' option to 
":results", Org expects a filename as the output result, I only need specify 
the filename once, and Org will still create a link for the results section:

#+RESULTS:
[[file:image.png]]

Thanks again for your help and info!

--dag

On September 22, 2016 9:02:45 AM PDT, Aaron Ecay  wrote:
>Hi David,
>
>The way you have this code set up, perl will print a string to its
>stdout.  Emacs will read that string into a buffer, then write it to a
>file.
>
>It would be simpler to write the file directly from perl.  Note that
>this will require specifying the file name twice (in the :file header
>and in the perl code).  This is because ob-perl does not support the
>:results graphics syntax (which could be classed as a wishlist-type
>bug).

-- 
David A. Gershman, CISSP
dagersh...@dagertech.net



Re: [O] XML dump of org file?

2016-09-22 Thread Brett Viren
Aaron Ecay  writes:

> Have a look at the org-element library,

Just to add, there are circular dependencies in this data structure due
to ":parent" and potentially some of the ":structure" elements.  They
obviously need to be broken to avoid infinite loops.

Here my hackish attempt to deal with this in order to dump org-element
to JSON:

  https://github.com/brettviren/joyful-web/blob/master/joy/org2json.el

See org-json-straigten-tree for how I nullified these elements.

-Brett.


signature.asc
Description: PGP signature


Re: [O] Add org-bookmark-heading to Org proper?

2016-09-22 Thread Nicolas Goaziou
Hello,

> Given that, now might be a good time to consider merging the package
> into Org proper.  It seems like something that should be in Org already,
> being able to make Emacs bookmarks that point to Org headings.  It's
> actually just three functions, so not much of a "package" really.
>
> https://github.com/alphapapa/org-bookmark-heading
>
> Thoughts?  :)

I think Org could benefit from a shrunk version of this library, i.e.,
`org-bookmark-make-record' and `org-bookmark-jump'.

However I'm not convinced about `org-bookmark-jump-indirect' since this
variable complicates code and the same effect can be achieved easily
once the destination headline is reached.

Besides, the helm part doesn't really belong to Org. IIUC, it is not
even needed if we drop support for `org-bookmark-jump-indirect', as
suggested above.

A few suggestions, after a cursory look:

- please switch to lexical binding as all but one file in Org core,

- it is "Org mode", not "org-mode"

- `org-replace-links-in-string-with-desc' already exists, it is
  (mis)called `org-link-display-format'

- `assoc' -> `assq' when key is a symbol

- if you create a marker, unset it once useless

- first sentence in docstrings has to fit in the first line.


Thank you for your work.


Regards,

-- 
Nicolas Goaziou



Re: [O] Dynamic tangle target?

2016-09-22 Thread Grant Rettke
Most things that you can image are also listed here:

https://eschulte.github.io/org-scraps/

Awesome reading for Org-Mode Literate Programmers.
Sincerely,

Grant Rettke


On Wed, Sep 21, 2016 at 8:06 PM, Charles C. Berry  wrote:
> On Wed, 21 Sep 2016, Philip Hudson wrote:
>
>> AFAICT :tangle takes only "yes", "no", or a literal pathname.
>
>
> Stuff like
>
>:tangle (my-lisp-function arg1 arg2)
>
> will work.
>
>> How
>> might I dynamically generate a pathname for :tangle? I suppose what I
>> want is some kind of escape syntax for eval'ing a Lisp form, like
>> maybe:
>>
>>:tangle %(my-dynamic-filename-generator)
>
>
> Try this:
>
> #+BEGIN_SRC R :tangle (concat "my-" "file" ".R")
> abs <- def
> #+END_SRC
>
> just as an example.
>
> BTW, org-babel-view-src-block-info (C-c C-v C-i) will show you what header
> args evaluate as without the need to eval or tangle them.
>
> HTH,
>
> Chuck
>



Re: [O] working with tables can be quite painful...

2016-09-22 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> I cannot send the actual table I am working on as it relates to grades
> for students.  I will try to create a similar table with random
> entries.

You could also try the imperfect (make sure to eyeball the result):

  (defun scramble-contents ()
(interactive)
(let ((tree (org-element-parse-buffer)))
  (org-element-map tree '(code comment comment-block example-block 
fixed-width
   keyword link node-property plain-text 
verbatim)
(lambda (obj)
  (cl-case (org-element-type obj)
((code comment comment-block example-block fixed-width keyword
   node-property verbatim)
 (let ((value (org-element-property :value obj)))
   (org-element-put-property
obj :value (replace-regexp-in-string "[[:alnum:]]" "x" value
(link
 (unless (string= (org-element-property :type obj) "radio")
   (org-element-put-property obj :raw-link "http://orgmode.org";)))
(plain-text
 (org-element-set-element
  obj (replace-regexp-in-string "[[:alnum:]]" "x" obj)
nil nil nil t)
  (let ((buffer (get-buffer-create "*Scrambled text*")))
(with-current-buffer buffer
  (insert (org-element-interpret-data tree))
  (goto-char (point-min)))
(switch-to-buffer buffer

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Indicate what happens to CLOCK entries in cloned subtrees

2016-09-22 Thread Nicolas Goaziou
Hello,

Samuel Loury  writes:

> This is a very small documentation patch to explain to the user what
> will happen to the CLOCK entries of a cloned subtree.

Applied. Thank you.

Regards,
-- 
Nicolas Goaziou



Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Fabrice Popineau
My $0.02

As I'm using Emacs on Windows, with MSYS2+MingW64, I tried this.
There is a problem with using bash from a _native_ MingW64 Emacs:
bash is a MSYS2 app and Emacs is a MingW64 app.

>From emacs, I would have used the plink protocol, so that's what I did.
And I got this message in the *Org-Babel Error Output* buffer

/bin/sh: 1: C:/Local/Emacs/bin/cmdproxy.exe: not found

So I looked at ob-eval.el and the org-babel-eval function.
And there are at least 2 big problems.
1- when entering this function, the `command' parameter is
"C:/Local/Emacs/bin/cmdproxy.exe"
2 - the `shell-file-name' variable has the same value
So the following won't work for Windows :
;; Unfortunately, `executable-find' does not support file name
;; handlers.  Therefore, we could use it in the local case
;; only.
(shell-file-name
(cond ((and (not (file-remote-p default-directory))
(executable-find shell-file-name))
shell-file-name)
  ((file-executable-p
(concat (file-remote-p default-directory) shell-file-name))
shell-file-name)
  ("/bin/sh")))

BTW I don't see the point concatenating shell-file-name with
default-directory when the later is remote.
Do we expect to find the shell in the remote directory ?

Anyway, there is little chance this stuff will work under Windows with a
native Emacs.
If I find time, I may try to propose some fix.

Fabrice


2016-09-22 16:52 GMT+02:00 Nick Dokos :

> Colin Baxter  writes:
>
>
> >> #+BEGIN_SRC shell :dir /scp:openwrt:/mnt/sda1
> >> ls -al
> >> #+END_SRC
> >>
> >> The error, I think, is from the remote end.
> >>
> >> /bin/sh: /bin/zsh: not found
> >>
> >> Clearly, I am using zsh on my Windows, but my remote OpenWRT system
> only has ash installed. Is
> >> there's way to specify the shell to use on the remote end?
> >>
> >
> > I can't help you here. I've never used openwrt. All I can suggest is to
> > search openwrt documentation or try with cgywin.
> >
>
> IIUC, openwrt is the name of the remote node - nothing to do with OpenWrt
> (except of course, that
> the remote node may be a router which has been flashed with OpenWrt, but
> that should make no
> difference to ssh/tramp).
>
> --
> Nick
>
>
>


-- 
Fabrice Popineau
-
SUPELEC
Département Informatique
3, rue Joliot Curie
91192 Gif/Yvette Cedex
Tel direct : +33 (0) 169851950
Standard : +33 (0) 169851212
--


Re: [O] apply attr_html to a whole figure?

2016-09-22 Thread Matt Price
On Thu, Sep 22, 2016 at 3:09 AM, Christian Moe 
wrote:

>
> I don't think Org syntax provides any way to do this at present, but
> ignore the rest of this message if anyone knows better.
>
> Possible workarounds:
>
> 1. Wrap your figure in a #+BEGIN_ADDITIONALCLASS...#+END_ADDITIONALCLASS
> block, to wrap the div.figure in a div.additionalclass. Not exactly what
> you wanted, and a pain in the neck if you have many such figures, but
> gives you enough to work with in CSS.
>

This does it for me, and actually makes it easier to delimit css classes
appropriately, so it's great, thank you.

>
> 2. Add javascript to move the extra class attribute from the img to
> the containing div.
>

Yeah I thought about it but haven't gotten around to it.

>
> 3. Write an export filter.
>

THis feels like what I should learn to do, but, well, now that you've given
me a workaround it's hard to get up the motivation to learn...

Thank you!!


Re: [O] apply attr_html to a whole figure?

2016-09-22 Thread Matt Price
On Thu, Sep 22, 2016 at 5:50 AM, Eric Abrahamsen 
wrote:

> Matt Price  writes:
>
> > When exporting images with captions, ox-html currently creates a
> > strucuture like this:
> >
> > 
> > 
> > 
> > Figure 1: "test"
> > 
> >
> > (I've tried setting org-html-html5-fancy" to t, but for whatever
> > reason this doesn't result in the useo f the  tag. I tried
> > with emacs -q with no luck).
>
> It looks like `org-html--wrap-image' should be responsible for using a
> proper "figure" element, maybe try edebugging it and see what it's
> doing? This may be obvious, but the document has to be exported as html5
> before html5-fancy has any effect!
>

It should have been obvious, but it wasn't to me! setting org-html-doctype
to "html5" fixed the problem. Thank you!
Matt

>
> Eric
>
>
>


[O] Turn off #+BEGIN_EXAMPLE conversions?

2016-09-22 Thread David A. Gershman
Hello,

I have some text in an EXAMPLE block but on HTML export '<' and '>' are 
converted to their '&' equivalents.  Is there a way to turn this off on a 
per-instance basis?

For example, I have:

#+BEGIN_EXAMPLE
  T = X + Y1
#+END_EXAMPLE

and I'd like the '1' to be subscript.  But when I write:

#+BEGIN_EXAMPLE
  T = X + Y1
#+END_EXAMPLE

obviously the'<' and '>' are converted to < and >.  "Y_1" also won't 
work. 

Is there a way/option to disable this conversion for that specific block?  Ex:

#+BEGIN_EXAMPLE :nointerpolation
  T = X + Y1
#+END_EXAMPLE

This would let the browser apply the  even though it's in a  
block.

Thanks.
-- 
David A. Gershman, CISSP
dagersh...@dagertech.net



Re: [O] [PATCH] custom port for postgresql

2016-09-22 Thread Nicolas Goaziou
Hello,

Jakob Lombacher  writes:

> Hi Nicolas,
>
> sure, here you go.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Fix the call to `org-expiry-handler-function'

2016-09-22 Thread Nicolas Goaziou
Hello,

Samuel Loury  writes:

> `org-expiry-handler-function' is meant to be a variable containing the symbol 
> of
> a function to be called.
>
> Therefore, calling (funcall 'org-expiry-handler-function) results in a
> void function error while (funcall org-expiry-handler-function)
> correctly calls the contained function.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Feedback on changes to org-id

2016-09-22 Thread Nicolas Goaziou
Hello,

Aaron Ecay  writes:

> 2016ko irailak 3an, Nicolas Goaziou-ek idatzi zuen:
>
>> Please don't make that change. A marker is pointless if the file is not
>> currently associated to any buffer. In that case (file-name . postition)
>> cons cell is a valuable return value.
>
> The API has the following two functions already:
> - org-id-find-file-for: id -> file-name
> - org-id-find-id-in-file: id file -> position

I don't think these functions belong to the API. The seems more like
internal functions, implemented before the "--" convention.

> Imagine I add to this API org-id-find-marker: id -> marker. Then
> I think we can deprecate (and eventually delete) org-id-find, since
> all its uses can be replaced by some combination of the other
> 3 functions. (We could also keep it as a convenience function wrapping
> the other 3, but it hardly seems worth it: the marker case just adds
> the overhead of another funcall,

This complicates the API for no real benefit. We ought to consider
`org-id-find' as the sole entry point in "org-id.el". The rest is
implementation details.

More on this below.

> whereas a significant proportion of the non-marker calls in the
> codebase actually only care about the file name, so it is a waste of
> effort to calculate the buffer position only to throw it away.)

In the code base, notwithstanding contrib/ and "org-id.el" itself, there
are 4 calls to `org-id-find' without a marker. Half of them make use of
the position (in org-capture and org-colview.el). If we add
`org-id-find-id-in-file', there are two more calls. One of them actually
require the position anyway (in ob-ref). I don't think 3 calls out of
6 is significant.

If speed is an issue, we can add an optional argument to skip position
(and marker) in the return value. E.g.,

  (org-id-find ID &optional OUTPUT)

where OUTPUT is either

- nil : return value is the usual cons cell (file . position)
- file : return value is the file, as a string
- marker : return value is a marker.

Again, I don't think we need 3 functions just for this.

> I think this would imply writing the ID database to ‘org-id-locations-file’
> under certain circumstances without asking/letting the user approve this
> action.  Is that OK?  (I am not bothered by it, FWIW).
>
> If it’s not acceptable, perhaps this variable should be replaced by a
> new defcustom ‘org-id-write-database’ which would control only the
> writing of the DB to disk (but unlike the existing implementation would
> not turn off the ID tracking code paths within the emacs session).

IMO the former is acceptable. If it happens to disturb some users,
I guess we will fallback to the latter.

Regards,

-- 
Nicolas Goaziou



Re: [O] [patch] more Beamer properties

2016-09-22 Thread Nicolas Goaziou
Hello,

Rasmus  writes:

> Nicolas Goaziou  writes:

>> Per above, would the following be cleaner?
>>
>>   #+attr_beamer: :short shortdate
>>
>>   #+date: longdate
>>
>> Ditto for title, institute, author...

> Looks good, but how do I get the element representation of a parsed
> keyword in the :options-alist?
>
> In the buffer, I can do
>
>(org-export-read-attribute :attr_beamer (org-element-at-point))
>
> But this does not work with what is stored in the info list.

Good point. Let's forget about this suggestion. 

Feel free to push the last iteration of the patch. Please also add
documentation and an entry in ORG-NEWS.

Thank you.

Regards,

-- 
Nicolas Goaziou



[O] Bug with behavior of point in cycle commands?

2016-09-22 Thread Adam Porter
I came across this discussion today:

http://emacs.stackexchange.com/questions/27210/how-to-prevent-org-global-cycle-glitch

It seems like a bug to me, because the visual position of the point does
not match its actual position.  Shouldn't the cycle commands adjust the
point to match where it appears after cycling?




Re: [O] Add org-bookmark-heading to Org proper?

2016-09-22 Thread Adam Porter
Nicolas Goaziou  writes:

Hi Nicholas,

> I think Org could benefit from a shrunk version of this library, i.e.,
> `org-bookmark-make-record' and `org-bookmark-jump'.
>
> However I'm not convinced about `org-bookmark-jump-indirect' since this
> variable complicates code and the same effect can be achieved easily
> once the destination headline is reached.
>
> Besides, the helm part doesn't really belong to Org. IIUC, it is not
> even needed if we drop support for `org-bookmark-jump-indirect', as
> suggested above.

Yes, the Helm-related code would certainly be left out.  I could propose
a patch to Thierry or make it a separate package on MELPA.

The indirect feature could be left out as well, but I find it so useful
that I think it might be worth including so that users can try it.  It
really transforms the way I use Org, especially in combination with some
other functions I have that use indirect buffers when jumping to items
from the agenda.  It wouldn't need to be enabled by default, of course.
But it's not strictly necessary, so I won't fight you on that if you
want to leave it out.  ;)  

> A few suggestions, after a cursory look:
>
> - please switch to lexical binding as all but one file in Org core,
>
> - it is "Org mode", not "org-mode"
>
> - `org-replace-links-in-string-with-desc' already exists, it is
>   (mis)called `org-link-display-format'
>
> - `assoc' -> `assq' when key is a symbol
>
> - if you create a marker, unset it once useless
>
> - first sentence in docstrings has to fit in the first line.

Thanks for reading through the code and finding these.  I'll go through
them soon and prepare a patch (which I'll post after doing the copyright
assignment).

> Thank you for your work.

No, thank you!  :D




Re: [O] Turn off #+BEGIN_EXAMPLE conversions?

2016-09-22 Thread Eric S Fraga
On Thursday, 22 Sep 2016 at 21:56, David A. Gershman wrote:
> Is there a way/option to disable this conversion for that specific
> block?  Ex:
>
> #+BEGIN_EXAMPLE :nointerpolation
>   T = X + Y1
> #+END_EXAMPLE

Maybe you could write the HTML directly using
#+BEGIN_EXPORT HTML
...
#+END_EXPORT

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.2-164-g50a182