Re: [PATCH] Add margin option to float for figure in ox-latex.el

2020-05-15 Thread Kyle Meyer
Pablo Palazon writes:

> I've created a path to add a new option to float properties for figures on
> latex. This is my first change for org-mode, and I don't really sure if
> this is the correct way to do it.

Thank you!

> * lisp/ox-latex.el (org-latex--inline-image): Include margin option
> to create marginfigure environment for figures. It's useful for tufte
> latex class, where with this environment shows the figure in the margin.

I wondered if something like this had been proposed or discussed before.
Searching the list, I see a patch [0] very similar to yours from a
couple of months back that didn't get a response (author added to cc).

Further back, there is a thread about an exporter Thomas Dye (+cc) wrote
to handle marginfigure and some other Tufte-y things [1].  It looks like
the code is available at ,
though I'm not sure if it still works with the current Org.

As for the proposed patch, while I think the specific code change itself
looks fine, skimming through the above thread makes me think that adding
marginfigure to ox-latex.el without considering similar cases may not be
the right approach.  What do others think?


[0]: https://yhetil.org/orgmode/35aac187-b751-5723-0f15-be6605fb8...@free.fr/
[1]: https://yhetil.org/orgmode/m2h9hsgdo2@tsdye.com/



Re: [Solved]: Bug: org-encrypt-entry fails [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)]

2020-05-15 Thread silipwn

Hello,

On 15.05.2020 21:17, Nicolas Goaziou wrote:

This is not a valid value: `org-crypt-key' must be a string.


On removing the variable, it works fine. The GPG configuration directly
takes my mail address to get the key. 
The other issue was I also had a revoked key with the same email, that

might have been causing an error, mentioned in the earlier mail.

Thanks for the help. 


--
Regards,
Silipwn



RE: Re: Suggestion: would like a customize setting to suppress multi-newline insertion on Alt+ENTER

2020-05-15 Thread tiburbage
Thx – that is what I was missing. I was looking at org-list-* variables, but can see this is more generalized in usage. From: Nicolas GoaziouSent: Friday, May 15, 2020 12:59 PMTo: tiburb...@gmail.comCc: Org-modeSubject: Re: Suggestion: would like a customize setting to suppress multi-newline insertion on Alt+ENTER Hello, "tiburb...@gmail.com"  writes: > When hitting Alt+ENTER at the end of a bullet list item, a new item is inserted below the current line. However, there is an evaluation of the line spacing below the list which can result in a “double spacing”> of list items, which I personally never want.> >  > > In org-list.el, the function org-list-separating-blank-lines-number appears to do the logic relating to this, it called from org-list-insert-item.> >  > > My suggestion is that a customize variable be exposed allowing the> user to decide whether to have this behavior or not. I think you are looking for `org-blank-before-new-entry'. Regards, -- Nicolas Goaziou 



Re: Bug - all org files open as if visibilty is set to "showeverything"

2020-05-15 Thread Nicolas Goaziou
Hello,

Charles Millar  writes:

> I recall seeing these messages, but did not realize that this change
> was going to effect all org files and by default, use lots and lots of
> space when an org file is opened.

That's true. On large files, this is not the best set-up. But I assume
anyone opening very large Org files is able to configure Org to their
liking.

On small files, e.g., a couple of screens high, this is a decent value,
however. But, more importantly, this is the least surprising value.

I think it is not uncommon for an Emacs user to open an Org file without
knowing about this major mode, e.g., if a project provides a README.org
file. This change is (mostly) for them, not for you, or me.

> As dar as I am concerned,the past default was OK and it took only
> a brief time to learn the past behavior and the visibility settings on
> a per file basis.
>
> I may be only a user but if I had I would have voted no.

You can voice your opinion in the thread, which is not closed. I hope
the Org community can find a consensus about this change.

Regards,

-- 
Nicolas Goaziou



Re: Suggestion: would like a customize setting to suppress multi-newline insertion on Alt+ENTER

