[BUG] org-up-heading-safe behaves different in v9.7 [9.7 (9.7-??-d6f3aed @ /home/zhaoyiyu/.config/emacs/.local/straight/build-28.1/org/)]

2023-08-26 Thread zhaoyiyu




Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See

https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


When I track down a issue about org-journal, with org v9.7
I noticed that when execute
(org-up-heading-safe)
it's different with org v9.6, which would caused the org-journal issue.
In detail as follows org file. After execution the cursor position will
change to


File Header                 <-- v9.7, return nil and cursor here
* heading lv 1 <-- v9.6, return nil and cursor here
some contents and your prev cursor is here I


Personaly, I write a advice to fix the issue


(defun myfunc/org-up-heading-safe ()
(let* ((heading (org-element-lineage
(org-element-at-point)
'(headline inlinetask) 'with-self))
(parent (org-element-parent heading))
(ret (and parent
(org-element-property :level parent)
(<= (point-min) (org-element-begin parent)
(if ret
(goto-char (org-element-begin parent))
(when heading
(goto-char (org-element-begin heading
ret))
(advice-add 'org-up-heading-safe :override #'myfunc/org-up-heading-safe)

However, Since I didn't get the purpose for the org v9.7 changes, I
submit this issue here.


Emacs : GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.24.33, cairo version 1.16.0)

of 2022-05-31
Package: Org mode version 9.7 (9.7-??-d6f3aed @ 
/home/zhaoyiyu/.config/emacs/.local/straight/build-28.1/org/)





Re: What do you recommend for acronyms in org-mode?

2023-08-26 Thread Maske
Hi John!

I was using org-ref some time ago, but it seemed to get emacs slower, in my low 
resources PC.

Would you give me some tips to make org-ref lighter?

Best regards

27 ago 2023 2:33:05 John Kitchin :

> You can see how these work in org-ref in this video: 
> https://www.youtube.com/watch?v=sebs2vSIEk4=PL0sMmOaE_gs3E0OjExoI7vlCAVygj6S4I=13.
> 
> On Sat, Aug 26, 2023 at 1:21 PM Maske  wrote:
>> 
>> I would like to know what do you use for acronyms, glossaries, etc for using 
>> inside org-mode? Not for exportation, just to use them inside Emacs.
>> 
>> Maybe radio links, or the package org-glossary? org-ref?
>> 
>> Best regards
>> 
> 
> 
> -- 
> John
> 
> ---
> Professor John Kitchin (he/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> https://kitchingroup.cheme.cmu.edu[https://kitchingroup.cheme.cmu.edu/]
> https://pointbreezepubs.gumroad.com/ pycse bookstore


Re: [DISCUSSION] Re-design of inlinetasks

2023-08-26 Thread Juan Manuel Macías
Ihor Radchenko writes:

> In other words, it is not the section itself, but other
> headline/inlinetask features, like todo keywords, tags, planning. Right?

No, it is the section itself (or the concept of "section", with its toys
in Org, of course) that is important to me in this case. I am not
emphasizing so much how or in which way an element can be exported, but
what (semantic) role that element plays in the logical structure of an
Org document. To get a little philosophical, the Org document (where I
work and write) would be the idea, and the export to any format a
possible concrete realization. I mean, I find it comfortable and
productive to view an Org document as agnostic of any format. This use
of inlinetasks that I'm discussing here occurred to me a long time ago
because if I stop to think about an untitled, detached section of the
level hierarchy, this Org element is a perfect candidate. It is true
that you can use a special block, or another element (org is very
versatile, and supports role swapping between elements), but if I have
to think of a logical candidate, inlinetasks are the closest to that
concept. If inlinetasks didn't exist, I'd probably use special blocks
for that purpose. When I'm writing inside Org I'm not thinking about the
export (at least not simultaneously), that is, about the format; I think
more of the structure of the document, as something abstract.


-- 
Juan Manuel Macías

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com
 



Re: [DISCUSSION] Re-design of inlinetasks

2023-08-26 Thread Russell Adams
On Sat, Aug 26, 2023 at 05:31:46PM +, Juan Manuel Macías wrote:
> Ihor Radchenko writes:
>
> *** TODO anonsec :tag:
> Content that has neither a title nor a section number.
> *** END
>
> and a construction that for the purposes of parceling out the text
> behaves like a section. The problem is the LaTeX side. Since there is no
> support for anonymous sections in LaTeX (I seem to remember that some
> special class like Koma had some command to introduce anonymous breaks,
> but I only use the standard classes), I had to define an environment. It
> is not inconvenient, since after all what appears in LaTeX is the
> typographical result. For the Org side I can use TODO keywords, tags,
> deadlines, etc.

Why not just put the TODO heading in a code block with type org?

Then you get all the toys, ignored by the main file.


--
Russell Adamsrlad...@adamsinfoserv.com
https://www.adamsinfoserv.com/



Re: [DISCUSSION] Re-design of inlinetasks

2023-08-26 Thread Ihor Radchenko
Juan Manuel Macías  writes:

>> Why not simply
>>
>> #+begin_anonsection
>> ...
>> #+end_anonsection
>>
>> ?
> ... The problem is the LaTeX side. Since there is no
> support for anonymous sections in LaTeX (I seem to remember that some
> special class like Koma had some command to introduce anonymous breaks,
> but I only use the standard classes), I had to define an environment. It
> is not inconvenient, since after all what appears in LaTeX is the
> typographical result. For the Org side I can use TODO keywords, tags,
> deadlines, etc.

In other words, it is not the section itself, but other
headline/inlinetask features, like todo keywords, tags, planning. Right?

Custom blocks can be exported to anything (not necessarily
\begin{foo}...), similar to how you did custom export for inlinetasks.
There was also an idea to make custom block export more customizeable,
similar to link. Like what
https://github.com/alhassy/org-special-block-extras does.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [DISCUSSION] Re-design of inlinetasks

2023-08-26 Thread Juan Manuel Macías
Ihor Radchenko writes:

> Why not simply
>
> #+begin_anonsection
> ...
> #+end_anonsection
>
> ?

Because with an inlinetask I can have something like this:

*** TODO anonsec :tag:
Content that has neither a title nor a section number.
*** END

and a construction that for the purposes of parceling out the text
behaves like a section. The problem is the LaTeX side. Since there is no
support for anonymous sections in LaTeX (I seem to remember that some
special class like Koma had some command to introduce anonymous breaks,
but I only use the standard classes), I had to define an environment. It
is not inconvenient, since after all what appears in LaTeX is the
typographical result. For the Org side I can use TODO keywords, tags,
deadlines, etc.


-- 
Juan Manuel Macías

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com



What do you recommend for acronyms in org-mode?

2023-08-26 Thread Maske
I would like to know what do you use for acronyms, glossaries, etc for 
using inside org-mode? Not for exportation, just to use them inside Emacs.


Maybe radio links, or the package org-glossary? org-ref?

Best regards


Re: [DISCUSSION] Re-design of inlinetasks

2023-08-26 Thread Ihor Radchenko
Juan Manuel Macías  writes:

>> Do you mean section in LaTeX sense or in Org sense?
>
> In Org sense, I think. If an author adds an 'anonymous' break (through
> some customary symbol) and continues writing, the content that follows
> belongs (for Org) to the current section. By using an inlenitask, you
> can have control over the inlinetask content, for any purpose, for
> example with some export filter, etc.
>
> On the other hand, for my own writing I usually use this:
>
> #+begin_src emacs-lisp
>   (defun my-org-latex-format-inlinetask-default-function
>   (todo _todo-type priority title tags contents _info)
> (if (string-match-p "anonsec" title)
>   (concat
>"\n\\begin{anonsection}\n"
>(org-string-nw-p contents)
>"\n\\end{anonsection}\n")
>   (org-string-nw-p contents)))

Why not simply

#+begin_anonsection
...
#+end_anonsection

?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] FAILED test-ob-python/session-multiline

2023-08-26 Thread Ihor Radchenko
Jack Kamm  writes:

>>FAILED   376/1256  test-ob-python/session-multiline (0.011955 sec) at 
>> ../lisp/test-ob-python.el:105
>
> Hmmm. Do you have an idea of how long this has been happening, and how
> frequently it breaks?

For months.

> My first suspicion is the large ob-python commit I pushed on Tuesday:
>
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=579e8c572345c42ad581d3ddf0f484567d55a787

So, should not be the recent commit.

> Also, do you have any tips for searching or navigating the failing CI
> builds?  I tried going to https://builds.sr.ht/~bzg, but it didn't
> include the failed build you linked to (which I guess is an "unlisted"
> build).

https://lists.sr.ht/~bzg/org-build-failures

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Warning when creating preview

2023-08-26 Thread Ihor Radchenko
Edgar Lux  writes:

> 9. M-& make repro REPRO_ARGS="-l /tmp/bug.el /tmp/bug.org"

Did you see a new Emacs instance at this point?

> 10. M-x switch-to-buffer RET /tmp/bug.org RET
> 11. Move point to "t = 0" line
> 12. C-c C-x C-l (2x)
>
> I see the warning.
>
> After step 10, I removed the files in ltximg, ran =emacs -q=, find file 
> /tmp/bug.org, step 11 & 12, and I see no warning. There must be something 
> else in my configuration which triggers the error (if you want to follow the 
> rabbit, let me know).

Sure, I do want to go into this rabbit hole. This kind of problem is
runtime and very hard to catch unless we get help from users with
unusual configs.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: ob-lilypond fontification

2023-08-26 Thread Ihor Radchenko
Henrik Frisk  writes:

>> Is lilypond library is loaded when you open Org file?
>> What happens if you run C-c ' on an src-block?
>>
>
> That works fine, code is syntax highlighted.

Hmm. Did you customize `org-src-fontify-natively'?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] org-cite-insert fails to open json format bibliographies that contain entries for books with editors but no authors [9.6.6 (release_9.6.6 @ /snap/emacs/current/usr/share/emacs/29.1/lisp/org/

2023-08-26 Thread Ihor Radchenko
Margaret Patterson  writes:

> Thanks!  Yes that seems to fix my problem.

Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7c929e9d8

> I failed to apply the patch (perhaps because the file is in a different 
> place, /lisp/org/ instead of /lisp/ ) however making that change 
> manually and rebuilding fixed the problem.
>
> For future reference is there a resource that explains how to apply 
> patches for testing?  I have emacs installed via the snap package on 
> Ubuntu, and in the end (with a lot of help from my spouse) we built it 
> directly from source without installing it to test this, but is there a 
> more direct way to do this?

We develop Org mode separately from Emacs in a different git repository.
See https://orgmode.org/manual/Installation.html or "source code" link
in https://orgmode.org/

My patch was against Org repository, not Emacs.

Applying a patch is the same as with any other git repo. We might drop a
reference to some online documentation on how to use git, but (1) I am
not sure what should be the place to put such a reference; (2) If you
are unsure how to apply patches, you could ask, and I would offer another
way to test things.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] FAILED test-ob-python/session-multiline

2023-08-26 Thread Jack Kamm
Ihor Radchenko  writes:

> Hi,
>
> We have fairly regular CI test failures for one of the ob-python tests.
> The test does not fail _every_ time, but I keep seeing the problem in
> various Emacs versions, including Emacs 29.
>
> Example log: https://builds.sr.ht/~bzg/job/1047678#task-build
>
> In the test the result somehow includes prompt:
>
> Test test-ob-python/session-multiline condition:
> (ert-test-failed
>  ((should
>(equal "20"
> (org-test-with-temp-text "#+begin_src python :session :results 
> output\n  foo = 0\n  for _ in range(10):\n  foo += 1\n\n  foo += 
> 1\n\n  print(foo)\n#+end_src" ...)))
>   :form
>   (equal "20" ">>> 20")
>   :value nil :explanation
>
>
> -->   (arrays-of-different-length 2 6 "20" ">>> 20" first-mismatch-at 0)))
>
>
>FAILED   376/1256  test-ob-python/session-multiline (0.011955 sec) at 
> ../lisp/test-ob-python.el:105

Hmmm. Do you have an idea of how long this has been happening, and how
frequently it breaks?

My first suspicion is the large ob-python commit I pushed on Tuesday:

https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=579e8c572345c42ad581d3ddf0f484567d55a787

But that commit shouldn't affect ":results output", at least not
intentionally.

Also, do you have any tips for searching or navigating the failing CI
builds?  I tried going to https://builds.sr.ht/~bzg, but it didn't
include the failed build you linked to (which I guess is an "unlisted"
build).



Re: [BUG] Warning when creating preview

2023-08-26 Thread Edgar Lux
On Aug 23, 2023 at 9:56 AM, Ihor Radchenko 
> 1. Save the equation to file /tmp/bug.org
> 2. Save your `setq' snippet to /tmp/bug.el
> 3. cd /path/to/org/repo
> 4. make repro REPRO_ARGS="-l /tmp/bug.el /tmp/bug.org"
> 5. Move point to "t = 0" line
> 6. C-c C-x C-l (2x)
> 7. The preview appears and then disappears, as expected.
>
> May you please repeat my steps and let me know if your are seeing the warning?

1. emacs (loading my full configuration)
2. find the file of my previous bug report: t.org
3. dedent and mark the equation (without the =_quote=)
4. M-x copy-to-buffer RET bug.org RET
5. Save to /tmp/bug.org
6. add :tangle /tmp/bug.el to the emacs-lisp source block
7. C-u C-c C-v t to tangle (save) the file
8. find /path/to/org/repo (with dired)
9. M-& make repro REPRO_ARGS="-l /tmp/bug.el /tmp/bug.org"
10. M-x switch-to-buffer RET /tmp/bug.org RET
11. Move point to "t = 0" line
12. C-c C-x C-l (2x)

I see the warning.

After step 10, I removed the files in ltximg, ran =emacs -q=, find file 
/tmp/bug.org, step 11 & 12, and I see no warning. There must be something else 
in my configuration which triggers the error (if you want to follow the rabbit, 
let me know).

In this case, the warning was:

#+begin_example
  Warning (org-element-cache): org-element--cache: Org parser error in 
bug.org::22. Resetting.
   The error was: (error "Invalid search bound (wrong side of point)")
   Backtrace:
  "  backtrace-to-string(nil)
org-element-at-point()
org-element-context()
org-latex-preview(nil)
funcall-interactively(org-latex-preview nil)
call-interactively(org-latex-preview nil nil)
command-execute(org-latex-preview)
  "
   Please report this to Org mode mailing list (M-x org-submit-bug-report). 
Disable showing Disable logging
#+end_example

-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] org-cite-insert fails to open json format bibliographies that contain entries for books with editors but no authors [9.6.6 (release_9.6.6 @ /snap/emacs/current/usr/share/emacs/29.1/lisp/org/

2023-08-26 Thread Margaret Patterson

Thanks!  Yes that seems to fix my problem.

I failed to apply the patch (perhaps because the file is in a different 
place, /lisp/org/ instead of /lisp/ ) however making that change 
manually and rebuilding fixed the problem.


For future reference is there a resource that explains how to apply 
patches for testing?  I have emacs installed via the snap package on 
Ubuntu, and in the end (with a lot of help from my spouse) we built it 
directly from source without installing it to test this, but is there a 
more direct way to do this?


Best wishes,
Margaret.

On 25/08/2023 09:39, Ihor Radchenko wrote:

Margaret Patterson  writes:


Since upgrading to emacs 29.1 org-cite-insert no longer copes with
bibliography files in json format where there is an entry for a book
that has only editors and no author.

Thanks for reporting!
Does the attached patch fix the problem?






Re: [DISCUSSION] Re-design of inlinetasks

2023-08-26 Thread Juan Manuel Macías
Ihor Radchenko writes:

> Juan Manuel Macías  writes:

>> I think that would not be expected, since an anonymous section is just a
>> break in the text that has neither a title nor a section number.
>> ... Anonymous breaks using asterisks or other symbols is usually the applied
>> remedy. The advantage of enclosing the content of the anonymous section
>> in an inlinetask is that we have a 'true' section with content (over
>> which you have control). That would not happen if the author explicitly
>> added a break symbol and continue writing.
>
> Do you mean section in LaTeX sense or in Org sense?

In Org sense, I think. If an author adds an 'anonymous' break (through
some customary symbol) and continues writing, the content that follows
belongs (for Org) to the current section. By using an inlenitask, you
can have control over the inlinetask content, for any purpose, for
example with some export filter, etc.

On the other hand, for my own writing I usually use this:

#+begin_src emacs-lisp
  (defun my-org-latex-format-inlinetask-default-function
  (todo _todo-type priority title tags contents _info)
(if (string-match-p "anonsec" title)
(concat
 "\n\\begin{anonsection}\n"
 (org-string-nw-p contents)
 "\n\\end{anonsection}\n")
  (org-string-nw-p contents)))

(defun mi-org-odt-format-inlinetask-default-function
(todo todo-type  priority name tags contents)
  (if (string-match-p "anonsec" name)
  (concat
   contents
   "* * *")))
#+end_src

And for LaTeX I have defined this:

#+begin_src latex
\newcommand\dinkus{\mbox{\textasteriskcentered\space\textasteriskcentered\space\textasteriskcentered}}
\newcommand\anonsectionmark{\dinkus}

%% require the needspace package
\newcommand\anonsectionbreak{%
  \nopagebreak[4]
  \bigskip%
  {\centering
  \anonsectionmark\par}
  \Needspace*{2\bigskipamount}
  \bigskip}

\newenvironment{anonsection}{%
\anonsectionbreak%
}
{%
\par}
#+end_src


>> Anonymous breaks are also widely used in essay or narrative texts. An
>> essay text, published as a blog entry or as an article, can be perfectly
>> structured into anonymous sections:
>> ...
>> https://en.wikipedia.org/wiki/Section_(typography)#Section_form_and_numbering
>>
>> https://en.wikipedia.org/wiki/Section_(typography)#Flourished_section_breaks
>
> This one I know. But it can work fine with normal headings, because such
> texts are nothing but a sequence of "scenes" - nothing "inline" when we
> have one scene, interrupted by other, then coming back to the first one.

Actually, I think any anonymous text break or sectioning can be
accomplished using Org headings and some trickery to ignore the heading on
export, but I think inlinetasks lends itself quite well to this
constructions and others I've seen discussed in this thread. In general,
for any 'piece' (section = something that is sectioned) of text that
needs to be separated in some way from the main text, without a
hierarchy of levels, inlinetasks are a great, versatile and simple tool
(IMHO).

-- 
Juan Manuel Macías

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com



Re: ob-lilypond fontification

2023-08-26 Thread Henrik Frisk
Den lör 26 aug. 2023 kl 14:27 skrev Ihor Radchenko :

> Henrik Frisk  writes:
>
> > So I changed to the main branch of
> >
> > git://git.savannah.gnu.org/emacs/org-mode.git
> >
> > and the new features you added to ob-lilypond is working (much
> > appreciated) but I still don' have syntax highlight in source blocks
> > though it works fine in lilypond-mode.
>
> Is lilypond library is loaded when you open Org file?
> What happens if you run C-c ' on an src-block?
>

That works fine, code is syntax highlighted.


Re: [RFC] Quoting property names in tag/property matches [Was: [BUG?] Matching tags: & operator no more implicit between tags and special property]

2023-08-26 Thread Jens Schmidt
On 2023-08-26  14:22, Ihor Radchenko wrote:
> Jens Schmidt  writes:

>> #+begin_example
>> boss\-prio="C"
>> boss\:prio="C"
>> boss\\prio="C"
>> #+end_example
> 
> Looks good to me.

Implemented in the next version of the patch, please check.

From 11dc3ac4ff060f1ffb9dae7b35eabe526bbbc572 Mon Sep 17 00:00:00 2001
From: Jens Schmidt 
Date: Thu, 24 Aug 2023 22:38:02 +0200
Subject: [PATCH] org-make-tags-matcher: Re-add quoting of property names

* lisp/org.el (org-make-tags-matcher):
* testing/lisp/test-org.el (test-org/map-entries): Move special cased
handling of LEVEL properties.  Add tests for other special cased
properties TODO and CATEGORY.

* lisp/org.el (org-make-tags-matcher):
* doc/org-manual.org (Matching tags and properties):
* testing/lisp/test-org.el (test-org/map-entries): Re-add and extend
quoting of property names in search strings.

Link: https://orgmode.org/list/87h6oq2nu1@gmail.com
---
 doc/org-manual.org   | 22 
 lisp/org.el  | 55 
 testing/lisp/test-org.el | 34 +
 3 files changed, 68 insertions(+), 43 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 17b25fef4..249648566 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -9320,21 +9320,21 @@ With the regular =<= operator, the search would handle entries without
 an =EFFORT= property as having a zero effort and would include them in
 the result as well.
 
-Currently, you can use only property names including alphanumeric
-characters, underscores, and minus characters in search strings.  In
-addition, if you want to search for a property whose name starts with
-a minus character, you have to "quote" that leading minus character
-with an explicit positive selection plus character, like this:
+You can use all characters valid in property names when matching
+properties.  However, you have to quote some characters in property
+names with backslashes when using them in search strings, namely all
+characters different from alphanumerics and underscores[fn:: If you
+quote alphanumeric characters or underscores with a backslash, that
+backslash is ignored.].  For example, to search for all entries having
+a property =boss-prio=, =boss:prio=, or =boss\prio=, respectively,
+with value =C=, use search strings
 
 #+begin_example
-+-long-and-twisted-property-name-="foo"
+boss\-prio="C"
+boss\:prio="C"
+boss\\prio="C"
 #+end_example
 
-#+texinfo: @noindent
-Without that extra plus character, the minus character would be taken
-to indicate a negative selection on search term
-=long-and-twisted-property-name-​="foo"=.
-
 You can configure Org mode to use property inheritance during
 a search, but beware that this can slow down searches considerably.
 See [[*Property Inheritance]], for details.
diff --git a/lisp/org.el b/lisp/org.el
index 50df1b2d9..78f8eb2e9 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11328,15 +11328,14 @@ See also `org-scan-tags'."
   "\\(?2:"
   ;; tag regexp match
   "{[^}]+}\\|"
-  ;; LEVEL property match.  For sake of consistency,
-  ;; recognize starred operators here as well.  We do
-  ;; not need to process them below, however, since
-  ;; the LEVEL property is always present.
-  "LEVEL\\(?3:" opre "\\)\\*?\\(?4:[0-9]+\\)\\|"
-  ;; regular property match
+  ;; property match.  Try to keep this subre generic
+  ;; and rather handle special properties like LEVEL
+  ;; and CATEGORY further below.  This ensures that
+  ;; the same quoting mechanics can be used for all
+  ;; property names.
   "\\(?:"
   ;; property name [1]
-  "\\(?5:[[:alnum:]_-]+\\)"
+  "\\(?5:\\(?:[[:alnum:]_]+\\|[^[:space:]]\\)+\\)"
   ;; operator, optionally starred
   "\\(?6:" opre "\\)\\(?7:\\*\\)?"
   ;; operand (regexp, double-quoted string,
@@ -11353,13 +11352,19 @@ See also `org-scan-tags'."
  (start 0)
  tagsmatch todomatch tagsmatcher todomatcher)
 
-;; [1] The minus characters in property names do *not* conflict
-;; with the exclusion operator above, since the mandatory
-;; following operator distinguishes these both cases.
-;; Accordingly, minus characters do not need any special quoting,
-;; even if https://orgmode.org/list/87jzv67k3p.fsf@localhost and
-;; commit 19b0e03f32c6032a60150fc6cb07c6f766cb3f6c suggest
-;; otherwise.
+;; [1] The history of this particular subre:
+;; - \\([[:alnum:]_]+\\) [pre-19b0e03]
+;;   Does not allow for minus characters in property names.
+;; - "\\(\\(?:[[:alnum:]_]+\\(?:-\\)*\\)+\\)" [19b0e03]
+;;   Incomplete fix of above issue, still resulting in, e.g.,
+;;   

[BUG] FAILED test-ob-python/session-multiline

2023-08-26 Thread Ihor Radchenko
Hi,

We have fairly regular CI test failures for one of the ob-python tests.
The test does not fail _every_ time, but I keep seeing the problem in
various Emacs versions, including Emacs 29.

Example log: https://builds.sr.ht/~bzg/job/1047678#task-build

In the test the result somehow includes prompt:

Test test-ob-python/session-multiline condition:
(ert-test-failed
 ((should
   (equal "20"
  (org-test-with-temp-text "#+begin_src python :session :results 
output\n  foo = 0\n  for _ in range(10):\n  foo += 1\n\n  foo += 1\n\n  
print(foo)\n#+end_src" ...)))
  :form
  (equal "20" ">>> 20")
  :value nil :explanation


-->   (arrays-of-different-length 2 6 "20" ">>> 20" first-mismatch-at 0)))


   FAILED   376/1256  test-ob-python/session-multiline (0.011955 sec) at 
../lisp/test-ob-python.el:105

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [DISCUSSION] Re-design of inlinetasks

2023-08-26 Thread Ihor Radchenko
Juan Manuel Macías  writes:

>>
>> May they contain sub-sections?
>
> I think that would not be expected, since an anonymous section is just a
> break in the text that has neither a title nor a section number.
> ... Anonymous breaks using asterisks or other symbols is usually the applied
> remedy. The advantage of enclosing the content of the anonymous section
> in an inlinetask is that we have a 'true' section with content (over
> which you have control). That would not happen if the author explicitly
> added a break symbol and continue writing.

Do you mean section in LaTeX sense or in Org sense?

> Anonymous breaks are also widely used in essay or narrative texts. An
> essay text, published as a blog entry or as an article, can be perfectly
> structured into anonymous sections:
> ...
> https://en.wikipedia.org/wiki/Section_(typography)#Section_form_and_numbering
>
> https://en.wikipedia.org/wiki/Section_(typography)#Flourished_section_breaks

This one I know. But it can work fine with normal headings, because such
texts are nothing but a sequence of "scenes" - nothing "inline" when we
have one scene, interrupted by other, then coming back to the first one.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [POLL] Should we accept breaking changes to get rid of Org libraries that perform side effects when loading?

2023-08-26 Thread Ihor Radchenko
"Fraga, Eric"  writes:

>> My personal use case is when using Org for authoring long texts.
>> I often leave inline tasks around the specific paragraph I need to
>> revise in future:
>
> For completeness, I will add that I do the same but using drawers at the
> point where I want to note a task, where the drawer is ~:todo:~.  I then
> have some special formatting for LaTeX export that converts such drawers
> into footnotes with a note in the margin.

That will indeed work. But then the todo will not appear in agenda.

I think that a combination of drawers/special blocks + ability to assign
todos/tags to paragraphs/tables/drawers/etc may give people what they
usually need when using inlinetasks.
 

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: ob-lilypond fontification

2023-08-26 Thread Ihor Radchenko
Henrik Frisk  writes:

> So I changed to the main branch of
>
> git://git.savannah.gnu.org/emacs/org-mode.git
>
> and the new features you added to ob-lilypond is working (much
> appreciated) but I still don' have syntax highlight in source blocks
> though it works fine in lilypond-mode.

Is lilypond library is loaded when you open Org file?
What happens if you run C-c ' on an src-block?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: ob-lilypond fontification

2023-08-26 Thread Henrik Frisk
Den ons 23 aug. 2023 kl 08:04 skrev Henrik Frisk :

>
>
> On Tue, Aug 22, 2023, 6:17 PM Ihor Radchenko  wrote:
>
>> Henrik Frisk  writes:
>>
>> > So I grabbed the file ob-lilypond from another inactive install of Emacs
>> > 29.1 and linked to it in my init file. Everythin appears to work fine
>> > except I dont get syntax highlightning unless I hit C-c '
>>
>> I recommend installing Org mode from ELPA to make sure that you are
>> using the latest version.
>>
>> Also, there were possibly relevant changes on development branch. So you
>> might need ELPA devel version.
>>
>
> Makes sense. I will try that, thanks!
>

So I changed to the main branch of

git://git.savannah.gnu.org/emacs/org-mode.git

and the new features you added to ob-lilypond is working (much
appreciated) but I still don' have syntax highlight in source blocks
though it works fine in lilypond-mode.

/Henrik


Re: [RFC] Quoting property names in tag/property matches [Was: [BUG?] Matching tags: & operator no more implicit between tags and special property]

2023-08-26 Thread Ihor Radchenko
Jens Schmidt  writes:

>> That's partially what I meant.
>> It would help to provide a simpler example first.
>
> How about a series of simpler examples then, like this:
>
> #+begin_example
> boss\-prio="C"
> boss\:prio="C"
> boss\\prio="C"
> #+end_example

Looks good to me.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [RFC] Quoting property names in tag/property matches [Was: [BUG?] Matching tags: & operator no more implicit between tags and special property]

2023-08-26 Thread Jens Schmidt
On 2023-08-26  14:00, Ihor Radchenko wrote:
> Jens Schmidt  writes:
>> On 2023-08-26  12:16, Ihor Radchenko wrote:

>>> This actually feels rather cubersome.
>>
>> [...]  I can
>> provide a simpler example in the manual, but that's probably not
>> what you meant :-)
> 
> That's partially what I meant.
> It would help to provide a simpler example first.

How about a series of simpler examples then, like this:

#+begin_example
boss\-prio="C"
boss\:prio="C"
boss\\prio="C"
#+end_example




Re: [RFC] Quoting property names in tag/property matches [Was: [BUG?] Matching tags: & operator no more implicit between tags and special property]

2023-08-26 Thread Ihor Radchenko
Jens Schmidt  writes:

> On 2023-08-26  12:16, Ihor Radchenko wrote:
>> Jens Schmidt  writes:
>>>  #+begin_example
>>> -+-long-and-twisted-property-name-="foo"
>>> +\-long\=and\\twisted\:property\.name\*="foo"
>>>  #+end_example
>> 
>> This actually feels rather cubersome.
>
> That particular example looks awkward, but pls don't forget that
> users (mostly) have been happy without any option of quoting so
> far.  IOW, there shouldn't be much to quote in real life.  I can
> provide a simpler example in the manual, but that's probably not
> what you meant :-)

That's partially what I meant.
It would help to provide a simpler example first.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [RFC] Quoting property names in tag/property matches [Was: [BUG?] Matching tags: & operator no more implicit between tags and special property]

2023-08-26 Thread Jens Schmidt
On 2023-08-26  12:16, Ihor Radchenko wrote:
> Jens Schmidt  writes:
>>  #+begin_example
>> -+-long-and-twisted-property-name-="foo"
>> +\-long\=and\\twisted\:property\.name\*="foo"
>>  #+end_example
> 
> This actually feels rather cubersome.

That particular example looks awkward, but pls don't forget that
users (mostly) have been happy without any option of quoting so
far.  IOW, there shouldn't be much to quote in real life.  I can
provide a simpler example in the manual, but that's probably not
what you meant :-)

> I am now wondering if we could instead do something like
> "-long=and\twisted:property.name*"="foo"
> Then, we will just have to quote the " itself, not all
> non-alphanumerics.
> 
> Although, using " might be tricky.

Agreed.  It introduces more context, and longer context, than a
simple backslash.  Plus double quotes are already used for other
purposes in the larger regexp, which could introduce more
ambiguities.

Finally, a term

  "foo-bar"="foo-bar"

looks, er, tautologically? at best.




Re: [DISCUSSION] Re-design of inlinetasks

2023-08-26 Thread Juan Manuel Macías
Ihor Radchenko writes:

>> ... They
>> behave like a true section, except that they are not headed by titles or
>> level numbers.
>
> May they contain sub-sections?

I think that would not be expected, since an anonymous section is just a
break in the text that has neither a title nor a section number. There
are many possible scenarios. Let's imagine, for example, that an author
is working on a section of an article. And at the end of various
subsections he/she wants to make some text breaks that, for whatever
reason, don't deserve either a title or a subsubsection number.
Anonymous breaks using asterisks or other symbols is usually the applied
remedy. The advantage of enclosing the content of the anonymous section
in an inlinetask is that we have a 'true' section with content (over
which you have control). That would not happen if the author explicitly
added a break symbol and continue writing.

Anonymous breaks are also widely used in essay or narrative texts. An
essay text, published as a blog entry or as an article, can be perfectly
structured into anonymous sections:

contents 1

***

contents 2

***

etc

See:

https://en.wikipedia.org/wiki/Section_(typography)#Section_form_and_numbering

https://en.wikipedia.org/wiki/Section_(typography)#Flourished_section_breaks


-- 
Juan Manuel Macías





Re: [DISCUSSION] Re-design of inlinetasks

2023-08-26 Thread Ihor Radchenko
Juan Manuel Macías  writes:

> I think inlinetasks may also have a use for those sections that are not
> "nested". In typography they are usually called "anonymous sections" and
> they are separated by some symbol (asterisks, dinkus[1], etc.).

This is a very interesting idea. Thanks for sharing!

> ... They
> behave like a true section, except that they are not headed by titles or
> level numbers.

May they contain sub-sections?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [RFC] Quoting property names in tag/property matches [Was: [BUG?] Matching tags: & operator no more implicit between tags and special property]

2023-08-26 Thread Ihor Radchenko
Jens Schmidt  writes:

>> IOW, backslash quotes everything except whitespace, which by definition
>> cannot be part of a property name.
>> 
>> Will start on this, but with tests and documentation this might take
>> some time.
>
> Here comes a first patch ... please check.

Thanks!

>  #+begin_example
> -+-long-and-twisted-property-name-="foo"
> +\-long\=and\\twisted\:property\.name\*="foo"
>  #+end_example

This actually feels rather cubersome.
I am now wondering if we could instead do something like
"-long=and\twisted:property.name*"="foo"
Then, we will just have to quote the " itself, not all
non-alphanumerics.

Although, using " might be tricky.
  

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [POLL] Should we accept breaking changes to get rid of Org libraries that perform side effects when loading?

2023-08-26 Thread Fraga, Eric
On Wednesday, 23 Aug 2023 at 09:33, Ihor Radchenko wrote:
>> "Fraga, Eric"  writes:
>>
>>> I'll chime in regarding inlinetasks: I used to use these *a lot*
>>> but I
>>> found that drawers do what I needed in almost all cases very
>>> effectively (for my use cases).
>
> My personal use case is when using Org for authoring long texts.
> I often leave inline tasks around the specific paragraph I need to
> revise in future:

For completeness, I will add that I do the same but using drawers at the
point where I want to note a task, where the drawer is ~:todo:~.  I then
have some special formatting for LaTeX export that converts such drawers
into footnotes with a note in the margin.

-- 
: Eric S Fraga, with org release_9.6.6-412-g2f7b35 in Emacs 30.0.50