[-- Attachment #1: Type: text/plain, Size: 596 bytes --] 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 [-- Attachment #2: Type: text/html, Size: 1021 bytes --]
* Mirko Vukovic <mirko.vukovic@gmail.com> [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
Jean Louis <bugs@gnu.support> writes:
> * Mirko Vukovic <mirko.vukovic@gmail.com> [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.
Mirko Vukovic <mirko.vukovic@gmail.com> 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.
[-- Attachment #1: Type: text/plain, Size: 1412 bytes --] On Fri, Dec 4, 2020 at 12:41 PM Pankaj Jangid <pankaj@codeisgreat.org> wrote: > Mirko Vukovic <mirko.vukovic@gmail.com> 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 [-- Attachment #2: Type: text/html, Size: 2678 bytes --]
* Mirko Vukovic <mirko.vukovic@gmail.com> [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?
[-- Attachment #1: Type: text/plain, Size: 1038 bytes --] +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 <pankaj@codeisgreat.org> wrote: > Mirko Vukovic <mirko.vukovic@gmail.com> 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. > > [-- Attachment #2: Type: text/html, Size: 1597 bytes --]
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
Jean Louis <bugs@gnu.support> 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.