2020-05-15 Thread Nicolas Goaziou
Hello,

"tiburb...@gmail.com"  writes:

> When hitting Alt+ENTER at the end of a bullet list item, a new item is 
> inserted below the current line. However, there is an evaluation of the line 
> spacing below the list which can result in a “double spacing”
> of list items, which I personally never want.
>
>  
>
> In org-list.el, the function org-list-separating-blank-lines-number appears 
> to do the logic relating to this, it called from org-list-insert-item.
>
>  
>
> My suggestion is that a customize variable be exposed allowing the
> user to decide whether to have this behavior or not.

I think you are looking for `org-blank-before-new-entry'.

Regards,

-- 
Nicolas Goaziou



Suggestion: would like a customize setting to suppress multi-newline insertion on Alt+ENTER

2020-05-15 Thread tiburb...@gmail.com
When hitting Alt+ENTER at the end of a bullet list item, a new item is inserted below the current line. However, there is an evaluation of the line spacing below the list which can result in a “double spacing” of list items, which I personally never want. In org-list.el, the function org-list-separating-blank-lines-number appears to do the logic relating to this, it called from org-list-insert-item. My suggestion is that a customize variable be exposed allowing the user to decide whether to have this behavior or not.



Re: Bug: org-encrypt-entry fails [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)]

2020-05-15 Thread Nicolas Goaziou
silipwn  writes:

> The current commit, still results in a error. I had a set the
> org-crypt-key to nil. 

This is not a valid value: `org-crypt-key' must be a string.

> It still prompts to use a key.

