From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] Editing 'quote' source blocks in artist mode Date: Thu, 23 Feb 2012 15:44:26 -0700 Message-ID: <87ehtl2mr9.fsf@gmx.com> References: <87d3964cpp.fsf@googlemail.com> <7405.1329958243@alphaville> <87ty2hlwgm.fsf@googlemail.com> <9331.1330013212@alphaville> <871uplldqc.fsf@googlemail.com> <9593.1330015057@alphaville> <87wr7djxyj.fsf@googlemail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:37065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0hOt-00027S-EN for emacs-orgmode@gnu.org; Thu, 23 Feb 2012 17:44:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0hOr-0002tS-VC for emacs-orgmode@gnu.org; Thu, 23 Feb 2012 17:44:35 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:47182) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1S0hOr-0002sn-Ox for emacs-orgmode@gnu.org; Thu, 23 Feb 2012 17:44:33 -0500 In-Reply-To: <87wr7djxyj.fsf@googlemail.com> (Thorsten's message of "Thu, 23 Feb 2012 17:50:28 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Thorsten Cc: emacs-orgmode@gnu.org >> >> 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]*.*?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/