emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* block quotes in prose?
@ 2013-01-23  0:13 Peter Salazar
  2013-01-23  5:03 ` John Hendy
  2013-01-23 12:44 ` Bastien
  0 siblings, 2 replies; 10+ messages in thread
From: Peter Salazar @ 2013-01-23  0:13 UTC (permalink / raw)
  To: org-mode

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

1. What's the best way to demarcate block quotes in org-mode? I'd like a
way to demarcate them that makes it visually clear at a glance that it's a
block quote and not regular text.

I would prefer not to have to put them inside #+BEGIN_QUOTE and #+END_QUOTE
references, because I'd rather not have any content in my buffer that
distracts me from my actual writing.

In Markdown-Mode, for instance, I just prefix a block quote with a > and
the line automatically changes color:

http://i.imgur.com/AUsYJ.png

Org-mode is infinitely more powerful than Markdown-Mode, so I'd just like a
way to work with lots of prose and block quotes in org-mode that will be
easy and visually pleasing. I'm primarily concerned about how it appears in
the org-mode editor, not in export.

2. It would also be cool to find a way to make bulleted lists appear in a
different color if possible, or a workaround to simulate this.

Thanks!

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

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

* Re: block quotes in prose?
  2013-01-23  0:13 block quotes in prose? Peter Salazar
@ 2013-01-23  5:03 ` John Hendy
  2013-02-05  4:10   ` Peter Salazar
  2013-01-23 12:44 ` Bastien
  1 sibling, 1 reply; 10+ messages in thread
From: John Hendy @ 2013-01-23  5:03 UTC (permalink / raw)
  To: Peter Salazar; +Cc: org-mode

On Tue, Jan 22, 2013 at 6:13 PM, Peter Salazar <cycleofsong@gmail.com> wrote:
> 1. What's the best way to demarcate block quotes in org-mode? I'd like a way
> to demarcate them that makes it visually clear at a glance that it's a block
> quote and not regular text.
>
> I would prefer not to have to put them inside #+BEGIN_QUOTE and #+END_QUOTE
> references, because I'd rather not have any content in my buffer that
> distracts me from my actual writing.
>
> In Markdown-Mode, for instance, I just prefix a block quote with a > and the
> line automatically changes color:
>
> http://i.imgur.com/AUsYJ.png
>
> Org-mode is infinitely more powerful than Markdown-Mode, so I'd just like a
> way to work with lots of prose and block quotes in org-mode that will be
> easy and visually pleasing. I'm primarily concerned about how it appears in
> the org-mode editor, not in export.
>

Looking around, at least some of this appears defined in
/path/to/org-src/lisp/org-faces.el.

I don't know enough elisp to tell you how to make Org treat ">
text..." the same as #+begin_quote.

Perhaps you could figure out where the face change is for lines like
#+latex: and #+begin_src, as they both change the face of the text
immediately after (no need for an #+end_ command to tell Org to go
back to the default face). You might be able to add "^> text" to the
list of face-sensitive regexps to look for (using ^ as symbol for
beginning of line).

ETA: after some more grepping, it looks like you could add something
in two places:

1) org-faces.el

Search the file for "defface" and make a new face. I've not done this,
but you can definitely copy/yank some existing definitions and tweak
to your liking.

2) org.el

Find a matching fontify function to see how the fontification is done.
They look pretty complicated... but perhaps it's possible to tweak one
to fontify "^> text...".

Perhaps the easiest would be to find a face you like and just add "^>
text..." to the existing list of things org already fontifies with
that style. In other words, add "^> text" regexp to the existing hunt
for lines that start with #+ in order to get src code fontification
applied.

> 2. It would also be cool to find a way to make bulleted lists appear in a
> different color if possible, or a workaround to simulate this.

As in?
- item 1
- item 2

I'm sure that's possible, too. Can't imagine this will become global,
but you could surely create your own git branch if you figure out how
or someone tells you how.


Good luck!
John


>
> Thanks!
>
>

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

* Re: block quotes in prose?
  2013-01-23  0:13 block quotes in prose? Peter Salazar
  2013-01-23  5:03 ` John Hendy
