Org-mode mailing list
 help / color / mirror / Atom feed
* <<noweb>> and ?font-lock?  fly-check, ...
@ 2021-05-02 12:28 Greg Minshall
  2021-05-02 14:05 ` Diego Zamboni
  2021-05-02 15:48 ` Sébastien Miquel
  0 siblings, 2 replies; 8+ messages in thread
From: Greg Minshall @ 2021-05-02 12:28 UTC (permalink / raw)
  To: emacs-orgmode

hi, all.

using a <<noweb>> reference in a bash source block, the buffer's font
lock colors go south on lines folowing the <<noweb>> reference.  (in my
case, all remaining lines in the buffer are colored bright yellow).  the
major and minor modes are as listed below.

is there an obvious thing to do to either get whatever syntax checker is
running to ignore the <<noweb>> reference, or some such?

thanks in advance, Greg

major mode: Shell-script[bash]

Enabled minor modes: Async-Bytecomp-Package Auto-Composition
Auto-Compression Auto-Encryption Blink-Cursor Electric-Indent
File-Name-Shadow Flycheck Font-Lock Global-Eldoc Global-Flycheck
Global-Font-Lock Line-Number Marginalia Menu-Bar Mouse-Wheel
My-Global-Subword Org-Src Override-Global Selectrum
Sh-Electric-Here-Document Shell-Dirtrack Straight-Package-Neutering
Straight-Use-Package Subword Tooltip Transient-Mark Yas Yas-Global


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

* Re: <<noweb>> and ?font-lock? fly-check, ...
  2021-05-02 12:28 <<noweb>> and ?font-lock? fly-check, Greg Minshall
@ 2021-05-02 14:05 ` Diego Zamboni
  2021-05-02 15:48 ` Sébastien Miquel
  1 sibling, 0 replies; 8+ messages in thread
From: Diego Zamboni @ 2021-05-02 14:05 UTC (permalink / raw)
  To: Greg Minshall; +Cc: Org-mode

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

I don't think there's an easy way to fix this - since src blocks are
fontified using the mode for the corresponding language. Particularly in
shell script, since << has a meaning in the language ("here" input), I
assume this is why the rest of the block gets fontified differently.

Best,
--Diego


On Sun, May 2, 2021 at 2:29 PM Greg Minshall <minshall@umich.edu> wrote:

> hi, all.
>
> using a <<noweb>> reference in a bash source block, the buffer's font
> lock colors go south on lines folowing the <<noweb>> reference.  (in my
> case, all remaining lines in the buffer are colored bright yellow).  the
> major and minor modes are as listed below.
>
> is there an obvious thing to do to either get whatever syntax checker is
> running to ignore the <<noweb>> reference, or some such?
>
> thanks in advance, Greg
>
> major mode: Shell-script[bash]
>
> Enabled minor modes: Async-Bytecomp-Package Auto-Composition
> Auto-Compression Auto-Encryption Blink-Cursor Electric-Indent
> File-Name-Shadow Flycheck Font-Lock Global-Eldoc Global-Flycheck
> Global-Font-Lock Line-Number Marginalia Menu-Bar Mouse-Wheel
> My-Global-Subword Org-Src Override-Global Selectrum
> Sh-Electric-Here-Document Shell-Dirtrack Straight-Package-Neutering
> Straight-Use-Package Subword Tooltip Transient-Mark Yas Yas-Global
>
>

