Specifying shells for remote ob-shell sessions?

2021-06-24 Thread David Dynerman
Dear Org Mode Friends,

I’m having some trouble getting the shell I want to run on remote hosts in 
session ob-shell blocks - it seems that no matter what shell I specify, session 
blocks will always run /bin/sh. I’m not sure if this is an org or tramp 
configuration issue on my end, or a bug in org.

I’m pasting a snippet that reproduces the behavior in emacs -Q below. Does 
anyone have an inkling if this is a bug, or, alternatively, suggestions for how 
I can run remote ob-shell sessions with the shell of my choice?

Thank you,
David

#+BEGIN_SRC emacs-lisp  

  (require 'ob-shell)   

  (emacs-version)   

#+END_SRC   


#+RESULTS:
: GNU Emacs 27.2 (build 1, x86_64-apple-darwin17.7.0, Carbon Version 158 AppKit 
1561.6) 
:  of 2021-05-20


#+BEGIN_SRC emacs-lisp  

  (org-version) 

#+END_SRC   


#+RESULTS:
: 9.4.4 


#+BEGIN_SRC zsh :dir /ssh:remote-host:/home/ubuntu  
 
echo $0
#+END_SRC   


#+RESULTS:
: zsh   


#+BEGIN_SRC zsh :dir /ssh:remote-host:/home/ubuntu :session foobar  
 
echo $0
#+END_SRC   


#+RESULTS:
|   |
| $ /bin/sh |


Bug: "before first headline" error when adding clock out note [9.4.6 (9.4.6-dist @ /home/wenlong/org-9.4.6/lisp/)]

2021-06-24 Thread Dave Dai


Steps to reproduce the bug:
1. download orgmode 9.4.6 from https://orgmode.org/org-9.4.6.tar.gz and
extract to home folder
2. start clean emacs instance with 'emacs -Q'
3. evaluate (add-to-list 'load-path "~/org-9.4.6/lisp")
4. create a new org file, create a new heading and clock in
5. evaluate (setq org-log-note-clock-out t)
6. clock out. Once the "*org note*" buffer appears, the error message
"before first headline" will occur.

I could reproduce this with both emacs 27 and 28.
The org version bundled with emacs seems to work fine. Only the latest
version from git repo or from the website has the problem.  


Emacs  : GNU Emacs 27.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
 of 2021-05-24
Package: Org mode version 9.4.6 (9.4.6-dist @ /home/wenlong/org-9.4.6/lisp/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-log-note-clock-out t
 org-reveal-start-hook '(org-decrypt-entry)
 org-mode-hook '((closure
  (org--rds reftex-docstruct-symbol
   org-element-greater-elements org-clock-history
   org-agenda-current-date org-with-time org-defdecode org-def
   org-read-date-inactive org-ans2 org-ans1
   org-columns-current-fmt-compiled org-clock-current-task
   org-clock-effort org-agenda-skip-function
   org-agenda-skip-comment-trees org-agenda-archives-mode
   org-end-time-was-given org-time-was-given
   org-log-note-extra org-log-note-purpose
   org-log-post-message org-last-inserted-timestamp
   org-last-changed-timestamp
   org-entry-property-inherited-from org-blocked-by-checkboxes
   org-state org-agenda-headline-snapshot-before-repeat
   org-agenda-start-on-weekday org-agenda-buffer-tmp-name
   org-priority-regexp org-mode-abbrev-table
   org-mode-syntax-table buffer-face-mode-face org-tbl-menu
   org-org-menu org-struct-menu org-entities org-last-state
   org-id-track-globally org-clock-start-time texmathp-why
   remember-data-file
   org-agenda-tags-todo-honor-ignore-options
   iswitchb-temp-buflist calc-embedded-open-mode
   calc-embedded-open-formula calc-embedded-close-formula
   align-mode-rules-list org-emphasis-alist
   org-emphasis-regexp-components
   org-export-registered-backends org-modules
   org-babel-load-languages org-id-overriding-file-name
   org-indent-indentation-per-level
   org-element-paragraph-separate ffap-url-regexp
   org-inlinetask-min-level t)
  nil
  (add-hook 'change-major-mode-hook 'org-show-all 'append
   'local)
  )
 (closure
  (org-src-window-setup *this*
   org-babel-confirm-evaluate-answer-no
   org-babel-tangle-uncomment-comments
   org-src-preserve-indentation org-src-lang-modes
   org-edit-src-content-indentation org-babel-library-of-babel
   t)
  nil
  (add-hook 'change-major-mode-hook 'org-babel-show-result-all
   'append 'local)
  )
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function '(closure
   (org-id-locations
org-agenda-search-view-always-boolean
org-agenda-overriding-header t)
   (entry) (cdr (assq :title entry)))
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate
  org-babel-speed-command-activate)
 org-export-before-parsing-hook '(org-attach-expand-links)
 

Bug: "before first headline" error when adding clock out note [9.4.6 (9.4.6-dist @ /home/wenlong/org-9.4.6/lisp/)]

2021-06-24 Thread Dave Dai


Steps to reproduce the bug:
1. download orgmode 9.4.6 from https://orgmode.org/org-9.4.6.tar.gz and
extract to home folder
2. start clean emacs instance with 'emacs -Q'
3. evaluate (add-to-list 'load-path "~/org-9.4.6/lisp")
4. create a new org file, create a new heading and clock in
5. evaluate (setq org-log-note-clock-out t)
6. clock out. Once the "*org note*" buffer appears, the error message
"before first headline" will occur.

I could reproduce this with both emacs 27 and 28.
The org version bundled with emacs seems to work fine. Only the latest
version from git repo or from the website has the problem.  


Emacs  : GNU Emacs 27.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
 of 2021-05-24
Package: Org mode version 9.4.6 (9.4.6-dist @ /home/wenlong/org-9.4.6/lisp/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-log-note-clock-out t
 org-reveal-start-hook '(org-decrypt-entry)
 org-mode-hook '((closure
  (org--rds reftex-docstruct-symbol
   org-element-greater-elements org-clock-history
   org-agenda-current-date org-with-time org-defdecode org-def
   org-read-date-inactive org-ans2 org-ans1
   org-columns-current-fmt-compiled org-clock-current-task
   org-clock-effort org-agenda-skip-function
   org-agenda-skip-comment-trees org-agenda-archives-mode
   org-end-time-was-given org-time-was-given
   org-log-note-extra org-log-note-purpose
   org-log-post-message org-last-inserted-timestamp
   org-last-changed-timestamp
   org-entry-property-inherited-from org-blocked-by-checkboxes
   org-state org-agenda-headline-snapshot-before-repeat
   org-agenda-start-on-weekday org-agenda-buffer-tmp-name
   org-priority-regexp org-mode-abbrev-table
   org-mode-syntax-table buffer-face-mode-face org-tbl-menu
   org-org-menu org-struct-menu org-entities org-last-state
   org-id-track-globally org-clock-start-time texmathp-why
   remember-data-file
   org-agenda-tags-todo-honor-ignore-options
   iswitchb-temp-buflist calc-embedded-open-mode
   calc-embedded-open-formula calc-embedded-close-formula
   align-mode-rules-list org-emphasis-alist
   org-emphasis-regexp-components
   org-export-registered-backends org-modules
   org-babel-load-languages org-id-overriding-file-name
   org-indent-indentation-per-level
   org-element-paragraph-separate ffap-url-regexp
   org-inlinetask-min-level t)
  nil
  (add-hook 'change-major-mode-hook 'org-show-all 'append
   'local)
  )
 (closure
  (org-src-window-setup *this*
   org-babel-confirm-evaluate-answer-no
   org-babel-tangle-uncomment-comments
   org-src-preserve-indentation org-src-lang-modes
   org-edit-src-content-indentation org-babel-library-of-babel
   t)
  nil
  (add-hook 'change-major-mode-hook 'org-babel-show-result-all
   'append 'local)
  )
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function '(closure
   (org-id-locations
org-agenda-search-view-always-boolean
org-agenda-overriding-header t)
   (entry) (cdr (assq :title entry)))
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate
  org-babel-speed-command-activate)
 org-export-before-parsing-hook '(org-attach-expand-links)
 

Re: [longlines]

2021-06-24 Thread Haider Rizvi
Uwe Brauer  writes:

> In my experience the best I found was 
>
> (defun my-turn-on-longlines-in-auctex ()
>   "Turn on all three modes which support the display of long-lines."
>   (interactive)
>   (adaptive-wrap-prefix-mode 'toggle)
>   (visual-line-mode 'toggle)
>   (visual-fill-column-mode 'toggle)
>   (message "adaptive-wrap-prefix-mode; visual-line-mode and 
> visual-fill-column-mode are
> ON/OFF."))

Nice. Didn't know about adaptive-wrap mode. I had tried visual-fill-column-mode 
but it clobbered wide tables badly, adaptive-wrap fixes that problem.

Thanks for mentioning it :-) 
-- 




Re: [SOLVED] (kinda) Calendar vs. org-agenda exit

2021-06-24 Thread tomas
On Fri, Jun 25, 2021 at 06:54:25AM +1000, Tim Cross wrote:

[...]
> My view is that if org-mode is stealing the calendar bindings by default
> i.e. user has not enabled some specific option/configuration to do this,
> then this is a bug [...]

AFAIU, Stephen just gave his green light to Stephen's patch :-)

Cheers
 - t


signature.asc
Description: Digital signature


Re: [SOLVED] (kinda) Calendar vs. org-agenda exit

2021-06-24 Thread Tim Cross


Stephen Berman  writes:

> On Thu, 24 Jun 2021 14:09:46 +0200 to...@tuxteam.de wrote:
>
>> On Thu, Jun 24, 2021 at 12:13:40PM +0200, Stephen Berman wrote:
>>> On Wed, 23 Jun 2021 18:16:52 +0200 to...@tuxteam.de wrote:
>>>
>>> > On Wed, Jun 23, 2021 at 05:28:36PM +0200, to...@tuxteam.de wrote:
>>> >
>>> > [calendar insert-diary-entry doing funny things]
>>> >
>>> > OK, I solved it by setting `org-calendar-insert-diary-entry-key' to
>>> > [106], which is a ?j. It was set to ?i, which hijacked calendar's
>>> > original key map.
>>> >
>>> > Now I still don't know whether it's intended that Org hijacks that
>>> > key in calendar, whether I did something stupid, but at least I have
>>> > my toys back. Just remember to not push ?j.
>>> >
>>> > Anyway, you set me on the right track, so thanks for that!
>>>
>>> See also bug#48199 (also CC'd at
>>> https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00582.html).
>>> I continue to use the patch I posted there and have had no problems with
>>> it (but I don't use org-mode much).
>>
>> Oh, I see, thanks. For me, it's a bit confusing that this bug receives
>> so little attention. Hijacking other modes's keymaps isn't... friendly,
>> after all. I can't imagine that it is happening by intention.
>
> Yeah, the next time Org is merged to the Emacs master branch, forcing me
> to first stash and then reapply my patch locally, I'll ask if anyone
> objects to the patch being committed to master.  Maybe that will get
> someone's attention (and if not, I may just go ahead and commit it -- if
> it then still gets no one's attention, it must be ok ;-).
>

My view is that if org-mode is stealing the calendar bindings by default
i.e. user has not enabled some specific option/configuration to do this,
then this is a bug. Org should not interfere with the key bindings of
any mode unless asked to. Some people still like to use traditional
Emacs diary rather than org agenda for scheduling meetings/appointments,
but like to use (load) org for other things (like document authoring and
TODO lists). Org should only override the calendar bindings if
requested.

If your patch fixes this, I vote to apply it to master.


-- 
Tim Cross



Re: org-agenda no longer clocks out then in

2021-06-24 Thread Tory S. Anderson
My minimal loadup doesn't exhibit the problem. So, tracing the function 
"org-agenda-clock-in" that my =C-x TAB= is bound to, I see this.

On the broken one I see the following:

#+begin_src lisp
  =1 -> 
(org-agenda-clock-in nil)
1 <- org-agenda-clock-in: !non-local\ exit!
#+end_src

Whereas on the clean working one I see:

#+begin_src lisp
  =1 -> 
(org-agenda-clock-in nil)
1 <- org-agenda-clock-in: 0
#+end_src

But find-grep doesn't find anything in my dependencies that matches 
"non-local". This looks likely to be related to the original problem. Any idea 
how I can find the source of this !non-local? This is my first time using emacs 
function tracing.


Marco Wahl  writes:

> torys.ander...@gmail.com (Tory S. Anderson) writes:
>
>> For years my workflow has centered in org-agenda and I would go from
>> one clocked item to the next.  For instance, I would be clocked into
>> my "Emails" task, which never closes, and then eventually move down in
>> the agenda to "Task B". Then I hit C-x TAB to clock in. It correctly
>> queries for a comment on the task I'm leaving but no longer clocks me
>> in to the new task as I'd asked. Is this a bug or am I missing a new
>> setting?
>
> This should work AFAICT and it does for me.  (With key {I} or {C-c C-x
> TAB} in the agenda opposed to your setting with {C-x TAB}.)
>
> Could you provide a complete mini example?  Possibly this helps to see
> more clearly.
>
>
> Best regards,



Latex highlighting for org-mode

2021-06-24 Thread Christopher Dimech
The convenience of html output is the easiness by which one can zoom
in and out.  Doing that in printed output is difficult because you need
typefaces with different sizes.

I use the latex for mathematical typesetting, with the other things I 
wholeheartedly follow your drift.  There is still so much work to do.
Things have become complicated, and the design has to get simplified,
for the next generation of hackers to work with.


> Sent: Friday, June 25, 2021 at 5:54 AM
> From: "Rob Sargent" 
> To: emacs-orgmode@gnu.org
> Subject: Re: Latex highlighting for org-mode
>
> On 6/24/21 11:43 AM, Christopher Dimech wrote:
> > I only proposed colour highlighing for mathematical snippets.  Nothing else.
> >
> > Or making org able to export to html even when one is using LaTeX blocks.
> >
> > In that sense, it would act in ways similar to texinfo, using a single
> > source file to produce output in a number of formats, both online and 
> > printed.
> >
> >
> Print and digital are vastly different worlds.  Given that one can plop 
> most any file in a web page I would rather see more work on making print 
> layout easier without resorting to latex directives or other single 
> target mark-ups.  Even at the expense of html output.
> 
>



Re: Latex highlighting for org-mode

2021-06-24 Thread Rob Sargent

On 6/24/21 11:43 AM, Christopher Dimech wrote:

I only proposed colour highlighing for mathematical snippets.  Nothing else.

Or making org able to export to html even when one is using LaTeX blocks.

In that sense, it would act in ways similar to texinfo, using a single
source file to produce output in a number of formats, both online and printed.


Print and digital are vastly different worlds.  Given that one can plop 
most any file in a web page I would rather see more work on making print 
layout easier without resorting to latex directives or other single 
target mark-ups.  Even at the expense of html output.




Re: appearance of list as results from evaluating code blocks

2021-06-24 Thread Johannes Brauer
Hi John!

There is no „return“ in Lisp languages. The return value of (list 1 2 3) is (1 
2 3). Clojure is a Lisp language similar to Elisp. So

#+begin_src clojure :results code
(list 1 2 (+ 1 2))
  #+end_src

should work for Clojure as it does für Elisp.

Johannes

Am 24.06.2021 um 18:28 schrieb John Kitchin 
mailto:jkitc...@andrew.cmu.edu>>:

That probably means the clojure block is returning nil as the value. I don't 
know what it means to return something in clojure, but here is what you have to 
do with Python, for example.

#+BEGIN_SRC python :results value code
[1, 2, 3]
#+END_SRC

#+RESULTS:
#+begin_src python
None
#+end_src

You have to explicitly return a value to see it.

#+BEGIN_SRC python :results value code
return [1, 2, 3]
#+END_SRC

#+RESULTS:
#+begin_src python
[1, 2, 3]
#+end_src


John

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



On Thu, Jun 24, 2021 at 10:31 AM Johannes Brauer 
mailto:bra...@nordakademie.de>> wrote:
What about :results code
The default is a elisp code block so you get syntax coloring

That works fore lisp:

  #+begin_src elisp :results code
(list 1 2 (+ 1 2))
  #+end_src

  #+RESULTS:
  #+begin_src elisp
  (1 2 3)
  #+end_src

But with Clojure I get

  #+begin_src clojure :results code
(list 1 2 (+ 1 2))
  #+end_src

  #+RESULTS:
  #+begin_src clojure
  nil
  #+end_src




Latex highlighting for org-mode

2021-06-24 Thread Christopher Dimech


I only proposed colour highlighing for mathematical snippets.  Nothing else.

Or making org able to export to html even when one is using LaTeX blocks.

In that sense, it would act in ways similar to texinfo, using a single
source file to produce output in a number of formats, both online and printed.

> Sent: Friday, June 25, 2021 at 5:30 AM
> From: "Eric S Fraga" 
> To: "Christopher Dimech" 
> Cc: "Help Emacs Orgmode" 
> Subject: Re: Latex highlighting for org-mode
>
> On Thursday, 24 Jun 2021 at 19:25, Christopher Dimech wrote:
> > I conclude that org-mode cauld do with some improvements.  If org-mode
> > was designed to allow LaTeX fragments without the need of any special
> > marking, it should allow latex syntex highlighting without the need of
> > any special markings.
>
> What you want then is AUCTeX mode?  If you want to write in LaTeX, use a
> mode for it.
>
> Org is about much more than LaTeX and bending it backwards to make it
> AUCTeX would be detrimental (see recent discussion on performance issues
> with large special blocks).  You can have LaTeX blocks which you can
> edit very nicely and the rest of the document's interactive use does not
> have to suffer.
>
> --
> : Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-571-gc591be
> : Latest paper written in org: https://arxiv.org/abs/2106.05096
>



Re: [SOLVED] (kinda) Calendar vs. org-agenda exit

2021-06-24 Thread tomas
On Thu, Jun 24, 2021 at 05:04:02PM +0200, Nicolas Goaziou wrote:
> Hello,
> 
> Stephen Berman  writes:
> 
> > Yeah, the next time Org is merged to the Emacs master branch, forcing me
> > to first stash and then reapply my patch locally, I'll ask if anyone
> > objects to the patch being committed to master.
> 
> Sure, go ahead.

Warm thanks, you both!

:)

Cheers
 - t


signature.asc
Description: Digital signature


Re: Latex highlighting for org-mode

2021-06-24 Thread Eric S Fraga
On Thursday, 24 Jun 2021 at 19:25, Christopher Dimech wrote:
> I conclude that org-mode cauld do with some improvements.  If org-mode
> was designed to allow LaTeX fragments without the need of any special
> marking, it should allow latex syntex highlighting without the need of
> any special markings.

What you want then is AUCTeX mode?  If you want to write in LaTeX, use a
mode for it.  

Org is about much more than LaTeX and bending it backwards to make it
AUCTeX would be detrimental (see recent discussion on performance issues
with large special blocks).  You can have LaTeX blocks which you can
edit very nicely and the rest of the document's interactive use does not
have to suffer.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-571-gc591be
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Latex preview for whole buffer with on-off keybinding

2021-06-24 Thread Christopher Dimech
 

Does not say what ARG is !


 

Could be much better to do "M-x org-latex-preview" to toggle on-off.

 

Sent: Friday, June 25, 2021 at 4:06 AM
From: "Rodrigo Morales" 
To: "Christopher Dimech" 
Cc: "Help Emacs Orgmode" 
Subject: Re: Latex preview for whole buffer with on-off keybinding


Accomplishing this is explained in the docstring of org-latex-preview:

> org-latex-preview is an interactive compiled Lisp function in
> ‘org.el’.
>
> (org-latex-preview  ARG)
>
> ...
>
> With a ‘C-u’ prefix argument ARG, clear images for all fragments
> in the current section.
>
> With a ‘C-u C-u’ prefix argument ARG, display image for all
> fragments in the buffer.
>
> With a ‘C-u C-u C-u’ prefix argument ARG, clear image for all
> fragments in the buffer.

Hope that helps.

---
Greetings,
rdrg109
 


On Thu, 24 Jun 2021 at 10:45, Christopher Dimech  wrote:

Org-mode allows latex-preview.  But this applies to each latex
_expression_ independently.  Is there a way to have a keybinding
that would turn latex-preview "on" or "off" for the whole buffer?

This applies only to snippets
C-c C-x C-l (org-latex-preview)
 








Latex highlighting for org-mode

2021-06-24 Thread Christopher Dimech

I conclude that org-mode cauld do with some improvements.  If org-mode was designed to allow

LaTeX fragments without the need of any special marking, it should allow latex syntex highlighting

without the need of any special markings.

 

Sent: Friday, June 25, 2021 at 4:28 AM
From: "Rodrigo Morales" 
To: "Christopher Dimech" 
Cc: "Help Emacs Orgmode" 
Subject: Re: Latex highlighting for org-mode


There are two ways with which you can get LaTeX syntax highlighting when
editing LaTeX in org-mode buffers.

* No. 1: LaTeX code blocks

You can have LaTeX code blocks within your document with the following
header arguments and thus have syntax highlighting and make the content
of those code blocks to be exported as LaTeX.

Advantage: Code blocks are syntax highlighted.

Disadvantage: The code block is not exported when exporting to HTML,
only when exporting to LaTeX.

#+BEGIN_SRC latex :results latex :exports results
\[
  \frac{12}{13} + 12
\]
#+END_SRC

* No 2: Executing org-edit-special in LaTeX environments

When using org-edit-special (C-c ') in LaTeX environments, the snippet
is opened in a buffer whose major mode is latex-mode so you get syntax
highlighting within that buffer.

Advantage: The snippets are exported as raw text when exporting to HTML.

Disadvantage: The snippets are not syntax highlighted. They are only syntax
highlighted in the dedicated buffer which is shown in org-edit-special.

#+BEGIN_SRC org
Solving $12 + 13$ is not difficult.
#+END_SRC

#+BEGIN_SRC org
Solving

\[
  12 + 13
\]

is not difficult.
#+END_SRC

#+BEGIN_SRC org
Solving

\begin{equation}
  12 + 13
\end{equation}

is not difficult.
#+END_SRC

* Side note

If you want to see the behavior when exporting to HTML, I encourage you
to export the following Org Mode file to HTML and see what happens.

#+BEGIN_SRC org
The following is not shown when exporting to HTML.

#+begin_src latex :results latex :exports results
\[
  10 + 10
\]
#+end_src

#+RESULTS:
#+begin_export latex
\[
  10 + 10
\]
#+end_export

The following is shown as an image when exporting to HTML.
3
#+begin_src latex :exports results :results file graphics :file 20.png
\[
  20 + 20
\]
#+end_src

#+RESULTS:
[[file:20.png]]

The following is shown as text when exporting to HTML.

\[
  30 + 30
\]

The following is shown as text when exporting to HTML.

\begin{equation}
40 + 40
\end{equation}
#+END_SRC

Hope that helps.

---
Greetings,
rdrg109
 


On Thu, 24 Jun 2021 at 00:07, Christopher Dimech  wrote:

Would it be possible for org-mode to have syntax highlighting
for latex commands?  Currently I have to change mode with
"M-x latex-mode" to get the highlighting.

 








Re: list re-numbering not working in odt export

2021-06-24 Thread Eric S Fraga
On Thursday, 24 Jun 2021 at 10:45, Rob Sargent wrote:
> I am using org version 9.1.9 and libre office version 6.4.7.2

Confirmed with very recent version, as shown in signature.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-571-gc591be
: Latest paper written in org: https://arxiv.org/abs/2106.05096



list re-numbering not working in odt export

2021-06-24 Thread Rob Sargent
It appears to me that explicitly setting list order number is not 
honoured by the odt export mechanism.  The following works on latex 
(list numbering starts at 7) but not on odt (list numbering starts at 
one though the [@7] is stripped from the output (as expect)):


   1. [@7](/facilities/) The tangible compute infrastructure employed
   by SGSaaS is entirely ...

I am using org version 9.1.9 and libre office version 6.4.7.2


Re: Latex highlighting for org-mode

2021-06-24 Thread Rodrigo Morales
There are two ways with which you can get LaTeX syntax highlighting when
editing LaTeX in org-mode buffers.

* No. 1: LaTeX code blocks

You can have LaTeX code blocks within your document with the following
header arguments and thus have syntax highlighting and make the content
of those code blocks to be exported as LaTeX.

Advantage: Code blocks are syntax highlighted.

Disadvantage: The code block is not exported when exporting to HTML,
only when exporting to LaTeX.

#+BEGIN_SRC latex :results latex :exports results
\[
  \frac{12}{13} + 12
\]
#+END_SRC

* No 2: Executing org-edit-special in LaTeX environments

When using org-edit-special (C-c ') in LaTeX environments, the snippet
is opened in a buffer whose major mode is latex-mode so you get syntax
highlighting within that buffer.

Advantage: The snippets are exported as raw text when exporting to HTML.

Disadvantage: The snippets are not syntax highlighted. They are only syntax
highlighted in the dedicated buffer which is shown in org-edit-special.

#+BEGIN_SRC org
Solving $12 + 13$ is not difficult.
#+END_SRC

#+BEGIN_SRC org
Solving

\[
  12 + 13
\]

is not difficult.
#+END_SRC

#+BEGIN_SRC org
Solving

\begin{equation}
  12 + 13
\end{equation}

is not difficult.
#+END_SRC

* Side note

If you want to see the behavior when exporting to HTML, I encourage you
to export the following Org Mode file to HTML and see what happens.

#+BEGIN_SRC org
The following is not shown when exporting to HTML.

#+begin_src latex :results latex :exports results
\[
  10 + 10
\]
#+end_src

#+RESULTS:
#+begin_export latex
\[
  10 + 10
\]
#+end_export

The following is shown as an image when exporting to HTML.
3
#+begin_src latex :exports results :results file graphics :file 20.png
\[
  20 + 20
\]
#+end_src

#+RESULTS:
[[file:20.png]]

The following is shown as text when exporting to HTML.

\[
  30 + 30
\]

The following is shown as text when exporting to HTML.

\begin{equation}
40 + 40
\end{equation}
#+END_SRC

Hope that helps.

---
Greetings,
rdrg109

On Thu, 24 Jun 2021 at 00:07, Christopher Dimech  wrote:

> Would it be possible for org-mode to have syntax highlighting
> for latex commands?  Currently I have to change mode with
> "M-x latex-mode" to get the highlighting.
>
>
>


Re: appearance of list as results from evaluating code blocks

2021-06-24 Thread John Kitchin
That probably means the clojure block is returning nil as the value. I
don't know what it means to return something in clojure, but here is what
you have to do with Python, for example.

#+BEGIN_SRC python :results value code
[1, 2, 3]
#+END_SRC

#+RESULTS:
#+begin_src python
None
#+end_src

You have to explicitly return a value to see it.

#+BEGIN_SRC python :results value code
return [1, 2, 3]
#+END_SRC

#+RESULTS:
#+begin_src python
[1, 2, 3]
#+end_src


John

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



On Thu, Jun 24, 2021 at 10:31 AM Johannes Brauer 
wrote:

> What about :results code
> The default is a elisp code block so you get syntax coloring
>
>
> That works fore lisp:
>
>   #+begin_src elisp :results code
> (list 1 2 (+ 1 2))
>   #+end_src
>
>   #+RESULTS:
>   #+begin_src elisp
>   (1 2 3)
>   #+end_src
>
> But with Clojure I get
>
>   #+begin_src clojure :results code
> (list 1 2 (+ 1 2))
>   #+end_src
>
>   #+RESULTS:
>   #+begin_src clojure
>   nil
>   #+end_src
>
>


Re: Latex preview for whole buffer with on-off keybinding

2021-06-24 Thread Rodrigo Morales
Accomplishing this is explained in the docstring of org-latex-preview:

> org-latex-preview is an interactive compiled Lisp function in
> ‘org.el’.
>
> (org-latex-preview  ARG)
>
> ...
>
> With a ‘C-u’ prefix argument ARG, clear images for all fragments
> in the current section.
>
> With a ‘C-u C-u’ prefix argument ARG, display image for all
> fragments in the buffer.
>
> With a ‘C-u C-u C-u’ prefix argument ARG, clear image for all
> fragments in the buffer.

Hope that helps.

---
Greetings,
rdrg109

On Thu, 24 Jun 2021 at 10:45, Christopher Dimech  wrote:

> Org-mode allows latex-preview.  But this applies to each latex
> expression independently.  Is there a way to have a keybinding
> that would turn latex-preview "on" or "off" for the whole buffer?
>
> This applies only to snippets
> C-c C-x C-l (org-latex-preview)
>
>


Latex preview for whole buffer with on-off keybinding

2021-06-24 Thread Christopher Dimech
Org-mode allows latex-preview.  But this applies to each latex
expression independently.  Is there a way to have a keybinding
that would turn latex-preview "on" or "off" for the whole buffer?

This applies only to snippets
C-c C-x C-l (org-latex-preview)



Re: [SOLVED] (kinda) Calendar vs. org-agenda exit

2021-06-24 Thread Nicolas Goaziou
Hello,

Stephen Berman  writes:

> Yeah, the next time Org is merged to the Emacs master branch, forcing me
> to first stash and then reapply my patch locally, I'll ask if anyone
> objects to the patch being committed to master.

Sure, go ahead.

Regards,
-- 
Nicolas Goaziou



Re: appearance of list as results from evaluating code blocks

2021-06-24 Thread Johannes Brauer
What about :results code
The default is a elisp code block so you get syntax coloring

That works fore lisp:

  #+begin_src elisp :results code
(list 1 2 (+ 1 2))
  #+end_src

  #+RESULTS:
  #+begin_src elisp
  (1 2 3)
  #+end_src

But with Clojure I get

  #+begin_src clojure :results code
(list 1 2 (+ 1 2))
  #+end_src

  #+RESULTS:
  #+begin_src clojure
  nil
  #+end_src



Re: [SOLVED] (kinda) Calendar vs. org-agenda exit

2021-06-24 Thread Stephen Berman
On Thu, 24 Jun 2021 14:09:46 +0200 to...@tuxteam.de wrote:

> On Thu, Jun 24, 2021 at 12:13:40PM +0200, Stephen Berman wrote:
>> On Wed, 23 Jun 2021 18:16:52 +0200 to...@tuxteam.de wrote:
>>
>> > On Wed, Jun 23, 2021 at 05:28:36PM +0200, to...@tuxteam.de wrote:
>> >
>> > [calendar insert-diary-entry doing funny things]
>> >
>> > OK, I solved it by setting `org-calendar-insert-diary-entry-key' to
>> > [106], which is a ?j. It was set to ?i, which hijacked calendar's
>> > original key map.
>> >
>> > Now I still don't know whether it's intended that Org hijacks that
>> > key in calendar, whether I did something stupid, but at least I have
>> > my toys back. Just remember to not push ?j.
>> >
>> > Anyway, you set me on the right track, so thanks for that!
>>
>> See also bug#48199 (also CC'd at
>> https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00582.html).
>> I continue to use the patch I posted there and have had no problems with
>> it (but I don't use org-mode much).
>
> Oh, I see, thanks. For me, it's a bit confusing that this bug receives
> so little attention. Hijacking other modes's keymaps isn't... friendly,
> after all. I can't imagine that it is happening by intention.

Yeah, the next time Org is merged to the Emacs master branch, forcing me
to first stash and then reapply my patch locally, I'll ask if anyone
objects to the patch being committed to master.  Maybe that will get
someone's attention (and if not, I may just go ahead and commit it -- if
it then still gets no one's attention, it must be ok ;-).

Steve Berman



Re: [SOLVED] (kinda) Calendar vs. org-agenda exit

2021-06-24 Thread tomas
On Thu, Jun 24, 2021 at 12:13:40PM +0200, Stephen Berman wrote:
> On Wed, 23 Jun 2021 18:16:52 +0200 to...@tuxteam.de wrote:
> 
> > On Wed, Jun 23, 2021 at 05:28:36PM +0200, to...@tuxteam.de wrote:
> >
> > [calendar insert-diary-entry doing funny things]
> >
> > OK, I solved it by setting `org-calendar-insert-diary-entry-key' to
> > [106], which is a ?j. It was set to ?i, which hijacked calendar's
> > original key map.
> >
> > Now I still don't know whether it's intended that Org hijacks that
> > key in calendar, whether I did something stupid, but at least I have
> > my toys back. Just remember to not push ?j.
> >
> > Anyway, you set me on the right track, so thanks for that!
> 
> See also bug#48199 (also CC'd at
> https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00582.html).
> I continue to use the patch I posted there and have had no problems with
> it (but I don't use org-mode much).

Oh, I see, thanks. For me, it's a bit confusing that this bug receives
so little attention. Hijacking other modes's keymaps isn't... friendly,
after all. I can't imagine that it is happening by intention.

Cheers & thanks for the background.

-- tomás


signature.asc
Description: Digital signature


Re: appearance of list as results from evaluating code blocks

2021-06-24 Thread Eric S Fraga
On Thursday, 24 Jun 2021 at 10:46, Johannes Brauer wrote:
>   #+begin_src clojure :results verbatim :wrap src clojure
> (list 1 2 (+ 1 2))
>   #+end_src

For completeness, another option is ":results verbatim drawer" without
:wrap.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-571-gc591be
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: appearance of list as results from evaluating code blocks

2021-06-24 Thread Johannes Brauer
Hi Rodrigo!

Thanks a lot for the detailed information. In the meantime I’ve studied the 
org-mode manual a bit more closely (perhaps, I should have done that before 
asking my question …) and found the following interesting possibilitiy:

  #+begin_src clojure :results verbatim :wrap src clojure
(list 1 2 (+ 1 2))
  #+end_src

  #+RESULTS:
  #+begin_src clojure
  (1 2 3)
  #+end_src

Johannes

> Am 23.06.2021 um 23:14 schrieb Rodrigo Morales :
> 
> Johannes Brauer  writes:
> 
> Johannes Brauer writes:
> 
>> thanks, that works
> 
> While that works, you might be interested in ":results verbatim" instead
> of ":results raw" since when using "verbatim" the results are replaced
> when re-evaluating the code block. See minimal working example below.
> 
> After pressing =C-c C-c= five times
> 
> #+BEGIN_SRC elisp :results raw
> (list 1 2 3)
> #+END_SRC
> 
> #+RESULTS:
> (1 2 3)
> (1 2 3)
> (1 2 3)
> (1 2 3)
> (1 2 3)
> 
> After pressing =C-c C-c= five times
> 
> #+BEGIN_SRC elisp :results verbatim
> (list 1 2 3)
> #+END_SRC
> 
> #+RESULTS:
> #+begin_example
> (1 2 3)
> #+end_example
> 
> PS: If you haven't customized Org Mode enough, you might get a ":" as
> the prefix of some of your results.
> 
> #+BEGIN_SRC elisp :results verbatim
> (list 1 2 3)
> #+END_SRC
> 
> #+RESULTS:
> : (1 2 3)
> 
> As can be seen above, the results are not enclosed within
> #+begin_example and #+end_example. To enable this, set the following.
> 
> #+BEGIN_SRC elisp
> (setq org-babel-min-lines-for-block-output 0)
> #+END_SRC
> 
> Once you set the option shown above, you might get the following when
> evaluating the code block.
> 
> #+BEGIN_SRC elisp :results verbatim
> (list 1 2 3)
> #+END_SRC
> 
> #+RESULTS:
> #+begin_example
> (1 2 3)
> #+end_example



Re: [SOLVED] (kinda) Calendar vs. org-agenda exit

2021-06-24 Thread Stephen Berman
On Wed, 23 Jun 2021 18:16:52 +0200 to...@tuxteam.de wrote:

> On Wed, Jun 23, 2021 at 05:28:36PM +0200, to...@tuxteam.de wrote:
>
> [calendar insert-diary-entry doing funny things]
>
> OK, I solved it by setting `org-calendar-insert-diary-entry-key' to
> [106], which is a ?j. It was set to ?i, which hijacked calendar's
> original key map.
>
> Now I still don't know whether it's intended that Org hijacks that
> key in calendar, whether I did something stupid, but at least I have
> my toys back. Just remember to not push ?j.
>
> Anyway, you set me on the right track, so thanks for that!

See also bug#48199 (also CC'd at
https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00582.html).
I continue to use the patch I posted there and have had no problems with
it (but I don't use org-mode much).

Steve Berman



Re: [PATCH] ob-R output file with graphics parameter

2021-06-24 Thread Colin Baxter
Hi Jeremie,
> Jeremie Juste  writes:

> Hello,

> With the following patch the link to graphics output is finally
> back on with R source code. Note that on top of the "graphics"
> parameter the "file" parameter have to be used for the org-link to
> work out of the box. I will try to remove the need for a second
> "file" parameter in the future.


> #+begin_src R :results output graphics file :file test2.pdf
> :session *local* :cache no :dir "~/Documents/images"
> plot(rnorm(100)) #+end_src

> #+RESULTS: [[file:images/test2.pdf]]

I obviously missing something. The above works for me without the
patch. Unfortunately, I can't trace back the thread in order to
understand the context.

Best wishes,



Re: [PATCH] extra space at the end of lines in source

2021-06-24 Thread Greg Minshall
Sébastien Miquel,


> If I try your original examples with `emacs -q' I do not get extra
> whitespace in the org src buffer. Those two spaces in the original org
> buffer -- that are due to `org-edit-src-content-indentation' -- are
> removed in the org src buffer. If you do not find it to be the case,
> then I'm missing something.

i apologize, i think i described the problem badly.  the problem i saw
is not extra spaces in the Org Src buffer; it is the appearance of the
extra spaces in the original .org file after closing (C-c ') the Org Src
buffer that i see as problematic.

> Anyway, here's a patch that cleans up blank lines, except the current
> one. It preserves the fix for the original issue.

thanks.  my trivial test shows this works *except* in the particular
case where, when closing the Org Src buffer, `point` is on an empty
line.  in this case, that one empty line is given extra spaces.

if i try my test with
: Org mode version 9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)
i do not see the extra spaces in the .org file.

the test src block is

#+BEGIN_SRC bash
  echo hello, world

  echo 23


#+END_SRC

(modulo any e-mail mangling).

again, thanks.  Greg



Re: Using b6paper for pdf output

2021-06-24 Thread Vladimir Lomov
Hello,
** Christopher Dimech  [2021-06-24 06:50:50 +0200]:

> Am using org-mode with latex commands but need to have the page as b6paper.

Try 'geometry' package,

(untested)

#+LATEX_HEADER: \usepackage[b6paper]{geometry}

---
WBR, Vladimir Lomov

-- 
Honesty pays, but it doesn't seem to pay enough to suit some people.
-- F. M. Hubbard


signature.asc
Description: PGP signature


Re: An attempt to convert Elfeed entries (with parameters) to Org trees

2021-06-24 Thread Juan Manuel Macías
Hi Ihor,

Ihor Radchenko writes:

> What about duplicates? If you insert all the feeds from the last few
> months and then update the same headline weeks later, there will overlap
> between elfeed entries.

When I update a headline, all previous feeds are removed, so there is no
possibility of duplicates. As I said, I find this system very useful to
have an overview within Org of the latest updates to certain feeds, such
as new packages uploaded to CTAN. I also have an org-capture template
only for new CTAN packages, in case I see any interesting packages.

I also have a section on CTAN news in my blog about typography and TeX
(in Spanish), and I update it using that method.

Best regards,

Juan Manuel 



Re: Large source block causes org-mode to be unusable

2021-06-24 Thread Eric S Fraga
On Wednesday, 23 Jun 2021 at 15:42, Gennady Uraltsev wrote:
> In Org Mode, headings cannot "terminate" i.e. only a new section can
> stop a previous one. 

True.

What I do for cases where I want "separation" for visibility etc. is use
headings at the same level but tell the exporter to ignore the actual
headings when exporting.  So I frequently have something like this:

#+begin_src org
  ,* Section heading
  ,** introduction to section   :ignoreheading:
  ,** statement of problem  :ignoreheading:
  ,** proof :ignoreheading:
 ,#+latex: \begin{proof}
 proof goes here
 ,#+latex: \end{proof}
  ,** continuation of section   :ignoreheading:
  ,* Next section
#+end_src

also showing how you can introduce a proof environment without using
special blocks and hence maybe help with speed.  (noting that you could
do the same for HTML.)

I have a filter for export that strips headings that have the
:ignoreheading: tag.  I believe there's something similar built-in now?

This approach makes for easier navigation in the document (for me) and
helps keep that bird's eye view of what I am writing.
-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-571-gc591be
: Latest paper written in org: https://arxiv.org/abs/2106.05096