emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* the comment environment does not work for checkboxes
@ 2022-07-29  5:30 Uwe Brauer
  2022-07-29  7:56 ` Dr. Arne Babenhauserheide
  0 siblings, 1 reply; 14+ messages in thread
From: Uwe Brauer @ 2022-07-29  5:30 UTC (permalink / raw)
  To: emacs-orgmode



Hi

Please consider 

#+begin_src 

* Everything [3/4]
  :PROPERTIES:
  :COLUMNS:   %TODO %ITEM  %Nr %Comp1 %Comp2  
  :COOKIE_DATA: aggregate
  :TODO:     [ ]
  :COMP1:    [1/2]
  :COMP2:    [1/2]
  :END:

# *** DONE Books
#     :PROPERTIES:
#     :Nr:       1
#     :Comp1:    [X]
#     :Comp2:    [X]
#     :END:

** DONE Car 
   :PROPERTIES:
   :Nr:       2
   :Comp1:    [X]
   :Comp2:    [ ]
   :END:

** DONE Food 
   :PROPERTIES:
   :Nr:       3
   :COMP1:    [ ]
   :COMP2:    [X]
   :END:


# **** WAIT  Computer
#      :PROPERTIES:
#      :Nr:       4
#      :Comp1:    [X]
#      :Comp2:    [X]
#      :END:




#+BEGIN: columnview :maxlevel 2 :skip-empty-rows t :hlines 1 :indent nil  :format "%5TODO(Status) %5Nr(Nr) %5Comp1(Comp1){X/} %5Comp2(Comp2){X/}"
| Status | Nr | Comp1 | Comp2 |
|--------+----+-------+-------|
|        |    | [1/2] | [1/2] |
| DONE   |  2 | [X]   | [ ]   |
| DONE   |  3 | [ ]   | [X]   |
#+END:
#+end_src

Which works as expected 

While 

#+begin_src 

* Everything [3/4]
  :PROPERTIES:
  :COLUMNS:   %TODO %ITEM  %Nr %Comp1 %Comp2  
  :COOKIE_DATA: aggregate
  :TODO:     [ ]
  :COMP1:    [2/2]
  :COMP2:    [1/2]
  :END:

# *** DONE Books
#     :PROPERTIES:
#     :Nr:       1
#     :Comp1:    [X]
#     :Comp2:    [X]
#     :END:

** DONE Car 
   :PROPERTIES:
   :Nr:       2
   :Comp1:    [X]
   :Comp2:    [ ]
   :END:

** DONE Food 
   :PROPERTIES:
   :Nr:       3
   :COMP1:    [1/1]
   :COMP2:    [1/1]
   :END:

#+BEGIN_COMMENT
**** WAIT  Computer
     :PROPERTIES:
     :Nr:       4
     :Comp1:    [X]
     :Comp2:    [X]
     :END:
#+END_COMMENT



#+BEGIN: columnview :maxlevel 2 :skip-empty-rows t :hlines 1 :indent nil  :format "%5TODO(Status) %5Nr(Nr) %5Comp1(Comp1){X/} %5Comp2(Comp2){X/}"
| Status | Nr | Comp1 | Comp2 |
|--------+----+-------+-------|
|        |    | [2/2] | [1/2] |
| DONE   |  2 | [X]   | [ ]   |
| DONE   |  3 | [1/1] | [1/1] |
#+END:

#+end_src


Does not. Any idea why?

-- 
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. 



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: the comment environment does not work for checkboxes
  2022-07-29  5:30 the comment environment does not work for checkboxes Uwe Brauer
@ 2022-07-29  7:56 ` Dr. Arne Babenhauserheide
  2022-07-29 14:39   ` Uwe Brauer
  2022-07-30  5:21   ` [SOLVED: src not comment] (was: the comment environment does not work for checkboxes) Uwe Brauer
  0 siblings, 2 replies; 14+ messages in thread