[-- Attachment #2: Type: text/html, Size: 1769 bytes --]

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

* Re: <<noweb>> and ?font-lock? fly-check, ...
  2021-05-02 12:28 <<noweb>> and ?font-lock? fly-check, Greg Minshall
  2021-05-02 14:05 ` Diego Zamboni
@ 2021-05-02 15:48 ` Sébastien Miquel
  2021-05-02 17:43   ` Greg Minshall
  1 sibling, 1 reply; 8+ messages in thread
From: Sébastien Miquel @ 2021-05-02 15:48 UTC (permalink / raw)
  To: Greg Minshall, emacs-orgmode

Hi Greg,

Greg Minshall writes:
> is there an obvious thing to do to either get whatever syntax checker is
> running to ignore the <<noweb>> reference, or some such?
 From the org side of things, you could customize the variables
`org-babel-noweb-wrap-start` and `org-babel-noweb-wrap-end` to
something that doesn't interfere with bash syntax.

Regards,

-- 
Sébastien Miquel



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

* Re: <<noweb>> and ?font-lock? fly-check, ...
  2021-05-02 15:48 ` Sébastien Miquel
@ 2021-05-02 17:43   ` Greg Minshall
  2021-05-02 18:17     ` Tom Gillespie
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Minshall @ 2021-05-02 17:43 UTC (permalink / raw)
  To: sebastien.miquel; +Cc: emacs-orgmode

Diego and Sébastien,

thank you both.  in particular, i didn't know about
=org-babel-noweb-wrap-start=, and that's probably perfect for this
case.

cheers, Greg


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

* Re: <<noweb>> and ?font-lock? fly-check, ...
  2021-05-02 17:43   ` Greg Minshall
@ 2021-05-02 18:17     ` Tom Gillespie
  2021-05-03  4:11       ` Greg Minshall
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Gillespie @ 2021-05-02 18:17 UTC (permalink / raw)
  To: Greg Minshall; +Cc: sebastien.miquel, emacs-orgmode

Hi Greg,
    A slightly different suggestion that doesn't break other org
processors (which might not allow users to change
org-babel-noweb-wrap- values) is to prefix the names of the blocks
with & (e.g. <<&block-to-noweb-in>>) as I do in multiple places in
https://github.com/tgbugs/pyontutils/blob/master/docs/release.org#build-release.
I found this solution while fighting with the font-locking behavior in
shell blocks. Best!
Tom


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

* Re: <<noweb>> and ?font-lock? fly-check, ...
  2021-05-02 18:17     ` Tom Gillespie
@ 2021-05-03  4:11       ` Greg Minshall
  2021-05-03 20:55         ` Tom Gillespie
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Minshall @ 2021-05-03  4:11 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: sebastien.miquel, emacs-orgmode

Tom, that is quite devious, actually.  thank you very much!  do you
know, by the way, what flycheck and/or the shell make the "<<&"
construct out to be?  cheers, Greg


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

* Re: <<noweb>> and ?font-lock? fly-check, ...
  2021-05-03  4:11       ` Greg Minshall
@ 2021-05-03 20:55         ` Tom Gillespie
  2021-05-04  2:10           ` Greg Minshall
  0 siblings, 1 reply; 8+ messages in thread
From: Tom Gillespie @ 2021-05-03 20:55 UTC (permalink / raw)
  To: Greg Minshall; +Cc: emacs-orgmode

Hi Greg,
   I just checked and it induces a syntax error, which I did not know,
but turns out to be quite useful because it means that an untangled or
incorrectly tangled file will fail to run beyond that point. Best!
Tom

On Sun, May 2, 2021 at 9:11 PM Greg Minshall <minshall@umich.edu> wrote:
>
> Tom, that is quite devious, actually.  thank you very much!  do you
> know, by the way, what flycheck and/or the shell make the "<<&"
> construct out to be?  cheers, Greg
>


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

* Re: <<noweb>> and ?font-lock? fly-check, ...
  2021-05-03 20:55         ` Tom Gillespie
@ 2021-05-04  2:10           ` Greg Minshall
  0 siblings, 0 replies; 8+ messages in thread
From: Greg Minshall @ 2021-05-04  2:10 UTC (permalink / raw)
  To: Tom Gillespie; +Cc: emacs-orgmode

Tom,

>    I just checked and it induces a syntax error, which I did not know,
> but turns out to be quite useful because it means that an untangled or
> incorrectly tangled file will fail to run beyond that point. Best!

:)  cheers.


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

end of thread, other threads:[~2021-05-04  2:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-02 12:28 <<noweb>> and ?font-lock? fly-check, Greg Minshall
2021-05-02 14:05 ` Diego Zamboni
2021-05-02 15:48 ` Sébastien Miquel
2021-05-02 17:43   ` Greg Minshall
2021-05-02 18:17     ` Tom Gillespie
2021-05-03  4:11       ` Greg Minshall
2021-05-03 20:55         ` Tom Gillespie
2021-05-04  2:10           ` Greg Minshall

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/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 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

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