From: Gray Calhoun <gray.calhoun@gmail.com>
To: Tassilo Horn <tassilo@member.fsf.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: can the symbol for leading stars be changed?
Date: Mon, 16 Mar 2009 12:20:58 -0700 [thread overview]
Message-ID: <ff1904540903161220h1b8dbab7j7f2d2b9338ed40cd@mail.gmail.com> (raw)
In-Reply-To: <878wn5g4we.fsf@thinkpad.tsdh.de>
Hi Tassilo,
Thanks for the suggestion -- your code worked great when I loaded it
on its own, but seems to be in conflict with something else in my
.emacs file, so I'll have to tinker with it a little bit. This seems
like an okay temporary solution, but I may look into orgstruct proper
when I have some free time.
Best,
--Gray
2009/3/16 Tassilo Horn <tassilo@member.fsf.org>:
> Gray Calhoun <gray.calhoun@gmail.com> writes:
>
> Hi Gray,
>
>> Is there a way for users to easily replace the leading stars with
>> another symbol? In particular, I want to replace the '*' with '#' so
>> that I use org mode to write pseduocode for R in outline form -- R
>> uses # to designate comments and this would ensure that the headers
>> wouldn't be read as code.
>
> I guess you want to use `orgstruct-mode' in R files, right? I also had
> the idea to do that, but till now I failed. As a workaround I use
> `outline-minor-mode' and set the `outline-regexp' to <comment-character
> of the language><one-or-many-stars>.
>
> Here's the code from my .emacs.
>
> --8<---------------cut here---------------start------------->8---
> (defun th-outline-regexp ()
> "Calculate the outline regexp for the current mode."
> (let ((comment-starter (replace-regexp-in-string
> "[[:space:]]+" "" comment-start)))
> (when (string= comment-start ";")
> (setq comment-starter ";;"))
> (concat "^" comment-starter "\\*+")))
>
> (defun th-outline-minor-mode-init ()
> (interactive)
> (setq outline-regexp (th-outline-regexp)))
>
> (add-hook 'outline-minor-mode-hook
> 'th-outline-minor-mode-init)
> --8<---------------cut here---------------end--------------->8---
>
> I wonder if I cannot make `orgstruct-mode' work the same way. I've
> always thought that it uses `outline-regexp' for the cycling and stuff,
> but maybe I'm wrong. What's the correct regexp that's used for
> `org-cycle'? `org-complex-heading-regexp'?
>
> Bye,
> Tassilo
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
--
Gray Calhoun
Economics Department
UC San Diego
http://gray.calhoun.googlepages.com/
next prev parent reply other threads:[~2009-03-16 19:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-16 3:17 can the symbol for leading stars be changed? Gray Calhoun
2009-03-16 10:04 ` Tassilo Horn
2009-03-16 19:20 ` Gray Calhoun [this message]
2009-03-16 21:22 ` Carsten Dominik
2009-03-17 8:21 ` Orgstruct-mode with custom outline-regexp (was: can the symbol for leading stars be changed?) Tassilo Horn
2009-03-17 10:48 ` Carsten Dominik
2009-03-17 12:00 ` Orgstruct-mode with custom outline-regexp Tassilo Horn
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=ff1904540903161220h1b8dbab7j7f2d2b9338ed40cd@mail.gmail.com \
--to=gray.calhoun@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=tassilo@member.fsf.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.