From: Dr. Arne Babenhauserheide @ 2022-07-29  7:56 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 466 bytes --]


Uwe Brauer <oub@mat.ucm.es> writes:

> #+BEGIN_COMMENT
> **** WAIT  Computer
>      :PROPERTIES:
>      :Nr:       4
>      :Comp1:    [X]
>      :Comp2:    [X]
>      :END:
> #+END_COMMENT

> Does not. Any idea why?

In a block, you must escape * as ,* — open the environment with C-c C-'
and save it the same way, then it escapes them for you.

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: the comment environment does not work for checkboxes
  2022-07-29  7:56 ` Dr. Arne Babenhauserheide
@ 2022-07-29 14:39   ` Uwe Brauer
  2022-07-30  5:27     ` [PATCH] " Ihor Radchenko
  2022-07-30  5:21   ` [SOLVED: src not comment] (was: the comment environment does not work for checkboxes) Uwe Brauer
  1 sibling, 1 reply; 14+ messages in thread
From: Uwe Brauer @ 2022-07-29 14:39 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2470 bytes --]

>>> "AB" == Arne Babenhauserheide <arne_bab@web.de> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:

>> #+BEGIN_COMMENT
>> **** WAIT  Computer
>> :PROPERTIES:
>> :Nr:       4
>> :Comp1:    [X]
>> :Comp2:    [X]
>> :END:
>> #+END_COMMENT

>> Does not. Any idea why?

> In a block, you must escape * as ,* — open the environment with C-c C-'
> and save it the same way, then it escapes them for you.

Thanks, a couple of remarks

    1. It does not work! I Presume you mean «C-c '» no «C-c C-'»? Well
       this is bound to  is edit special

,----
| C-c ' runs the command org-edit-special (found in org-mode-map), which
| is an interactive compiled Lisp function in ‘org.el’.
| 
| It is bound to H-e, C-c ', C-c C-l, <menu-bar> <table> <Calculate>
| <Edit Formulas>, <menu-bar> <org> <Editing> <Edit Source Example>.
| 
| (org-edit-special &optional ARG)
| 
| Call a special editor for the element at point.
| When at a table, call the formula editor with ‘org-table-edit-formulas’.
| When in a source code block, call ‘org-edit-src-code’.
| When in a fixed-width region, call ‘org-edit-fixed-width-region’.
| When in an export block, call ‘org-edit-export-block’.
| When in a LaTeX environment, call ‘org-edit-latex-environment’.
| When at an INCLUDE, SETUPFILE or BIBLIOGRAPHY keyword, visit the included file.
| When at a footnote reference, call ‘org-edit-footnote-reference’.
| When at a planning line call, ‘org-deadline’ and/or ‘org-schedule’.
| When at an active timestamp, call ‘org-time-stamp’.
| When at an inactive timestamp, call ‘org-time-stamp-inactive’.
| On a link, call ‘ffap’ to visit the link at point.
| Otherwise, return a user error.
`----


Comments block are not listed and as I said it seems not to work, if
what you say is the correct syntax, then there  is a bug, since

    1. when I mark the region,

    2. Run org-insert-structure-template,

    3. Select comment, it should then lead to 

#+BEGIN_COMMENT
,**** WAIT  Computer
 :PROPERTIES:
 :Nr:       4
 :Comp1:    [X]
 :Comp2:    [X]
 :END:
#+END_COMMENT

Automatically, but it does *not*.

So I am a bit puzzled.

Uwe 

> Best wishes,
> Arne

-- 
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. 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [SOLVED: src not comment] (was: the comment environment does not work for checkboxes)
  2022-07-29  7:56 ` Dr. Arne Babenhauserheide
  2022-07-29 14:39   ` Uwe Brauer
@ 2022-07-30  5:21   ` Uwe Brauer
  1 sibling, 0 replies; 14+ messages in thread
