Re: How to evaluate source code while in the edit buffer?

2020-12-04 Thread Pankaj Jangid
Jean Louis  writes:

>> error in process sentinel: PLANTUML Preview failed: exited abnormally with
>> code 1
>> 
>> The plantuml.el code seems to
>> 
>>1. start a process and then
>>2. pass the plantuml string to the process.
>> 
>> It is at step 2 that the error is issued.
>
> Maybe you wish to show that code? Did you maybe test it outside of
> Emacs that it works well?

Even inside Emacs it works. When we exit the plantuml specific edit
buffer and press C-c C-c in the souce code block.



Re: How to evaluate source code while in the edit buffer?

2020-12-04 Thread Tom Gillespie
While we're on the subject of execution in the edit buffer, it is not
entirely clear what such execution would mean. Mirko's desire seems to
be to execute the buffer directly without org-babel as an
intermediary. However, the most consistent approach would be a command
to pop back to the source buffer from the edit buffer and use
org-babel-execute-src-block to run the code. If org were to provide
edit buffer evaluation it would likely have to be that. The reason for
this is that direct execution of code in the major mode of the edit
buffer is not well defined. For some languages (e.g. racket) there is
no easy way to evaluate a buffer that does not correspond directly to
a file on the file system, which is part of why org babel exists in
the first place (to define those semantics). In theory babel languages
could provide an alternate implementation for how an edit buffer can
be run, but absent such an implementation it would be up to the user
to figure out the semantics for each of the languages they wanted to
evaluate directly. Best,
Tom



Re: How to evaluate source code while in the edit buffer?

