unofficial mirror of emacs-orgmode@gnu.org
 help / color / mirror / Atom feed
* Bug: org-block face isn't applied to special blocks
@ 2020-02-29 20:05 Sébastien Miquel
  2020-09-04 16:14 ` Bastien
  0 siblings, 1 reply; 8+ messages in thread
From: Sébastien Miquel @ 2020-02-29 20:05 UTC (permalink / raw)
  To: emacs-orgmode

Afaict, the org-block face isn't applied to special blocks. Its 
documentation implies it applies to any block.

The relevant function is org-fontify-meta-lines-and-blocks-1.

It may be a simple matter of changing the logic a bit and adding 
(add-face-text-property bol-after-beginline beg-of-endline 'org-block t).

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

* Re: Bug: org-block face isn't applied to special blocks
  2020-02-29 20:05 Bug: org-block face isn't applied to special blocks Sébastien Miquel
@ 2020-09-04 16:14 ` Bastien
  2020-09-04 17:47   ` Sébastien Miquel
  0 siblings, 1 reply; 8+ messages in thread
From: Bastien @ 2020-09-04 16:14 UTC (permalink / raw)
  To: Sébastien Miquel; +Cc: emacs-orgmode

Hi Sébastien,

Sébastien Miquel <sebastien.miquel@posteo.eu> writes:

> Afaict, the org-block face isn't applied to special blocks. Its
> documentation implies it applies to any block.
>
> The relevant function is org-fontify-meta-lines-and-blocks-1.
>
> It may be a simple matter of changing the logic a bit and adding
> (add-face-text-property bol-after-beginline beg-of-endline 'org-block
> t).

Is it still the case with latest master?  If so, can you provide
a minimal example?

Thanks,

-- 
 Bastien


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

* Re: Bug: org-block face isn't applied to special blocks
  2020-09-04 16:14 ` Bastien
@ 2020-09-04 17:47   ` Sébastien Miquel
  2020-09-07  5:32     ` Bastien
  0 siblings, 1 reply; 8+ messages in thread
From: Sébastien Miquel @ 2020-09-04 17:47 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hi Bastien,