From: Uwe Brauer @ 2022-07-30  5:21 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1095 bytes --]

>>> "AB" == Arne Babenhauserheide <arne_bab@web.de> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:

>> #+BEGIN_COMMENT
>> **** WAIT  Computer
>> :PROPERTIES:
>> :Nr:       4
>> :Comp1:    [X]
>> :Comp2:    [X]
>> :END:
>> #+END_COMMENT

>> Does not. Any idea why?

> In a block, you must escape * as ,* — open the environment with C-c C-'
> and save it the same way, then it escapes them for you.

Your recommendation works if I use a *src* block not a *comment* 

#+begin_src 
,** Computer
   :PROPERTIES:
   :Nr:       4
   :Comp1:    [X]
   :Comp2:    [X]
   :END:
#+end_src


Is ignored! I found that contra intuitive. 

BTW how to get rid of the block?


Just deleting 

#+begin_src 
and 
#+end_src 


Does not help since 
 «*»  would still carry the «,»

I could run a query-replace, but this seems cumbersome!

regards

-- 
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. 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] Re: the comment environment does not work for checkboxes
  2022-07-29 14:39   ` Uwe Brauer
@ 2022-07-30  5:27     ` Ihor Radchenko
  2022-07-30  5:40       ` Uwe Brauer
                         ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Ihor Radchenko @ 2022-07-30  5:27 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 707 bytes --]

Uwe Brauer <oub@mat.ucm.es> writes:

> Thanks, a couple of remarks
>
>     1. It does not work! I Presume you mean «C-c '» no «C-c C-'»? Well
>        this is bound to  is edit special
> ...
>
> Comments block are not listed and as I said it seems not to work, if
> what you say is the correct syntax, then there  is a bug, since
>
>     1. when I mark the region,
>
>     2. Run org-insert-structure-template,
>
>     3. Select comment, it should then lead to 

Thanks for the heads-up!
Comment blocks are not supposed to contain Org markup, and thus it indeed
makes sense to support them in org-edit-special and in structure
templates.

See the attached patch.

Best,
Ihor


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Support-interactive-editing-of-comment-blocks.patch --]
[-- Type: text/x-patch, Size: 5928 bytes --]

From 4913df3f84b6d1d0fc5cc0f613dca42abe47821d Mon Sep 17 00:00:00 2001
Message-Id: <4913df3f84b6d1d0fc5cc0f613dca42abe47821d.1659158779.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Sat, 30 Jul 2022 13:24:10 +0800
Subject: [PATCH] Support interactive editing of comment blocks

* lisp/org-src.el (org-edit-comment-block): New command to edit
comment block elements.  The command auto-escapes Org markup inside.
(org-src--contents-area):
* lisp/org.el (org-insert-structure-template):
(org-edit-special): Support comment blocks.
* etc/ORG-NEWS (Interactive commands now support escaping text inside
comment blocks):
(New command ~org-edit-comment-block~ to edit comment block at point):
Document the new features.

See https://orgmode.org/list/87y1wc3ruw.fsf@mat.ucm.es
---
 etc/ORG-NEWS    | 19 ++++++++++++++++++-
 lisp/org-src.el | 25 ++++++++++++++++++++++++-
 lisp/org.el     |  5 ++++-
 3 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 478fcf95c..0bc3fa638 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -141,6 +141,14 @@ discouraged when working with Org files.
 
 ** New features
 
+*** Interactive commands now support escaping text inside comment blocks
+
+~org-edit-special~ and ~org-insert-structure-template~ now handle
+comment blocks.
+
+See [[*New command ~org-edit-comment-block~ to edit comment block at
+point]].
+
 *** New customization option =org-property-separators=
 A new alist variable to control how properties are combined.
 
@@ -253,6 +261,16 @@ instance,
 includes all available items in the printed bibliography.
 ** New functions and changes in function arguments
 
+*** New command ~org-edit-comment-block~ to edit comment block at point
+
+As the contents of comments blocks is not parsed as Org markup, the
+headlines and keywords inside should be escaped, similar to src
+blocks, example blocks, and export blocks.  This in inconvenient to do
+manually and ~org-edit-special~ is usually advised to edit text in
+such kind of blocks.
+
+Now, comment block editing is also supported via this new function.
+
 *** New function ~org-element-cache-map~ for quick mapping across Org elements
 
 When element cache is enabled, the new function provides the best
@@ -266,7 +284,6 @@ to ~org-element--cache-map-statistics~ and
 ~org-element--cache-map-statistics-threshold~.
 
 ~org-scan-tags~ and tag views in agenda utilise the new function.
-
 *** New function ~org-element-at-point-no-context~
 
 This function is like ~org-element-at-point~, but it does not try to
diff --git a/lisp/org-src.el b/lisp/org-src.el
index b7e0af50e..0249af60b 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -384,7 +384,7 @@ (defun org-src--contents-area (datum)
        (let ((beg (org-element-property :contents-begin datum))
 	     (end (org-element-property :contents-end datum)))
 	 (list beg end (buffer-substring-no-properties beg end))))
-      ((memq type '(example-block export-block src-block))
+      ((memq type '(example-block export-block src-block comment-block))
        (list (progn (goto-char (org-element-property :post-affiliated datum))
 		    (line-beginning-position 2))
 	     (progn (goto-char (org-element-property :end datum))
@@ -1161,6 +1161,29 @@ (defun org-edit-export-block ()
        (lambda () (org-escape-code-in-region (point-min) (point-max)))))
     t))
 
+(defun org-edit-comment-block ()
+  "Edit comment block at point.
+\\<org-src-mode-map>
+A new buffer is created and the block is copied into it, and the
+buffer is switched into Org mode.
+
+When done, exit with `\\[org-edit-src-exit]'.  The edited text \
+will then replace the area in the Org mode buffer.
+
+Throw an error when not at a comment block."
+  (interactive)
+  (let ((element (org-element-at-point)))
+    (unless (and (eq (org-element-type element) 'comment-block)
+		 (org-src--on-datum-p element))
+      (user-error "Not in a comment block"))
+    (org-src--edit-element
+     element
+     (org-src--construct-edit-buffer-name (buffer-name) "org")
+     'org-mode
+     (lambda () (org-escape-code-in-region (point-min) (point-max)))
+     (org-unescape-code-in-string (org-element-property :value element)))
+    t))
+
 (defun org-edit-src-code (&optional code edit-buffer-name)
   "Edit the source or example block at point.
 \\<org-src-mode-map>
diff --git a/lisp/org.el b/lisp/org.el
index 937892ef3..d75894590 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8869,7 +8869,8 @@ (defun org-insert-structure-template (type)
 	 (region-end (and region? (copy-marker (region-end))))
 	 (extended? (string-match-p "\\`\\(src\\|export\\)\\'" type))
 	 (verbatim? (string-match-p
-		     (concat "\\`" (regexp-opt '("example" "export" "src")))
+		     (concat "\\`" (regexp-opt '("example" "export"
+                                                "src" "comment")))
 		     type))
          (upcase? (string= (car (split-string type))
                            (upcase (car (split-string type))))))
@@ -16979,6 +16980,7 @@ (defun org-edit-special (&optional arg)
 When in a source code block, call `org-edit-src-code'.
 When in a fixed-width region, call `org-edit-fixed-width-region'.
 When in an export block, call `org-edit-export-block'.
+When in a comment block, call `org-edit-comment-block'.
 When in a LaTeX environment, call `org-edit-latex-environment'.
 When at an INCLUDE, SETUPFILE or BIBLIOGRAPHY keyword, visit the included file.
 When at a footnote reference, call `org-edit-footnote-reference'.
@@ -17025,6 +17027,7 @@ (defun org-edit-special (&optional arg)
       (`table-row (call-interactively 'org-table-edit-formulas))
       (`example-block (org-edit-src-code))
       (`export-block (org-edit-export-block))
+      (`comment-block (org-edit-comment-block))
       (`fixed-width (org-edit-fixed-width-region))
       (`latex-environment (org-edit-latex-environment))
       (`planning
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] Re: the comment environment does not work for checkboxes
  2022-07-30  5:27     ` [PATCH] " Ihor Radchenko
@ 2022-07-30  5:40       ` Uwe Brauer
  2022-07-30  5:55         ` Ihor Radchenko
  2022-08-04 12:08       ` Uwe Brauer
  2022-08-07  9:41       ` Ihor Radchenko
  2 siblings, 1 reply; 14+ messages in thread
From: Uwe Brauer @ 2022-07-30  5:40 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Uwe Brauer, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 683 bytes --]


> Uwe Brauer <oub@mat.ucm.es> writes:

Thanks for the patch (this is against the latest master I presume?)
> Thanks for the heads-up!
> Comment blocks are not supposed to contain Org markup, and thus it indeed
> makes sense to support them in org-edit-special and in structure
> templates.

> See the attached patch.

I test and report back: BTW

    1. The feature I require can only be achieved by using a «src» block
       not a comment block. A bit contra intuitive I say

    2. Suppose I once mark a lot of headings and add a src block (which
       add the required «,» to the *, how do I later get rid of the src
       block *and* the «,»

Uwe 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Re: the comment environment does not work for checkboxes
  2022-07-30  5:40       ` Uwe Brauer
@ 2022-07-30  5:55         ` Ihor Radchenko
  2022-07-30  6:00           ` Uwe Brauer
  0 siblings, 1 reply; 14+ messages in thread
From: Ihor Radchenko @ 2022-07-30  5:55 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

Uwe Brauer <oub@mat.ucm.es> writes:

>> Uwe Brauer <oub@mat.ucm.es> writes:
>
> Thanks for the patch (this is against the latest master I presume?)
>> Thanks for the heads-up!
>> Comment blocks are not supposed to contain Org markup, and thus it indeed
>> makes sense to support them in org-edit-special and in structure
>> templates.
>
>> See the attached patch.
>
> I test and report back: BTW
>
>     1. The feature I require can only be achieved by using a «src» block
>        not a comment block. A bit contra intuitive I say

I am sorry, but I am not familiar with the feature you are referring to.
Either way, both src and comment blocks are supposed to contain
arbitrary non-parseable text, which should not contribute to the
statistics? calculations.

>     2. Suppose I once mark a lot of headings and add a src block (which
>        add the required «,» to the *, how do I later get rid of the src
>        block *and* the «,»

AFAIK, you cannot. At least, not using an existing command. What you can
instead do is open C-c ' window, copy the unescaped text, exit the
window, remove the block, and yank the unescaped text.

Best,
Ihor


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Re: the comment environment does not work for checkboxes
  2022-07-30  5:55         ` Ihor Radchenko
@ 2022-07-30  6:00           ` Uwe Brauer
  2022-07-30  6:15             ` Ihor Radchenko
  0 siblings, 1 reply; 14+ messages in thread
From: Uwe Brauer @ 2022-07-30  6:00 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Uwe Brauer, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]


> Uwe Brauer <oub@mat.ucm.es> writes:

> I am sorry, but I am not familiar with the feature you are referring to.

I applied your patch and did a bit of testing: works flawlessly.

> Either way, both src and comment blocks are supposed to contain
> arbitrary non-parseable text, which should not contribute to the
> statistics? calculations.

With your patch, I can confirm this, before it did not since *** was not «escaped»

> AFAIK, you cannot. At least, not using an existing command. What you can
> instead do is open C-c ' window, copy the unescaped text, exit the
> window, remove the block, and yank the unescaped text.

I see, (patches are welcome I presume 😉)

thanks for the trick with C-c '

Uwe 

-- 
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. 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Re: the comment environment does not work for checkboxes
  2022-07-30  6:00           ` Uwe Brauer
@ 2022-07-30  6:15             ` Ihor Radchenko
  2022-07-30  6:23               ` Uwe Brauer
  0 siblings, 1 reply; 14+ messages in thread
From: Ihor Radchenko @ 2022-07-30  6:15 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

Uwe Brauer <oub@mat.ucm.es> writes:

>> Uwe Brauer <oub@mat.ucm.es> writes:
>
>> I am sorry, but I am not familiar with the feature you are referring to.
>
> I applied your patch and did a bit of testing: works flawlessly.

Thanks!

>> Either way, both src and comment blocks are supposed to contain
>> arbitrary non-parseable text, which should not contribute to the
>> statistics? calculations.
>
> With your patch, I can confirm this, before it did not since *** was not «escaped»

To clarify, when you have

* Heading

#+begin_comment
* Lorem ipsum
#+end_comment

it is not seen by Org as comment block.
Instead, what Org "sees" is

<begin heading 1>
* Heading

<begin paragraph>
#+begin_comment
<end paragraph>
<end heading 1>
<begin heading 2>
* Lorem ipsum

<begin paragraph>
#+end_comment
<end paragraph>
<end heading 2>

Headline markup has the top priority all the times.

>> AFAIK, you cannot. At least, not using an existing command. What you can
>> instead do is open C-c ' window, copy the unescaped text, exit the
>> window, remove the block, and yank the unescaped text.
>
> I see, (patches are welcome I presume 😉)

Yup. Probably, we can make org-insert-structure-template more smart and
remove the block when user selects the same block as the existing one.
It should be controlled by defcustom though (t nil 'ask). Wrapping a
comment block inside comment block can be a valid use case.

Best,
Ihor


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Re: the comment environment does not work for checkboxes
  2022-07-30  6:15             ` Ihor Radchenko
@ 2022-07-30  6:23               ` Uwe Brauer
  2022-07-30 12:09                 ` Ihor Radchenko
  0 siblings, 1 reply; 14+ messages in thread
From: Uwe Brauer @ 2022-07-30  6:23 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Uwe Brauer, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1494 bytes --]


> Uwe Brauer <oub@mat.ucm.es> writes:

> Thanks!


> To clarify, when you have

> * Heading

> #+begin_comment
> * Lorem ipsum
> #+end_comment


> it is not seen by Org as comment block.
> Instead, what Org "sees" is

> <begin heading 1>
> * Heading

> <begin paragraph>

> #+begin_comment
> <end paragraph>
> <end heading 1>
> <begin heading 2>
> * Lorem ipsum

> <begin paragraph>
> #+end_comment

> <end paragraph>
> <end heading 2>

> Headline markup has the top priority all the times.
I am confused

I have 
*** DONE Books
    :PROPERTIES:
    :Nr:       1
    :Comp1:    [X]
    :Comp2:    [X]
    :END:


Now with our patch I mark the headings and its properties and then insert a comment block, so I obtain 

#+begin_src 

,*** DONE Books
    :PROPERTIES:
    :Nr:       1
    :Comp1:    [X]
    :Comp2:    [X]
    :END:
#+end_src

Which is what I was looking for!


> Yup. Probably, we can make org-insert-structure-template more smart and
> remove the block when user selects the same block as the existing one.
> It should be controlled by defcustom though (t nil 'ask). Wrapping a
> comment block inside comment block can be a valid use case.


That would be nice.....

Uwe 
> Best,
> Ihor


-- 
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. 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Re: the comment environment does not work for checkboxes
  2022-07-30  6:23               ` Uwe Brauer
@ 2022-07-30 12:09                 ` Ihor Radchenko
  0 siblings, 0 replies; 14+ messages in thread
From: Ihor Radchenko @ 2022-07-30 12:09 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

Uwe Brauer <oub@mat.ucm.es> writes:

>> Headline markup has the top priority all the times.
> I am confused

Never mind then. I was explaining something you did not look for.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Re: the comment environment does not work for checkboxes
  2022-07-30  5:27     ` [PATCH] " Ihor Radchenko
  2022-07-30  5:40       ` Uwe Brauer
@ 2022-08-04 12:08       ` Uwe Brauer
  2022-08-04 14:26         ` Ihor Radchenko
  2022-08-07  9:41       ` Ihor Radchenko
  2 siblings, 1 reply; 14+ messages in thread
From: Uwe Brauer @ 2022-08-04 12:08 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Uwe Brauer, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 548 bytes --]


> Uwe Brauer <oub@mat.ucm.es> writes:

> Thanks for the heads-up!
> Comment blocks are not supposed to contain Org markup, and thus it indeed
> makes sense to support them in org-edit-special and in structure
> templates.

> See the attached patch.

Are you going to commit that patch to master any time soon?
I just pulled but cannot see it.

BTW, do you have any idea why columnview needs to many iterations if the number of headings and parameters (I sent a bug report, but it seems a border case, since nobody replied)


Uwe 

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Re: the comment environment does not work for checkboxes
  2022-08-04 12:08       ` Uwe Brauer
@ 2022-08-04 14:26         ` Ihor Radchenko
  0 siblings, 0 replies; 14+ messages in thread
From: Ihor Radchenko @ 2022-08-04 14:26 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

Uwe Brauer <oub@mat.ucm.es> writes:

>> See the attached patch.
>
> Are you going to commit that patch to master any time soon?
> I just pulled but cannot see it.

The patch task is scheduled for this Sunday.

> BTW, do you have any idea why columnview needs to many iterations if the number of headings and parameters (I sent a bug report, but it seems a border case, since nobody replied)

Sorry, I am not very familiar with columnview code. Hence, I did not
really investigate many of you patches hoping that someone else can
comment.

Best,
Ihor


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] Re: the comment environment does not work for checkboxes
  2022-07-30  5:27     ` [PATCH] " Ihor Radchenko
  2022-07-30  5:40       ` Uwe Brauer
  2022-08-04 12:08       ` Uwe Brauer
@ 2022-08-07  9:41       ` Ihor Radchenko
  2 siblings, 0 replies; 14+ messages in thread
From: Ihor Radchenko @ 2022-08-07  9:41 UTC (permalink / raw)
  To: Uwe Brauer; +Cc: emacs-orgmode

Ihor Radchenko <yantar92@gmail.com> writes:

> Thanks for the heads-up!
> Comment blocks are not supposed to contain Org markup, and thus it indeed
> makes sense to support them in org-edit-special and in structure
> templates.
>
> See the attached patch.

Applied onto main via a303a794f.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a303a794f8c6f880aa8dc46f10179890bfd27423

-- 
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-08-07  9:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-29  5:30 the comment environment does not work for checkboxes Uwe Brauer
2022-07-29  7:56 ` Dr. Arne Babenhauserheide
2022-07-29 14:39   ` Uwe Brauer
2022-07-30  5:27     ` [PATCH] " Ihor Radchenko
2022-07-30  5:40       ` Uwe Brauer
2022-07-30  5:55         ` Ihor Radchenko
2022-07-30  6:00           ` Uwe Brauer
2022-07-30  6:15             ` Ihor Radchenko
2022-07-30  6:23               ` Uwe Brauer
2022-07-30 12:09                 ` Ihor Radchenko
2022-08-04 12:08       ` Uwe Brauer
2022-08-04 14:26         ` Ihor Radchenko
2022-08-07  9:41       ` Ihor Radchenko
2022-07-30  5:21   ` [SOLVED: src not comment] (was: the comment environment does not work for checkboxes) Uwe Brauer

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).