Re: Regarding arbitrary Org blocks

2022-05-12 Thread Russell Adams
On Thu, May 12, 2022 at 06:19:35PM +0800, Ihor Radchenko wrote:
> > Some recent change instead now says "No special environment to edit
> > here". How can I get back that behavior?
>
> I am unable to get the described behaviour even using Org 8.2.10. Could
> you elaborate what you mean by "used to"? Which Org version?

It's been quite some time. I've been using Org for years and I don't
keep it up to date. I can't identify when it changed, only that my
muscle memory started throwing errors. ;]

To be fair, I think I only moved to v9 this year. So I may have
learned this in versions before v8.

> > Could I add some minor mode to say text-mode with auto-fill-mode and
> > aspell somewhere when opening those blocks?
>
> Not currently, unless you advice org-edit-special. Though we might add
> something like org-edit-special-hook (similar to org-ctrl-c-ctrl-c-hook)
> if others are also interested in this functionality.

That's the kind of configuration I was referring to. It'd be fine to
me to add items to match the tags I use.

On the other hand, perhaps it would be useful to have a fallback
behavior to use the current org-mode settings in a popup buffer for a
block that has no mode associated with it?

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



Re: Regarding arbitrary Org blocks

2022-05-12 Thread Ihor Radchenko
Russell Adams  writes:

> I used to insert arbitrary blocks like:
>
> #+BEGIN_IMPORTANT
> yadda yadda
> #+END_IMPORTANT
>
> in my documents, and when I hit C-c ' to edit them it would give me a
> basic buffer and I could edit the plain text within.
>
> Some recent change instead now says "No special environment to edit
> here". How can I get back that behavior?

I am unable to get the described behaviour even using Org 8.2.10. Could
you elaborate what you mean by "used to"? Which Org version?

> I'm really just editing text blocks for Latex export, and the source
> block type triggers some latex formatting. It's not source code
> language, just plain text.
>
> Could I add some minor mode to say text-mode with auto-fill-mode and
> aspell somewhere when opening those blocks?

Not currently, unless you advice org-edit-special. Though we might add
something like org-edit-special-hook (similar to org-ctrl-c-ctrl-c-hook)
if others are also interested in this functionality.

Best,
Ihor




Re: Regarding arbitrary Org blocks

2022-05-11 Thread Russell Adams
On Wed, May 11, 2022 at 02:39:28PM -0700, Greg Minshall wrote:
> Russell, the behavior you describe, that used to work, sounds reasonable
> to me.  otoh, in case you haven't discovered =narrow-to-region= and
> friends, (which i only recently did), that might also give you some of
> what you want.  cheers, Greg


Check out org-tree-to-indirect-buffer ;]


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



Re: Regarding arbitrary Org blocks

2022-05-11 Thread Greg Minshall
Russell, the behavior you describe, that used to work, sounds reasonable
to me.  otoh, in case you haven't discovered =narrow-to-region= and
friends, (which i only recently did), that might also give you some of
what you want.  cheers, Greg



Re: Regarding arbitrary Org blocks

2022-05-11 Thread Colin Baxter
> Russell Adams  writes:

> On Wed, May 11, 2022 at 09:23:27PM +0300, Daniel Fleischer wrote:
>> Russell Adams [2022-05-11 Wed 18:14] wrote:
>> 
>> > Could I add some minor mode to say text-mode with
>> auto-fill-mode and > aspell somewhere when opening those blocks?
>> 
>> Hi! If you're editing text why do you need a special buffer? You
>> can edit them in the orgmode buffer and enjoy all its textual
>> features.

> First up, it's because it used to work and now it doesn't. ;]

> Second it can be very useful to work on a sub-buffer, or indirect
> buffer for some content. Why shouldn't I be able to edit the
> contents of that block inside an indirect buffer where my
> beginning-of-buffer, end-of-buffer, word wrap, or global find and
> replace are constrained to that block of text?

> This works for example blocks, but no longer for verse and quote
> blocks. These are native Org block types and not my fanciful made
> up ones. Why should the popup work for example blocks, but not the
> others? That borders on a bug, where my question was considered as
> a configuration question.

I very much support the idea that special and source blocks should be
treatable in the same way. I'd like to be able to edit example and quote
using C-c '.

Best wishes,

Colin Baxter.



Re: Regarding arbitrary Org blocks

2022-05-11 Thread Russell Adams
On Wed, May 11, 2022 at 09:23:27PM +0300, Daniel Fleischer wrote:
> Russell Adams [2022-05-11 Wed 18:14] wrote:
>
> > Could I add some minor mode to say text-mode with auto-fill-mode and
> > aspell somewhere when opening those blocks?
>
> Hi! If you're editing text why do you need a special buffer? You can
> edit them in the orgmode buffer and enjoy all its textual features.

First up, it's because it used to work and now it doesn't. ;]

Second it can be very useful to work on a sub-buffer, or indirect
buffer for some content. Why shouldn't I be able to edit the contents
of that block inside an indirect buffer where my beginning-of-buffer,
end-of-buffer, word wrap, or global find and replace are constrained
to that block of text?

This works for example blocks, but no longer for verse and quote
blocks. These are native Org block types and not my fanciful made up
ones. Why should the popup work for example blocks, but not the
others? That borders on a bug, where my question was considered as a
configuration question.

Finally when you edit in the popup buffer, the results are indented
which makes the document more legible. Regular text tools do that
inconsistently.

> The special buffer is for major modes which are not orgmode such as
> programming languages or latex which use different
> completions/highlighting/minor-modes and editing them in orgmode is
> a hassle.

I think what I am using were once called "special blocks". You're
referring to source blocks. They have many more features but are
outside the question.

https://orgmode.org/manual/Special-blocks-in-LaTeX-export.html

Thanks.

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



Re: Regarding arbitrary Org blocks

2022-05-11 Thread Daniel Fleischer
Russell Adams [2022-05-11 Wed 18:14] wrote:

> Could I add some minor mode to say text-mode with auto-fill-mode and
> aspell somewhere when opening those blocks?

Hi! If you're editing text why do you need a special buffer? You can
edit them in the orgmode buffer and enjoy all its textual features. The
special buffer is for major modes which are not orgmode such as
programming languages or latex which use different
completions/highlighting/minor-modes and editing them in orgmode is a
hassle. 

-- 

Daniel Fleischer



Regarding arbitrary Org blocks

2022-05-11 Thread Russell Adams
I used to insert arbitrary blocks like:

#+BEGIN_IMPORTANT
yadda yadda
#+END_IMPORTANT

in my documents, and when I hit C-c ' to edit them it would give me a
basic buffer and I could edit the plain text within.

Some recent change instead now says "No special environment to edit
here". How can I get back that behavior?

I'm really just editing text blocks for Latex export, and the source
block type triggers some latex formatting. It's not source code
language, just plain text.

Could I add some minor mode to say text-mode with auto-fill-mode and
aspell somewhere when opening those blocks?

Thanks.

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