With latest org-mode master, and emacs -q,
run (defface org-block '((t (:background "#494949" :extend t))) "") 
before loading org-mode,
then visit an org buffer containing the three following blocks.

When I do so, the org-block face only gets applied to the src block, and 
not to the quote block, nor the special block.


#+BEGIN_theorem

#+END_theorem


#+BEGIN_SRC sh

#+END_SRC

#+BEGIN_QUOTE

#+END_QUOTE

Regards,



> Hi Sébastien,
>
> Sébastien Miquel <sebastien.miquel@posteo.eu> writes:
>
>> Afaict, the org-block face isn't applied to special blocks. Its
>> documentation implies it applies to any block.
>>
>> The relevant function is org-fontify-meta-lines-and-blocks-1.
>>
>> It may be a simple matter of changing the logic a bit and adding
>> (add-face-text-property bol-after-beginline beg-of-endline 'org-block
>> t).
> Is it still the case with latest master?  If so, can you provide
> a minimal example?
>
> Thanks,
>


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

* Re: Bug: org-block face isn't applied to special blocks
  2020-09-04 17:47   ` Sébastien Miquel
@ 2020-09-07  5:32     ` Bastien
  2020-09-10 18:17       ` Sébastien Miquel
  0 siblings, 1 reply; 8+ messages in thread
From: Bastien @ 2020-09-07  5:32 UTC (permalink / raw)
  To: Sébastien Miquel; +Cc: emacs-orgmode

Hi Sébastien

Sébastien Miquel <sebastien.miquel@posteo.eu> writes:

> Hi Bastien,
>
> With latest org-mode master, and emacs -q,
> run (defface org-block '((t (:background "#494949" :extend t))) "") 
> before loading org-mode,
> then visit an org buffer containing the three following blocks.
>
> When I do so, the org-block face only gets applied to the src block, and 
> not to the quote block, nor the special block.

Fixed in maint, as 7769518f3.  Thanks for the report again,

-- 
 Bastien


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

* Re: Bug: org-block face isn't applied to special blocks
  2020-09-07  5:32     ` Bastien
@ 2020-09-10 18:17       ` Sébastien Miquel
  2020-09-11 11:34         ` Eric S Fraga
  2020-09-13 20:23         ` Bastien
  0 siblings, 2 replies; 8+ messages in thread
From: Sébastien Miquel @ 2020-09-10 18:17 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hi Bastien,

As far as I can tell, with 8a083514a7 from master, the situation is now 
as follows.

The org-block face is applied
  - to src blocks, when the language is recognized
  - to example, export blocks
  - to verse and quote blocks, if ~org-fontify-quote-and-verse-blocks~ 
is ~t~.

It isn't applied
  - to src blocks, when the language isn't recognized
  - to special blocks (that is, blocks with arbitrary names)


I make heavy use of special blocks and I'd like this face to apply to them.
I think it would make more sense than the current behavior, and is less 
surprising. (It is also more in line with the previous docstring).

(I also think it should apply to unrecognized src blocks)

Regards,
Sebastien



> Hi Sébastien
>
> Sébastien Miquel <sebastien.miquel@posteo.eu> writes:
>
>> Hi Bastien,
>>
>> With latest org-mode master, and emacs -q,
>> run (defface org-block '((t (:background "#494949" :extend t))) "")
>> before loading org-mode,
>> then visit an org buffer containing the three following blocks.
>>
>> When I do so, the org-block face only gets applied to the src block, and
>> not to the quote block, nor the special block.
> Fixed in maint, as 7769518f3.  Thanks for the report again,
>


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

* Re: Bug: org-block face isn't applied to special blocks
  2020-09-10 18:17       ` Sébastien Miquel
@ 2020-09-11 11:34         ` Eric S Fraga
  2020-09-14 15:17           ` Sébastien Miquel
  2020-09-13 20:23         ` Bastien
  1 sibling, 1 reply; 8+ messages in thread
From: Eric S Fraga @ 2020-09-11 11:34 UTC (permalink / raw)
  To: Sébastien Miquel; +Cc: Bastien, emacs-orgmode

On Thursday, 10 Sep 2020 at 20:17, Sébastien Miquel wrote:
> It isn't applied
>  - to src blocks, when the language isn't recognized
>  - to special blocks (that is, blocks with arbitrary names)
>
> I make heavy use of special blocks and I'd like this face to apply to them.

I also make heavy use of special blocks but, for me, these are often
more like verse or quote blocks (i.e. the contents of the block are
prose) than src blocks so I would not want them to be treated as src
blocks are.  I think we'll need to have (yet) another option to control
this?

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.7-725-g7bc18e


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

* Re: Bug: org-block face isn't applied to special blocks
  2020-09-10 18:17       ` Sébastien Miquel
  2020-09-11 11:34         ` Eric S Fraga
@ 2020-09-13 20:23         ` Bastien
  1 sibling, 0 replies; 8+ messages in thread
From: Bastien @ 2020-09-13 20:23 UTC (permalink / raw)
  To: Sébastien Miquel; +Cc: emacs-orgmode

Hi Sébastien,

Sébastien Miquel <sebastien.miquel@posteo.eu> writes:

> As far as I can tell, with 8a083514a7 from master, the situation is
> now as follows.
>
> The org-block face is applied
>  - to src blocks, when the language is recognized
>  - to example, export blocks
>  - to verse and quote blocks, if ~org-fontify-quote-and-verse-blocks~
> is ~t~.
>
> It isn't applied
>  - to src blocks, when the language isn't recognized
>  - to special blocks (that is, blocks with arbitrary names)

Exact.

> I make heavy use of special blocks and I'd like this face to apply to them.
> I think it would make more sense than the current behavior, and is
> less surprising. (It is also more in line with the previous
> docstring).
>
> (I also think it should apply to unrecognized src blocks)

I agree there is room for improvement, but I'm not sure on what we
should be aiming for.

-- 
 Bastien


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

* Re: Bug: org-block face isn't applied to special blocks
  2020-09-11 11:34         ` Eric S Fraga
@ 2020-09-14 15:17           ` Sébastien Miquel
  0 siblings, 0 replies; 8+ messages in thread
From: Sébastien Miquel @ 2020-09-14 15:17 UTC (permalink / raw)
  To: emacs-orgmode, e.fraga; +Cc: Bastien

As far as src blocks being treated differently, there's already the 
~org-src-block-faces~ variable.

How about the following :

  + Make the ~org-block~ face apply to every block
  + either
    - add an ~org-src-block~ face
    - modify ~org-src-block-faces~ to allow a catch-all case
    It'd be nice for those to apply to unrecognized languages
  + keep ~org-fontify-quote-and-verse-blocks~

I think the only users that would notice the difference are the few (?) 
who use special blocks and expect them not to be fontified.
All they'd have to do to restore the previous behavior is set the 
~org-src-block~ and unset the ~org-block~ faces.



>> It isn't applied
>>   - to src blocks, when the language isn't recognized
>>   - to special blocks (that is, blocks with arbitrary names)
>>
>> I make heavy use of special blocks and I'd like this face to apply to them.
> I also make heavy use of special blocks but, for me, these are often
> more like verse or quote blocks (i.e. the contents of the block are
> prose) than src blocks so I would not want them to be treated as src
> blocks are.  I think we'll need to have (yet) another option to control
> this?
>


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

end of thread, other threads:[~2020-09-14 17:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-29 20:05 Bug: org-block face isn't applied to special blocks Sébastien Miquel
2020-09-04 16:14 ` Bastien
2020-09-04 17:47   ` Sébastien Miquel
2020-09-07  5:32     ` Bastien
2020-09-10 18:17       ` Sébastien Miquel
2020-09-11 11:34         ` Eric S Fraga
2020-09-14 15:17           ` Sébastien Miquel
2020-09-13 20:23         ` Bastien

unofficial mirror of emacs-orgmode@gnu.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git