Re: Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

2022-06-07 Thread lin Sun
Hi lhor,

You're totally right, the commit b5f0efc had appended the `-headless`
to the jar parameter list. Here is the comment:
> *** =org-plantump-executable-args= is renamed and applies to jar as well
The original issue does not exist now.  Please ignore the previous patch.

Thank you so much.

B.R.
Lin



Re: [DISCUSSION] Refactoring fontification system

2022-06-07 Thread Tom Gillespie
> As for lang parameter support in example blocks, would you mind creating
> a separate feature request thread? Extending export blocks export will
> require changing in parser syntax and thus should be discussed carefully
> in a separate thread.

I would strongly caution against allowing an optional #+begin_example lang
syntax. It will lead to extreme confusion, even when users know to use org-lint.
The reason for this is that example blocks do not have (and frankly should not
have) full org-babel support. Babel is already complex enough as is without
having to explain to a user that yes they can noweb an example block into
a src block, but that they cannot noweb a source block into an example block.

One of the most powerful features of src blocks is that they can go from being
dumb examples all the way up to fully executable programs. Example blocks
cannot do that, and adding features that overlap with code blocks is inviting
duplicated effort and will confuse and frustrate users if they have
the misfortune
to start with an example block an then have to change mid way through to a
code block.

I also think that adding a parameter #+begin_example :lang bash to example
blocks will also lead to confusion because now there are two different ways
to specify what lang a block is. To me the answer should be to just use source
blocks if you need highlighting, example blocks should not highlight at all in
order to make the distinction clear.

Best,
Tom



Re: git branch rename and git config q

2022-06-07 Thread Ihor Radchenko
Samuel Wales  writes:

> more confused than ever.  i hoped i could just run a rename command,
> or possibly rename maint to bugfix in config.

Max tends to go very deeply into details.

For starters, you can just:
1. Rename maint -> bugfix
2. Rename master -> main
3. Set origin to https://git.sv.gnu.org/emacs/org-mode.git (read-only)
4. Set remote for the local main and bugfix branches as origin
5. fetch the latest origin
6. Rebase you local branches onto origin/main and origin/bugfix

I strongly recommend using magit to work with git repos.

Best,
Ihor



Re: [DISCUSSION] Refactoring fontification system

2022-06-07 Thread Ihor Radchenko
Max Nikulin  writes:

> On 03/06/2022 16:45, Ihor Radchenko wrote:
>> 
>> 1. org-protecting-blocks is an internal auxiliary variable used to
>> determine which blocks should be fontified using different major
>> mode.
>> It's value is ("src" "example" "export")
>> So, #+begin_src lang and #+begin_export lang are fontified according
>> to LANG. Makes sense.
>> However, what about #+begin_example?
>
> I have a lot of #+begin_example with language in my notes. In the 
> beginning I accidentally discovered that code is highlighted accordingly 
> to language syntax, so I continued to use this feature for snippets that 
> are not intended to be evaluated. Later it was a bad surprise that 
> export does not preserves highlights. So for me #+begin_example is a 
> shortcut for #+begin_src with :eval never (that can be specified as a 
> property).
>
>  From my point of view exporters may reuse code block formatters for 
> examples. It would allow to pass options to e.g. LaTeX verbatim environment:
> Pedro Andres Aranda Gutierrez. Re: A question/bug report(?) Wed, 30 Mar 
> 2022 07:14:54 +0200 
> https://list.orgmode.org/orgmode/CAO48Bk_dJs1=5zgpczwodatsrqyrskq1alj6wpaxcc4bdjw...@mail.gmail.com/

Among other goals, the new fontification is aiming to avoid such bad
surprises.

As for lang parameter support in example blocks, would you mind creating
a separate feature request thread? Extending export blocks export will
require changing in parser syntax and thus should be discussed carefully
in a separate thread.

