[O] [PATCH] Consistently use `org-mac-paste-applescript-links' in org-mac-links

2015-09-08 Thread Alan Schmitt
Hello,

The attached patch simplifies the code in org-mac-links to always use
`org-mac-paste-applescript-links' when parsing the results returned from
AppleScript. As a side effect, it gets rid of the bug where the link or
description would have an extra quote at the end.

I do not know how to write the changelog when the same change happens
over many different functions. Please tell me if I need to change the
commit message.

Alan

From 64385400360dea961cf8497db75738d583c177a8 Mon Sep 17 00:00:00 2001
From: Alan Schmitt 
Date: Tue, 8 Sep 2015 10:03:56 +0200
Subject: [PATCH] org-mac-link.el: Consistently use
 `org-mac-paste-applescript-links'

* contrib/lisp/org-mac-link.el (org-mac-firefox-get-frontmost-url):
Replace the handling of AppleScript results code with
`org-mac-paste-applescript-links'.
(org-mac-vimperator-get-frontmost-url): Replace the handling of
AppleScript results code with `org-mac-paste-applescript-links'.
(org-mac-chrome-get-frontmost-url): Replace the handling of AppleScript
results code with `org-mac-paste-applescript-links'.
(org-mac-skim-get-page): Replace the handling of AppleScript results
code with `org-mac-paste-applescript-links'.
(org-mac-outlook-message-get-links): Replace the handling of AppleScript
results code with `org-mac-paste-applescript-links'.
(org-mac-devonthink-get-links): Replace the handling of AppleScript
results code with `org-mac-paste-applescript-links'.

This fixes some bugs where links would have a dangling quote at the end.
---
 contrib/lisp/org-mac-link.el | 93 
 1 file changed, 16 insertions(+), 77 deletions(-)

diff --git a/contrib/lisp/org-mac-link.el b/contrib/lisp/org-mac-link.el
index c991dfa..5e0f891 100644
--- a/contrib/lisp/org-mac-link.el
+++ b/contrib/lisp/org-mac-link.el
@@ -1,6 +1,6 @@
 ;;; org-mac-link.el --- Insert org-mode links to items selected in various Mac apps
 ;;
-;; Copyright (c) 2010-2014 Free Software Foundation, Inc.
+;; Copyright (c) 2010-2015 Free Software Foundation, Inc.
 ;;
 ;; Author: Anthony Lander 
 ;;  John Wiegley 
@@ -18,6 +18,10 @@
 ;; Author: Mike McLean 
 ;; Add support for Microsoft Outlook for Mac as Org mode links
 ;;
+;; Version: 1.3
+;; Author: Alan Schmitt 
+;; Consistently use `org-mac-paste-applescript-links'
+;; 
 ;; This file is not part of GNU Emacs.
 ;;
 ;; This program is free software; you can redistribute it and/or modify
