From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?R=C3=A9mi_Vanicat?= Subject: Bugs in org-cycle-internal-local? Date: Mon, 17 Dec 2012 22:43:52 +0100 Message-ID: <8738z4bbhj.fsf@debian.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkiTw-0001a5-2B for emacs-orgmode@gnu.org; Mon, 17 Dec 2012 16:44:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkiTo-0005i3-O6 for emacs-orgmode@gnu.org; Mon, 17 Dec 2012 16:44:15 -0500 Received: from plane.gmane.org ([80.91.229.3]:38142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkiTo-0005ht-Ho for emacs-orgmode@gnu.org; Mon, 17 Dec 2012 16:44:08 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TkiU0-0004jh-EN for emacs-orgmode@gnu.org; Mon, 17 Dec 2012 22:44:20 +0100 Received: from 185.109.22.109.rev.sfr.net ([109.22.109.185]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Dec 2012 22:44:20 +0100 Received: from vanicat by 185.109.22.109.rev.sfr.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Dec 2012 22:44:20 +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: emacs-orgmode@gnu.org Hello, I've tried to use visibility cycling in outline minor mode[1] with ruby, and I've a problem with when hiding some subtree: when the next subtree on the same level begin with space char, its heading is put on the same line than the current one: Something like: def get(info, attr, default=nil) end def initialize become def get(info, attr, default=nil)... def initialize when I expect def get(info, attr, default=nil)... def initialize The problem seem to come from the org-cycle-internal-local function that wrongly put the end of the subtree in the middle of a line, if the beginning of this line is all white character. Here is the code I use to setup ruby-mode for interesting integration with outline-minor-mode and org cycling facilities: #+begin_src emacs-lisp (defvar my-ruby-outline-regexp "### \\| *def\\>\\| *module\\>\\| *class\\>") (defun my-ruby-outline-level () "compute the level of a outline for ruby" (save-match-data (cond ((looking-at "###") 1) ((looking-at "\\( *\\)") (+ 2 (length (match-string 1))))))) (defun define-ruby-outline () (make-local-variable 'outline-regexp) (setq outline-regexp my-ruby-outline-regexp) (make-local-variable 'outline-level) (setq outline-level #'my-ruby-outline-level) (outline-minor-mode)) (add-hook 'ruby-mode-hook 'define-ruby-outline) (eval-after-load 'outline '(progn (define-key outline-minor-mode-map [(control tab)] 'org-cycle) (define-key outline-minor-mode-map [(backtab)] 'org-global-cycle))) #+end_src [1]:http://orgmode.org/worg/org-faq.html#use-visibility-cycling-in-outline-mode -- RĂ©mi Vanicat