From: dkcombs@panix.com (David Combs)
To: help-gnu-emacs@gnu.org
Subject: make sort-paragraph do non-paragraphs; key = numAsterisks
Date: 3 Oct 2013 04:14:25 -0400 [thread overview]
Message-ID: <l2j911$im2$1@panix1.panix.com> (raw)
Maybe 20 years I solved with sort-paragraphs a file todo-tasks like
below, each task beginning with a "^\[\]", where the sort-key is a
string of asterisks, and if no such string on the left of the
pseudo-paragraphs first line, then the sort key is zero or negative
infinity or would "bottom" be a proper term for this also?
The MORE asterisks that first-line asterisk-string had, the
HIGHER the sort-order, with no such asterisk-string giving zero.
------------------- beginning of file or region:
[] get gas, plus
fill one 5-gal tank.
Also put Stabil into the lawnmower
[] ** go to store
[] **** order books from amazon:
book1 ...
book2 ...
[] wash the dog
and the cat too.
[] ** email HELLO to John.
[] 2oct13: ******* now is the time for
all good men [NOTE: if necessary, I could
have the possible asterisk-string shifted
left, to come after the "[]<whiteSpace>*" (THAT
asterisk meaning, between you and me, 0 or
more white-chars)end-NOTE]
to come to the aid of their country.
------------------- ending of file or region.
This was my idea of CHANGING what sort-paragraph
thought a "paragraph" looked like:
The body of my pseudo paragraph contained a [] as the
first two chars, and included everything up to (not
through) the NEXT [] OR the EOB or end of region.
What I wanted to do was to pretend that each "[]"
(a) ended any prior "paragraph"
and was not contained with in it
(with option with its trailing "vertical" blankspace
was or was not to be eaten away), AND ALSO
(b) started a paragraph AND indeed was kept as part of it.
I used sort-paragraph rearrange the "paragraphs" of the
HIGHEST priority (MOST asterisks) ended up FIRST in the file or region..
I recall I had to fool with paragraph-start and -end,
and somehow made it work.
But I stupidly didn't save it somewhere I could find it,
with my documentation of it.
Thanks!
David
next reply other threads:[~2013-10-03 8:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-03 8:14 David Combs [this message]
2013-10-03 9:28 ` make sort-paragraph do non-paragraphs; key = numAsterisks Damien Wyart
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='l2j911$im2$1@panix1.panix.com' \
--to=dkcombs@panix.com \
--cc=help-gnu-emacs@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.