>> 2. org-script-display is an internal auxiliary variable used to display
>> sub/superscripts. Note that it's default value holds 4 possibilities.
>> Two for each type of script. For example, for superscripts we have
>> two options:
>> ((raise 0.3) (height 0.7)) and ((raise 0.5))
>> The first one looks more compact (does not change the line height)
>
> Notice that subscript still increases inter-line space a bit.

Can you (and other interested users) try the following value of
org-script-display and let me know if it looks acceptable:

(defconst org-script-display  '(;; The values are tweaked to not change
;; the line height.
((raise -0.1)  (height 0.7))
((raise 0.25)  (height 0.7))
;; Alternative properties for tables.
;; FIXME: We cannot change the text
;; height because it will alter the
;; symbol width and thus break the
;; table alignment (at least, until
;; org table are aligned via pixel
;; width).
((raise -0.5))
((raise 0.5)))
  "Display properties for showing superscripts and subscripts.")

>> However, it currently uses x1.5 line height for tables creating empty
>> space between vertical | separators. It looks like a typo for me. It
>> would make more sense to make table lines compact, not vice versa. Am
>> I missing something?
>
> git blame gives 0618aeafb39dbf78e753348eaeaddbb7f8104cd0
> It seems smaller font breaks horizontal alignment in tables.

Thanks! Now it is crystal clear what was the reason behind the different
fontification inside/outside the tables. I will add the explanation to
comments.

Best,
Ihor




Re: Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

2022-06-07 Thread Ihor Radchenko
lin Sun  writes:

> The commit f9dcc3d was overridden by the commit b5f0efc.
>
> This patch will re-submit the solution based on the last rev.
>
> Please help review and merge the patch. Thanks

I am unable to reproduce the original error on latest main.
Could you please provide a reproducer when the proposed patch is
actually useful?

Best,
Ihor



Re: git branch rename and git config q

2022-06-07 Thread Samuel Wales
more confused than ever.  i hoped i could just run a rename command,
or possibly rename maint to bugfix in config.

there is no git remove command in my version of git.  i tried remote
instead.  on branch local.

$ git remote -v show; git branch -r -v
origin  https://code.orgmode.org/bzg/org-mode.git (fetch)
origin  https://code.orgmode.org/bzg/org-mode.git (push)
  origin/Globals   796952ac7 Add missing
declarations in org-element
  origin/HEAD  -> origin/master
  origin/backport-master   6f9184a29 Merge branch
'maint' into backport-master
  origin/dan-session-errors6d28c79cc ob: python:
catch errors in sessions
  origin/emacs-syncdd9105d17 Merge branch
'maint' into emacs-sync
  origin/emacs-sync-9.3.8  f7dc6be22 Backport
commit 78eacf31e from Emacs
  origin/file-header   d234a9973 ob-R: Delete
duplicated function
  origin/file-header-alt-uid1c50e737 working
  origin/fix-doc   c34121c60 Documentation fix
  origin/hide-table-column 9655ba966 org-table:
Obey  cookie when aligning a table
  origin/km/from-emacs-master  0f7fcc9de Backport
commit 6a3920c07 from Emacs
  origin/ledgerbb1241026 babel: Use
common evaluation mechanism for ledger
  origin/maint dcc3a84a9 keys:
Re-instate some RET bindings
  origin/maint-quotes  08ee6c60d Backport
commit 26bd978 from Emacs master branch
  origin/masterd70f28067 org-macs:
Allow for nil ffap-url-regexp
  origin/mintedaa86ce564 org-latex.el:
minor docstring clean up.
  origin/next  655c08dcc org-clock:
Fix failing tests
  origin/org-7.8.502ddc9b60b Remove
org-ascii, org-html, org-latex and org-odt
  origin/org-tempo 20afd5b44 ;
org-tempo.el: add a missing require
  origin/scratch/sm/agenda-lexical 1fd7d4865 Merge branch
'master' into scratch/sm/agenda-lexical
  origin/stow-design   036b876f3 Bugfix:
Disable typecheck if support is missing.
  origin/taskjuggler-exportcaed2af32 Merge branch
'master' into taskjuggler-export
  origin/tehom-html-export-refactor-build-link 76230e9f8 Re-added code