I think setting `org-crypt-key' to nil means: use all keys in your key
ring. Some of them are not trusted, others may be invalid. Again, use
default empty string if you don't want to set a key and would rather use
symmetric encryption.

> The current backtrace is similar to this:
>
> Debugger entered--Lisp error: (error "GPG error: \"Encrypt failed\",
> \"Unusable public key: 49F84EA6007F964D; Exit\"")
>   signal(error ("GPG error: \"Encrypt failed\", \"Unusable public key:
>   49F84EA6007F964D; Exit\""))
> error("GPG error: \"Encrypt failed\", \"Unusable public key:
> 49F84EA6007F964D; Exit\"")

You should check that key in your key ring. It probably has expired and
cannot be used for encryption.

Regards,



Re: [PATCH] Add margin option to float for figure in ox-latex.el

2020-05-15 Thread Pablo Palazon
Thanks eric, I've done the changes and I attach all the patches.

On Fri, May 15, 2020 at 2:21 PM Eric S Fraga  wrote:

> Just a minor point: in the patch for the documentation, change "imagen"
> to "image".
> --
> : Eric S Fraga via Emacs 28.0.50, Org release_9.3.6-631-g48b223
>
From 46a7fcecf5d2735f3f6f18481b302d4b4f887120 Mon Sep 17 00:00:00 2001
From: Pablo Palazon 
Date: Fri, 15 May 2020 18:25:21 +0200
Subject: [PATCH 3/3] org-manual.org: Fix type error

* doc/org-manual.org (Images in LaTeX export): Fix typo error on image
---
 doc/org-manual.org | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index e0c41f13e..b792f588a 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13572,8 +13572,8 @@ attribute to one of the following:
 
 - =margin= ::
 
-  For use the =marginfigure= environment. This environment shows the imagen in
-  the margin
+  For use the =marginfigure= environment. This environment shows the
+  image in the margin
 
 - =nil= ::
 
-- 
2.26.2

From 5c3eee89e501140460ea974195249a432b213bb2 Mon Sep 17 00:00:00 2001
From: Pablo Palazon 
Date: Thu, 14 May 2020 16:55:19 +0200
Subject: [PATCH 2/3] ox-latex.el: Add documentation to margin option in float

* doc/org-manual.org: Add documentation
---
 doc/org-manual.org | 5 +
 1 file changed, 5 insertions(+)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 673bb11c5..e0c41f13e 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13570,6 +13570,11 @@ attribute to one of the following:
   For a new page with the image sideways, rotated ninety degrees, in
   a =sidewaysfigure= environment; overrides =:placement= setting.
 
+- =margin= ::
+
+  For use the =marginfigure= environment. This environment shows the imagen in
+  the margin
+
 - =nil= ::
 
   To avoid a =:float= even if using a caption.
-- 
2.26.2

From a4ff98eb82397721a152b3c3e51f6a993947140d Mon Sep 17 00:00:00 2001
From: Pablo Palazon 
Date: Thu, 14 May 2020 16:33:53 +0200
Subject: [PATCH 1/3] ox-latex.el: Add margin to float option for attr_latex in
 images

* lisp/ox-latex.el (org-latex--inline-image): Include margin option
to create marginfigure environment for figures. It's useful for tufte
latex class, where with this environment shows the figure in the margin.

TINYCHANGE
---
 lisp/ox-latex.el | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 6535d59f8..4b9281e1a 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2374,6 +2374,7 @@ used as a communication channel."
 		  (cond ((string= float "wrap") 'wrap)
 			((string= float "sideways") 'sideways)
 			((string= float "multicolumn") 'multicolumn)
+			((string= float "margin") 'marginfigure)
 			((and (plist-member attr :float) (not float)) 'nonfloat)
 			((or float
 			 (org-element-property :caption parent)
@@ -2494,6 +2495,15 @@ used as a communication channel."
 			(if center "\\centering" "")
 			comment-include image-code
 			(if caption-above-p "" caption)))
+  (`marginfigure (format "\\begin{marginfigure}%s
+%s%s
+%s%s
+%s\\end{marginfigure}"
+			placement
+			(if caption-above-p caption "")
+			(if center "\\centering" "")
+			comment-include image-code
+			(if caption-above-p "" caption)))
   (`figure (format "\\begin{figure}%s
 %s%s
 %s%s
-- 
2.26.2



Re: [PATCH] Add margin option to float for figure in ox-latex.el

2020-05-15 Thread Pablo Palazon
Thanks Eric, I've done the changes and I attach path files again.
From a4ff98eb82397721a152b3c3e51f6a993947140d Mon Sep 17 00:00:00 2001
From: Pablo Palazon 
Date: Thu, 14 May 2020 16:33:53 +0200
Subject: [PATCH 1/3] ox-latex.el: Add margin to float option for attr_latex in
 images

* lisp/ox-latex.el (org-latex--inline-image): Include margin option
to create marginfigure environment for figures. It's useful for tufte
latex class, where with this environment shows the figure in the margin.

TINYCHANGE
---
 lisp/ox-latex.el | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 6535d59f8..4b9281e1a 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2374,6 +2374,7 @@ used as a communication channel."
 		  (cond ((string= float "wrap") 'wrap)
 			((string= float "sideways") 'sideways)
 			((string= float "multicolumn") 'multicolumn)
+			((string= float "margin") 'marginfigure)
 			((and (plist-member attr :float) (not float)) 'nonfloat)
 			((or float
 			 (org-element-property :caption parent)
@@ -2494,6 +2495,15 @@ used as a communication channel."
 			(if center "\\centering" "")
 			comment-include image-code
 			(if caption-above-p "" caption)))
+  (`marginfigure (format "\\begin{marginfigure}%s
+%s%s
+%s%s
+%s\\end{marginfigure}"
+			placement
+			(if caption-above-p caption "")
+			(if center "\\centering" "")
+			comment-include image-code
+			(if caption-above-p "" caption)))
   (`figure (format "\\begin{figure}%s
 %s%s
 %s%s
-- 
2.26.2

From 46a7fcecf5d2735f3f6f18481b302d4b4f887120 Mon Sep 17 00:00:00 2001
From: Pablo Palazon 
Date: Fri, 15 May 2020 18:25:21 +0200
Subject: [PATCH 3/3] org-manual.org: Fix type error

* doc/org-manual.org (Images in LaTeX export): Fix typo error on image
---
 doc/org-manual.org | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index e0c41f13e..b792f588a 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13572,8 +13572,8 @@ attribute to one of the following:
 
 - =margin= ::
 
-  For use the =marginfigure= environment. This environment shows the imagen in
-  the margin
+  For use the =marginfigure= environment. This environment shows the
+  image in the margin
 
 - =nil= ::
 
-- 
2.26.2

From 5c3eee89e501140460ea974195249a432b213bb2 Mon Sep 17 00:00:00 2001
From: Pablo Palazon 
Date: Thu, 14 May 2020 16:55:19 +0200
Subject: [PATCH 2/3] ox-latex.el: Add documentation to margin option in float

* doc/org-manual.org: Add documentation
---
 doc/org-manual.org | 5 +
 1 file changed, 5 insertions(+)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 673bb11c5..e0c41f13e 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13570,6 +13570,11 @@ attribute to one of the following:
   For a new page with the image sideways, rotated ninety degrees, in
   a =sidewaysfigure= environment; overrides =:placement= setting.
 
+- =margin= ::
+
+  For use the =marginfigure= environment. This environment shows the imagen in
+  the margin
+
 - =nil= ::
 
   To avoid a =:float= even if using a caption.
-- 
2.26.2



Re: Bug: org-encrypt-entry fails [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)]

2020-05-15 Thread silipwn

On 15.05.2020 17:00, Nicolas Goaziou wrote:

Anyway, I pushed a fix in master. Could you try it?


The current commit, still results in a error. I had a set the
org-crypt-key to nil. It still prompts to use a key. 


The current backtrace is similar to this:

Debugger entered--Lisp error: (error "GPG error: \"Encrypt failed\",
\"Unusable public key: 49F84EA6007F964D; Exit\"")
  signal(error ("GPG error: \"Encrypt failed\", \"Unusable public key:
  49F84EA6007F964D; Exit\""))
error("GPG error: \"Encrypt failed\", \"Unusable public key:
49F84EA6007F964D; Exit\"")
--
Regards,
Silipwn
Never trust an operating system you don't have sources for. ;-)
-- Unknown source



Re: Bug: org-encrypt-entry fails [9.4 (nil @ /home/silipwn/.emacs.d/.local/straight/build/org-mode/)]

2020-05-15 Thread Nicolas Goaziou
Hello,

silipwn  writes:

> The org-encrypt-entry fails to encrypt an entry, with a wrong-type-argument. 
> I am currently using doom-emacs, and created a corresponding issue 
> (https://github.com/hlissner/doom-emacs/issues/3123),
> where I was told to report the issue upstream.
> As hlissner mentioned in the above issue, it seems to be that the
> issue is the org-encrypt-string function expects epa-file-encrypt-to
> to be a string, but epa-file-encrypt-to's documentation says 'May
> either be a string or a list of strings.'.
> Doom-emacs sets it to a list of strings. 

I am a bit surprised you even reached `epa-file-encrypt-to'. I assume
`org-crypt-key' was nil.

Anyway, I pushed a fix in master. Could you try it?

Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [bug] error on RET in read-only buffer with org-return-follows-link set to t

2020-05-15 Thread Gregor Zattler
Hi Nicolas, Kévin,

thanks to both of you: It works again for me.

Ciao; Gregor
-- 
 -... --- .-. . -.. ..--.. ...-.-
* Nicolas Goaziou  [2020-05-15; 00:49]:
> Kévin Le Gouguec  writes:
>
>> Shouldn't the call to org-return be wrapped in (call-interactively …)
>> though?
>
> Indeed. Done. Thank you.




Re: [PATCH] Add margin option to float for figure in ox-latex.el

2020-05-15 Thread Eric S Fraga
Just a minor point: in the patch for the documentation, change "imagen"
to "image".
-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.6-631-g48b223