@ 2013-01-23 12:44 ` Bastien
  2013-01-24  6:36   ` Peter Salazar
  1 sibling, 1 reply; 10+ messages in thread
From: Bastien @ 2013-01-23 12:44 UTC (permalink / raw)
  To: Peter Salazar; +Cc: org-mode

Hi Peter,

Peter Salazar <cycleofsong@gmail.com> writes:

> 1. What's the best way to demarcate block quotes in org-mode? 

(setq org-fontify-quote-and-verse-blocks t)

This uses the org-quote face, which inherits its properties from the
org-block face -- M-x customize-face RET org-quote RET to customize
the org-quote face.

> 2. It would also be cool to find a way to make bulleted lists appear
> in a different color if possible, or a workaround to simulate this.

You can play around with this

(highlight-regexp (org-item-re))

or 

(highlight-regexp (org-item-re) 'org-quote)

or 

(highlight-regexp org-list-full-item-re 'org-quote)

...

But this is hackish, temporary and half-satisfactory.

HTH,

-- 
 Bastien

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

* Re: block quotes in prose?
  2013-01-23 12:44 ` Bastien
@ 2013-01-24  6:36   ` Peter Salazar
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Salazar @ 2013-01-24  6:36 UTC (permalink / raw)
  To: Bastien; +Cc: org-mode

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

This is awesome, thank you. I'll play around with it!


On Wed, Jan 23, 2013 at 7:44 AM, Bastien <bzg@altern.org> wrote:

> Hi Peter,
>
> Peter Salazar <cycleofsong@gmail.com> writes:
>
> > 1. What's the best way to demarcate block quotes in org-mode?
>
> (setq org-fontify-quote-and-verse-blocks t)
>
> This uses the org-quote face, which inherits its properties from the
> org-block face -- M-x customize-face RET org-quote RET to customize
> the org-quote face.
>
> > 2. It would also be cool to find a way to make bulleted lists appear
> > in a different color if possible, or a workaround to simulate this.
>
> You can play around with this
>
> (highlight-regexp (org-item-re))
>
> or
>
> (highlight-regexp (org-item-re) 'org-quote)
>
> or
>
> (highlight-regexp org-list-full-item-re 'org-quote)
>
> ...
>
> But this is hackish, temporary and half-satisfactory.
>
> HTH,
>
> --
>  Bastien
>

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

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

* Re: block quotes in prose?
  2013-01-23  5:03 ` John Hendy
@ 2013-02-05  4:10   ` Peter Salazar
  2013-02-11 15:54     ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Salazar @ 2013-02-05  4:10 UTC (permalink / raw)
  To: John Hendy; +Cc: org-mode

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

I think an easy workaround would be to define block quotes as code blocks
instead.

putting the ":" as a prefix before a paragraph automatically fontifies it
and places it in another color.

This allows me to work in org-mode with visual highlighting of block quotes
as desired.

Now the question is: How do I make org-mode recognize the ">" prefix as a
demarcator of a code block, so that my document remains readable as
Markdown?

Thanks!


On Wed, Jan 23, 2013 at 12:03 AM, John Hendy <jw.hendy@gmail.com> wrote:

> On Tue, Jan 22, 2013 at 6:13 PM, Peter Salazar <cycleofsong@gmail.com>
> wrote:
> > 1. What's the best way to demarcate block quotes in org-mode? I'd like a
> way
> > to demarcate them that makes it visually clear at a glance that it's a
> block
> > quote and not regular text.
> >
> > I would prefer not to have to put them inside #+BEGIN_QUOTE and
> #+END_QUOTE
> > references, because I'd rather not have any content in my buffer that
> > distracts me from my actual writing.
> >
> > In Markdown-Mode, for instance, I just prefix a block quote with a > and
> the
> > line automatically changes color:
> >
> > http://i.imgur.com/AUsYJ.png
> >
> > Org-mode is infinitely more powerful than Markdown-Mode, so I'd just
> like a
> > way to work with lots of prose and block quotes in org-mode that will be
> > easy and visually pleasing. I'm primarily concerned about how it appears
> in
> > the org-mode editor, not in export.
> >
>
> Looking around, at least some of this appears defined in
> /path/to/org-src/lisp/org-faces.el.
>
> I don't know enough elisp to tell you how to make Org treat ">
> text..." the same as #+begin_quote.
>
> Perhaps you could figure out where the face change is for lines like
> #+latex: and #+begin_src, as they both change the face of the text
> immediately after (no need for an #+end_ command to tell Org to go
> back to the default face). You might be able to add "^> text" to the
> list of face-sensitive regexps to look for (using ^ as symbol for
> beginning of line).
>
> ETA: after some more grepping, it looks like you could add something
> in two places:
>
> 1) org-faces.el
>
> Search the file for "defface" and make a new face. I've not done this,
> but you can definitely copy/yank some existing definitions and tweak
> to your liking.
>
> 2) org.el
>
> Find a matching fontify function to see how the fontification is done.
> They look pretty complicated... but perhaps it's possible to tweak one
> to fontify "^> text...".
>
> Perhaps the easiest would be to find a face you like and just add "^>
> text..." to the existing list of things org already fontifies with
> that style. In other words, add "^> text" regexp to the existing hunt
> for lines that start with #+ in order to get src code fontification
> applied.
>
> > 2. It would also be cool to find a way to make bulleted lists appear in a
> > different color if possible, or a workaround to simulate this.
>
> As in?
> - item 1
> - item 2
>
> I'm sure that's possible, too. Can't imagine this will become global,
> but you could surely create your own git branch if you figure out how
> or someone tells you how.
>
>
> Good luck!
> John
>
>
> >
> > Thanks!
> >
> >
>

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

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

* Re: block quotes in prose?
  2013-02-05  4:10   ` Peter Salazar
@ 2013-02-11 15:54     ` Bastien
  2013-02-11 16:01       ` Sebastien Vauban
  2013-02-16 20:27       ` Peter Salazar
  0 siblings, 2 replies; 10+ messages in thread
From: Bastien @ 2013-02-11 15:54 UTC (permalink / raw)
  To: Peter Salazar; +Cc: org-mode

Hi Peter,

Peter Salazar <cycleofsong@gmail.com> writes:

> Now the question is: How do I make org-mode recognize the ">" prefix
> as a demarcator of a code block, so that my document remains readable
> as Markdown?

You can't -- using ":" as the prefix for fixed-width regions is
hardcoded.  If we allow to customize this, it will lower the
"exchangeability" of .org files between users (this exchangeability 
is already quite low due to the many options user have.)

Best,

-- 
 Bastien

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

* Re: block quotes in prose?
  2013-02-11 15:54     ` Bastien
@ 2013-02-11 16:01       ` Sebastien Vauban
  2013-02-16 20:27       ` Peter Salazar
  1 sibling, 0 replies; 10+ messages in thread
From: Sebastien Vauban @ 2013-02-11 16:01 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Bastien and Peter,

Bastien wrote:
> Peter Salazar <cycleofsong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>> Now the question is: How do I make org-mode recognize the ">" prefix as a
>> demarcator of a code block, so that my document remains readable as
>> Markdown?
>
> You can't -- using ":" as the prefix for fixed-width regions is hardcoded.
> If we allow to customize this, it will lower the "exchangeability" of .org
> files between users (this exchangeability is already quite low due to the
> many options user have.)

That 'd have been excellent: copies of (replies to) emails wouldn't have
needed to be protected anyhow.

But, yes, I can understand it's too late...

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: block quotes in prose?
  2013-02-11 15:54     ` Bastien
  2013-02-11 16:01       ` Sebastien Vauban
@ 2013-02-16 20:27       ` Peter Salazar
  2013-02-23  9:54         ` Bastien
  1 sibling, 1 reply; 10+ messages in thread
From: Peter Salazar @ 2013-02-16 20:27 UTC (permalink / raw)
  To: Bastien; +Cc: org-mode

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

Bastien, thanks for the response and the explanation. Looks like getting
org-mode recognize the ">" prefix as a demarcator of a code block isn't the
right approach then.

What about John Hendy's suggestion of finding a face I like, and then
adding "^> text..." to the list of things org fontifies with that style?
('In other words, add "^> text" regexp to the existing hunt for lines that
start with #+ in order to get src code fontification applied.')

Is this feasible? If so, how would I go about doing this? Sorry for the
newbie question. I'm looking in org-faces, and I don't see anywhere where I
can specify the prefix characters org looks for...



John Hendy wrote:
> The easiet would be to find a face you like and just add "^>
text..." to the existing list of things org already fontifies with
that style. In other words, add "^> text" regexp to the existing hunt
for lines that start with #+ in order to get src code fontification
applied.




On Mon, Feb 11, 2013 at 10:54 AM, Bastien <bzg@altern.org> wrote:

> Hi Peter,
>
> Peter Salazar <cycleofsong@gmail.com> writes:
>
> > Now the question is: How do I make org-mode recognize the ">" prefix
> > as a demarcator of a code block, so that my document remains readable
> > as Markdown?
>
> You can't -- using ":" as the prefix for fixed-width regions is
> hardcoded.  If we allow to customize this, it will lower the
> "exchangeability" of .org files between users (this exchangeability
> is already quite low due to the many options user have.)
>
> Best,
>
> --
>  Bastien
>

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

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

* Re: block quotes in prose?
  2013-02-16 20:27       ` Peter Salazar
@ 2013-02-23  9:54         ` Bastien
  2013-02-24 19:45           ` Peter Salazar
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien @ 2013-02-23  9:54 UTC (permalink / raw)
  To: Peter Salazar; +Cc: org-mode

Hi Peter,

Peter Salazar <cycleofsong@gmail.com> writes:

> What about John Hendy's suggestion of finding a face I like, and then
> adding "^> text..." to the list of things org fontifies with that
> style? ('In other words, add "^> text" regexp to the existing hunt
> for lines that start with #+ in order to get src code fontification
> applied.') 
>
> Is this feasible?

Use this somewhere in your configuration:

  (font-lock-add-keywords
       'org-mode '(("^\\(:+\\) " 1 (compose-region (match-beginning 1) (match-end 1) ?> ) nil)))

M-x org-mode RET in an org-mode buffer if you evaluate this sexp after
you visited the file, otherwise the change will not be visible.

HTH,

-- 
 Bastien

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

* Re: block quotes in prose?
  2013-02-23  9:54         ` Bastien
@ 2013-02-24 19:45           ` Peter Salazar
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Salazar @ 2013-02-24 19:45 UTC (permalink / raw)
  To: Bastien; +Cc: org-mode

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

Excellent! Thank you so much! :-)


On Sat, Feb 23, 2013 at 4:54 AM, Bastien <bzg@altern.org> wrote:

> Hi Peter,
>
> Peter Salazar <cycleofsong@gmail.com> writes:
>
> > What about John Hendy's suggestion of finding a face I like, and then
> > adding "^> text..." to the list of things org fontifies with that
> > style? ('In other words, add "^> text" regexp to the existing hunt
> > for lines that start with #+ in order to get src code fontification
> > applied.')
> >
> > Is this feasible?
>
> Use this somewhere in your configuration:
>
>   (font-lock-add-keywords
>        'org-mode '(("^\\(:+\\) " 1 (compose-region (match-beginning 1)
> (match-end 1) ?> ) nil)))
>
> M-x org-mode RET in an org-mode buffer if you evaluate this sexp after
> you visited the file, otherwise the change will not be visible.
>
> HTH,
>
> --
>  Bastien
>

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

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

end of thread, other threads:[~2013-02-24 19:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-23  0:13 block quotes in prose? Peter Salazar
2013-01-23  5:03 ` John Hendy
2013-02-05  4:10   ` Peter Salazar
2013-02-11 15:54     ` Bastien
2013-02-11 16:01       ` Sebastien Vauban
2013-02-16 20:27       ` Peter Salazar
2013-02-23  9:54         ` Bastien
2013-02-24 19:45           ` Peter Salazar
2013-01-23 12:44 ` Bastien
2013-01-24  6:36   ` Peter Salazar

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