emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [babel] Editing 'quote' source blocks in artist mode


From: Eric Schulte
Subject: Re: [O] [babel] Editing 'quote' source blocks in artist mode
Date: Thu, 23 Feb 2012 15:44:26 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (gnu/linux)

>>
>> Not sure what the "best" solution is: sometimes they are ascii art and
>> having picture mode on is helpful, sometimes they are text and some kind
>> of text mode would be more appropriate. But they could really be anything
>> so *any* choice is bound to disappoint at some point/time and I'm not sure
>> org can be prescient enough TDRT all the time.
>
> I seem to remember that before my shift to emacs24 I just used
> quote-blocks and they were in text mode and I thought that was allright
> as default behaviour. Actually, I did not even notice what mode I was
> in, because it felt so natural to edit the quote as text. 
>
> I'm not really into this, its a bit strange, and might be just a special
> problem with my emacs installation/configuration. 

I can confirm that this is the behavior seen on Emacs24 even when no
configuration is loaded.  I think this is the *wrong* behavior, quotes
are generally textual and loading them in artist mode (to me) is
surprising and undesirable.

In looking at the code it seems that `org-edit-special' will launch
*any* block type in fixed width mode which isn't explicitly caught by
`org-edit-src-code'.  See the relevant portion of the function [1].  I
think the fix here would be to change `org-edit-fixed-width-region'
s.t. it only returns true when in fixed width block types (e.g.,
example).  Then possibly add another case statement to launch other
block types into text-mode special editing.

Best,

Footnotes: 
[1]  The call to `org-edit-fixed-width-region' returns true when the
     point is in *any* block type.

,----
| (cond ;; proceed with `org-edit-special'
|    ((save-excursion
|       (beginning-of-line 1)
|       (looking-at "\\(?:#\\+\\(?:setupfile\\|include\\):?[ \t]+\"?\\|[ 
\t]*<include\\>.*?file=\"\\)\\([^\"\n>]+\\)"))
|     (find-file (org-trim (match-string 1))))
|    ((org-edit-src-code))
|    ((org-edit-fixed-width-region))
|    ((org-at-table.el-p)
|     (org-edit-src-code))
|    ((or (org-at-table-p)
|       (save-excursion
|         (beginning-of-line 1)
|         (looking-at "[ \t]*#\\+TBLFM:")))
|     (call-interactively 'org-table-edit-formulas))
|    (t (call-interactively 'ffap)))
`----


-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]