to inline descriptions as images
  origin/tehom-master  413e6b4ee Add handling
of blockquote and output formats that must be flowed.
  origin/top-propertiesc81bc4d9c Update custom
properties handling
  origin/wip   8fd176ee7 Merge branch
'maint' into wip
  origin/wip-agenda-speedupf5bc563a6 org-agenda:
Optimize log data processing
  origin/wip-cite  5af597836 org-element: Tiny fix
  origin/wip-cite-awe  cb0085e07 WIP support
for exporting citations
  origin/wip-cite-new  b373a2f54 oc-csl:
Implement `csl' citation processor
  origin/wip-lint  406cfbf2a org-element:
Fix parsing recursive babel calls
  origin/wip-sitemap   1a12f3854 ox-publish:
Remove :sitemap-sans-extension

> Your "local" branch has "rebase" setting, I am unsure concerning its precise 
> meaning. I usually do not set any remote for local branches and explicitly 
> specify target commit every time I need to rebase them.

i followed instructions from org manual or similar long ago and it
worked perfectly.  it auto-rebases my patches every time i upgrade org
which is what i want.  that is, i am in branch local, and i pull, and
git sticks the latest changes from maint on top of local for me, then
sticks my patches on top of that for me.  then i just make.  i want to
continue doing all of this.  i don't want to change that workflow if
possible.  i know how to deal with it after many years of use.  i am
limited in computer use.

i think that you have different workflow from me and more knowledge of
git, so this is why it is confusing for me.

On 6/7/22, Max Nikulin  wrote:
> On 07/06/2022 10:33, Samuel Wales wrote:
>>
>> the last par of your email makes it seem as if i should do a git
>> [interactive?] rebase operation from [top of] local on bugfix, even
>> though it is already rebasing on maint each upgrade.  would that be a
>> good description of what you meant?
>
> The state of your local repository is unclear for me. Maybe
>  git remove -v show
>  git branch -r -v
> will shed some light.
>
> maint branch existed in the repository hosted at orgmode.org. During
> migration to savannah it was renamed to bugfix, so if earlier you
> rebased local branches onto maint as the release branch, you should use
> bugfix (from savannah) now.
>
> Your "local" 

Re: babel output seems to drop anything before % (in session)

2022-06-07 Thread Felix Freeman
> (setq shell-prompt-pattern "^sh-[[:digit:]].[[:digit:]]\$ ")

Updated this bit for something better written for emacs and suitable for
my use cases: bash and SSH over TRAMP. I'll leave it here in case anyone
else needs it in the future:

(setq shell-prompt-pattern 
"^\\(sh-[[:digit:]]\\.[[:digit:]]\\|/ssh:[^:]+:[^$]+\\)$ ")

Notice it requires the patch to org-babel-sh-strip-weird-long-prompt
posted earlier.

I hope I got it right this time ^_^'

Felix Freeman



Re: babel output seems to drop anything before % (in session)

2022-06-07 Thread Felix Freeman
I've been able to bypass the error by adding the following to my .emacs

(require 'ob-shell)

(defun org-babel-sh-strip-weird-long-prompt (string)
  "Remove prompt cruft from a string of shell output."
  (while (string-match shell-prompt-pattern string)
(setq string (substring string (match-end 0
  string)

(setq shell-prompt-pattern "^sh-[[:digit:]].[[:digit:]]\$ ")

Of course, this is is just a dirty hack not suitable for a release.

It seems logical that `org-babel-sh-strip-weird-long-prompt` on
`ob-shell.el` respects `shell-prompt-pattern` from `shell.el`. It's not
like this on the released source code.

But to be honest still the idea ripping a dynamic string from the shell
output seems pretty hackish to me. I'm not really aware of the internals
of `comint.el`, but I think that instead it should set the shell $PS1 to
an empty value and read the thing afterwards, or - if this changes
things too much - at least set $PS1 to a very unique and distinctive
value in order to avoid these kind of bugs.

Felix Freeman



[bug] org-list-struct-apply-struct: insert an item in the end of a list

2022-06-07 Thread Phil Estival

Hi there

 - A nasty bug when inserting an item in a list
   in last position (org 9.5.3-g69c588):
   - here is a list
 with a sub list

 - like here ;

 and then text
   x

 1) when trying to insert an item in the list
    above, by suppressing the "x", and hitting
    M-RET, if there's no text after (like this one)
    the command gets stuck in
    org-list-struct-apply-struct

    org-list.el::1932
    #+begin_src elisp

(while (< (point) down)
;; should probably check if forward line returns 0
;; otherwise will keep looping. Something like:
;;  (while (and ( < (point) down) (not(> lines-left-to-move 0)))
   #+end_src

    org-list.el::1946
    #+begin_src

 (forward-line)))
;; (setq lines-left-to-move (forward-line)

   #+end_src

 2) after a break, C-g, or immediately when there no
    text following, text gets destroyed (much
    possibly), the list's structure is
    disorganized and the next paragraph too.

Good luck,
Phil




Re: [DISCUSSION] Refactoring fontification system

2022-06-07 Thread Max Nikulin

On 03/06/2022 16:45, Ihor Radchenko wrote:


1. org-protecting-blocks is an internal auxiliary variable used to
determine which blocks should be fontified using different major
mode.
It's value is ("src" "example" "export")
So, #+begin_src lang and #+begin_export lang are fontified according
to LANG. Makes sense.
However, what about #+begin_example?


I have a lot of #+begin_example with language in my notes. In the 
beginning I accidentally discovered that code is highlighted accordingly 
to language syntax, so I continued to use this feature for snippets that 
are not intended to be evaluated. Later it was a bad surprise that 
export does not preserves highlights. So for me #+begin_example is a 
shortcut for #+begin_src with :eval never (that can be specified as a 
property).


From my point of view exporters may reuse code block formatters for 
examples. It would allow to pass options to e.g. LaTeX verbatim environment:
Pedro Andres Aranda Gutierrez. Re: A question/bug report(?) Wed, 30 Mar 
2022 07:14:54 +0200 
https://list.orgmode.org/orgmode/CAO48Bk_dJs1=5zgpczwodatsrqyrskq1alj6wpaxcc4bdjw...@mail.gmail.com/



2. org-script-display is an internal auxiliary variable used to display
sub/superscripts. Note that it's default value holds 4 possibilities.
Two for each type of script. For example, for superscripts we have
two options:
((raise 0.3) (height 0.7)) and ((raise 0.5))
The first one looks more compact (does not change the line height)


Notice that subscript still increases inter-line space a bit.


However, it currently uses x1.5 line height for tables creating empty
space between vertical | separators. It looks like a typo for me. It
would make more sense to make table lines compact, not vice versa. Am
I missing something?


git blame gives 0618aeafb39dbf78e753348eaeaddbb7f8104cd0
It seems smaller font breaks horizontal alignment in tables.




Re: git branch rename and git config q

2022-06-07 Thread Max Nikulin

On 07/06/2022 10:33, Samuel Wales wrote:


the last par of your email makes it seem as if i should do a git
[interactive?] rebase operation from [top of] local on bugfix, even
though it is already rebasing on maint each upgrade.  would that be a
good description of what you meant?


The state of your local repository is unclear for me. Maybe
git remove -v show
git branch -r -v
will shed some light.

maint branch existed in the repository hosted at orgmode.org. During 
migration to savannah it was renamed to bugfix, so if earlier you 
rebased local branches onto maint as the release branch, you should use 
bugfix (from savannah) now.


Your "local" branch has "rebase" setting, I am unsure concerning its 
precise meaning. I usually do not set any remote for local branches and 
explicitly specify target commit every time I need to rebase them.



do i do git branch -m bugfix in my maint branch


This renames just your local branch but should not affect its 
association with remote (orgmode.org) branch. From my point of view it 
just increases confusion. Add new remote, checkout bugfix branch (it 
will track the branch from proper remote repository), then rebase your 
local modifications onto bugfix. You can use "git rebase REMOTE/bugfix" 
(I do not know your remote names, replace REMOTE to the name of the 
savannah repository). Target branch name for rebase is no more than 
convenient way to specify particular commit.





[BUG] org-link-descriptive affects verbatim text

2022-06-07 Thread Max Nikulin

Hi,

I noticed that current main HEAD hides link description even when it is 
not a link but verbatim text:


=[[http://orgmode.org][Org]]=

Just underlined =Org= is displayed, while earlier version of Org 
displays whole verbatim text.


1105da80a doc/org-manual.org: variable rename
Emacs-26.3.




Re: Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

2022-06-07 Thread Max Nikulin

On 07/06/2022 13:34, Dr. Arne Babenhauserheide wrote:


lin Sun writes:

This patch will re-submit the solution based on the last rev.



diff --git a/lisp/ob-plantuml.el b/lisp/ob-plantuml.el
index 6e1b1b1..37a631b 100644
--- a/lisp/ob-plantuml.el
+++ b/lisp/ob-plantuml.el
@@ -122,6 +122,7 @@ This function is called by `org-babel-execute-src-block'."
((not (file-exists-p org-plantuml-jar-path))
 (error "Could not find plantuml.jar at %s" 
org-plantuml-jar-path))
(t `(,java
+ "-Djava.awt.headless=true"


This looks good and low-risk to me.


Could you, please, clarify why -headless in `org-plantuml-args' is not 
enough and -Djava.awt.headless=true should be added despite it looks 
redundant. Another question is why this option should be applied to jar 
but not to plantuml launcher script. The commit dropping this option has 
a link to discussion whether this argument is necessary and hard coded 
in such way.





 "-jar"
 ,(shell-quote-argument (expand-file-name 
org-plantuml-jar-path))
   ,@org-plantuml-args





Re: babel output seems to drop anything before % (in session)

2022-06-07 Thread Felix Freeman
Today I stumbed upon the same bug.

Sadly I have no idea how to fix it, but thought it would be nice to post
about it here so the bug doesn't get lost in the sands of time.

Felix Freeman



Re: [PATCH] Support #+include-ing URLs

2022-06-07 Thread Fraga, Eric
On Tuesday,  7 Jun 2022 at 19:27, Timothy wrote:
> This already occurs with #+setupfile.

Ah, interesting.  I had not realised this.  It definitely would be nice
to provide confirmation for setup files as well, then.

thank you,
eric

-- 
: Eric S Fraga, with org release_9.5.4-521-g1105da in Emacs 29.0.50


Re: [PATCH] Support #+include-ing URLs

2022-06-07 Thread Timothy
Hi Eric,

>> Is it possible to disable fetching remote files by some setting?
>
> I would not want automatic retrieval of URLs without confirmation.

This already occurs with #+setupfile.

I think this is a good point to raise, but a slightly separate one as it
concerns the pre-existing behaviour of org-file-contents.

A new patch set introducing a defcustom with three values (t, prompt, nil) and
accompanying modification to org-file-contents (it’s the only use of
`url-retrieve-synchronously' other than org-feed I see) would probably be a 
decent
idea. If nobody makes such a patch in the next week or so I’ll take a punt at
this.

All the best,
Timothy


Re: [PATCH] Support #+include-ing URLs

2022-06-07 Thread Fraga, Eric
On Sunday,  5 Jun 2022 at 22:01, Max Nikulin wrote:
> Is it possible to disable fetching remote files by some setting? 

+1

I would not want automatic retrieval of URLs without confirmation.

-- 
: Eric S Fraga, with org release_9.5.4-521-g1105da in Emacs 29.0.50


[SOLVED] (was: org-ref-helm-insert-cite-link change the formatted citations include urls)

2022-06-07 Thread Uwe Brauer
>>> "UB" == Uwe Brauer  writes:

> Hi

> When using org-ref-helm-insert-cite-link I would like to insert the
> urls, as in this example

> @Misc{Author,
>   author   = {Author},
>   title= {Global existence of a nonlinear wave equation}
>   howpublished = {accepted for publication in Journal  (preprint in the 
> arXiv)},
>   eprint   = {123.456.888},
>   archivePrefix= {arXiv},
>   primaryClass = {math.AP},
>   url  = {https://arxiv.org/abs/123.456.888},
>   month= {October},
>   year = 2021
> }

(setq
 org-ref-formatted-citation-formats
   '(("text"
 ("org"
  ("misc" . "${author}, /${title}/ *${howpublished}* ${url} (${year}).")


Seems to work


smime.p7s
Description: S/MIME cryptographic signature


[SOLVED] (was: org-ref-insert-link: insert formatted entry: but mark several entries)

2022-06-07 Thread Uwe Brauer
>>> "UB" == Uwe Brauer  writes:

> Hi 

> While using org-ref-insert-link, I obtain a list of possible entries
> (which I would like to inserted via F7 as formatted citations)

> That works well for one entry, but how can I mark several of these?


C-space is the solution


smime.p7s
Description: S/MIME cryptographic signature


org-ref-helm-insert-cite-link change the formatted citations include urls

2022-06-07 Thread Uwe Brauer


Hi

When using org-ref-helm-insert-cite-link I would like to insert the
urls, as in this example

@Misc{Author,
  author   = {Author},
  title= {Global existence of a nonlinear wave equation}
  howpublished = {accepted for publication in Journal  (preprint in the arXiv)},
  eprint   = {123.456.888},
  archivePrefix= {arXiv},
  primaryClass = {math.AP},
  url  = {https://arxiv.org/abs/123.456.888},
  month= {October},
  year = 2021
}


How can I achieve this?

Thanks and regards

Uwe Brauer 
-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 




org-ref-insert-link: insert formatted entry: but mark several entries

2022-06-07 Thread Uwe Brauer


Hi 

While using org-ref-insert-link, I obtain a list of possible entries
(which I would like to inserted via F7 as formatted citations)

That works well for one entry, but how can I mark several of these?


Thanks and regards

Uwe Brauer 


-- 
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 




Re: Subject: [PATCH] Fix DISPLAY error on exporting org with plantuml to html

2022-06-07 Thread Dr. Arne Babenhauserheide
Hi Lin Sun,

lin Sun via "General discussions about Org-mode."  
writes:
> This patch will re-submit the solution based on the last rev.
>
> Please help review and merge the patch. Thanks 
>
> [4. text/x-patch; 
> 0001-ob-plantuml-fix-DISPLAY-error-with-html-export.patch]...
> From 6512e94806a4c08f40e6796e239ad2b318f7fbc5 Mon Sep 17 00:00:00 2001
> From: Lin Sun 
> Date: Tue, 7 Jun 2022 04:06:06 +
> Subject: [PATCH] ob-plantuml: fix DISPLAY error with html export
> 
> * lisp/ob-plantuml.el (org-babel-execute:plantuml): Use headless mode
> for Org calling plantuml for exporting to html to avoid issues with
> operations that normally try to access the system graphics stack.
> ---
>  lisp/ob-plantuml.el | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lisp/ob-plantuml.el b/lisp/ob-plantuml.el
> index 6e1b1b1..37a631b 100644
> --- a/lisp/ob-plantuml.el
> +++ b/lisp/ob-plantuml.el
> @@ -122,6 +122,7 @@ This function is called by `org-babel-execute-src-block'."
>   ((not (file-exists-p org-plantuml-jar-path))
>(error "Could not find plantuml.jar at %s" 
> org-plantuml-jar-path))
>   (t `(,java
> + "-Djava.awt.headless=true"

This looks good and low-risk to me.

>"-jar"
>,(shell-quote-argument (expand-file-name 
> org-plantuml-jar-path))
>   ,@org-plantuml-args
> -- 
> 2.7.0

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de


signature.asc
Description: PGP signature