emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: Bayle Shanks <bshanks3@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-mode without stars
Date: Wed, 26 Jan 2011 09:57:22 -0700	[thread overview]
Message-ID: <AANLkTinrAZWoGKLaQbk5q5_9BPxkjBPoiw6iv0s_40Uh@mail.gmail.com> (raw)
In-Reply-To: <20110123032132.GM25446@bshanks.dyndns.org>

Hi Bayle,

On 2011-01-22, Bayle Shanks <bshanks3@gmail.com> wrote:
> get new laptop
>
> organize interstellar dust meeting
>  book the meeting room
>  organize LOC
>  Invited speakers
>   - Draine
>   - Tielens
>   - Hollenbach
>  1st announcement
>
> fix the bell in the hall

I indent by spaces by 2 a lot to save typing.  c-c - and c-c * will
convert.  They do not handle indentation, but that might be a very
useful feature (I would use it too).

This does handle indentation.  I wrote it a very long time ago for a
different, 8-space indentation.

(defun alpha-orgify ()
  "quick hack.  create org format from my indented outline
format, which consists of 8-space indentation.  operate on the
region.  assume a certain number of stars and odd levels."
  (interactive)
  (let ((b (region-beginning))
        (e (region-end))
        ;;manually mod for now.  headline vs. bullet.
        (bulletp nil))
    (loop
       while
         (progn
           (save-excursion
             ;;use (re-)search-forward and replace-match when no query?  i'd
             ;;prefer without the pattern (i.e. just ^) but you might be
             ;;re-orgifying an already-orgified region.  btw match-string is
             ;;how you get the string.
             (perform-replace "^\\([^*]\\)"
                              (if bulletp
                                  "  \\1"
                                "*** \\1")
                              t         ;interactive
                              t nil nil nil
                              b
                              e))
           (save-excursion
             (perform-replace "        "
                              (if bulletp
                                  "  "
                                "**")
                              t         ;interactive
                              t nil nil nil
                              b
                              e))
           (when bulletp
             (progn
               ;;how to make it greedy?
               (perform-replace "^\\( +\\)\\([^ ]\\)" "\\1- \\2"
                                t         ;interactive
                                t nil nil nil)))))))

Samuel

-- 
The Kafka Pandemic:
http://thekafkapandemic.blogspot.com/2010/12/welcome-to-kafka-pandemic-two-forces_9182.html
I support the Whittemore-Peterson Institute (WPI)
===
I want to see the original (pre-hold) Lo et al. 2010 NIH/FDA/Harvard MLV paper.

  parent reply	other threads:[~2011-01-26 16:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-23  3:21 org-mode without stars Bayle Shanks
2011-01-26 15:38 ` Giovanni Ridolfi
2011-01-26 16:57 ` Samuel Wales [this message]
2011-01-26 19:27   ` brian powell
2011-02-12  1:27     ` Samuel Wales

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinrAZWoGKLaQbk5q5_9BPxkjBPoiw6iv0s_40Uh@mail.gmail.com \
    --to=samologist@gmail.com \
    --cc=bshanks3@gmail.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).