Re: bugs in the new release of org

2020-10-02 Thread Samuel Wales
a couple of corrections to my previous post.

the keystrokes are C-c C-e t A after setting subtree and body only.

pointer actually works for showing the link.  just not cursor.

On 10/2/20, Samuel Wales  wrote:
> a few things are broken for me in the new version of maint.  my
> computer use is limited, so i am taking them slowly..
>
> emacs 25.
>
> any hints are welcome.  i am not able to proceed further.
>
>
> 1.
>
> this export does nothing, with no errors or warnings:
>
>   (org-export-to-buffer 'ascii "alpha-org-export-output.txt" nil
> 'subtree nil 'body-only)
>
> prior to the recent release, it exported.
>
> i tried emacs -Q with C-c C-e A, this said that it was unable to
> resolve a link.  however, the link was outside the subtree.  i do not
> know why it would look there.  also i do not know why it woul dtry to
> resolve a link.  or rather i don't know what that means.
>
> the link seems ok.  it is an org id link.  so why is it erroring?  i
> don't know.  does this have anything to do with the errorless
> no-result problem i am trying to debug?  i could not be sure.
>
> i also tried edebug, but that quickly exceeds my limits.  i did
> unwisely do a few levels, but everything returned nothing.  for
> example, the export-as function returned an empty string.
>
>
> any comments or hints, even small ones, would be appreciated.  i am
> not able to debug this.
>
>
> 2.
>
> another broken thing, in case it rings a bell for anybody, is that i
> had eldoc set up to emit link target when hovering cursor/pointer.  i
> think this uses
> help echo.  that stopped working.  if this does not trigger a priori
> ideas, i will let it stay broken.
>
>
> thank you.
>
> --
> The Kafka Pandemic
>
> Please learn what misopathy is.
> https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



bugs in the new release of org

2020-10-02 Thread Samuel Wales
a few things are broken for me in the new version of maint.  my
computer use is limited, so i am taking them slowly..

emacs 25.

any hints are welcome.  i am not able to proceed further.


1.

this export does nothing, with no errors or warnings:

  (org-export-to-buffer 'ascii "alpha-org-export-output.txt" nil
'subtree nil 'body-only)

prior to the recent release, it exported.

i tried emacs -Q with C-c C-e A, this said that it was unable to
resolve a link.  however, the link was outside the subtree.  i do not
know why it would look there.  also i do not know why it woul dtry to
resolve a link.  or rather i don't know what that means.

the link seems ok.  it is an org id link.  so why is it erroring?  i
don't know.  does this have anything to do with the errorless
no-result problem i am trying to debug?  i could not be sure.

i also tried edebug, but that quickly exceeds my limits.  i did
unwisely do a few levels, but everything returned nothing.  for
example, the export-as function returned an empty string.


any comments or hints, even small ones, would be appreciated.  i am
not able to debug this.


2.

another broken thing, in case it rings a bell for anybody, is that i
had eldoc set up to emit link target when hovering cursor/pointer.  i
think this uses
help echo.  that stopped working.  if this does not trigger a priori
ideas, i will let it stay broken.


thank you.

-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



[PATCH] org: Fix a docstring typo

2020-10-02 Thread Morgan . J . Smith
From: Morgan Smith 

* lisp/org.el (org-check-before-invisible-edit): Fix a docstring typo.
---

Hello Org! This is my first patch so go easy on me. I'm planning on doing more 
patches in the future. I already submitted the FSF paperwork for emacs, so 
hopefully I don't have to do anything extra there.


 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 7438b9944..b222ea20c 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16577,7 +16577,7 @@ overwritten, and the table is not marked as requiring 
