Re: [PATCH] ob-core: Fix handling of multiple noweb refs in same line

2020-09-14 Thread Tom Gillespie
Hi Kyle,
   This fixes the issue on my system, and looking over the bisected
commit it looks like the ^ was just an oversight. This also resolves
the issue for <> as well, I don't think we need a
separate test case for that since any issue with references breaking
should show up elsewhere (though I guess you never know). Thank you
for tracking this down, and now I know how to add ert tests for things
like this in the future! Best,
Tom

On Tue, Sep 15, 2020 at 12:21 AM Kyle Meyer  wrote:
>
> Tom Gillespie writes:
>
> > Hi,
> >The 9.4 release has a bug where it will only tangle the first noweb
> > reference on a line.
> > This is also present at 9c31cba002a1ba93053aebea1f778be87f61ba06. It 
> > happens in
> > emacs-27 and emacs-28. The reproduction is below. Best!
>
> Thanks for the report and the reproducer.
>
> This bisects to c1aed9f80 (ob-core: Refactor
> `org-babel-expand-noweb-references', 2020-01-12).  The patch below
> addresses the case you provided (added as a test) and doesn't cause any
> of the other tests to fail.  However, I'm no tangler, so I'd appreciate
> if you could give it some testing and report back.
>
> (I should also look more closely at org-babel-expand-noweb-references
> before applying and see if I spot anything that suggests this change is
> problematic.)
>
> -- >8 --
> Subject: [PATCH] ob-core: Fix handling of multiple noweb refs in same line
>
> * lisp/ob-core.el (org-babel-expand-noweb-references): Don't anchor
> noweb regexp at start of line to allow multiple matches per line.
> * testing/lisp/test-ob-tangle.el (ob-tangle/multiple-noweb-in-line):
> Add test.
>
> This fixes a regression introduced by c1aed9f80 (ob-core: Refactor
> `org-babel-expand-noweb-references', 2020-01-12), which was part of
> the 9.4 release.
>
> Reported-by: Tom Gillespie 
> Ref: 
> https://orgmode.org/list/ca+g3_po2yo1jmmpdrkc39bgqq2eu5x4fztejvotjdjo-50d...@mail.gmail.com
> ---
>  lisp/ob-core.el|  2 +-
>  testing/lisp/test-ob-tangle.el | 32 
>  2 files changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/ob-core.el b/lisp/ob-core.el
> index a5e079d9a..7300f239e 100644
> --- a/lisp/ob-core.el
> +++ b/lisp/ob-core.el
> @@ -2781,7 +2781,7 @@ (defun org-babel-expand-noweb-references ( 
> info parent-buffer)
>   (lang (nth 0 info))
>   (body (nth 1 info))
>  (comment (string= "noweb" (cdr (assq :comments (nth 2 info)
> -(noweb-re (format "^\\(.*?\\)\\(%s\\)"
> +(noweb-re (format "\\(.*?\\)\\(%s\\)"
>(with-current-buffer parent-buffer
>  (org-babel-noweb-wrap
>  (cache nil)
> diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el
> index e0e2ea52c..cfdf16d40 100644
> --- a/testing/lisp/test-ob-tangle.el
> +++ b/testing/lisp/test-ob-tangle.el
> @@ -420,6 +420,38 @@ (ert-deftest ob-tangle/commented-src-blocks ()
> (org-split-string (buffer-string
>   (delete-file file))
>
> +(ert-deftest ob-tangle/multiple-noweb-in-line ()
> +  "Test handling of multiple noweb references in a single line."
> +  (should
> +   (equal '("1" "2" "1")
> + (let ((file (make-temp-file "org-tangle-")))
> +   (unwind-protect
> +   (progn
> + (org-test-with-temp-text-in-file
> + (format "
> +#+name: block1
> +#+begin_src elisp
> +1
> +#+end_src
> +
> +#+name: block2
> +#+begin_src elisp
> +2
> +#+end_src
> +
> +#+name: block3
> +#+begin_src elisp :noweb yes :tangle %s
> +<> <> <>
> +#+end_src"
> + file)
> +   (let ((org-babel-noweb-error-all-langs nil)
> + (org-babel-noweb-error-langs nil))
> + (org-babel-tangle)))
> + (with-temp-buffer
> +   (insert-file-contents file)
> +   (org-split-string (buffer-string
> + (delete-file file))
> +
>  (ert-deftest ob-tangle/detangle-false-positive ()
>"Test handling of false positive link during detangle."
>(let (buffer)
>
> base-commit: e6021bc9b18982b30dd61417d98276b2984892cd
> --
> 2.28.0
>



[PATCH] ob-core: Fix handling of multiple noweb refs in same line

2020-09-14 Thread Kyle Meyer
Tom Gillespie writes:

> Hi,
>The 9.4 release has a bug where it will only tangle the first noweb
> reference on a line.
> This is also present at 9c31cba002a1ba93053aebea1f778be87f61ba06. It happens 
> in
> emacs-27 and emacs-28. The reproduction is below. Best!

Thanks for the report and the reproducer.

This bisects to c1aed9f80 (ob-core: Refactor
`org-babel-expand-noweb-references', 2020-01-12).  The patch below
addresses the case you provided (added as a test) and doesn't cause any
of the other tests to fail.  However, I'm no tangler, so I'd appreciate
if you could give it some testing and report back.

(I should also look more closely at org-babel-expand-noweb-references
before applying and see if I spot anything that suggests this change is
problematic.)

-- >8 --
Subject: [PATCH] ob-core: Fix handling of multiple noweb refs in same line

* lisp/ob-core.el (org-babel-expand-noweb-references): Don't anchor
noweb regexp at start of line to allow multiple matches per line.
* testing/lisp/test-ob-tangle.el (ob-tangle/multiple-noweb-in-line):
Add test.

This fixes a regression introduced by c1aed9f80 (ob-core: Refactor
`org-babel-expand-noweb-references', 2020-01-12), which was part of
the 9.4 release.

Reported-by: Tom Gillespie 
Ref: 
https://orgmode.org/list/ca+g3_po2yo1jmmpdrkc39bgqq2eu5x4fztejvotjdjo-50d...@mail.gmail.com
---
 lisp/ob-core.el|  2 +-
 testing/lisp/test-ob-tangle.el | 32 
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index a5e079d9a..7300f239e 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -2781,7 +2781,7 @@ (defun org-babel-expand-noweb-references ( info 
parent-buffer)
  (lang (nth 0 info))
  (body (nth 1 info))
 (comment (string= "noweb" (cdr (assq :comments (nth 2 info)
-(noweb-re (format "^\\(.*?\\)\\(%s\\)"
+(noweb-re (format "\\(.*?\\)\\(%s\\)"
   (with-current-buffer parent-buffer
 (org-babel-noweb-wrap
 (cache nil)
diff --git a/testing/lisp/test-ob-tangle.el b/testing/lisp/test-ob-tangle.el
index e0e2ea52c..cfdf16d40 100644
--- a/testing/lisp/test-ob-tangle.el
+++ b/testing/lisp/test-ob-tangle.el
@@ -420,6 +420,38 @@ (ert-deftest ob-tangle/commented-src-blocks ()
(org-split-string (buffer-string
  (delete-file file))
 
+(ert-deftest ob-tangle/multiple-noweb-in-line ()
+  "Test handling of multiple noweb references in a single line."
+  (should
+   (equal '("1" "2" "1")
+ (let ((file (make-temp-file "org-tangle-")))
+   (unwind-protect
+   (progn
+ (org-test-with-temp-text-in-file
+ (format "
+#+name: block1
+#+begin_src elisp
+1
+#+end_src
+
+#+name: block2
+#+begin_src elisp
+2
+#+end_src
+
+#+name: block3
+#+begin_src elisp :noweb yes :tangle %s
+<> <> <>
+#+end_src"
+ file)
+   (let ((org-babel-noweb-error-all-langs nil)
+ (org-babel-noweb-error-langs nil))
+ (org-babel-tangle)))
+ (with-temp-buffer
+   (insert-file-contents file)
+   (org-split-string (buffer-string
+ (delete-file file))
+
 (ert-deftest ob-tangle/detangle-false-positive ()
   "Test handling of false positive link during detangle."
   (let (buffer)

base-commit: e6021bc9b18982b30dd61417d98276b2984892cd
-- 
2.28.0




Re: [PATCH] org-plot abstractions and extension

2020-09-14 Thread TEC

Oooops, I've just noticed my patch attachment re-send was only addressed
to Bastien (maybe this is why I haven't heard anything?).
This is what I get for mixing mail clients and not paying attention
I guess .

If someone would be willing to have a look through my work, and comment
- that would be fantastic.

I'd love to get my code into shape to be merged :)

All the best,

Timothy.

> Bastien  wrote:
>
>> Can you repost as plain text?  The email is not very readable in HTML
>> and the patches are not readable at all.
>
> Ooops, that shouldn't have happened. Unfortunately, I have yet to find
> a good way of attaching files in mu4e.
> Those should have been converted into attachments in a plaintext
> email, but that didn't work.
>
> Let me know if this attempt works as intended,
>
> Timothy.

>From c62e817b04dfbe624ee8b2090ebcde257bbd3f23 Mon Sep 17 00:00:00 2001
From: TEC 
Date: Wed, 8 Jul 2020 19:26:07 +0800
Subject: [PATCH 02/11] org-plot.el: add new option :transpose

* lisp/org-plot.el (org-plot/add-options-to-plist,
org-plot/add-options-to-plist): Add a new option :transpose, and a
shorter alias :trans. Transposition is performed if the argument is yes,
y, or t.  This treats the table as a matrix and performs matrix
transposition on it.  If an hline is present, it is assumed that it is a
marks a separation from a first header row.  The first row is then
treated as the new header by inserting a hline in the transposed data.
This is quite useful for some plots, where across multiple categories,
there are a large number of data points.  Without this, the data points
would be columns and the table can spread irritatingly wide.
---
 lisp/org-plot.el | 44 +---
 1 file changed, 29 insertions(+), 15 deletions(-)

diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index c08bc144e..6ff633130 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -50,19 +50,21 @@
   "Parse an OPTIONS line and set values in the property list P.
 Returns the resulting property list."
   (when options
-(let ((op '(("type". :plot-type)
-		("script"  . :script)
-		("line". :line)
-		("set" . :set)
-		("title"   . :title)
-		("ind" . :ind)
-		("deps". :deps)
-		("with". :with)
-		("file". :file)
-		("labels"  . :labels)
-		("map" . :map)
-		("timeind" . :timeind)
-		("timefmt" . :timefmt)))
+(let ((op '(("type"  . :plot-type)
+		("script". :script)
+		("line"  . :line)
+		("set"   . :set)
+		("title" . :title)
+		("ind"   . :ind)
+		("deps"  . :deps)
+		("with"  . :with)
+		("file"  . :file)
+		("labels". :labels)
+		("map"   . :map)
+		("timeind"   . :timeind)
+		("timefmt"   . :timefmt)
+		("trans" . :transpose)
+		("transpose" . :transpose)))
 	  (multiples '("set" "line"))
 	  (regexp ":\\([\"][^\"]+?[\"]\\|[(][^)]+?[)]\\|[^ \t\n\r;,.]*\\)")
 	  (start 0))
@@ -289,8 +291,20 @@ line directly before or after the table."
 	(setf params (plist-put params (car pair) (cdr pair)
 ;; collect table and table information
 (let* ((data-file (make-temp-file "org-plot"))
-	   (table (org-table-collapse-header (org-table-to-lisp)))
-	   (num-cols (length (car table
+	   (table (let ((tbl (org-table-to-lisp)))
+		(when (pcase (plist-get params :transpose)
+			('y   t)
+			('yes t)
+			('t   t))
+		  (if (memq 'hline tbl)
+			  (setq tbl (apply #'cl-mapcar #'list tbl))
+			;; When present, remove hlines as they can't (currentily) be easily transposed.
+			(setq tbl (apply #'cl-mapcar #'list
+	 (remove 'hline tbl)))
+			(push 'hline (cdr tbl
+		tbl))
+	   (num-cols (length (if (eq (nth 0 table) 'hline) (nth 1 table)
+			   (nth 0 table)
   (run-with-idle-timer 0.1 nil #'delete-file data-file)
   (when (eq (cadr table) 'hline)
 	(setf params
-- 
2.28.0

>From fc7f4015c726e4a685002e8d69fad1eb1d605790 Mon Sep 17 00:00:00 2001
From: TEC 
Date: Wed, 8 Jul 2020 22:26:21 +0800
Subject: [PATCH 03/11] org-plot.el: add new custom gnuplot preamble

* lisp/org-plot.el: Define new custom variable
`org-plot/gnuplot-script-preamble' which can be either a string or a
function.  The value of this (when executed, in the case of the
function) is inserted near the top of the generated gnuplot script.
(org-plot/gnuplot-script): Use the new variable
`org-plot/gnuplot-script-preamble' in the manner described.

This allows for the user to set the font/colour-scheme, default
precision, and much more.
---
 lisp/org-plot.el | 13 +
 1 file changed, 13 insertions(+)

diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index 6ff633130..f8db45273 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -181,6 +181,13 @@ and dependent variables."
 	  (setf back-edge "") (setf front-edge ""
 row-vals))
 
+(defcustom org-plot/gnuplot-script-preamble ""
+  "String or function which provides content to be inserted into the GNUPlot
+script before the plot command. Not that this 

Re: Bug: =C-c C-e l o= does not open the pdf anymore [9.3.7 (9.3.7-55-gba2405-elpa @ /home/fsantos/.emacs.d/elpa/org-20200907/)]

2020-09-14 Thread Kyle Meyer
Colin Baxter writes:

>> Frederic Santos  writes:
>
> > Hi everyone, After upgrading to Emacs 27, I noticed that, for any
> > org document, =C-c C-e l o= now behaves on my computer as =C-c C-e
> > l p=; i.e., the pdf is correctly produced, but is not displayed
> > anymore on side window.
>
> > Several users (using various operating systems) confirmed the bug
> > on StackExchange:
> > 
> https://emacs.stackexchange.com/questions/60379/c-c-c-e-l-o-does-not-open-the-pdf-anymore
>
> > Is there any simple workaround to solve that?
>
> Does not happen to me. I'm on emacs-27.1 and org-mode from git (version
> 9.3.8 (release_9.3.8-777-g9c31cb). Perhaps try updating your org-mode.

Thanks for checking.  And I can't trigger the issue with Emacs 27 and
the commit reported in the subject (ba2405) on a GNU/Linux system.

This goes through org-open-file, so it depends on the OS and system
configuration.  Frederic, I'd recommend trying to tweak org-file-apps to
see if you can land on something that displays the PDF again.

And I think Nick's suggestion/question in the SE comment thread is a
good one:

It's probably not an emacs issue at all: what happens when you run
usr/bin/xdg-open /home/fs/Documents/essai.pdf from the command line?



Re: How to refer to remote table, in another file, as a source block variable?

2020-09-14 Thread John Kitchin
I think you are looking for (Assuming your table is in an org file called
test.org):

#+BEGIN_SRC ipython :var data=test.org:test_table
for row in data:
print(row)
#+END_SRC

#+RESULTS:
:results:
# Out [2]:
# output
['two', 'yes']
['three', 'yes']
['four', 'no']

:end:
John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Mon, Sep 14, 2020 at 5:58 PM William Denton  wrote:

> My apologies for sending this around a second time, but I still haven't
> got it
> so I thought I'd try again.  If it's possible to refer to a remote table
> in
> another file, I've love to know how.
>
>
> Bill
>
>
> On 7 August 2020, William Denton wrote:
>
> > I can't figure this one out.  Let's say I have a table in an Org file,
> like
> > so:
> >
> > # -
> >
> > * Primes
> >
> > #+NAME: test_table
> > | number | prime |
> > |+---|
> > | two| yes   |
> > | three  | yes   |
> > | four   | no|
> >
> > # -
> >
> > In another file, I want to bring this table into a source block as a
> > variable. If it was the same file, I'd say ":var t=test_table" and
> that's
> > that.  But what's the syntax for a different file?  I can't figure it
> out
> > from the docs [1] and none of my attempts with quotes, file:, etc. work.
> > It's something like this, isn't it?  But what?
> >
> > #+begin_src R :var t=(remote(table.org::*Primes))
> > t
> > #+end_src
> >
> > Thanks,
> >
> > Bill
> >
> > [1] https://orgmode.org/manual/References.html#References
> > --
> > William Denton :: Toronto, Canada   ---   Listening to Art:
> > https://listeningtoart.org/
> > https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
> > Caveat lector.  ---   STAPLR: https://staplr.org/
> >
>
> --
> William Denton :: Toronto, Canada   ---   Listening to Art:
> https://listeningtoart.org/
> https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
> Caveat lector.  ---   STAPLR: https://staplr.org/
>
>


Re: How to refer to remote table, in another file, as a source block variable?

2020-09-14 Thread William Denton

My apologies for sending this around a second time, but I still haven't got it
so I thought I'd try again.  If it's possible to refer to a remote table in 
another file, I've love to know how.



Bill


On 7 August 2020, William Denton wrote:

I can't figure this one out.  Let's say I have a table in an Org file, like 
so:


# -

* Primes

#+NAME: test_table
| number | prime |
|+---|
| two| yes   |
| three  | yes   |
| four   | no|

# -

In another file, I want to bring this table into a source block as a 
variable. If it was the same file, I'd say ":var t=test_table" and that's 
that.  But what's the syntax for a different file?  I can't figure it out 
from the docs [1] and none of my attempts with quotes, file:, etc. work. 
It's something like this, isn't it?  But what?


#+begin_src R :var t=(remote(table.org::*Primes))
t
#+end_src

Thanks,

Bill

[1] https://orgmode.org/manual/References.html#References
--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/

https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
Caveat lector.  ---   STAPLR: https://staplr.org/



--
William Denton :: Toronto, Canada   ---   Listening to Art: 
https://listeningtoart.org/
https://www.miskatonic.org/ ---   GHG.EARTH: https://ghg.earth/
Caveat lector.  ---   STAPLR: https://staplr.org/



Re: Getting Org-Crypt to work (doc bug?)

2020-09-14 Thread David Masterson
David Masterson  writes:

> Bastien  writes:
>
>> Hi David,
>>
>> David Masterson  writes:
>>
>>> Both things should be mentioned in the Org-Mode Info pages for
>>> org-crypt.
>>
>> Can you please provide a patch for this?
>>
>> Thanks,
>
> I'm not very good with this yet, but, when I figure it out, I will
> certainly consider a patch.  Never having done a patch before, could you
> list the steps for providing a patch?

Nevermind -- here's the patch:

-
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 3eb745b5d..775af7a13 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -19650,8 +19650,9 @@ an Org file that is part of a publishing project.
 :END:
 
 Org Crypt encrypts the text of an entry, but not the headline, or
-properties.  Behind the scene, it uses the Emacs EasyPG library to
-encrypt and decrypt files.
+properties.  Behind the scene, it uses the [[info:epa][Emacs EasyPG Library]] 
to
+encrypt and decrypt files.  Also, pay attention to the installation
+and setup of [[info:gnupg][GnuPG]]
 
 #+vindex: org-crypt-tag-matcher
 Any text below a headline that has a =crypt= tag is automatically
-

-- 
David Masterson



Re: Getting Org-Crypt to work (doc bug?)

2020-09-14 Thread David Masterson
Bastien  writes:

> Hi David,
>
> David Masterson  writes:
>
>> Both things should be mentioned in the Org-Mode Info pages for
>> org-crypt.
>
> Can you please provide a patch for this?
>
> Thanks,

I'm not very good with this yet, but, when I figure it out, I will
certainly consider a patch.  Never having done a patch before, could you
list the steps for providing a patch?
-- 
David Masterson



Re: Getting Org-Crypt to work (doc bug?)

2020-09-14 Thread David Masterson
Colin Baxter  writes:

> The overlay of a password field (either in an xterm or popup) is a
> particular problem for full screen applications, or if you using
> something like  stumpwm. I've found that whether or not I get a popup
> depends on the version of gnupg. Anything greater than gpg version 2.1.18
> I get a popup. In those cases, to make sure the password request is
> passed always to emacs and not to a popup, I set the variable
> `epa-pinentry-mode' to loopback as in
>
> #+begin_src elisp
> (setq epa-pinentry-mode 'loopback)
> #+end_src
>
> This seems to work.

Oh! I'll have to try that.  Thanks.
-- 
David Masterson



Re: [feature request] A new cookie type [!] showing the last note taken

2020-09-14 Thread Eric Abrahamsen
Nicolas Goaziou  writes:

> Hello,
>
> Ihor Radchenko  writes:
>
>> I did not know this and I cannot find any reference about such behaviour
>> in manual (info:org#Markup for Rich Contents).
>
> You can find it looking for "line break" in the index. It points there:
> (info "(org) Paragraphs").
>
 However, it is unused it unordered lists. We might define a note as a
 unnumbered list item with [@note]:

 - [@note] This is note
>>>
>>> That's a reasonable syntax extension, maybe too English-centered. Maybe
>>> a more abstract [@!] would be better.
>>
>> It also looks better for me.
>> Should I open separate bug report proposing this syntax extension?
>
> Thinking again about it, I'm not sold about this idea. Is extending the
> syntax the way to go? 
>
> Sure, in the proposal above, it is relatively cheap. But what is the
> meaning of an item marked as a "note"? Everything in an entry could be
> a note; this is not limited to items. Moreover, if we are considering it
> to be a note just because it was automatically inserted using
> `org-add-log-note', then we are binding the tool to the syntax. This is
> a mistake.
>
> I would like to reconsider the solution to your use case. With a non-nil
> value for `org-log-into-drawer', it is possible to guess the location of
> the last inserted note, assuming manually inserted ones—if there is
> any—also follow the same pattern. Under such a reasonable configuration,
> it should not be too difficult to write a function extracting the last
> note, or a whole library operating on notes (ideas: move log-related
> functions to a new "org-log.el" library, simplify it using Org Capture
> as the machinery, extend it…).

Here's code I've had in my config for quite a while. It gets the
logbook, and shows the most recent item, bound to "V" in the agenda. It
also includes an aborted function to do more thorough parsing of the log
items -- I abandoned that because it was too gross.

I actually also have a library called org-log.el around here somewhere,
but that does quantitative logging of values, which I don't think has
enough general interest. But I'm attaching that, too, just in case.

Anyway, I'd be happy to work on this.

(defun org-get-log-list ()
  "Return the entry's log items, or nil.
The items are returned as a list of 'item elements."
  (save-excursion
(goto-char (org-log-beginning))
(let* ((el (org-element-at-point))
   list-string list-items)
  ;; Should we try harder to make sure it's actually the log list?
  (when (eq (org-element-type el) 'plain-list)
(setq list-string
  (buffer-substring
   (org-element-property :contents-begin el)
   (org-element-property :contents-end el)))
(with-temp-buffer
  (insert list-string)
  (setq list-items
(org-element-map
(org-element-parse-buffer)
'item #'identity
  list-items)))

(defun org-agenda-show-log-item ()
  "Echo the text of the entry's most recent log note."
  (interactive)
  (let (log-list item)
(org-agenda-with-point-at-orig-entry
 nil (setq log-list (org-get-log-list)))
(if (not log-list)
(message "Entry has no log")
  (setq item
(if org-log-states-order-reversed
(car log-list)
  (last log-list)))
  (message (org-element-interpret-data
(org-element-contents item))

(with-eval-after-load 'org-agenda
  (org-defkey org-agenda-mode-map "V" 'org-agenda-show-log-item))

(defun org-parse-log-list (log-list)
  "Turn a parsed plain log list (as returned by
  `org-get-log-list') into something more interesting.

Specifically, this means to extract information from the plain
text of each log item, and put it onto the item's property
list.  Right now this function extracts  "
  (mapcar
   (lambda (item)
 (let* ((pars (org-element-map item 'paragraph #'identity))
(head-par (car pars))
;; This is absolutely horrible: assume that, if the first
;; four characters of the log note heading match a value
;; from `org-log-note-headings', then that's the kind of
;; heading we've got.
(horrible (mapcar
   (lambda (x) (cons (car x) (substring (cdr x) 0 3)))
   org-log-note-headings))
(item-type (or (rassoc (substring head-par 0 3) horrible)
   'uncertain))
(timestamp (car-safe (org-element-map head-par 'timestamp 
#'identity)))
state-from state-to schedule deadline)
   (cond ((eq item-type 'state)
  (setq state-to
(and (string-match "State \\([^[:space:]]*\\) " head-par)
 (match-string 1 head-par)))
  (setq state-from
(and (string-match "from \\([^[:space:]]*\\) " head-par)
 (match-string 1 

Re: Release Org 9.4

2020-09-14 Thread Michael Welle
Hello,

Bastien  writes:

> Dear all,
>
> Org 9.4 is out.  Enjoy!
I do!

Thank you! And thank you to all contributors.

All the best
hmw



Bug: org-babel only tangles first noweb reference on a line [9.4 (9.4-elpaplus @ /home/tom/.emacs.d/elpa/org-plus-contrib-20200914/)]

2020-09-14 Thread Tom Gillespie
Hi,
   The 9.4 release has a bug where it will only tangle the first noweb
reference on a line.
This is also present at 9c31cba002a1ba93053aebea1f778be87f61ba06. It happens in
emacs-27 and emacs-28. The reproduction is below. Best!
Tom

The expected content of oops-3.el should be 1 2 1, but is instead 1
<> <>.
C-c C-v C-t or C-c C-v C-v will show the issue.

#+name: block1
#+begin_src elisp
1
#+end_src

#+name: block2
#+begin_src elisp
2
#+end_src

#+name: block3
#+begin_src elisp :noweb yes :tangle ./oops-3.el
<> <> <>
#+end_src



Re: Bug: org-block face isn't applied to special blocks

2020-09-14 Thread Sébastien Miquel
As far as src blocks being treated differently, there's already the 
~org-src-block-faces~ variable.


How about the following :

 + Make the ~org-block~ face apply to every block
 + either
   - add an ~org-src-block~ face
   - modify ~org-src-block-faces~ to allow a catch-all case
   It'd be nice for those to apply to unrecognized languages
 + keep ~org-fontify-quote-and-verse-blocks~

I think the only users that would notice the difference are the few (?) 
who use special blocks and expect them not to be fontified.
All they'd have to do to restore the previous behavior is set the 
~org-src-block~ and unset the ~org-block~ faces.





It isn't applied
  - to src blocks, when the language isn't recognized
  - to special blocks (that is, blocks with arbitrary names)

I make heavy use of special blocks and I'd like this face to apply to them.

I also make heavy use of special blocks but, for me, these are often
more like verse or quote blocks (i.e. the contents of the block are
prose) than src blocks so I would not want them to be treated as src
blocks are.  I think we'll need to have (yet) another option to control
this?





clocktable: link to :ID: rather than header text?

2020-09-14 Thread Bill White
I'm generating clocktables with :link t, and after changing the text of a 
target heading I found that links in clocktables point to the header text and 
not its :ID: 

Is it possible for clocktable links to use the target heading's :ID: rather 
than its text, which I may need to change? 

Thanks - 

bw 
-- 
"No, ma'am, we're musicians." 


Re: Elpa package out-of-date?

2020-09-14 Thread Kartik Saranathan
Looks like the 9.4 release has updated ob-python.el to latest.  Thanks

On Mon, Sep 14, 2020 at 2:06 AM Kartik Saranathan 
wrote:

> Hello,
>
> I've installed package org-plus-contrib version 20200914 from
> http://orgmode.org/elpa/
> I see in org.el that the version is 9.3.8 which was updated 6 days ago in
> https://code.orgmode.org/bzg/org-mode/commit/dab32da708057b18e8b3585543d7f44982dbf13f
>
> But when i look at ob-python.el I don't have following change that was
> made 6 months ago
>
>
> https://code.orgmode.org/bzg/org-mode/commit/4f31aa2d3b2d1d8148a44550158f667b67c1fafd
>
> I see the ob-python.el from the 9.3.8 release is 8 months old.
> https://code.orgmode.org/bzg/org-mode/src/release_9.3.8/lisp/ob-python.el
>
> Does the file need to be updated?  There are bugfixes made to ob-python.el
> that I would like to have.
>
> Thank you
>
> Kartik
>


Re: [PATCH] Add %L (the link content *not* as a full link) to Capture expansions

2020-09-14 Thread Samuel W. Flint
Marked as TINYCHANGE.

Sam


> Samuel W Flint writes:

> Bastien  writes:
B> Hi Samuel, swfl...@flintfam.org (Samuel W. Flint) writes:

>>> In an attempt at automating a part of my workflow, I found that
>>> org-capture's %l didn't quite fit what I needed.  Normally,
>>> org-store-link does the right thing, but for some capture tasks,
>>> I want to custom generate the description, so %l doesn't work.
>>> I've attached a patch that adds %L, a version that doesn't add
>>> the link brackets.

B> It looks good to me for Org 9.5.  Can you add a Changelog entry
B> to your patch and also patch the tests and the manual, if needed?

SWF> Apologies for spamming you with multiple copies Bastien.

SWF> Certainly!  Hopefully this looks better.  I didn't see any
SWF> tests for %a, %A or %l already, and I don't have time atm to
SWF> write them, otherwise I'd have done so.

SWF> I can mark this as TINYCHANGE, if necessary, as I don't have a
SWF> copyright assignment on file, though I'm willing to do so.

SWF> Thanks,

SWF> Sam


B> See
B> 
B> for the format of the Changelog.

B> Thanks,

B> -- Bastien

SWF> -- Samuel W. Flint 4096R/FA13D704 (F50D 862B 4F65 5943 A8C2
SWF> EF0E 86C9 3E7A FA13 D704) λs.(s s) λs.(s s)



-- 
Samuel W. Flint
4096R/FA13D704
  (F50D 862B 4F65 5943 A8C2  EF0E 86C9 3E7A FA13 D704)
λs.(s s) λs.(s s)
>From 02de43c3457419f1031f4988d6c95fac535134e7 Mon Sep 17 00:00:00 2001
From: "Samuel W. Flint" 
Date: Mon, 14 Sep 2020 09:07:07 -0500
Subject: [PATCH] Add in support for filling in the bare link in org capture

* doc/org-manual.org: Document new %L capture template formatting
directive.
* lisp/org-capture.el: (org-capture-templates) Document new %L capture
template formatting directive.
* lisp/org-capture.el: (org-capture-fill-template) Add in support for
%L, bare link formatting, in org-capture-fill-template.

TINYCHANGE
---
 doc/org-manual.org  | 4 
 lisp/org-capture.el | 7 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 7ab7d1c94..229575b13 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -7799,6 +7799,10 @@ here:
 
   Like =%a=, but only insert the literal link.
 
+- =%L= ::
+
+  Like =%l=, but without brackets (the link content itself).
+
 - =%c= ::
 
   Current kill ring head.
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index d73e927fc..2ef55cd5c 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -315,6 +315,7 @@ be replaced with content and expanded:
   %a  Annotation, normally the link created with `org-store-link'.
   %A  Like %a, but prompt for the description part.
   %l  Like %a, but only insert the literal link.
+  %L  Like %l, but without brackets (the link content itself).
   %c  Current kill ring head.
   %x  Content of the X clipboard.
   %k  Title of currently clocked task.
@@ -1592,6 +1593,9 @@ The template may still contain \"%?\" for cursor positioning."
 	 (v-l (if (and v-a (string-match l-re v-a))
 		  (replace-match "[[\\1]]" nil nil v-a)
 		v-a))
+	 (v-L (if (or v-a (string-match l-re v-a))
+		  (replace-match "\\1" nil nil v-a)
+		v-a))
 	 (v-n user-full-name)
 	 (v-k (if (marker-buffer org-clock-marker)
 		  (org-no-properties org-clock-heading)
@@ -1644,7 +1648,7 @@ The template may still contain \"%?\" for cursor positioning."
   ;; Mark %() embedded elisp for later evaluation.
   (org-capture-expand-embedded-elisp 'mark)
   ;; Expand non-interactive templates.
-  (let ((regexp "%\\(:[-A-Za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuUx]\\)"))
+  (let ((regexp "%\\(:[-A-Za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlLntTuUx]\\)"))
 	(save-excursion
 	  (while (re-search-forward regexp nil t)
 	;; `org-capture-escaped-%' may modify buffer and cripple
@@ -1681,6 +1685,7 @@ The template may still contain \"%?\" for cursor positioning."
 			  (?k v-k)
 			  (?K v-K)
 			  (?l v-l)
+			  (?L v-L)
 			  (?n v-n)
 			  (?t v-t)
 			  (?T v-T)
-- 
2.18.1



Release Org 9.4

2020-09-14 Thread Bastien
Dear all,

Org 9.4 is out.  Enjoy :)

See https://orgmode.org/Changes.html for the release notes.

Thanks a lot to every contributor!

Also, I've shared some notes one how to help Org here:
https://bzg.fr/en/org-mode-9.4-is-out-can-you-help.html

You're welcome to discuss them on this list or on the web:
https://news.ycombinator.com/item?id=24470336

-- 
 Bastien



Re: Bug: Italicised text in between quotes

2020-09-14 Thread Sharon Kimble
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512


> I think that I've found a bug in the new org-mode version released
> today.
>
> If you have this in your document (or any italicised text in between
> quotes),
>
> --8<---cut here---start->8---
> #+BEGIN_QUOTE
> /In the previous versions of org-plus, you can plainly see that it is bright 
> green and italicised./
> #+END_QUOTE
> --8<---cut here---end--->8---
>
> then it doesn't show the text in between the quotes showing as italics
> (it should show as bright green in my theme of 'darkest-midnight').
>
> In the previous versions of org-plus, you can plainly see that it is
> bright green and italicised.

Following up on this I've also noticed that its occurring in my config
file, which is an org-mode file.

Every single '#+BEGIN_SRC' seems to be faded out, and its occurring with
any command that starts '#+'. As soon as you start typing '#+' the
command appears faded out. And the same still applies with the zenburn
theme as well.

Thanks
  Sharon.   
- -- 
Debian 10.5, fluxbox 1.3.7, emacs 27.1.50, org 9.3.8
-BEGIN PGP SIGNATURE-

iQJPBAEBCgA5FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAl9fe2gbHGJvdWRpY2Nh
c0Bza2ltYmxlLnBsdXMuY29tAAoJEDaBgBkK+INbJQ4QAKfnrPaEb9OfCt31uSzn
ppdlS6Hq16gM2V55R6wTNaEbaJkzAztFQOirjBeFPkKVoHa1Czmlt7ufCyLlCWMx
UvcT3IagUjxAfSg5EguRqAKtTw7gzDOyjKVlRucWGuqjfX7teooC9izVXtyvjn8/
zmw9lVqqrEL04QCkMypzVTZMi8ixKgRnxqH4ngu6rWXrLueY1mQnaI/pDq6CglNK
G8D5Frttu3pr9Yv8CIxqpoyFK+CTbb6fK3tFa84Ad5nWKZHgUFR0rr3+EedfiYcX
/mxr8Trx79SSi7Ssp4cGHj3ZZfXqa9lkpNkcwi4Q5Eqzg80H90CoxsIsk8dlP5Qp
AR3EvCZckS1hRRzBAhtTLST5BGddWG/CMc3/VkyzreFPkyMvv7pfnHrjUSa7jPft
Z4/qlTclnYF9POaX6FuCw6XxM97Re93n+lqxfAa/oMUP0rqFKJE7ZtIciZsT0yk/
TuRexWIZslrk0ddz+iLeG0trRamO3xtqPwVOeZD+ebwpzvwUrm6F5ylODF6wEUJo
O7f63gEbyRtLVqAaIBPexc/zbHnzHQWxWZR0w76KIoaa5NEg/le6D6tHSj0CaHeK
zlVVVbSpfSdYTqaEqMxcZn2UvM0QGWMSq6c/CW/hMb07mbEKzHnCoRwUd7XHaqKE
AgwwgSpmHnCcpdrAxML0x/Kh
=eM1Y
-END PGP SIGNATURE-




Re: [PATCH] Add %L (the link content *not* as a full link) to Capture expansions

2020-09-14 Thread Samuel W. Flint
> Bastien  writes:

B> Hi Samuel, swfl...@flintfam.org (Samuel W. Flint) writes:

>> In an attempt at automating a part of my workflow, I found that
>> org-capture's %l didn't quite fit what I needed.  Normally,
>> org-store-link does the right thing, but for some capture tasks,
>> I want to custom generate the description, so %l doesn't work.
>> I've attached a patch that adds %L, a version that doesn't add
>> the link brackets.

B> It looks good to me for Org 9.5.  Can you add a Changelog entry
B> to your patch and also patch the tests and the manual, if needed?

Apologies for spamming you with multiple copies Bastien.

Certainly!  Hopefully this looks better.  I didn't see any tests for %a,
%A or %l already, and I don't have time atm to write them, otherwise I'd
have done so.

I can mark this as TINYCHANGE, if necessary, as I don't have a copyright
assignment on file, though I'm willing to do so.

Thanks,

Sam


B> See
B> 
B> for the format of the Changelog.

B> Thanks,

B> -- Bastien

-- 
Samuel W. Flint
4096R/FA13D704
  (F50D 862B 4F65 5943 A8C2  EF0E 86C9 3E7A FA13 D704)
λs.(s s) λs.(s s)
>From 02de43c3457419f1031f4988d6c95fac535134e7 Mon Sep 17 00:00:00 2001
From: "Samuel W. Flint" 
Date: Mon, 14 Sep 2020 09:07:07 -0500
Subject: [PATCH] Add in support for filling in the bare link in org capture

* doc/org-manual.org: Document new %L capture template formatting
directive.
* lisp/org-capture.el: (org-capture-templates) Document new %L capture
template formatting directive.
* lisp/org-capture.el: (org-capture-fill-template) Add in support for
%L, bare link formatting, in org-capture-fill-template.
---
 doc/org-manual.org  | 4 
 lisp/org-capture.el | 7 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 7ab7d1c94..229575b13 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -7799,6 +7799,10 @@ here:
 
   Like =%a=, but only insert the literal link.
 
+- =%L= ::
+
+  Like =%l=, but without brackets (the link content itself).
+
 - =%c= ::
 
   Current kill ring head.
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index d73e927fc..2ef55cd5c 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -315,6 +315,7 @@ be replaced with content and expanded:
   %a  Annotation, normally the link created with `org-store-link'.
   %A  Like %a, but prompt for the description part.
   %l  Like %a, but only insert the literal link.
+  %L  Like %l, but without brackets (the link content itself).
   %c  Current kill ring head.
   %x  Content of the X clipboard.
   %k  Title of currently clocked task.
@@ -1592,6 +1593,9 @@ The template may still contain \"%?\" for cursor positioning."
 	 (v-l (if (and v-a (string-match l-re v-a))
 		  (replace-match "[[\\1]]" nil nil v-a)
 		v-a))
+	 (v-L (if (or v-a (string-match l-re v-a))
+		  (replace-match "\\1" nil nil v-a)
+		v-a))
 	 (v-n user-full-name)
 	 (v-k (if (marker-buffer org-clock-marker)
 		  (org-no-properties org-clock-heading)
@@ -1644,7 +1648,7 @@ The template may still contain \"%?\" for cursor positioning."
   ;; Mark %() embedded elisp for later evaluation.
   (org-capture-expand-embedded-elisp 'mark)
   ;; Expand non-interactive templates.
-  (let ((regexp "%\\(:[-A-Za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlntTuUx]\\)"))
+  (let ((regexp "%\\(:[-A-Za-z]+\\|<\\([^>\n]+\\)>\\|[aAcfFikKlLntTuUx]\\)"))
 	(save-excursion
 	  (while (re-search-forward regexp nil t)
 	;; `org-capture-escaped-%' may modify buffer and cripple
@@ -1681,6 +1685,7 @@ The template may still contain \"%?\" for cursor positioning."
 			  (?k v-k)
 			  (?K v-K)
 			  (?l v-l)
+			  (?L v-L)
 			  (?n v-n)
 			  (?t v-t)
 			  (?T v-T)
-- 
2.18.1



Re: Release Org 9.4

2020-09-14 Thread Russell Adams
Awesome! Thanks everyone for the hard work!

On Mon, Sep 14, 2020 at 04:08:00PM +0200, Bastien wrote:
> Dear all,
>
> Org 9.4 is out.  Enjoy!
>
> See https://orgmode.org/Changes.html for the release notes.
>
> Thanks a lot to everyone who contributed :)
>
> Also, here are some notes on how everyone can help:
> https://bzg.fr/en/org-mode-9.4-is-out-can-you-help.html
>
> --
>  Bastien
>


--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: Getting Org-Crypt to work (doc bug?)

2020-09-14 Thread Colin Baxter
>writes:

> On Mon, Sep 14, 2020 at 12:18:50PM +0100, Colin Baxter wrote:
>> [...] I set the variable `epa-pinentry-mode' to loopback as in
>> 
>> #+begin_src elisp (setq epa-pinentry-mode 'loopback) #+end_src
>> 
>> This seems to work.

> Oh, thanks -- this answers the question I only half-posed :)

> BTW: the variable documentation says to use `epg-pinentry-mode'
> for Emacs versions >= 27.1

I remember I had this epa/epg issue a while ago, I think with
emacs-26.3. Putting the variable as `epa-pinentry-mode' worked for me, but
`epg-pinentry-mode' didn't. I've not looked at it since. It still works
for me with emacs-27.1 and I thought it best to leave it alone. :-)

Best wishes,


signature.asc
Description: PGP signature


Release Org 9.4

2020-09-14 Thread Bastien
Dear all,

Org 9.4 is out.  Enjoy!

See https://orgmode.org/Changes.html for the release notes.

Thanks a lot to everyone who contributed :)

Also, here are some notes on how everyone can help:
https://bzg.fr/en/org-mode-9.4-is-out-can-you-help.html

-- 
 Bastien



Re: [PATCH] org.el: Adapt org-cycle to work with headlines with hidden stars

2020-09-14 Thread Marlin Strub
Awesome, thanks!

On Mon, 14 Sep 2020 at 15:37, Bastien  wrote:

> Hi Marlin,
>
> Marlin Strub  writes:
>
> > Thanks for looking into this. I just tested with 9c31cba00 and
> > org-cycle does not work reliably when org-starless-mode is
> > enabled unless the patch is applied.
>
> Applied now, thanks for checking.
>
> --
>  Bastien
>


Re: [PATCH] org.el: Adapt org-cycle to work with headlines with hidden stars

2020-09-14 Thread Bastien
Hi Marlin,

Marlin Strub  writes:

> Thanks for looking into this. I just tested with 9c31cba00 and
> org-cycle does not work reliably when org-starless-mode is
> enabled unless the patch is applied.

Applied now, thanks for checking.

-- 
 Bastien



Re: Help administer code.orgmode.org: moderate user access and manage the gogs instance

2020-09-14 Thread TEC


> Is anyone willing to help with (1) and/or (2)?

I'm willing to give (2), and potentially (1) a shot :)

Timothy.



Re: [Announcement] New package ox-leanpub

2020-09-14 Thread TEC


Bastien  writes:

> this is more like: the main website should contain as little as
> possible while worg, being collaborative, should contain as much
> as possible.

Ok. I'll keep this in mind in future efforts. Sounds like the current
tools page should be shifted over, I'll try to do this in the future.

> I think for handling tiles and other fancy display layouts, it is
> safer to use a minimal css framework.  I like https://bulma.io a lot,
> but as long as it is CSS-only, it's good.

Thanks to the CSS grid / flexbox, this is actually pretty trivial now :)
The most annoying thing is getting Org's export to wrap the div in a
link.

At the moment it's quite hacky - it relies on browsers correcting
malformed XML and I'd desperately like to fix this but I'm not sure how.

Example:
#+begin_src html

Python


https://github.com/karlicoss/orgparse;>
https://cdn.iconscout.com/icon/free/png-256/python-14-569257.png; 
alt="python-14-569257.png">
 # malformed here


orgparse creates a tree from an org file.
 # malformed here



#+end_src

> Then once this is done, we can let worg display tiles for some pages.
>
> Is this something you would like to explore?

I'll happily lay the groundwork in Worg's CSS.

All the best,

Timothy.



Help administer code.orgmode.org: moderate user access and manage the gogs instance

2020-09-14 Thread Bastien
Hi all,

code.orgmode.org is the place where we host Org's code and Worg
collaborative documentation.

There are two tasks involved in administering code.orgmode.org:

1. Creating accounts and let users get write access to org/worg.
2. Maintaining the gogs instance on the server.

Both tasks are unrelated.

Is anyone willing to help with (1) and/or (2)?

Thanks!

-- 
 Bastien



Re: Getting Org-Crypt to work (doc bug?)

2020-09-14 Thread Bastien
Hi David,

David Masterson  writes:

> Both things
> should be mentioned in the Org-Mode Info pages for org-crypt.

Can you please provide a patch for this?

Thanks,

-- 
 Bastien



Re: Bug: org-table-import fails to import xlxs files

2020-09-14 Thread Bastien
Hi,

swedebugia  writes:

> Do you have any idea how I can setup org-mode to use a convert
> tool before trying to import?

Nope, sorry!

-- 
 Bastien



Re: [Announcement] New package ox-leanpub

2020-09-14 Thread Bastien
Hi Timothy,

TEC  writes:

> My mental model was with the website as 'first class' information,
> and Worg as a 'secondary' wiki. This does seem like the ideal content to
> be collaboratively updated though.

this is more like: the main website should contain as little as
possible while worg, being collaborative, should contain as much 
as possible.

> I would. 

Thanks!

> The one other reason I lent towards the website initially
> though was because I felt that this could be best served by a tiled
> layout similar to https://orgmode.tecosaur.com/tools.html - which
> currently relies on some CSS not in Worg. That could be added inline,
> but that feels slightly hacky to me somehow.

We need to enhance worg css to make this possible.

> Let me know if there's a particular direction you'd like me to take with
> this.

I think for handling tiles and other fancy display layouts, it is
safer to use a minimal css framework.  I like https://bulma.io a lot,
but as long as it is CSS-only, it's good.

Then once this is done, we can let worg display tiles for some pages.

Is this something you would like to explore?

> Other than that, I don't believe I have an account on code.orgmode.org
> yet --- that could be helpful :P

Please send me a private email with your username and I'll create one
for you.

Thanks!

-- 
 Bastien



Re: Getting Org-Crypt to work (doc bug?)

2020-09-14 Thread tomas
On Mon, Sep 14, 2020 at 12:18:50PM +0100, Colin Baxter wrote:
> [...] I set the variable
> `epa-pinentry-mode' to loopback as in
> 
> #+begin_src elisp
> (setq epa-pinentry-mode 'loopback)
> #+end_src
> 
> This seems to work.

Oh, thanks -- this answers the question I only half-posed :)

BTW: the variable documentation says to use `epg-pinentry-mode'
for Emacs versions >= 27.1

Cheers
 - t


signature.asc
Description: Digital signature


Re: Getting Org-Crypt to work (doc bug?)

2020-09-14 Thread tomas
On Mon, Sep 14, 2020 at 10:42:57AM +0200, Gregor Zattler wrote:
> Hi David,
> * David Masterson  [2020-09-13; 17:11]:
> > Yes, gpg-agent is installed and appears to have been started in
> > background.  My O/S is Debian on a Chromebook.
> >
> > I start Emacs via 'xterm -e emacs' and just noticed (thanks to you) that
> > I'm getting a textual popup on the xterm asking for the
> > passphrase. Given that, everything works.
> >
> > So, you're saying that the textual popup is the correct mechanism for
> > getting the passphrase?
> 
> That's one possible way.  If you want to have a graphical
> dialog box, check which pinentry packages are installed:
> 
> $ dpkg -l '*pinentry*'

[...]

> as you see, at my system, there are two pinentry packages
> installed (besides the docs): pinentry-curses for terminal
> while pinentry-qt provides a graphical dialog box.  I choose
> pinentry-qt, because it had fewer dependencies and was
> smaller than the other options.
> 
> If your system lacks a graphical pinentry, install one.

Pinentry is gpg's way to ask you for your passphrase.
AFAIK there's a way for Emacs to do the pinentry thing
(in case you don't like some unrelated popup exploding
in your face).

I don't know what the current status is (there used to
be a pinentry.el).

So... lots of possibilities.

Cheers
 - t


signature.asc
Description: Digital signature


Re: Getting Org-Crypt to work (doc bug?)

2020-09-14 Thread Colin Baxter
> David Masterson  writes:

> Nicolas Goaziou  writes:
>> Hello,
>> 
>> David Masterson  writes:
>> 
>>> I'm trying to get org-crypt to work, but I'm missing something.
>>> Following the Org-Crypt Info page, I've set it up for symmetric
>>> encryption and added a :crypt: tag to a header.  When I try to
>>> save the file, it reports that no key was specified, so it will
>>> do symmetric encryption.  And then it freezes.  C-g will
>>> unfreeze, but the buffer is slightly messed up like it started
>>> working on something, but waited for an external command? GPG is
>>> installed.  What am I missing?
>> 
>> Could you explain more precisely what you did? For example, I
>> encounter no problem crypting the following file:
>> 
>> * Test :crypt:
>> 
>> This is crypted.
>> 
>> # Local Variables: # org-crypt-key: nil # End:
>> 
>> Upon saving the file, I type the key twice, and the entry is
>> encrypted.
>> 
>> Note that I evaluated (org-crypt-use-before-save-magic) once
>> beforehand.

> I'm setting up Org this way:

> (use-package org :init (setq org-tags-exclude-from-inheritance
> '("crypt") org-crypt-key nil ) :config (progn (require 'org-crypt)
> (org-crypt-use-before-save-magic) ) )

> I did essentially what you did (added :crypt: to a header in one
> of my files) and tried to save the file.

> Found it!  I started Emacs on Linux via 'xterm -e emacs &' because
> something else had done this to me (forget what).  The thing is
> that GPG is asking for the passphrase on the xterm window and not
> in the Emacs.  I didn't notice this because Emacs covered
> it. Someone else mentioned the gpg-agent(?) to prevent this (is
> there another way?).  Both things should be mentioned in the
> Org-Mode Info pages for org-crypt.

> -- David Masterson

The overlay of a password field (either in an xterm or popup) is a
particular problem for full screen applications, or if you using
something like  stumpwm. I've found that whether or not I get a popup
depends on the version of gnupg. Anything greater than gpg version 2.1.18
I get a popup. In those cases, to make sure the password request is
passed always to emacs and not to a popup, I set the variable
`epa-pinentry-mode' to loopback as in

#+begin_src elisp
(setq epa-pinentry-mode 'loopback)
#+end_src

This seems to work.

Best wishes,





Re: Getting Org-Crypt to work (doc bug?)

2020-09-14 Thread Gregor Zattler
Hi David,
* David Masterson  [2020-09-13; 17:11]:
> Yes, gpg-agent is installed and appears to have been started in
> background.  My O/S is Debian on a Chromebook.
>
> I start Emacs via 'xterm -e emacs' and just noticed (thanks to you) that
> I'm getting a textual popup on the xterm asking for the
> passphrase. Given that, everything works.
>
> So, you're saying that the textual popup is the correct mechanism for
> getting the passphrase?

That's one possible way.  If you want to have a graphical
dialog box, check which pinentry packages are installed:

$ dpkg -l '*pinentry*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ NameVersion  Architecture Description
+++-===---==
un  pinentry  (no description available)
ii  pinentry-curses 1.1.0-2  amd64curses-based PIN or pass-phrase 
entry dialog for GnuPG
ii  pinentry-doc1.1.0-2  all  documentation for pinentry 
packages
un  pinentry-gnome3   (no description available)
un  pinentry-gtk2 (no description available)
ii  pinentry-qt 1.1.0-2  amd64Qt-based PIN or pass-phrase entry 
dialog for GnuPG
un  pinentry-qt4  (no description available)
un  pinentry-x11  (no description available)

as you see, at my system, there are two pinentry packages
installed (besides the docs): pinentry-curses for terminal
while pinentry-qt provides a graphical dialog box.  I choose
pinentry-qt, because it had fewer dependencies and was
smaller than the other options.

If your system lacks a graphical pinentry, install one.




Ciao; Gregor
--
 -... --- .-. . -.. ..--.. ...-.-




Bug: Italicised text in between quotes

2020-09-14 Thread Sharon Kimble
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512


I think that I've found a bug in the new org-mode version released
today.

If you have this in your document (or any italicised text in between
quotes),

- --8<---cut here---start->8---
#+BEGIN_QUOTE
/In the previous versions of org-plus, you can plainly see that it is bright 
green and italicised./
#+END_QUOTE
- --8<---cut here---end--->8---

then it doesn't show the text in between the quotes showing as italics
(it should show as bright green in my theme of 'darkest-midnight').

In the previous versions of org-plus, you can plainly see that it is
bright green and italicised.

Thanks
  Sharon Kimble.
- -- 
Debian 10.5, fluxbox 1.3.7, emacs 27.1.50, org 9.3.8
-BEGIN PGP SIGNATURE-

iQJPBAEBCgA5FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAl9fK30bHGJvdWRpY2Nh
c0Bza2ltYmxlLnBsdXMuY29tAAoJEDaBgBkK+INbH7wP/R6foDOQEOzW6ORuk0K3
z2zIMJgxMa40o7GV5Ws30oCeoWSXMzZ+Q0N9e83nrhasdonaY34QsY9mTpCK/zH2
4d6VirfAfygHq1SQgTnzHmsu6Wm0IWjYw6moI2FwYzsnFTZT7t8lpFCoKPFrnRUv
8wWZYZhMZF9zMf5IzgOOtOK/5cDEr++5edSmfWeMDVY5vsr5iHSp4iJkLKwuE19x
KENbtt8AQGhd2FG7oxjqwSOaQctFz4Z6xuBsqyB2CEUvtJc6BRkqhXQLcFIVPeMG
LUG6jvVTNTKBZCmSC90zPL9nnrcnRrWz6c5v58eJPC6TI3UyuK97nhdeqJbzOPrZ
j+H6Y6FEUi70XXXO/kv16EW5OvaNeEQLqQbDXX6n7hp0TAyd3AJu7IdenNv2N8+c
0rxvnNSKJY2Ya6PQP6aStGthB/6ElyUns67VsAn4cld54x8YMjKST5pptFnKx1SF
nMQwtAU1yAeCmXWB27KOSs0hp8A0s9no5nUCL4Ihn/7pQBxfrOsALBVZI5Lan/6X
c8x/EdoreVMmxm7J6YZlw1R2si54qXZqpRoUVNQVEVJ9O+y6ircnokBE4ecUHTQo
zmiGLmeQdmrEb4Uqqb/UZ1ydWz0JSBRgs30NnuZ7tor62A9zwVlnBKPgIxpGIGSs
f6pR/RcDTP6ZgfFEgasbaEPX
=yKvF
-END PGP SIGNATURE-



[PATCH] Re: RFE: Capture: property prompt: default completion

2020-09-14 Thread Phil Hudson
Sorry, should have changed the subject. Re-sending patch (no alterations).

On Mon, 14 Sep 2020 at 00:32, Phil Hudson  wrote:
>
> On Sat, 12 Sep 2020 at 19:20, Phil Hudson  wrote:
> >
> > I'd like us to add the ability to provide a default completion value
> > for a property prompt in a capture template, as already exists for a
> > non-property prompt.
> >
> > So where at the moment we can have:
> >
> > %^{prompt|default|completion2|completion3|...}
> >
> > I want, by analogy:
> >
> > %^{prop|default}p
> >
> > with the remaining completions provided by the #+prop_ALL in-buffer
> > setting, and with the implied constraint that "default" is a member of
> > that set.
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 46498bd22..659e3ffaf 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -7854,7 +7854,8 @@ here:
 
 - =%^{PROP}p= ::
 
-  Prompt the user for a value for property {{{var(PROP)}}}.
+  Prompt the user for a value for property {{{var(PROP)}}}.  You may
+  specify a default value with =%^{PROP|default}=.
 
 - =%^{PROMPT}= ::
 
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index d9c8472b9..de2e19a8b 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -331,8 +331,10 @@ be replaced with content and expanded:
   %^C Interactive selection of which kill or clip to use.
   %^L Like %^C, but insert as link.
   %^{prop}p   Prompt the user for a value for property `prop'.
+  A default value can be specified like this:
+  %^{prop|default}p.
   %^{prompt}  Prompt the user for a string and replace this sequence with it.
-  A default value and a completion table ca be specified like this:
+  A default value and a completion table can be specified like this:
   %^{prompt|default|completion2|completion3|...}.
   %?  After completing the template, position cursor here.
   %\\1 ... %\\N Insert the text entered at the nth %^{prompt}, where N
@@ -1782,7 +1784,8 @@ The template may still contain \"%?\" for cursor positioning."
 	   (setq l (org-up-heading-safe)))
 	 (if l (point-marker)
 	   (point-min-marker)))
-			(value (org-read-property-value prompt pom)))
+			(value
+			 (org-read-property-value prompt pom default)))
 		   (org-set-property prompt value)))
 		((or "t" "T" "u" "U")
 		 ;; These are the date/time related ones.
diff --git a/lisp/org.el b/lisp/org.el
index 3264694aa..4077530f1 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -13300,11 +13300,12 @@ This is computed according to `org-property-set-functions-alist'."
   (or (cdr (assoc property org-property-set-functions-alist))
   'org-completing-read))
 
-(defun org-read-property-value (property  pom)
+(defun org-read-property-value (property  pom default)
   "Read value for PROPERTY, as a string.
 When optional argument POM is non-nil, completion uses additional
 information, i.e., allowed or existing values at point or marker
-POM."
+POM.
+Optional argument DEFAULT provides a default value for PROPERTY."
   (let* ((completion-ignore-case t)
 	 (allowed
 	  (or (org-property-get-allowed-values nil property 'table)
@@ -13320,7 +13321,8 @@ POM."
  (if allowed
 	 (funcall set-function
 		  prompt allowed nil
-		  (not (get-text-property 0 'org-unrestricted (caar allowed
+		  (not (get-text-property 0 'org-unrestricted (caar allowed)))
+		  default nil default)
(let ((all (mapcar #'list
 			  (append (org-property-values property)
   (and pom


Re: org-store-link and help for a key

2020-09-14 Thread Ihor Radchenko
> Ihor, if you add a "X-Woof-Bug: confirmed" header to your reply, your
> message will make it through https://updates.orgmode.org - I'm adding
> this header to this very message as an example.

Noted.



Bastien  writes:

> Thanks Maxim for reporting this...
>
> Ihor Radchenko  writes:
>
>>> Such behavior exists for ages, at least since 8.2.10 till current master.
>>
>> I can reproduce this.
>
> ... and Ihor for reproducing/confirming the bug.
>
> Ihor, if you add a "X-Woof-Bug: confirmed" header to your reply, your
> message will make it through https://updates.orgmode.org - I'm adding
> this header to this very message as an example.
>
> Best,
>
> -- 
>  Bastien



Re: changelog entry via Magit (was Bug: Typo in archive location example in manual)

2020-09-14 Thread Ihor Radchenko
> Hmm, that's what I use.  If you go to the diff buffer that (by default)
> is popped up while committing [*], hitting C (magit-commit-add-log) on a
> hunk should add an entry to the commit message buffer.
>
> What happens on your end?  (And what version of Magit are you using?)

Thanks for the pointer about magit-commit-add-log! It indeed works, but
the binding was shadowed by my modal bindings in boon-mode. I usually
access the magit commands from transient magit help menu.
magit-commit-add-log is not listed there.

Best,
Ihor

Kyle Meyer  writes:

> Ihor Radchenko writes:
>
>> By the way, do you know how to automatically format changelog entries in
>> magit. The suggestion from contribute page seems outdated (or I miss
>> something):
>>
>>> If you are using magit.el in Emacs, the ChangeLog for such entries are
>>> easily produced by pressing C in the diff listing.
>
> Hmm, that's what I use.  If you go to the diff buffer that (by default)
> is popped up while committing [*], hitting C (magit-commit-add-log) on a
> hunk should add an entry to the commit message buffer.
>
> What happens on your end?  (And what version of Magit are you using?)
>
>
>   [*] I haven't followed it closely, but Noam Postavsky has worked on
>   improving changelog generation in Emacs (shipped with Emacs 27, I
>   believe) and then using that in Magit (in-flight PR).  IIUC the
>   end result is that the full changelog skeleton could be inserted
>   by calling a single command from the commit message buffer.  (And
>   calling the command manually could be avoided by adding it to
>   git-commit-setup-hook.)
>
>   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16301#11
>   https://github.com/magit/magit/issues/2931
>   https://github.com/magit/magit/pull/3928



Re: [PATCH] org.el: Adapt org-cycle to work with headlines with hidden stars

2020-09-14 Thread Marlin Strub
Hi Bastien,

Thanks for looking into this. I just tested with 9c31cba00 and
org-cycle does not work reliably when org-starless-mode is
enabled unless the patch is applied.

Best,
Marlin

On Sun, 13 Sep 2020 at 19:18, Bastien  wrote:

> Hi Marlin,
>
> Marlin Strub  writes:
>
> > I looked into using text properties to hide all the stars in org
> > headings (with org-starless-mode [1]),
> > and noticed that `org-cycle' didn't reliably cycle the visibility of
> > headings anymore.
>
> there was a recent fix for this in the master branch: can you test
> latest Org (from master) and see if your fix is still needed?
>
> Thanks a lot,
>
> --
>  Bastien
>


Re: Bug: =C-c C-e l o= does not open the pdf anymore [9.3.7 (9.3.7-55-gba2405-elpa @ /home/fsantos/.emacs.d/elpa/org-20200907/)]

2020-09-14 Thread Colin Baxter
> Frederic Santos  writes:

> Hi everyone, After upgrading to Emacs 27, I noticed that, for any
> org document, =C-c C-e l o= now behaves on my computer as =C-c C-e
> l p=; i.e., the pdf is correctly produced, but is not displayed
> anymore on side window.

> Several users (using various operating systems) confirmed the bug
> on StackExchange:
> 
https://emacs.stackexchange.com/questions/60379/c-c-c-e-l-o-does-not-open-the-pdf-anymore

> Is there any simple workaround to solve that?

Does not happen to me. I'm on emacs-27.1 and org-mode from git (version
9.3.8 (release_9.3.8-777-g9c31cb). Perhaps try updating your org-mode.

Best wishes




Re: Bug: org-table-import fails to import xlxs files

2020-09-14 Thread swedebugia
Den Sun, 13 Sep 2020 19:15:58 +0200
skrev Re: Bug: org-table-import fails to import xlxs files:

> Hi,
> 
> swedebugia  writes:
> 
> > When trying to import a xslx table into org-mode I get a lot of
> > binary data instead of a table back.  
> 
> Indeed!  Let's have Org throw an error in such cases, I made this
> change in master as 9c31cba00.
> 
> Thanks,
> 

Thank you!

Do you have any idea how I can setup org-mode to use a convert
tool before trying to import?

cheers



Re: [Announcement] New package ox-leanpub

2020-09-14 Thread TEC


Bastien  writes:

> I think it would be best to store this information on Worg rather than
> on the website: the website should be for quasi-immutable things (with
> only a few people having write access), while worg is a perfect place
> for things that can be collaboratively updated.

My mental model was with the website as 'first class' information,
and Worg as a 'secondary' wiki. This does seem like the ideal content to
be collaboratively updated though.

> Would you volunteer to build the list on Worg?  It does not need to be
> complete, just regularily updated.

I would. The one other reason I lent towards the website initially
though was because I felt that this could be best served by a tiled
layout similar to https://orgmode.tecosaur.com/tools.html - which
currently relies on some CSS not in Worg. That could be added inline,
but that feels slightly hacky to me somehow.

Let me know if there's a particular direction you'd like me to take with
this.

Other than that, I don't believe I have an account on code.orgmode.org
yet --- that could be helpful :P

Timothy.



Fwd: how to remove automatically an intermediate odt-File

2020-09-14 Thread Rainer Thiel
-- Forwarded message -
Von: Kyle Meyer 
Date: So., 13. Sept. 2020 um 17:09 Uhr
Subject: Re: how to remove automatically an intermediate odt-File
To: 


Hi Rainer,

Rainer Thiel writes:

> Thanks for the help, but I cannot get it right.  I am always getting
> the message «error: Unknown add-function location ‘org-odt-convert’».

org-odt-convert is defined in ox-odt, so if that library isn't loaded
yet, you'll need to explicitly load it before that snippet:

(require 'ox-odt)

Or you could use eval-after-load, as in the next snippet.

> Where exactly do I have to place this code snippet?  I am sorry should
> I be overlooking something obvious.

Anywhere in your Emacs customization should do.  If you wanted to avoid
loading ox-odt at startup, you do something like this:

(eval-after-load 'ox-odt
  '(advice-add 'org-odt-convert :after
   (lambda ( in-file  _)
 (when in-file
   (delete-file in-file)))
   '((name . "org-odt-convert--delete-in-file"

> Thank you very much again,

Happy to help, but in the future please keep your replies on list.  That
(1) allows others to help and give feedback and (2) may help other
readers that had the same question as you.


-- 
Prof. Dr. Rainer Thiel
Institut für Altertumswissenschaften
07737 Jena, Germany (EU)
r.th...@uni-jena.de



Elpa package out-of-date?

2020-09-14 Thread Kartik Saranathan
Hello,

I've installed package org-plus-contrib version 20200914 from
http://orgmode.org/elpa/
I see in org.el that the version is 9.3.8 which was updated 6 days ago in
https://code.orgmode.org/bzg/org-mode/commit/dab32da708057b18e8b3585543d7f44982dbf13f

But when i look at ob-python.el I don't have following change that was made
6 months ago

https://code.orgmode.org/bzg/org-mode/commit/4f31aa2d3b2d1d8148a44550158f667b67c1fafd

I see the ob-python.el from the 9.3.8 release is 8 months old.
https://code.orgmode.org/bzg/org-mode/src/release_9.3.8/lisp/ob-python.el

Does the file need to be updated?  There are bugfixes made to ob-python.el
that I would like to have.

Thank you

Kartik