From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Outline and org-mode don't insert text into folded sections logically Date: Sat, 29 Oct 2011 17:40:08 +0200 Message-ID: <87hb2ru7qf.fsf@gnu.org> References: <1315077299.1785.YahooMailClassic@web121520.mail.ne1.yahoo.com> <837h5nh1df.fsf@yahoo.it> <877h3xibb0.fsf@gnu.org> <81ehy5uy0t.fsf@gmail.com> <87wrbxdter.fsf@gnu.org> <877h3n7usn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKB0A-0000cw-70 for emacs-orgmode@gnu.org; Sat, 29 Oct 2011 11:39:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKB08-0001ew-GR for emacs-orgmode@gnu.org; Sat, 29 Oct 2011 11:39:18 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:61473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKB08-0001er-AS for emacs-orgmode@gnu.org; Sat, 29 Oct 2011 11:39:16 -0400 Received: by wyg34 with SMTP id 34so5788179wyg.0 for ; Sat, 29 Oct 2011 08:39:14 -0700 (PDT) In-Reply-To: (suvayu ali's message of "Sat, 29 Oct 2011 16:57:31 +0200") 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: suvayu ali Cc: emacs-orgmode@gnu.org, Kelly Dean --=-=-= Content-Type: text/plain Hi Suvayu, suvayu ali writes: > Did you by any chance attach the old patch again? ;) Er, yes :) Here is the fresh one -- thanks for testing it. >> As for `org-reveal', please report a bug if it doesn't work >> as expected in specific parts of the buffer. > > I will try to make a more complete analysis and report it. Thanks! --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org.el-Unfold-invisible-region-at-point-or-right-bef.patch >From 23ef0209d53b0acdf2158da9dd8d4532b437f97e Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 29 Oct 2011 16:08:27 +0200 Subject: [PATCH] org.el: Unfold invisible region at point or right before point when editing. * org.el (org-self-insert-command): Unfold invisible region at point or right before point when editing. Thanks to Suvayu Ali for discussing this. --- lisp/org.el | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index fe45cf7..6c809be 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17393,6 +17393,23 @@ hook. The default setting is `org-speed-command-default-hook'." If the cursor is in a table looking at whitespace, the whitespace is overwritten, and the table is not marked as requiring realignment." (interactive "p") + (let ((invisible-at-point + (car (get-char-property-and-overlay (point) 'invisible))) + (invisible-before-point + (car (get-char-property-and-overlay (1- (point)) 'invisible)))) + (when (or (eq invisible-at-point 'outline) + (eq invisible-at-point 'org-hide-block) + (eq invisible-before-point 'outline) + (eq invisible-before-point 'org-hide-block)) + (if (or (eq invisible-before-point 'outline) + (eq invisible-before-point 'org-hide-block)) + (goto-char (previous-overlay-change (point)))) + (org-cycle) + (if (or (eq invisible-before-point 'outline) + (eq invisible-before-point 'org-hide-block)) + (forward-char 1)) + (message "Unfolding invisible region around point before editing") + (sit-for 1))) (cond ((and org-use-speed-commands (setq org-speed-command -- 1.7.7.1 --=-=-= Content-Type: text/plain -- Bastien --=-=-=--