Re: :STYLE: habit causes position in agenda view to change

2020-07-14 Thread Kyle Meyer
Adam Spiers writes:

> I've noticed that adding the :STYLE: habit property to a TODO causes
> its position in the agenda view to change; it jumps to the bottom of
> the day.  Is there any way to prevent that?

Try customizing org-agenda-sorting-strategy (in particular, dropping
habit-down from agenda's values).



Re: patch: ob-screen: don't change user-specified session name [9.3.7 (9.3.7-12-g5d6868-elpaplus @ /home/kdm/.emacs.d/elpa/org-plus-contrib-20200706/)]

2020-07-14 Thread Kyle Meyer
Kyle Meyer writes:

> Kyle Meyer writes:
>
>> Ken Mankoff writes:
>>
>>> ob-screen prepends "org-babel-session-" to the user-specific screen
>>> name for some reason. I suggest this is not necessary nor optimal. One
>>> of the key points of 'screen' is that you can detach and attach from
>>> elsewhere. The name of the session is an important part of this
>>> process, and changing the user-chosen name complicates this. I note
>>> that in the other babel :session names I use (shell, Python,
>>> jupyter-python, etc.) the :session name is not modified.
>>
>> Sounds reasonable to me.  Could add a commit message and NEWS entry to
> :/   ^ you
>> the patch?

For posterity: This patch was included in a set of patches at
.



Re: patch: ob-screen support for user-specified screenrc [9.3.7 (9.3.7-12-g5d6868-elpaplus @ /home/kdm/.emacs.d/elpa/org-plus-contrib-20200706/)]

2020-07-14 Thread Kyle Meyer
Ken Mankoff writes:

> Last ob-screen patch. I apologize if these should have been one email
> but they are there independent issues.
>
> This patch maintains the default behavior of no screenrc "-c
> /dev/null", but adds a :screenrc header arg that allows the user to
> specify their default or any file to be used as a screenrc file.

For posterity: This patch was included in a set of patches at
.



Re: [PATCH] 3 improvements to ob-screen

2020-07-14 Thread Kyle Meyer
Ken Mankoff writes:

> I've signed the FSF docs but do not see my name here:
> https://orgmode.org/worg/org-contribute.html under "Current
> contributors".

Thanks for the information.  I'll add you to the list.

> Subject: [PATCH 1/3] ob-screen: Execute last line in block (send newline)

Could you add a changelog entry to the body of this commit message and
the others?  As an example, here's the one in the most recent commit on
master:

* lisp/ox.el (org-export-smart-quotes-alist): Add Romanian variants for
  smart quotes.

> Subject: [PATCH 3/3] ob-screen: accept :screenrc header argument
>
> ---
>  etc/ORG-NEWS  | 6 ++
>  lisp/ob-screen.el | 5 +++--
>  2 files changed, 9 insertions(+), 2 deletions(-)

I didn't comment on this one elsewhere.  Looks good to me.

> diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
> index 623fa9dc3..5fb2af22e 100644
[...]
> diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el
> index fe4698203..7115080f8 100644
> --- a/lisp/ob-screen.el
> +++ b/lisp/ob-screen.el
> @@ -40,7 +40,7 @@
>  In case you want to use a different screen than one selected by your $PATH")
>  
>  (defvar org-babel-default-header-args:screen
> -  '((:results . "silent") (:session . "default") (:cmd . "sh") (:terminal . 
> "xterm"))
> +  '((:results . "silent") (:session . "default") (:cmd . "sh") (:terminal . 
> "xterm") (:screenrc . "/dev/null"))
>"Default arguments to use when running screen source blocks.")

nit-pick: Please move the new entry to the next line.



Bug: no math-mode detection for align-environment [9.3.7 (9.3.7-13-ge62ca4-elpaplus @ /home/stefi/.emacs.d/elpa/org-plus-contrib-20200713/)]

2020-07-14 Thread Stefi
Hi there,

I recently updated my emacs packages and noticed that \begin{align*}
does not trigger math-mode detection any more, so org-cdlatex does not
work. However, begin{equation} still does trigger the math-mode
detection. I have read the documentation of
"org-inside-LaTeX-fragment-p" and found something about matchers, but
nothing about equation or align environment and why it might be treated
differently for math-mode detection.