realignment."
(1+ org-self-insert-command-undo-counter

 (defun org-check-before-invisible-edit (kind)
-  "Check is editing if kind KIND would be dangerous with invisible text around.
+  "Check if editing kind KIND would be dangerous with invisible text around.
 The detailed reaction depends on the user option `org-catch-invisible-edits'."
   ;; First, try to get out of here as quickly as possible, to reduce overhead
   (when (and org-catch-invisible-edits
--
2.28.0



Re: Two tables with same data but different sorting

2020-10-02 Thread John Kitchin
I don't know of something built in, but dash provides a few things sort
of like that:

#+BEGIN_SRC emacs-lisp :results raw
(-last-item '(a b c))
#+END_SRC

#+RESULTS:
c



#+BEGIN_SRC emacs-lisp :results raw
(-slice '(a b c) -1)
#+END_SRC

#+RESULTS:
(c)

#+BEGIN_SRC emacs-lisp :results raw
(-take-last 1 '(a b c))
#+END_SRC

#+RESULTS:
(c)

surprisingly, it does not seem to support negative indices, but I guess
it would not be hard to make a wrapper that does that.

Axel Kielhorn  writes:

>> Am 01.10.2020 um 17:47 schrieb John Kitchin :
>>
>> Glad it was helpful. You might also try (seventh row1) or (nth 6 row1). I 
>> think it is the same thing, but more obvious to read!
>
> I agree that „first second …“ would be easier for an english speaker.
> Having the ordinal number 1 based but the nth number 0 based is irritating 
> (and sadly there is no „last“ or „penultimate“).
>
> Actually I was looking for something like last element or the element before 
> the last element.
>
> (nth -1 row1) for the last row would be fine, but I guess that is the Python 
> whispering in my ear.
>
> Combined with the right :exports I now get what I want.
>
> Thanks again for this additional information.
>
> Greetings Axel


--
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



How to reinject custom function into derived backend which doesn't implement it, ex : footnote in ox-slimhtml backend.

2020-10-02 Thread rey-coyrehourcq

Hi,

I'm trying to develop my own `publish.el` for some research project linked to 
reproductibility. 
I chose ox-slimhtml [0] as derived backend to limit and simplify the html/css 
outputs generated by vanilla html
backend/publish. 

Actually footnotes are not defined in ox-slimhtml, so as i read in the org 
documentation [1] ), 
i try to add this capacity by simply calling vanilla ox-html function 
org-html-footnote-reference into translate-alist :

(org-export-define-derived-backend 'ox-slimhtml-publish-to-html 'slimhtml
  :translate-alist '((bold . ox-slimhtml-bold)
 
(footnote-reference . org-html-footnote-reference)
 (verse-block . org-html-
verse-block)
 (special-block . org-html-special-block)))

Using the vanilla ox-html export function, everything is awesome and footnote 
appear in my html, normal.
 
:publishing-function org-blog-publish-to-html 

But if i switch to ":publishing-function ox-slimhtml-publish-to-html" the 
function 
org-html-footnote-reference is never called.

There is something i don't understand in the processing of "translate-alist", 
so perhaps if the derived backend doesn't
implement a footnote-reference function, i cannot extend it ?

If you have some higlight on this, or solution on this problem, i'm interested.

[0] https://github.com/balddotcat/ox-slimhtml
[1] https://orgmode.org/manual/Advanced-Export-Configuration.html

Best 
-- 

Sébastien Rey-Coyrehourcq
Research Engineer UMR IDEES
02.35.14.69.30

{Stronger security for your email, follow EFF tutorial : https://ssd.eff.org/}



signature.asc
Description: This is a digitally signed message part


Re: org-capture at point

2020-10-02 Thread No Wayman



Looks like it was introduced with:

f5573e6a0 org-capture.el: Fix heading's level when inserting a
template "here"


I believe the issue is due to `org-back-to-heading' moving point 
when calculating the heading level.

The attached patch corrects the issue on my end.
Tested by running:

#+begin_src emacs-lisp :lexical t
(dotimes (n 3)
 (let ((org-capture-templates
`(( "e" "test"
entry
(file "/temp/null.org")
,(format "* %d" n)
:immediate-finish t
:no-save t
   (goto-char (point-max))
   (org-capture 0 "e")))
#+end_src

With a buffer containing:

* foo
** one
*** two
 three
*** four

Which results in:

* foo
** one
*** two
 three
*** four
*** 0
*** 1
*** 2

>From 5a35577f22cdc849ebcede6bac7b7f22da7eb16b Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer 
Date: Fri, 2 Oct 2020 14:01:35 -0400
Subject: [PATCH] org-capture.el: Fix heading's position when inserting a
 template "here"

* lisp/org-capture.el (org-capture-place-entry): Fix heading's
position when inserting a template "here" with C-0 M-x org-capture.
---
 lisp/org-capture.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 67c58ffdd..020feb4d6 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1150,10 +1150,11 @@ may have been stored before."
  (insert-here?
   ;; FIXME: level should probably set directly within (let ...).
   (setq level (org-get-valid-level
-		   (if (or (org-at-heading-p)
-			   (ignore-errors (org-back-to-heading t)))
-		   (org-outline-level)
-		 1
+   (if (or (org-at-heading-p)
+   (ignore-errors
+			 (save-excursion (org-back-to-heading t
+   (org-outline-level)
+ 1
  ;; Insert as a child of the current entry.
  ((org-capture-get :target-entry-p)
   (setq level (org-get-valid-level
-- 
2.28.0



Re: recursive checkbox counting

2020-10-02 Thread Alan Schmitt
On 2020-10-02 09:40, Nick Dokos  writes:

> Not sure whether this will work (or whether it will help in your case):
>
> https://emacs.stackexchange.com/questions/60710/is-there-any-way-of-getting-overview-statistics-for-all-checkboxes-in-a-given-or/60747#60747
>
> There are some links to other questions on Emacs SE that might (or
> might not) be helpful.

Thank you for the suggestion. I think I might stay with nested lists at
the moment, as it works for me.

Best,

Alan


signature.asc
Description: PGP signature


Re: recursive checkbox counting

2020-10-02 Thread Nick Dokos
Alan Schmitt  writes:

> On 2020-10-01 14:24, torys.ander...@gmail.com (Tory S. Anderson) writes:
>
>> The way I've made this work is with the following property:
>>
>>:COOKIE_DATA: ALL
>>
>> But I suppose I haven't tried if that's fully recursive.
>
> Thank you for the suggestion. I gave it a try, and unfortunately it does
> not work.
>

Not sure whether this will work (or whether it will help in your case):

   
https://emacs.stackexchange.com/questions/60710/is-there-any-way-of-getting-overview-statistics-for-all-checkboxes-in-a-given-or/60747#60747

There are some links to other questions on Emacs SE that might (or
might not) be helpful.

> Best,
>
> Alan
>

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: Two tables with same data but different sorting

2020-10-02 Thread Robert Pluim
> On Fri, 2 Oct 2020 08:25:03 +0200, Axel Kielhorn 
>  said:

>> Am 01.10.2020 um 17:47 schrieb John Kitchin :
>> 
>> Glad it was helpful. You might also try (seventh row1) or (nth 6 row1). 
I think it is the same thing, but more obvious to read!

Axel> I agree that „first second …“ would be easier for an english speaker.
Axel> Having the ordinal number 1 based but the nth number 0 based is 
irritating (and sadly there is no „last“ or „penultimate“).

? C-h f last

last is a compiled Lisp function in `subr.el'.

(last LIST  N)

  Probably introduced at or before Emacs version 1.1.
  This function does not change global state, including the match data.

Return the last link of LIST.  Its car is the last element.
If LIST is nil, return nil.
If N is non-nil, return the Nth-to-last link of LIST.
If N is bigger than the length of LIST, return LIST.

Axel> Actually I was looking for something like last element or the element 
before the last element.

element before last would be

(car (last lst 2))


Robert
-- 



Re: recursive checkbox counting

2020-10-02 Thread Alan Schmitt
On 2020-10-01 14:24, torys.ander...@gmail.com (Tory S. Anderson) writes:

> The way I've made this work is with the following property:
>
>:COOKIE_DATA: ALL
>
> But I suppose I haven't tried if that's fully recursive.

Thank you for the suggestion. I gave it a try, and unfortunately it does
not work.

Best,

Alan


signature.asc
Description: PGP signature


Re: Reciprocal links between items

2020-10-02 Thread Victor A. Stoichita

Hi Samuel,

When you say item, do you mean list item, or thing?  In either 
case,

Org cannot currently do this.


That was unclear, sorry: I really meant linking two headings. 
I have one heading per note and the idea is to go back and forth 
between related notes. org-super-links promises to do just that so 
I think I’ll try it first. But being able to find all the links to 
a given heading will definitely be useful too. Thank you for 
sharing your way to do this! I’ll try to play with it from 
my agenda.


Cheers,
Victor



Re: Reciprocal links between items

2020-10-02 Thread Victor A. Stoichita



Le 02 Oct 2020, Ihor Radchenko  a écrit :
https://github.com/toshism/org-super-links is probably what 
you want.


Yes, this looks like it! Thank you Ihor!





Re: Two tables with same data but different sorting

2020-10-02 Thread Axel Kielhorn


> Am 01.10.2020 um 17:47 schrieb John Kitchin :
> 
> Glad it was helpful. You might also try (seventh row1) or (nth 6 row1). I 
> think it is the same thing, but more obvious to read!

I agree that „first second …“ would be easier for an english speaker.
Having the ordinal number 1 based but the nth number 0 based is irritating (and 
sadly there is no „last“ or „penultimate“).

Actually I was looking for something like last element or the element before 
the last element.

(nth -1 row1) for the last row would be fine, but I guess that is the Python 
whispering in my ear.

Combined with the right :exports I now get what I want.

Thanks again for this additional information.

Greetings Axel