all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* make sort-paragraph do non-paragraphs; key = numAsterisks
@ 2013-10-03  8:14 David Combs
  2013-10-03  9:28 ` Damien Wyart
  0 siblings, 1 reply; 2+ messages in thread
From: David Combs @ 2013-10-03  8:14 UTC (permalink / raw)
  To: help-gnu-emacs

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-03  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-03  8:14 make sort-paragraph do non-paragraphs; key = numAsterisks David Combs
2013-10-03  9:28 ` Damien Wyart

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.