My test-file.org:
8<-8<-8<-8<-

* blabla
 \begin{equation}
\label{eq:1} \frac{}{}
test_{cds} \frac{}{}
\end{equation}

\begin{align}
\label{eq:2}
test$_d$ fr
\end{align}

$\frac{}{} fds_{fdsf} \frac{}{}$

\begin{align*}
fr
\end{align*}


8<-8<-8<-8<-

- detection works for: \begin{equation}, $$, \[\] (not in testfile)
- detection does not work for: \begin{align}, begin{align*}; subscript _
  does insert extra $_{}$, which it should not in math mode, and fr does
  not get expanded to \frac{}{}

Emacs  : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
 of 2020-05-19
Package: Org mode version 9.3.7 (9.3.7-13-ge62ca4-elpaplus @
/home/stefi/.emacs.d/elpa/org-plus-contrib-20200713/)


Kind regards,
stefi



[PATCH] Update ob-haskell from deprecated inf-haskell-mode to haskell-interactive-mode

2020-07-14 Thread Seth Lee
Hello, I've made a patch for `ob-haskell.el`.
I'm not really an elisper, but I made a patch that seems to work on my machine.

Issue: compiling code in a source block that had an infinite list that would 
evaluate in the ghci.
All code, even with `:compile` flag set would be run in ghci.

Updating deprecated `inf-haskell-mode` to `haskell-interactive-mode` solves the 
issue for me.

Source blocks flagged to compile will compile in a temp file, and those flagged 
otherwise will be run interactively. This is the intended behaviour.

Patch attached.

0001-ob-haskell.el-Update-deprecated-functions.patch
Description: Binary data


[PATCH] 3 improvements to ob-screen

2020-07-14 Thread Ken Mankoff
Hello,

The attached three patches implement a bug fix, a simplification, and a new 
feature to ob-screen.

bug fix: 001 Execute last line in block (send newline)
simplify: 002 Don't add extra characters to session name
feature: 003 Accept :screenrc header argument

I've signed the FSF docs but do not see my name here: 
https://orgmode.org/worg/org-contribute.html under "Current contributors".

  -k.

>From cb014cd2da79b30967dd24fba37d7f75569ed92d Mon Sep 17 00:00:00 2001
From: "Kenneth D. Mankoff" 
Date: Tue, 14 Jul 2020 13:29:36 -0700
Subject: [PATCH 1/3] ob-screen: Execute last line in block (send newline)

---
 lisp/ob-screen.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el
