emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <eric.schulte@gmx.com>
To: Thorsten <quintfall@googlemail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] Editing 'quote' source blocks in artist mode
Date: Thu, 23 Feb 2012 15:44:26 -0700	[thread overview]
Message-ID: <87ehtl2mr9.fsf@gmx.com> (raw)
In-Reply-To: <87wr7djxyj.fsf@googlemail.com> (Thorsten's message of "Thu, 23 Feb 2012 17:50:28 +0100")

>>
>> 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	other threads:[~2012-02-23 22:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23  0:26 [babel] Editing 'quote' source blocks in artist mode Thorsten
2012-02-23  0:50 ` Nick Dokos
2012-02-23  9:39   ` Thorsten
2012-02-23 15:57     ` Gustav Wikström
2012-02-23 16:06       ` Nick Dokos
2012-02-23 16:24         ` Thorsten
2012-02-23 16:37           ` Nick Dokos
2012-02-23 16:50             ` Thorsten
2012-02-23 22:44               ` Eric Schulte [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ehtl2mr9.fsf@gmx.com \
    --to=eric.schulte@gmx.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=quintfall@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).