From: David Rogoff <david@therogoffs.com>
To: emacs-orgmode@gnu.org
Subject: problem with orgstruct/outline-minor-mode with indented headlines
Date: Tue, 24 Jan 2012 21:47:23 +0000 (UTC) [thread overview]
Message-ID: <loom.20120124T224333-623@post.gmane.org> (raw)
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
next reply other threads:[~2012-01-24 21:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-24 21:47 David Rogoff [this message]
2012-01-29 7:15 ` problem with orgstruct/outline-minor-mode with indented headlines David Rogoff
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=loom.20120124T224333-623@post.gmane.org \
--to=david@therogoffs.com \
--cc=emacs-orgmode@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.