index 75a2dc691..3edc2c265 100644
--- a/lisp/ob-screen.el
+++ b/lisp/ob-screen.el
@@ -108,6 +108,7 @@ In case you want to use a different screen than one selected by your $PATH")
   (let ((tmpfile (org-babel-temp-file "screen-")))
 (with-temp-file tmpfile
   (insert body)
+  (insert "\n")
 
   ;; org-babel has superfluous spaces
   (goto-char (point-min))
-- 
2.25.1

>From e6ee8bff913da35a0183f8e2c1db7021342492d9 Mon Sep 17 00:00:00 2001
From: "Kenneth D. Mankoff" 
Date: Tue, 14 Jul 2020 13:41:35 -0700
Subject: [PATCH 2/3] ob-screen: Respect :session name. Don't prepend
 'org-babel-session-'

---
 etc/ORG-NEWS  | 7 +++
 lisp/ob-screen.el | 6 ++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index c366f61e0..623fa9dc3 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -380,6 +380,13 @@ From ~org-enable-priority-commands~ to ~org-priority-enable-commands~.
 From ~org-show-priority~ to ~org-priority-show~.
 
 ** Miscellaneous
+*** =ob-screen.el=: Respect screen =:session= name
+
+Screen babel session are now named based on the =:session= header 
+argument (defaults to ~default~). 
+
+Previously all session names had  ~org-babel-session-~ prepended.
+
 *** Forward/backward paragraph functions in line with the rest of Emacs
 ~org-forward-paragraph~ and ~org-backward-paragraph~, bound to
 ~~ and ~~ functions mimic more closely behaviour of
diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el
index 3edc2c265..fe4698203 100644
--- a/lisp/ob-screen.el
+++ b/lisp/ob-screen.el
@@ -62,8 +62,7 @@ In case you want to use a different screen than one selected by your $PATH")
  (process-name (concat "org-babel: terminal (" session ")")))
 (apply 'start-process process-name "*Messages*"
terminal `("-T" ,(concat "org-babel: " session) "-e" ,org-babel-screen-location
-		  "-c" "/dev/null" "-mS" ,(concat "org-babel-session-" session)
-		  ,cmd))
+		  "-c" "/dev/null" "-mS" ,session ,cmd))
 ;; XXX: Is there a better way than the following?
 (while (not (org-babel-screen-session-socketname session))
   ;; wait until screen session is available before returning
@@ -97,8 +96,7 @@ In case you want to use a different screen than one selected by your $PATH")
 			 nil
 			 (mapcar
 			  (lambda (x)
-			(when (string-match
-   (concat "org-babel-session-" session) x)
+			(when (string-match x)
 			  x))
 			  sockets)
 (when match-socket (car (split-string match-socket)
-- 
2.25.1

>From 866f3c4788e58bf26dcf9c90cb7638f48a6a4ecc Mon Sep 17 00:00:00 2001
From: "Kenneth D. Mankoff" 
Date: Tue, 14 Jul 2020 13:48:52 -0700
Subject: [PATCH 3/3] ob-screen: accept :screenrc header argument

---
 etc/ORG-NEWS  | 6 ++
 lisp/ob-screen.el | 5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 623fa9dc3..5fb2af22e 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -229,6 +229,12 @@ directory configured for ClojureScript will /not/ work.
 Babel Java blocks recognize header argument =:cmdargs= and pass its
 value in call to =java=.
 
+*** =ob-screen.el=: Screen now accepts =:screenrc= header argument
+
+Screen blocks now recognize the =:screenrc= header argument and pass
+its value to the screen command via the "-c" option. The default
+remains =/dev/null= (i.e. a clean screen session)
+
 *** =RET= and =C-j= now obey ~electric-indent-mode~
 
 Since Emacs 24.4, ~electric-indent-mode~ is enabled by default.  In
diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el
index fe4698203..7115080f8 100644
--- a/lisp/ob-screen.el
+++ b/lisp/ob-screen.el
@@ -40,7 +40,7 @@
 In case you want to use a different screen than one selected by your $PATH")
 
 (defvar org-babel-default-header-args:screen
-  '((:results . "silent") (:session . "default") (:cmd . "sh") (:terminal . "xterm"))
+  '((:results . "silent") (:session . "default") (:cmd . "sh") (:terminal . "xterm") (:screenrc . "/dev/null"))
   "Default arguments to use when running screen source blocks.")
 
 (defun org-babel-execute:screen (body params)
@@ -59,10 +59,11 @@ In case you want to use a different screen than one selected by your $PATH")
   (let* ((session (cdr (assq :session 

Re: org-babel parenthesis tracking blinded by > in code block

2020-07-14 Thread Jeremie Juste


Many thanks indeed,
>
> I have the following settings,
>
> (modify-syntax-entry ?< ".")
> (modify-syntax-entry ?> ".")
>
> in my org mode hook.  This stops org from treating them as parenthesis.


Best regards,
Jeremie



Re: Superscript and non-blank character

2020-07-14 Thread ian martins
Bo, you can try this. I don't know what else it will break, so I did it as
a file local. alternatively you could set `org-match-substring-regexp' in
your init.

---
;;; -*- org-match-substring-regexp:
"\\(\\)\\([_^]\\)\\(\\(?:{\\([^{}]*?\\|\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?\\|\\(?:[^{}]*?{\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?}\\)+[^{}]*?\\)}\\)\\|\\(?:(\\([^()]*?\\|\\(?:[^()]*?([^()]*?)\\)+[^()]*?\\|\\(?:[^()]*?(\\(?:[^()]*?([^()]*?)\\)+[^()]*?)\\)+[^()]*?\\))\\)\\|\\(?:\\*\\|[+-]?[[:alnum:].,\\]*[[:alnum:]]\\)\\)";
org-pretty-entities: t; -*-

here are some verses where there's a space after the verse number:

^1 In the beginning God created the heavens and the earth. ^2 Now the earth
was formless and empty, darkness was over the surface of the deep, and the
Spirit of God was hovering over the waters.

if you don't want the space after the verse number, you can use curlys:

^{3}And God said, “Let there be light,” and there was light. ^{4}God saw
that the light was good, and he separated the light from the darkness.
^{5}God called the light “day,” and the darkness he called “night.” And
there was evening, and there was morning—the first day.

On Fri, Jul 10, 2020 at 8:33 PM Bo Grimes  wrote:

> Emacs 26.3, Org-mode 9.1.9, Kubuntu 20.04, 5.4.0-39-generic
>
> Hi,
>
> I've tried my hardest to find an answer in the manuals (print book and
> on-line), this list, Reddit, and Stack Exchange with no luck.  I use Emacs
> for org-mode, and I don't code or know Elisp.  I have no use for or
> interest in learning LaTeX.  I never use subscript, and I only use
> superscript in poetry/prose (mostly quotes, not original), and I don't
> foresee (but admit I may) a need to export.
>
> I understand that:
>
> ^2H is not recognized as superscript _on purpose_. Per Org syntax, you
> have to add a non-blank character before the caret. Otherwise, there would
> be ambiguity between underline (e.g., _under_) and subscript (_under). And
> superscript syntax follows subscript's. [1]
>
> That makes sense to me as a default [2], given that so many org-mode users
> use both in math, science, and literate coding context, so I wouldn't think
> to suggest it to be changed.  All I want to know is how I can change it for
> *me*.
>
> I would like to org-toggle-pretty-entities in a buffer and see superscript
> before, say, a poetry line or Bible verse I'm quoting in a note or journal
> entry, and not see the non-blank character.
>
> Can this be done via customize or with an Elisp snippet in init.el?
>
> Thanks!
>
> [1] https://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg01022.html
>
> [2] Though I wish it were made explicit in the manuals
> https://orgmode.org/manual/Subscripts-and-Superscripts.html#Subscripts-and-Superscripts
> (Org Mode 9 Reference Manual p 132). It took me a while to figure out why
> it wasn't working at all.
>
>
>


Re: [BUG] org-fill-paragraph fills paragraph before selected region

2020-07-14 Thread Nicolas Goaziou
Hello,

Matt Lundin  writes:

> When there is an active region, the function org-fill-paragraph does not
> limit itself to the active region but also fills the paragraph before
> the active region.
>
> Steps to reproduce. Use the following file. Mark the last two entry
> paragraphs, beginning at "Lorem" and ending at the end of the buffer
> ("erat."). Type 'M-q' (org-fill-paragraph).
>
> --8<---cut here---start->8---
> * This is a test
>
>   Aliquam erat volutpat.  Nunc eleifend leo vitae magna.  In id erat non orci 
> commodo lobortis.  Proin neque massa, cursus ut, gravida ut, lobortis eget, 
> lacus.  Sed diam.  Praesent fermentum tempor tellus.  Nullam tempus.  Mauris 
> ac felis vel velit tristique imperdiet.  Donec at pede.  Etiam vel neque nec 
> dui dignissim bibendum.  Vivamus id enim.  Phasellus neque orci, porta a, 
> aliquet quis, semper a, massa.  Phasellus purus.  Pellentesque tristique 
> imperdiet tortor.  Nam euismod tellus id erat.
>
>   Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  Donec hendrerit 
> tempor tellus.  Donec pretium posuere tellus.  Proin quam nisl, tincidunt et, 
> mattis eget, convallis nec, purus.  Cum sociis natoque penatibus et magnis 
> dis parturient montes, nascetur ridiculus mus.  Nulla posuere.  Donec vitae 
> dolor.  Nullam tristique diam non turpis.  Cras placerat accumsan nulla.  
> Nullam rutrum.  Nam vestibulum accumsan nisl.
>
>   Aliquam erat volutpat.  Nunc eleifend leo vitae magna.  In id erat non orci 
> commodo lobortis.  Proin neque massa, cursus ut, gravida ut, lobortis eget, 
> lacus.  Sed diam.  Praesent fermentum tempor tellus.  Nullam tempus.  Mauris 
> ac felis vel velit tristique imperdiet.  Donec at pede.  Etiam vel neque nec 
> dui dignissim bibendum.  Vivamus id enim.  Phasellus neque orci, porta a, 
> aliquet quis, semper a, massa.  Phasellus purus.  Pellentesque tristique 
> imperdiet tortor.  Nam euismod tellus id erat.
> --8<---cut here---end--->8---
>
>
> This is the result. Note that the first paragraph, which is outside the
> selected region, is also filled.

Fixed. Thank you.

Regards,
-- 
Nicolas Goaziou



[SOLVED] (was: join tables columnwise columnames are ignored)

2020-07-14 Thread Uwe Brauer
>>> "UB" == Uwe Brauer  writes:

> Hi
> Consider please the following to tables

> #+begin_src 

> ,#+TBLNAME: test3
> | Email   | State|
> |-+--|
> | us...@gmail.com | Sent |
> | us...@gmail.com | not sent |


> ,#+TBLNAME: test4
> | Email  | State   |
> |+-|
> | us...@gmail.coom   | not sent|
> | us...@gmail.com| sent|
> #+end_src


> I want to join them, adding columns, and the colnames, so I tried.

> #+BEGIN_SRC emacs-lisp :var t1=test3 t2=test4 :colnames t
> (cl-mapcar #'append t1 t2)
> #+END_SRC




> However this is the result. 

>  #+begin_src 
>  ,#+RESULTS:
>  | us...@gmail.com | Sent | us...@gmail.coom | not sent |
>  | us...@gmail.com | not sent | us...@gmail.com  | sent |
>  #+end_src

> What went wrong?

> Thanks and regards

> Uwe Brauer 

The right code is this one
#+NAME: TA
| col1 | col2 |
|--+--|
|1 |2 |
#+NAME: TB
| col3 |
|--|
|3 |
#+BEGIN_SRC emacs-lisp :var t1=TA t2=TB :colnames no
(insert-at 1 (cl-mapcar #'append t1 t2) 'hline)
#+END_SRC
#+RESULTS:
| col1 | col2 | col3 |
|--+--+--|
|1 |2 |3 |
#+begin_src elisp :noexport
(defun insert-at (n list element)
  "Insert ELEMENT into LIST at position N.
I.e., (eq ELEMENT (nth N (insert-at N LIST ELEMENT)))."
  (if (eq n 0)
  (cons element list)
(let ((link (nthcdr (1- n) list)))
  (setcdr link (cons element (cdr link
list))
#+end_src




smime.p7s
Description: S/MIME cryptographic signature


join tables columnwise columnames are ignored

2020-07-14 Thread Uwe Brauer
Hi

Consider please the following to tables

#+begin_src 

,#+TBLNAME: test3
| Email   | State|
|-+--|
| us...@gmail.com | Sent |
| us...@gmail.com | not sent |


,#+TBLNAME: test4
| Email  | State   |
|+-|
| us...@gmail.coom   | not sent|
| us...@gmail.com| sent|
#+end_src

I want to join them, adding columns, and the colnames, so I tried.


#+BEGIN_SRC emacs-lisp :var t1=test3 t2=test4 :colnames t
(cl-mapcar #'append t1 t2)
#+END_SRC



However this is the result. 
 #+begin_src 
 ,#+RESULTS:
 | us...@gmail.com | Sent | us...@gmail.coom | not sent |
 | us...@gmail.com | not sent | us...@gmail.com  | sent |
 #+end_src

What went wrong?

Thanks and regards

Uwe Brauer 




specifically reduce line spacing of plain lists in OpenDocument Text Export

2020-07-14 Thread Heinz Tuechler

Dear All,

is there a way to specifically reduce the line spacing of plain lists
when exporting to odt? When changing the format of Text Body by the use
of an ODT_STYLES_FILE the spacing between list items and paragraphs is
changed simultaneously, but I don't know, how to change them independently.

best regards,

Heinz