2020-12-04 Thread George Mauer
+1 to this question. I have the exact same annoyance (would also be nice to
do some threading so it doesn't lock up emacs for a few seconds)

On Fri, Dec 4, 2020 at 2:28 PM Pankaj Jangid  wrote:

> Mirko Vukovic  writes:
>
> > My current workflow is
> >
> >1. Enter edit buffer (C-c ')
> >2. Perform edits in the window
> >3. Exit edit mode (C-c ')
> >4. Evaluate code (C-c C-c)
> >5. Monitor changes to resulting png file
> >
> > I would prefer instead to skip step 3, and evaluate the code from within
> > the edit mode.
> >
> > Is it possible to execute code from the edit buffer?
>
> 1. When I enter the edit mode (C-c ') it connects to plantuml server
> (that I don't like), and produces the error that you have specified:
> "Wrong type argument: stringp, nil".
>
> 2. Pressing C-c C-c in the edit buffer opens up plantuml preview but it
> gives some error: "The plugin you are using seems to generate a bad
> URL".
>
> I am on Emacs 28.x and default org 9.3.
>
>


Re: How to evaluate source code while in the edit buffer?

2020-12-04 Thread Jean Louis
* Mirko Vukovic  [2020-12-04 22:00]:
> error in process sentinel: PLANTUML Preview failed: exited abnormally with
> code 1
> 
> The plantuml.el code seems to
> 
>1. start a process and then
>2. pass the plantuml string to the process.
> 
> It is at step 2 that the error is issued.

Maybe you wish to show that code? Did you maybe test it outside of
Emacs that it works well?



Re: How to evaluate source code while in the edit buffer?

2020-12-04 Thread Mirko Vukovic
On Fri, Dec 4, 2020 at 12:41 PM Pankaj Jangid 
wrote:

> Mirko Vukovic  writes:
>
> > My current workflow is
> >
> >1. Enter edit buffer (C-c ')
> >2. Perform edits in the window
> >3. Exit edit mode (C-c ')
> >4. Evaluate code (C-c C-c)
> >5. Monitor changes to resulting png file
> >
> > I would prefer instead to skip step 3, and evaluate the code from within
> > the edit mode.
> >
> > Is it possible to execute code from the edit buffer?
>
> 1. When I enter the edit mode (C-c ') it connects to plantuml server
> (that I don't like), and produces the error that you have specified:
> "Wrong type argument: stringp, nil".
>
> 2. Pressing C-c C-c in the edit buffer opens up plantuml preview but it
> gives some error: "The plugin you are using seems to generate a bad
> URL".
>
> I am on Emacs 28.x and default org 9.3.
>

So I tried C-c C-c and got the same response as Pankaj.

I traced the code to understand better and saw that plant-uml-exec-mode can
have settings of server and jar

With the jar setting (and after pointing a few variables to the jar file),
I am getting a different error:

error in process sentinel: PLANTUML Preview failed: exited abnormally with
code 1

The plantuml.el code seems to

   1. start a process and then
   2. pass the plantuml string to the process.

It is at step 2 that the error is issued.

Mirko


Re: How to evaluate source code while in the edit buffer?

2020-12-04 Thread Pankaj Jangid
Mirko Vukovic  writes:

> My current workflow is
>
>1. Enter edit buffer (C-c ')
>2. Perform edits in the window
>3. Exit edit mode (C-c ')
>4. Evaluate code (C-c C-c)
>5. Monitor changes to resulting png file
>
> I would prefer instead to skip step 3, and evaluate the code from within
> the edit mode.
>
> Is it possible to execute code from the edit buffer?

1. When I enter the edit mode (C-c ') it connects to plantuml server
(that I don't like), and produces the error that you have specified:
"Wrong type argument: stringp, nil".

2. Pressing C-c C-c in the edit buffer opens up plantuml preview but it
gives some error: "The plugin you are using seems to generate a bad
URL".

I am on Emacs 28.x and default org 9.3.



Re: How to evaluate source code while in the edit buffer?

2020-12-04 Thread Pankaj Jangid
Jean Louis  writes:

> * Mirko Vukovic  [2020-12-04 16:59]:
>> Creating/editing UML diagrams using plantuml mode is an iterative process.
>> My current workflow is
>> 
>>1. Enter edit buffer (C-c ')
>>2. Perform edits in the window
>>3. Exit edit mode (C-c ')
>>4. Evaluate code (C-c C-c)
>>5. Monitor changes to resulting png file
>> 
>> I would prefer instead to skip step 3, and evaluate the code from within
>> the edit mode. I tried evaluating org-babel-execute-src-block from the edit
>> buffer, but that resulted in an error:
>> helm-M-x-execute-command: Wrong type argument: consp, nil
>
> Pozdrav Mirko,
>
> If you are editing source block in Org file, why not just do C-c C-c
> right there in the block to evaluate it?

Because major-mode features for the language are not available in org-mode.



Re: Missing line breaks in Beamer with alltt

2020-12-04 Thread Eric S Fraga
On Friday,  4 Dec 2020 at 16:03, Jarmo Hurri wrote:
> I have an eerie feeling that this should be either
> a) fixed so that it works without inserting fragile, or
> b) written down somewhere in documentation.
> Any ideas?

This is a beamer issue and I think it is mentioned somewhere in the
beamer documentation.

Of course, it wouldn't hurt to say something in the org beamer
documentation, probably on Worg.  I'm sure patches or contributions
would be welcome!

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4-143-g9a1549



Re: How to evaluate source code while in the edit buffer?

2020-12-04 Thread Jean Louis
* Mirko Vukovic  [2020-12-04 16:59]:
> Hello,
> 
> Creating/editing UML diagrams using plantuml mode is an iterative process.
> My current workflow is
> 
>1. Enter edit buffer (C-c ')
>2. Perform edits in the window
>3. Exit edit mode (C-c ')
>4. Evaluate code (C-c C-c)
>5. Monitor changes to resulting png file
> 
> I would prefer instead to skip step 3, and evaluate the code from within
> the edit mode. I tried evaluating org-babel-execute-src-block from the edit
> buffer, but that resulted in an error:
> helm-M-x-execute-command: Wrong type argument: consp, nil

Pozdrav Mirko,

If you are editing source block in Org file, why not just do C-c C-c
right there in the block to evaluate it?

Jean



Re: Missing line breaks in Beamer with alltt

2020-12-04 Thread Jarmo Hurri


Hi there Eric.

Eric S Fraga  writes:

>> I will take you up on that offer! Are you able to replicate the
>> difference between these two slides?
>
> Interesting.  It seems that the use of =...= in one of the items makes
> org insert the "fragile" option for the frame and that allows the alltt
> environment to work properly.  The solution therefore is either make
> sure that there is at least one use of =...= in the slide or, better
> yet, add the fragile option yourself by setting the BEAMER_opt property
> to fragile, as in:
>
> * Another slide
> :PROPERTIES:
> :BEAMER_opt: fragile
> :END:
>
> I've tested this and it works for me.

Works for me too, excellent!

I have an eerie feeling that this should be either
a) fixed so that it works without inserting fragile, or
b) written down somewhere in documentation.
Any ideas?

All the best, and stay safe.

Jarmo




How to evaluate source code while in the edit buffer?

2020-12-04 Thread Mirko Vukovic
Hello,

Creating/editing UML diagrams using plantuml mode is an iterative process.
My current workflow is

   1. Enter edit buffer (C-c ')
   2. Perform edits in the window
   3. Exit edit mode (C-c ')
   4. Evaluate code (C-c C-c)
   5. Monitor changes to resulting png file

I would prefer instead to skip step 3, and evaluate the code from within
the edit mode. I tried evaluating org-babel-execute-src-block from the edit
buffer, but that resulted in an error:
helm-M-x-execute-command: Wrong type argument: consp, nil

Is it possible to execute code from the edit buffer?

Thank you,

Mirko


Bug: [ob-js] error: require(...).print is not a function [9.3 (release_9.3 @ /Users/xcy/src/emacs-mac/lisp/org/)]

2020-12-04 Thread Xu Chunyang
* The issue

ob-js does not work for me, e.g.,

#+begin_src js
1 + 2
#+end_src

throws the error:

/private/var/folders/7f/s191h4q97p90374yw15ssrs0gn/T/babel-gBvsRp/js-script-zTHHhe:1
require('sys').print(require('sys').inspect(function(){
   ^

TypeError: require(...).print is not a function
at Object.
(/private/var/folders/7f/s191h4q97p90374yw15ssrs0gn/T/babel-gBvsRp/js-script-zTHHhe:1:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain]
(internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47

* Information

M-! node -v
v14.15.0

Emacs  : GNU Emacs 27.1 (build 2, x86_64-apple-darwin19.6.0, Carbon
Version 162 AppKit 1894.6)
 of 2020-11-11
Package: Org mode version 9.3 (release_9.3 @ /Users/xcy/src/emacs-mac/lisp/org/)

* Another issue: What's SBCL in the commentary?

;;; Commentary:

;; Now working with SBCL for both session and external evaluation.



Bug: Org Clock continues in canceled captured note [9.4 (9.4-53-gc97446-elpaplus @ /Users/df/.emacs.d/elpa/org-plus-contrib-20201130/)]

2020-12-04 Thread Daniel Fleischer
When using org-capture with :clock-in or when starting the clock
manually when writing the note, then after canceling the note using
C-c C-k, the clock continues as can be seen in the modeline. 

Reproduced also in a clean 'emacs -Q' setup. 


Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin19.6.0, NS 
appkit-1894.60 Version 10.15.7 (Build 19H15))
 of 2020-12-01

Package: Org mode version 9.4 (9.4-53-gc97446-elpaplus @ 
/Users/df/.emacs.d/elpa/org-plus-contrib-20201130/)


Daniel Fleischer




Re: generate an org file for today's appointments

2020-12-04 Thread Alan Schmitt
Hello,

On 2020-12-03 20:15, TRS-80  writes:

> I am also not someone who uses one of these "daily journal" workflows,
> so I can't help but wonder how you link these daily notes back to the
> underlying project that generated the event on the agenda in the first
> place.  Becasue in my mind, I would jump from the agenda to the
> underlying project or task and be making my notes in there directly.
> Those linking considerations, in my mind anyway, would really dictate
> the rest of the workflow.

This is a very good point. My appointments do not currently have links
to the related projects (the "database of trust" is the calendar one,
which is caldav outside of emacs… maybe I should change that, but I need
to synchronize my calendar with my phone). So I currently add the links
manually. I'll have to think about this.

Best,

Alan


signature.asc
Description: PGP signature


Re: generate an org file for today's appointments

2020-12-04 Thread Alan Schmitt
Hello,

On 2020-12-03 12:01, Mikhail Skorzhisnkii  writes:

> I'd suggest to use function "org-agenda-write". You can export 
> your agenda views to org files too! However, the formatting will 
> be different. Probably something like:
>
> * Event A
>   SCHEDULED: <2020-12-03 Thu 10:00-12:00>
> * Event B
>   SCHEDULED: <2020-12-03 Thu 10:00-11:00>
> * Event C
>   SCHEDULED: <2020-12-03 Thu 14:00-15:30>
> * Event D
>   SCHEDULED: <2020-12-03 Thu 20:00-21:30>
>
> I personally do this to generate separate org-file and then 
> generate ics file based on that and upload this ics file through 
> WebDAV to my calendar server.

This is most useful, thanks a lot! This should be more than sufficient
for my needs.

Best,

Alan


signature.asc
Description: PGP signature