From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Rogoff Subject: problem with orgstruct/outline-minor-mode with indented headlines Date: Tue, 24 Jan 2012 21:47:23 +0000 (UTC) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpoDR-0000q2-M6 for emacs-orgmode@gnu.org; Tue, 24 Jan 2012 16:47:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpoDN-0000iH-Av for emacs-orgmode@gnu.org; Tue, 24 Jan 2012 16:47:45 -0500 Received: from lo.gmane.org ([80.91.229.12]:60913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpoDM-0000hB-Sb for emacs-orgmode@gnu.org; Tue, 24 Jan 2012 16:47:41 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RpoDJ-00052R-O0 for emacs-orgmode@gnu.org; Tue, 24 Jan 2012 22:47:37 +0100 Received: from pat.qlogic.com ([198.70.193.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 Jan 2012 22:47:37 +0100 Received: from david by pat.qlogic.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 Jan 2012 22:47:37 +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 Hi all. I'm still trying to get orgstruct to work right. One thing I found is that I was getting confused with outline-magic which set up outline-minor-mode-map but not orgstruct-mode-map. I'm working inside verilog-mode, which uses the same "//" comment as c. So I defined outline-regexp: (setq outline-regexp "\\s-*// [*]+ ") ;; any line that starts with "// " (possibly preceeded with whitespace) and some number of stars and a space This works fine. I needed the whitespace in front since verilog-mode indents comments along with code. The problem is when I run org-cycle on a headline. The following headline ends up on the same line (also in outline-minor-mode). For example, in plain org mode I have this: * head 1 ** head 2 *** head 3 head 3 text head 3 text ** head 2b head 2b text head 2b text I now run org-cycle on headline "head 2" and it looks like this: * head 1 ** head 2... ** head 2b head 2b text head 2b text p.s. - is there a way to copy/export exactly what the collapse buffer looks like? I had to manually create this since copy/paste of the text includes the hidden parts. If I change to verlog-mode with orgstruct minor mode and add "// " at the beginning of headlines, everything is still good: // * head 1 // ** head 2 // *** head 3 head 3 text head 3 text // ** head 2b head 2b text head 2b text and // * head 1 // ** head 2 // ** head 2b head 2b text head 2b text Where it breaks is the case of indented comments: // * module declaration module a ( // * ports // ** inputs input b, input c, // ** outputs output d, output e ); // module code assign d = b & c; assign e = d | e; // * end module declaration endmodule // a If I run org-cycle on headline "ports" I get this: // * module declaration module a ( // * ports // * end module declaration endmodule // a Instead of this: // * module declaration module a ( // * ports // * end module declaration endmodule // a Likewise, collapsing "inputs" gives this: // * module declaration module a ( // * ports // ** inputs // ** outputs output d, output e ); // module code assign d = b & c; assign e = d | e; // * end module declaration endmodule // a Not this: // * module declaration module a ( // * ports // ** inputs ... // ** outputs output d, output e ); // module code assign d = b & c; assign e = d | e; // * end module declaration endmodule // a What's going on? There's some confusion about the headline level being based on the indent and the number of stars. I'm so close, but need help figuring out this last problem. Thanks, David