@@ -299,15 +303,7 @@ The links are of the form ::split::."
 (defun org-mac-firefox-get-frontmost-url ()
   (interactive)
   (message "Applescript: Getting Firefox url...")
-  (let* ((url-and-title (org-as-mac-firefox-get-frontmost-url))
- (split-link (split-string url-and-title "::split::"))
- (URL (car split-link))
- (description (cadr split-link))
- (org-link))
-(when (not (string= URL ""))
-  (setq org-link (org-make-link-string URL description)))
-(kill-new org-link)
-org-link))
+  (org-mac-paste-applescript-links (org-as-mac-firefox-get-frontmost-url)))
 
 (defun org-mac-firefox-insert-frontmost-url ()
   (interactive)
@@ -345,15 +341,7 @@ The links are of the form ::split::."
 (defun org-mac-vimperator-get-frontmost-url ()
   (interactive)
   (message "Applescript: Getting Vimperator url...")
-  (let* ((url-and-title (org-as-mac-vimperator-get-frontmost-url))
- (split-link (split-string url-and-title "::split::"))
- (URL (car split-link))
- (description (cadr split-link))
- (org-link))
-(when (not (string= URL ""))
-  (setq org-link (org-make-link-string URL description)))
-(kill-new org-link)
-org-link))
+  (org-mac-paste-applescript-links (org-as-mac-vimperator-get-frontmost-url)))
 
 (defun org-mac-vimperator-insert-frontmost-url ()
   (interactive)
@@ -383,15 +371,7 @@ The links are of the form ::split::."
 (defun org-mac-chrome-get-frontmost-url ()
   (interactive)
   (message "Applescript: Getting Chrome url...")
-  (let* ((url-and-title (org-as-mac-chrome-get-frontmost-url))
- (split-link (split-string url-and-title "::split::"))
- (URL (car split-link))
- (description (cadr split-link))
- (org-link))
-(when (not (string= URL ""))
-  (setq org-link (org-make-link-string URL description)))
-(kill-new org-link)
-org-link))
+  (org-mac-paste-applescript-links (org-as-mac-chrome-get-frontmost-url)))
 
 (defun org-mac-chrome-insert-frontmost-url ()
   (interactive)
@@ -557,15 +537,7 @@ The links are of the form ::split::."
 (defun org-mac-skim-get-page ()
   (interactive)
   (message "Applescript: Getting Skim page link...")
-  (let* ((link-and-descr (as-get-skim-page-link))
- (split-link (split-string link-and-descr "::split::"))
- (link (car split-link))
- (description (cadr split-link))
- (org-link))
-(when (not (string= 

Re: [O] ob-csharp

2015-09-08 Thread thomas

Thanks for the quick replies.

I'd really like to contribute to core, if that's possible (practically, 
I did nothing though; I just stripped Eric's ob-java and changed a few 
lines).


As Rüdiger pointed out csharp-mode is not part of Emacs.
But I'm not sure if csharp-mode is really necessary (besides syntax 
highlighting in the org buffer).


We might leave it out?


- thomas





On 08.09.2015 00:44, Rüdiger Sonderfeld wrote:

On Monday 07 September 2015 15:10:59 Grant Rettke wrote:

On Mon, Sep 7, 2015 at 2:28 PM, Thomas S. Dye  wrote:

It can live in core, contrib, or as an emacs package.

When it lives in core, it is available to everyone who downloads
Emacs. That is valuable because some users never install a single
package.

But it requires csharp-mode, which is not part of GNU Emacs.

Regards,

Rüdiger






Re: [O] Where to get started in creating my own org-mode exporter?

2015-09-08 Thread Marcin Borkowski

On 2015-09-08, at 07:54, edward sillador  wrote:

> Hello,
>
> I want to create my own org-mode exporter to support back end for latex
> pgfgantt package. Could someone please point me on a
> tutorial/reference on how to get started?

IIUC, you want to modify the LaTeX exporter.  Hence, you want a /derived
backend/.  See docstring for org-export-define-derived-backend, for
starters.  (If not, see the docstring for org-export-define-backend.)
Then you /might/ want to see the notes for my EmacsConf2015 talk on
making Org-mode exporters (from scratch, not derived ones, but most of
that stuff is really applicable to both) -- see
https://github.com/mbork/ox-oddmuse -- and especially the references
therein.  Then, you /might/ want to skim the sources in ox-latex.  (It's
not extremely long: 2071 SLOC excluding blank lines, comments and
docstrings.  I read most of that, and it took me a bit more than 7
hours.  Also, running some of those functions through Edebug may be
instructive.  And most probably you don't need to read all that code
anyway.)

And then, you may ask here.

> Thank you.

Hth,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



Re: [O] ob-csharp

2015-09-08 Thread thomas
well allright. I did some tests and think csharp-mode is not necessary. 
So I guess it would be OK to leave it out. Can anybody confirm?


- thomas


On 08.09.2015 09:36, thomas wrote:

Thanks for the quick replies.

I'd really like to contribute to core, if that's possible 
(practically, I did nothing though; I just stripped Eric's ob-java and 
changed a few lines).


As Rüdiger pointed out csharp-mode is not part of Emacs.
But I'm not sure if csharp-mode is really necessary (besides syntax 
highlighting in the org buffer).


We might leave it out?


- thomas





On 08.09.2015 00:44, Rüdiger Sonderfeld wrote:

On Monday 07 September 2015 15:10:59 Grant Rettke wrote:

On Mon, Sep 7, 2015 at 2:28 PM, Thomas S. Dye  wrote:

It can live in core, contrib, or as an emacs package.

When it lives in core, it is available to everyone who downloads
Emacs. That is valuable because some users never install a single
package.

But it requires csharp-mode, which is not part of GNU Emacs.

Regards,

Rüdiger









Re: [O] promote/demote indentation behaviour

2015-09-08 Thread Nicolas Goaziou
lipidic man  writes:

> That works.  It stops unindented paragraphs from being moved.  However
> under 8.2.10 the behaviour was to move indented text, but leave
> unindented text alone.

It was probably a bug then, since it was not following specifications.

> Any ideas on how to achieve this?

You could bring text at column 1 back to column 0 with a function added
to `org-after-promote-entry-hook'.

Regards,



Re: [O] outorg issue

2015-09-08 Thread Thorsten Jolitz
Kaushal  writes:

Hi all, Hi Bastien,


> I don't know the outshine and outorg code in and out. But I wouldn't
> mind keeping it maintained with the pull requests I get.
>
> That said, adding Thorsten Jolitz to this discussion.
> @Thorsten Would you mind making me (
> https://github.com/tj64/outshine/pull/46 ) a temporary maintainer of
> your outshine package on github. Or do you have anyone in mind you
> would take this up? Thanks.

sorry for being so late to the party, I didn't even notice the cc'd
messages, probably because I used to read this mailing list only via
gmane and filtered the posts from my mail inbox.

I feel bad anyway for the issues on github not taken care of, and while
I started to touch Emacs once in a while again, I'm afraid I won't be
much of a maintainer for these libraries in the future due to lack of
time and energy.
I used to simply apply patches untested on github, but that wasn't a
popular decision either.

So I'm very happy if somebody would like to take over (permanent)
maintainershisp. For me  outshine.el, outorg.el and navi-mode.el always
belonged together as the 'outshine suite', so to say, so I would prefer
to give them away as a bundle to a new maintainer (whoever that might
be, I'll leave that up to the Org Community and Maintainers).

I still find them quite usefull, I used them almost all the time when
programming or writing emails with emacs, and will do so in the future
whenever I touch Emacs.

So thanks in advance to the new maintainer, let me know (PM?) if I have
to do something in the course of changing maintainership

> I'd also like to second Bastien's suggestion, it would be
> excellent to
> see this useful extension maintained again.

1+

-- 
cheers,
Thorsten




Re: [O] org-collector unable to handle macros

2015-09-08 Thread Nicolas Goaziou
Mark Edgington  writes:

> Can you explain what you mean about using CUSTOM_ID in the context of
> org-collector?

:ID: is special property, which is usually set with `org-id-get-create'.
Creating it by any other mean can introduce error during export.

> Maybe I misunderstood something. Do you think the reason that a table
> can't be generated from my example code is that org-collector is
> somehow trying to expand the macros when the table is generated?

I didn't check org-collector library, so I don't know the problem and
didn't take time for serious debugging. I'm just trying to point out
what seems to be a mistake in your ECM.

Regards,



[O] Wanted: Clocking repord

2015-09-08 Thread Tobias Frischholz
Right now I’m tinkering with Clocking In and Clocking out - it is really great!

However, what I’m looking for is a PDF export that lets me share my reports 
with my supervisors.
The normal PDF export via LaTeX is good, but it shows too much information that 
they won’t understand.
Reducing the scope to the subtree is ok, but not optimal.

I’m looking for a way to narrow done my org file to only DONE items that also 
contain a clock report.
Is there a way?

Best regards,
Tobias Frischholz

PGP PUBLIC KEY: http://pgp.mit.edu/pks/lookup?search=0xCD463AC1=index



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [O] HTML export doesn't work when #+TITLE: is added

2015-09-08 Thread Lee Hinman

Hi Org-ML,

I'm trying to resolve an issue similar to the one here:
http://lists.gnu.org/archive/html/emacs-orgmode/2015-08/msg01195.html

Where I cannot export a file with a #+TITLE in it with the latest
org-mode release.

The solution that Kyle refers to[0] is to uninstall and then update
again with the latest org version. Can someone tell me how to do that? I
have tried running emacs with `emacs -q` and even then the older version
of org-mode installed in /usr/local/share/emacs/24.5/lisp/org is loaded
so it interferes.

Do I really need to uninstall emacs and then re-install it to be able to
use the newer org-mode version (8.3.1)? Is there not a way to override
the installed version of org-mode with a newer one from ELPA?

0: http://lists.gnu.org/archive/html/emacs-orgmode/2015-08/msg01196.html

-- 
;; Lee



Re: [O] [PATCH 2/3] org-datetree.el: Add support for ISO week trees.

2015-09-08 Thread Nicolas Goaziou
Hello,

Rüdiger Sonderfeld  writes:

> I don't think that's necessarily true since both formats don't mix well.  If 
> anyone still wants it then they can simply add both properties.

OK, then please document the property in the manual, and add an entry in
ORG-NEWS.

Otherwise, LGTM.


Regards,

-- 
Nicolas Goaziou



Re: [O] org-crypt: Secure encrypted message against inadvertent change

2015-09-08 Thread Hymie!
AW  t-online.de> writes:


> Dear John,
> 
> thank you. I simply changed "read_only" to "crypt" in the functions you 
> developed. This functions prevent a change of encrypted text, which I
think is 
> really an improvment.

This is awesome.  But I have a follow-up questions.

This function marks my buffer as "modified".  Is there any way to
automatically have the org-mark-readonly function turn off the modified flag?

This isn't a major problem, just a nicety.

--hymie!



> 
> (defun org-mark-readonly ()
>   (interactive)
>   (org-map-entries
>(lambda ()
>  (let* ((element (org-element-at-point))
> (begin (org-element-property :begin element))
> (end (org-element-property :end element)))
>(add-text-properties begin (- end 1) '(read-only t
>"crypt")
>  (message "Made readonly!"))

> 
> (add-hook 'org-mode-hook 'org-mark-readonly)





Re: [O] promote/demote indentation behaviour

2015-09-08 Thread Nicolas Goaziou
Hello,

lipidic man  writes:

> I have updated from org-mode 8.2.10 to 8.3.1 and the behaviour of 
>
> (org-do-promote), (org-do-demote), (org-promote-subtree), (org-demote-subtree)
>
> has changed.  It now indents an unindented paragraph when demoting the 
> headline.
> e.g.
> ** subsection
> There is a pre-defined list of commands, and you can add more such
> commands using the variable org-speed-commands-user
>
> This did not occur before and does not seem like desired behaviour.

According to `org-adapt-indentation' it is the desired behaviour. You
may want to set this variable to nil instead.


Regards,

-- 
Nicolas Goaziou



[O] [PATCH] Fix tangling in indirect buffers

2015-09-08 Thread Kyle Meyer
Rainer M Krug  writes:

> Kyle Meyer  writes:
>
>> Rainer M Krug  writes:
>>
>>> Hi
>>>
>>> it seems that tangling from an indirect buffer does not work. Is this by
>>> design or a bug?
>>
>> I don't think that's by design.
>>
>>> Would it be possible to make this possible?
>>
>> Does the below patch work for you?  If so, I can test it more thoroughly
>> and send a proper patch.
>
> Yes - works perfectly. I would really appreciate this. Please submit.

Patch against maint attached.

>From 57beac5636d8be61c0e778d8b3f6da9d6ad208a6 Mon Sep 17 00:00:00 2001
From: Kyle Meyer 
Date: Tue, 8 Sep 2015 23:48:44 -0400
Subject: [PATCH] Fix tangling in indirect buffers

* lisp/ob-tangle.el (org-babel-tangle-single-block): Get file name from
  base buffer.
(org-babel-tangle): Use file name from attribute list returned by
org-babel-tangle-single-block.

Reported-by: Rainer M Krug 

---
 lisp/ob-tangle.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index d20c2b3..cf48db3 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -242,7 +242,7 @@ (defun org-babel-tangle ( arg target-file lang)
 			 (base-name (cond
  ((string= "yes" tangle)
   (file-name-sans-extension
-   (buffer-file-name)))
+   (nth 1 spec)))
  ((string= "no" tangle) nil)
  ((> (length tangle) 0) tangle)))
 			 (file-name (when base-name
@@ -427,7 +427,7 @@ (defun org-babel-tangle-single-block
 	 (start-line
 	  (save-restriction (widen)
 			(+ 1 (line-number-at-pos (point)
-	 (file (buffer-file-name))
+	 (file (buffer-file-name (buffer-base-buffer)))
 	 (src-lang (nth 0 info))
 	 (params (nth 2 info))
 	 (extra (nth 3 info))
-- 
2.5.1


--
Kyle


Re: [O] Where to get started in creating my own org-mode exporter?

2015-09-08 Thread Nicolas Goaziou
Hello,

edward sillador  writes:

> I want to create my own org-mode exporter to support back end for latex
> pgfgantt package. Could someone please point me on a
> tutorial/reference on how to get started?

For a reference, see
.

Regards,

-- 
Nicolas Goaziou



Re: [O] ob-csharp

2015-09-08 Thread Nicolas Goaziou
Hello,

thomas  writes:

> I'd really like to contribute to core, if that's possible
> (practically, I did nothing though; I just stripped Eric's ob-java and
> changed a few lines).

Thank you for the library. You can contribute to core as long as you
have signed FSF papers.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Consistently use `org-mac-paste-applescript-links' in org-mac-links

2015-09-08 Thread Nicolas Goaziou
Hello,

Alan Schmitt  writes:

> I do not know how to write the changelog when the same change happens
> over many different functions. Please tell me if I need to change the
> commit message.

[...]

>
> * contrib/lisp/org-mac-link.el (org-mac-firefox-get-frontmost-url):
> Replace the handling of AppleScript results code with
> `org-mac-paste-applescript-links'.
> (org-mac-vimperator-get-frontmost-url): Replace the handling of
> AppleScript results code with `org-mac-paste-applescript-links'.
> (org-mac-chrome-get-frontmost-url): Replace the handling of AppleScript
> results code with `org-mac-paste-applescript-links'.
> (org-mac-skim-get-page): Replace the handling of AppleScript results
> code with `org-mac-paste-applescript-links'.
> (org-mac-outlook-message-get-links): Replace the handling of AppleScript
> results code with `org-mac-paste-applescript-links'.
> (org-mac-devonthink-get-links): Replace the handling of AppleScript
> results code with `org-mac-paste-applescript-links'.

IMO, it should be

* contrib/lisp/org-mac-link.el (org-mac-firefox-get-frontmost-url)
(org-mac-vimperator-get-frontmost-url)
(org-mac-chrome-get-frontmost-url)
...
(org-mac-devonthink-get-links): Replace the handling of AppleScript
results code with `org-mac-paste-applescript-links'.

Regards,

-- 
Nicolas Goaziou



Re: [O] Exporting multilingual documents (with Japanese) to PDF

2015-09-08 Thread Luis Felipe López Acevedo

On 2015-09-08 00:36, Robert Klein wrote:

Hi,

On Mon, 07 Sep 2015 19:18:02 -0500
Luis Felipe López Acevedo  wrote:


Hi,

I'm using Emacs 24.4.1 on Debian 8. I currently can export to PDF
documents that mix English and Spanish, but a simple document like
the following produces a PDF with no Japanese characters at all. Only
the English and Spanish text is visible.

 #+TITLE: Notes on Japanese
 #+DATE: 2015-09-07


 * 2015年9月7日

 - おはようございます!
 - Good morning!
 - ¡Buenos días!

The "Org PDF LaTeX Output" shows several errors like this one:

 ! Package inputenc Error: Unicode char \u8:年 not set up for use
with LaTeX.

The complete log:
https://bitbucket.org/sirgazil/dnd/downloads/nihongo.log

Searching for a solution on the Web I found this post
http://blogs.fsfe.org/ciaran/?p=150. When I use "pdflatex JIS.tex" as
indicated there, I get a good PDF with Japanese characters.

So I'm wondering how to get this working on Org mode...



like Thomas Dye showed in his mail, you have to encapsulate the
Japanese text in LaTeX with \begin{CJK} and \end{CJK}.

You can also use links or macros (using links).  An example (for
Chinese, but Japanese is basically the same, except the fonts):

Put the following in your .emacs:

#+begin_src elisp
  (org-add-link-type
   "zh" nil
   (lambda (path desc format)
 (cond
  ((eq format 'html)
   (format "%s" desc))
  ((eq format 'latex)
   (format "\\zh{%s}" desc)
#+end_src

Put the following in the head of your org file:

#+begin_src org
  #+LaTeX_HEADER: %% CJK stuff
  #+LaTeX_HEADER: \usepackage[encapsulated]{CJK}
  #+LaTeX_HEADER: \usepackage[CJK, overlap]{ruby}
  #+LaTeX_HEADER: \usepackage{pinyin}

  #+LaTeX_HEADER: \newcommand{\zh}[1]{\begin{CJK}{UTF8}{gkai}\Large
#1\end{CJK}} % gb2312 kai #+LaTeX_HEADER: \renewcommand{\rubysize}{0.5}

  #+LaTeX_HEADER: %% pinyin 1st and 3rd tone (shortened)
  #+LaTeX_HEADER: \usepackage{newunicodechar}
  #+LaTeX_HEADER: \newunicodechar{ǎ}{\v{a}}
  #+LaTeX_HEADER: \newunicodechar{ǐ}{\v{\i}}

  #+Macro: zh [[zh:][$1]]
#+end_src org


Then use CJK in your org file like this:

#+begin_src org
  Now you can user CJK characters like {{{zh(你好!)}}} (Nǐ hǎo) or
  [[zh:][你好!]].
#+end_src

Best regards
Robert


Hmm, that's kinda complex. I think I'll limit myself to HTML exports 
then.


Thomas, mahalo nui loa; Robert, thank you very much :)

--
Luis Felipe López Acevedo
http://sirgazil.bitbucket.org/



Re: [O] org-collector unable to handle macros

2015-09-08 Thread Mark Edgington
Nicolas Goaziou  nicolasgoaziou.fr> writes:

> 
> Mark Edgington  gmail.com> writes:
> 
> > On Aug 31, 2015 6:43 PM, "Nicolas Goaziou"  nicolasgoaziou.fr>
wrote:
> >>
> >> Hello,
> >>
> >> Mark Edgington  gmail.com> writes:
> >> >
> >> > Have you (or anyone else) been able to reproduce the problem given the
> >> > example which I provided?  Is this indeed a bug, or am I
> > misunderstanding
> >> > something?
> >>
> >>   :INCLASS:  ABC {{{c(stuff)}}} DEF
> >>
> >> looks incorrect. Macros are not expanded in node properties (with an
> >> exception for :EXPORT_SOMETHING: when #+SOMETHING is parsed).
> >
> > It is not intended to be expanded when generating the table, but the table
> > should have the macro in it, so that it gets expanded when the table is
> > exported.
> 
> OK. Then another problem:
> 
>   :ID: sched_table
> 
> ID properties are meant to be set with `org-id'. What about using
> CUSTOM_ID instead?

Hi Nicolas,

Can you explain what you mean about using CUSTOM_ID in the context of
org-collector?  Maybe I misunderstood something.  Do you think the reason
that a table can't be generated from my example code is that org-collector
is somehow trying to expand the macros when the table is generated?  I
assume that the correct behavior should be for it to *not* expand macros,
and just pass them through verbatim into the table-fields.

Regards,

Mark