On Wednesday, January 26, 2022 at 4:50:09 PM UTC-5, Btraven wrote:
> On Tuesday, January 25, 2022 at 9:01:30 AM UTC-5, Gene wrote:
> > Given Piaget's notions of assimilation and accommodation, do you suppose you'd experience more grief modifying your creative process to accommodate numberex ... or to somehow shoe-horn numberx functionality into your sacrosanct creative process?
> >
> >
https://melpa.org/#/numbex
> Both would be way above my pay grade.
Ya know ... I kinda experience the same sentiment, I suspect.
If one uses an out-of the-box, off-the-shelf configuration of emacs the parts seem to cooperate and dovetail better.
If one opts to attempt to pimp out one's working variant, BAD THINGS can happen.
If one uses the vanilla notion of a paragraph as something terminated with /n/n ... then tries to use numberx which allows the numbering of `examples' -- not paragraphs -- one is up against competing paradigms and has to use some dialectical process while merely HOPING -- against hope -- that some sort of synthesis CAN arise from reconciling theses, diatheses, ... different effing ways of representing things and doing-with vis-a-vis algorithmic glue which allows one to use an add-on package with extant data structures and functions.
From my perspective, this ain't a pay-grade problem so much as a gamble with one's time and sanity.
> It would require upgrading to ver. 26.1, setting lexical scope, reading and understanding code that uses many features that would require much study, and learning to use a very complex general purpose minor mode tool to solve a special problem. In short, it looks like overkill to me.
Seemingly ... from the perspective you just painted.
Thanks anyway. I've downloaded the code and I will read it more carefully later.
It's a teaser. If you could dream up an `example' in IT's worldview to map one-to-one and onto with your notion of a paragraph it would seem like you could use it as-is ... or with some mapping functions which map paragraph onto `example.
> In the meantime I added one line to my kludgey defun and that makes it work much better
> even though it sometimes fails to number the last few lines when there are more than about 100 paragraphs in a chapter:
We'll call it progress if it gets you a step or two out of the corner you found yourself painted into.
> (defun number-pgraphs (start end) ;; alias M-npg
> "insert paragraph-numbers of chapters at paragraphs' start in region. Blank lines have been guaranteed to consist of only a single C-j"
> (interactive "r")
> (save-excursion
> (setq i 1) ;; current par. number
> (goto-char start)
> (while (< (point) end)
> (forward-line)
> (while (and (bolp) (eolp)) (forward-line)) ;; skip blank line(s) with only linefeeds
> (move-beginning-of-line nil) ;; added this which somehow numbered most chaps correctly
> (if (not (= (char-after (point)) 42)) ;; not * character, start of new chapter
> (progn
> (insert (concat (number-to-string i) "." " "))
> (setq i (1+ i)))
> )))
> ) ;; defun
By way of stepwise refinement, promoting something closer to literate programming:
(1) Can the imperative code be reshaped or replaced with functional code?
(2) Can magic numbers -- such as 42 -- be replaced with semantically-suggestive descriptors, such as the-meaning-of-life ... or whatever you intend the reader of your literate program to `understand' or `resonate with' via conjoined fiction, folie à deux, or whatever your post-modernist authorial intent as an unreliable narrator is trying to induce in your audience.
(note: While taking an APL programming class back in the day I disdained the profs goading me to use descriptive variable names UNTIL I tried to read the code my former self had crafted just a few months prior. I had met the enemy and he was ME. APL effectively IS a write-only language. Are you going to recall what 42 `was' or `is a year or two down the road?)
(4) Use parametric equations/functions when possible. Rather than assume A buffer, even if only want to use your code in an implied buffer, allow the user of your RE-usable function to specify a buffer from any of those presently live. This allows mapcar and other functions to perform your magic on MANY enLISTED things-of-interest rather than just one identified via the conversational indexical `it' or `this'
Aside: I notice how you terminated your integer index numbers with one of the most overused and thus ambiguous terminators available: `."
What if you were to wrap your paragraph number in parentheticals -- such as {}, or [], for examples -- which disambiguate them as the unique paragraph identifiers you intend?
It would seem that a follow-on step could find then them ambiguously replace them as per the non-sensical-thou-standardized `traditional' language standards of the Language of the English.
But while your ideoglosical paracosm draft format were in use, you'd be better able to use automation via elisp while ignoring the procrustean standards of those kowtowing to standard problematic formatting conventions -- EG so-called `Natural' Language -- ... then performing a final step which keeps the language Nazi's from sending three consulting physicians to diagnose you with schizophrenia before calling in the guys with the straight jacket and a nice warm place with 3 hots, a cot, and drugs to make you heed the nonsense of the statistically normal people -- EG those with 100 IQ and an acquiescent attitude at the ready to pander to the normies and their norms.
> Thanks, again, Gene but I think I need help from someone smarter than I but not as smart as you. :-)
Were I merely `smart enough' I might have been more use during my first-pass response.
Sorry about that.
I didn't mean to either talk over your head or discourage you.
Best of luck in USING emacs for your intended purposes WHILE you augment your skills and abilities at pimping it out as you go.
Gene