all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Org to Markdown programmatically
@ 2021-05-04  8:48 Jean Louis
  2021-05-04  9:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 35+ messages in thread
From: Jean Louis @ 2021-05-04  8:48 UTC (permalink / raw)
  To: Help GNU Emacs

As I am editing database strings, not files, I have to export
programmatically Org blobs into HTML. 

Following receives output from comands that receive standard input:

(defun rcd-command-output-from-input (program input &rest args)
  "Returns output from PROGRAM INPUT with optional ARGS"
  (let* ((output (with-temp-buffer
		   (insert input)
		   (apply #'call-process-region nil nil program t t nil args)
		   (buffer-string))))
    output))

Following receives Markdown processed HTML:

(defun rcd-markdown (text)
  "Markdown processing"
  (if text
      (rcd-command-output-from-input "markdown" text)
    ""))

And this one returns HTML from Org string that is first exported to Markdown.

(defun rcd-org-to-markdown-to-html (text)
  "Transform Org string to HTML"
  (rcd-markdown 
   (with-temp-buffer
     (insert text)
     (org-export-to-buffer 'md (current-buffer) nil nil nil t)
     (buffer-string))))



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

* Re: Org to Markdown programmatically
  2021-05-04  8:48 Org to Markdown programmatically Jean Louis
@ 2021-05-04  9:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-04 10:09   ` Colin Baxter
  0 siblings, 1 reply; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-04  9:04 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

> As I am editing database strings, not files, I have to
> export programmatically Org blobs into HTML.

See if pandoc can do this...

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-04  9:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-04 10:09   ` Colin Baxter
  2021-05-04 17:29     ` Jean Louis
  2021-05-22  8:26     ` Jean Louis
  0 siblings, 2 replies; 35+ messages in thread
From: Colin Baxter @ 2021-05-04 10:09 UTC (permalink / raw)
  To: help-gnu-emacs

>>>>> Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> writes:

    > Jean Louis wrote:
    >> As I am editing database strings, not files, I have to export
    >> programmatically Org blobs into HTML.

    > See if pandoc can do this...

It can:

pandoc -o file.md file.org <RET>



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

* Re: Org to Markdown programmatically
  2021-05-04 10:09   ` Colin Baxter
@ 2021-05-04 17:29     ` Jean Louis
  2021-05-04 20:23       ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-22  8:26     ` Jean Louis
  1 sibling, 1 reply; 35+ messages in thread
From: Jean Louis @ 2021-05-04 17:29 UTC (permalink / raw)
  To: Colin Baxter; +Cc: help-gnu-emacs

* Colin Baxter <m43cap@yandex.com> [2021-05-04 13:24]:
> >>>>> Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> writes:
> 
>     > Jean Louis wrote:
>     >> As I am editing database strings, not files, I have to export
>     >> programmatically Org blobs into HTML.
> 
>     > See if pandoc can do this...
> 
> It can:
> 
> pandoc -o file.md file.org <RET>

It can, though in the context of Emacs the native Org converted to
Markdown markup with library ox-md and then processed with external
Discount Markdown is still faster than processing it alone with
external Pandoc to Markdown only.

Pandoc cannot handle all features of Org mode, it is let us say, good
to do that for other editors, it means every editor could use Org
style to convert it for example to HTML od EPUB, without Emacs.

https://pandoc.org/org.html

I find however that Pandoc is great tool for conversions of various
formats including processing and generation of HTML.

One really serious issue with Pandoc is that it is huge software
considering how many dependencies it has, including Haskell
compiler. I wonder if it is reproducible, as in 2016, it was not
possible to find C sources for it. Only Haskell that has to be
compiled with Haskell, older versions were somehow lost at the
time. Maybe something changed today.

(benchmark 100 
	   (let ((pages (rcd-sql-list "SELECT pages_id FROM pages WHERE pages_pagetype = 11" cf-db)))
	     (while pages
	       (let* ((id (pop pages))
		      (body (rcd-sql-first (format "SELECT pages_content FROM pages WHERE pages_id = %s" id) cf-db)))
		 (setq text (rcd-pandoc-org-markdown body))))))

Elapsed time: 0.000016s

Processing Org pages with native Emacs appears much faster.

(benchmark 100 
	   (let ((pages (rcd-sql-list "SELECT pages_id FROM pages WHERE pages_pagetype = 11" cf-db)))
	     (while pages
	       (let* ((id (pop pages))
		      (body (rcd-sql-first (format "SELECT pages_content FROM pages WHERE pages_id = %s" id) cf-db)))
		 (setq text (rcd-org-to-markdown-to-html body))))))

Elapsed time: 0.000007s



-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-04 17:29     ` Jean Louis
@ 2021-05-04 20:23       ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05  6:56         ` Jean Louis
  0 siblings, 1 reply; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-04 20:23 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

> It can, though in the context of Emacs the native Org
> converted to Markdown markup with library ox-md and then
> processed with external Discount Markdown is still faster
> than processing it alone with external Pandoc to
> Markdown only.

I think most people, tho we don't have the details of course
to determine your situation, but most people would use Emacs to
do _one_ format and then have automated shell tools in shell
scripts convert it to any and all formats you'd ever need.

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-04 20:23       ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05  6:56         ` Jean Louis
  2021-05-05  7:20           ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 35+ messages in thread
From: Jean Louis @ 2021-05-05  6:56 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-04 23:24]:
> Jean Louis wrote:
> 
> > It can, though in the context of Emacs the native Org
> > converted to Markdown markup with library ox-md and then
> > processed with external Discount Markdown is still faster
> > than processing it alone with external Pandoc to
> > Markdown only.
> 
> I think most people, tho we don't have the details of course
> to determine your situation, but most people would use Emacs to
> do _one_ format and then have automated shell tools in shell
> scripts convert it to any and all formats you'd ever need.

Yes, many various formats will ask for external commands.

Org is however, Emacs's internal stuff. It can produce Markdown and
also HTML without external commands. I could export as HTML, but
currently, for testing reasons, I export to Markdown intermittently
and then to HTML.

I have made Website Revision System in such way that specific
templates are related to text processors, such as Markdown, txt2tags,
Asciidoctor, Org mode, and then if page chooses different template,
then its body gets processed by such processor.

Org mode is often way too structured for web pages, and especially for
simpler pages it is faster to use Markdown. Let us say those pages
with few images or ordered images, where Org mode would need special
HTML exporting options, that becomes tiresome for no good reason, it
is easier then to use simpler markup like Markdown. 

Org mode developed from outline-mode. Now in development version
outline-mode will demote headings by using TAB. If I wish to include
some highlighted items, it becomes quite easy.

(defun outline-highlight-keywords ()
  (interactive)
  (let ((my-keywords '("TODO" hi-yellow
		       "DONE" hi-green
		       "URGENT" hi-red-b)))
    (while my-keywords
      (let ((keyword (pop my-keywords))
	    (highlight (pop my-keywords)))
	(highlight-regexp keyword highlight)))))

Outline mode is faster, more responsive then Org mode and can easily
be converted into Org mode on the fly, it can be considered Org mode
when exporting as a blob from database.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-05  6:56         ` Jean Louis
@ 2021-05-05  7:20           ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05  8:34             ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 11:58             ` Jean Louis
  0 siblings, 2 replies; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05  7:20 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

> Org mode is often way too structured for web pages, and
> especially for simpler pages it is faster to use Markdown.
> Let us say those pages with few images or ordered images,
> where Org mode would need special HTML exporting options,
> that becomes tiresome for no good reason, it is easier then
> to use simpler markup like Markdown.

Oh, I found the most amazing tool - on Android of all places,
it was called a SEO tool but it actually went thru the whole
page, all aspects, even language and style, but of course also
the old SEO things like header-body congruence and all that.

Anyway found lots of small mistakes that I corrected. I run it
on all my blog post pages - and this article by far scored the
highest, 79%

  https://dataswamp.org/~incal/blog/box-10/marco-antonio-barrera.html

I agree! Good article :)

> (defun outline-highlight-keywords ()
>   (interactive)
>   (let ((my-keywords '("TODO" hi-yellow
> 		       "DONE" hi-green
> 		       "URGENT" hi-red-b)))
>     (while my-keywords
>       (let ((keyword (pop my-keywords))
> 	    (highlight (pop my-keywords)))
> 	(highlight-regexp keyword highlight)))))

Hahaha, creative! :)

But go get yourself a proper loop, will you :)

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05  7:20           ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05  8:34             ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 11:58             ` Jean Louis
  1 sibling, 0 replies; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05  8:34 UTC (permalink / raw)
  To: help-gnu-emacs

> Oh, I found the most amazing tool - on Android of all
> places, it was called a SEO tool but it actually went thru
> the whole page, all aspects, even language and style, but of
> course also the old SEO things like header-body congruence
> and all that.

It is th SEH Check. Behind the trivial name etc etc

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05  7:20           ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05  8:34             ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 11:58             ` Jean Louis
  2021-05-05 15:36               ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 35+ messages in thread
From: Jean Louis @ 2021-05-05 11:58 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-05 10:23]:
> Oh, I found the most amazing tool - on Android of all places,
> it was called a SEO tool but it actually went thru the whole
> page, all aspects, even language and style, but of course also
> the old SEO things like header-body congruence and all that.
> 
> Anyway found lots of small mistakes that I corrected. I run it
> on all my blog post pages - and this article by far scored the
> highest, 79%
> 
>   https://dataswamp.org/~incal/blog/box-10/marco-antonio-barrera.html

Scored for which term?

> >   (let ((my-keywords '("TODO" hi-yellow
> > 		       "DONE" hi-green
> > 		       "URGENT" hi-red-b)))
> >     (while my-keywords
> >       (let ((keyword (pop my-keywords))
> > 	    (highlight (pop my-keywords)))
> > 	(highlight-regexp keyword highlight)))))
> 
> Hahaha, creative! :)
> 
> But go get yourself a proper loop, will you :)

For me, proper loops in Emacs Lisp are `while' and mapping
functions. It gives me more clarity due to old habbits.

`dolist' and `dotimes', or cl-loop, I will never use in Emacs Lisp. I
may use it in Common Lisp. But there is bunch of it to be converted
yet.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-05 11:58             ` Jean Louis
@ 2021-05-05 15:36               ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 19:47                 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 20:11                 ` Jean Louis
  0 siblings, 2 replies; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 15:36 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>> Oh, I found the most amazing tool - on Android of all
>> places, it was called a SEO tool but it actually went thru
>> the whole page, all aspects, even language and style, but
>> of course also the old SEO things like header-body
>> congruence and all that.
>> 
>> Anyway found lots of small mistakes that I corrected. I run
>> it on all my blog post pages - and this article by far
>> scored the highest, 79%
>> 
>>   https://dataswamp.org/~incal/blog/box-10/marco-antonio-barrera.html
>
> Scored for which term?

Overall score.

>>>   (let ((my-keywords '("TODO" hi-yellow
>>> 		       "DONE" hi-green
>>> 		       "URGENT" hi-red-b)))
>>>     (while my-keywords
>>>       (let ((keyword (pop my-keywords))
>>> 	    (highlight (pop my-keywords)))
>>> 	(highlight-regexp keyword highlight)))))
>> 
>> Hahaha, creative! :)
>> 
>> But go get yourself a proper loop, will you :)
>
> For me, proper loops in Emacs Lisp are `while' and mapping
> functions. It gives me more clarity due to old habbits.

`while' is proper but not here as you `pop' twice in the body
when you can iterate that.

Also my-keywords ... that name, also how it mixes two things,
plus insists on a certain order without enforcing it.

Ever heard that once you pop you can't stop? That's what's
going to happen, I'm afraid.

> `dolist' and `dotimes', or cl-loop, I will never use in
> Emacs Lisp. I may use it in Common Lisp.

Sorry, but your boycott notwithstanding, they are still Elisp
functions, so actually you can't use them in CL :P

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 15:36               ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 19:47                 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 20:41                   ` Jean Louis
  2021-05-05 20:47                   ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-05 20:11                 ` Jean Louis
  1 sibling, 2 replies; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 19:47 UTC (permalink / raw)
  To: help-gnu-emacs

For example:

(require 'cl)

(cl-loop for (x y) in '((1 2) (3 4) (5 6))
         do (message "%d + %d = %d" x y (+ x y)) )

1 + 2 = 3
3 + 4 = 7
5 + 6 = 11

Note that cl is an Elisp implementation of Lisp that is
associated with CL, but that doesn't make it CL - it is still
Emacs Lisp.

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 15:36               ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 19:47                 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 20:11                 ` Jean Louis
  2021-05-05 20:38                   ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 35+ messages in thread
From: Jean Louis @ 2021-05-05 20:11 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-05 18:47]:
> >> Anyway found lots of small mistakes that I corrected. I run
> >> it on all my blog post pages - and this article by far
> >> scored the highest, 79%
> >> 
> >>   https://dataswamp.org/~incal/blog/box-10/marco-antonio-barrera.html
> >
> > Scored for which term?
> 
> Overall score.

Overall score of how, what? Where?

> >>>   (let ((my-keywords '("TODO" hi-yellow
> >>> 		       "DONE" hi-green
> >>> 		       "URGENT" hi-red-b)))
> >>>     (while my-keywords
> >>>       (let ((keyword (pop my-keywords))
> >>> 	    (highlight (pop my-keywords)))
> >>> 	(highlight-regexp keyword highlight)))))
> >> 
> >> Hahaha, creative! :)
> >> 
> >> But go get yourself a proper loop, will you :)
> >
> > For me, proper loops in Emacs Lisp are `while' and mapping
> > functions. It gives me more clarity due to old habbits.
> 
> `while' is proper but not here as you `pop' twice in the body
> when you can iterate that.

I like popping.

I don't know why would the word "iterate" not relate to `while' here.

Show me how would you iterate on the above function.

When there are 2 elements to take out of the list and do something
with it, I like to pop it twice. Very handy, and why not.

Imagine if there are 3... popping thrice is so much easier than
thinking of what... I have no idea.

> Also my-keywords ... that name, also how it mixes two things,
> plus insists on a certain order without enforcing it.

You give me too much thinking here, more than it was necessary for the
function to work.

> Ever heard that once you pop you can't stop? That's what's going to
> happen, I'm afraid.

Since I have started changing `dolist' to `while' that is what
happened, there is often pop.

> > `dolist' and `dotimes', or cl-loop, I will never use in
> > Emacs Lisp. I may use it in Common Lisp.
> 
> Sorry, but your boycott notwithstanding, they are still Elisp
> functions, so actually you can't use them in CL :P

Maybe I am just bored. `while' loops seem to me easier
understandable, visible. Times change.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-05 20:11                 ` Jean Louis
@ 2021-05-05 20:38                   ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 20:54                     ` Jean Louis
  0 siblings, 1 reply; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 20:38 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>>>> Anyway found lots of small mistakes that I corrected. I run
>>>> it on all my blog post pages - and this article by far
>>>> scored the highest, 79%
>>>> 
>>>>   https://dataswamp.org/~incal/blog/box-10/marco-antonio-barrera.html
>>>
>>> Scored for which term?
>> 
>> Overall score.
>
> Overall score of how, what? Where?

When I applied the Android app "SEO Check" to the all the pages
and fixed everything it suggested - and the suggestions were
very good, not just classic SEO stuff (see previous posts).
Also, the app is awesome, organized, fast, good interface, no
ads or disruptive elements, none of the bad stuff we associate
with smartphone apps...

Try it, and see if you can beat my 79% :)

This also score 79% now BTW:

  https://dataswamp.org/~incal/blog/tree-house/tree-house-rooftop.html

And again I agree with the tool! Probably the best one!

> I like popping. I don't know why would the word "iterate"
> not relate to `while' here.

If you iterate the material naturally with a loop that fits
the purpose you don't have to pop. It is a poor man's way of
doing it.

> Show me how would you iterate on the above function.

See other my other post.

> When there are 2 elements to take out of the list and do
> something with it, I like to pop it twice. Very handy, and
> why not.

If you use the right loop it does that for you.

> Since I have started changing `dolist' to `while' that is what
> happened, there is often pop.

That's right, since `while' doesn't act on the material, you
have to do it explicitly instead.

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 19:47                 ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 20:41                   ` Jean Louis
  2021-05-05 20:58                     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 20:47                   ` Stefan Monnier via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 35+ messages in thread
From: Jean Louis @ 2021-05-05 20:41 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-05 22:48]:
> For example:
> 
> (require 'cl)
> 
> (cl-loop for (x y) in '((1 2) (3 4) (5 6))
>          do (message "%d + %d = %d" x y (+ x y)) )
> 
> 1 + 2 = 3
> 3 + 4 = 7
> 5 + 6 = 11

Sure. If I look in my Common Lisp directory, I have 94 occurences
of `loop' there. Various complex things. But I try not to over
load things.

The `cl' library is now in "obsolete" directory and function
`cl-loop' is not obsolete. So I guess maybe you will not need
`require', it should work, it is now in `cl-macs.el'
file. Package describes it as extensions to Emacs Lisp for
compatibility reasons.

Same with `while':

(let ((list '((1 2) (3 4) (5 6))))
  (while list
    (let* ((pair (pop list))
	   (x (car pair))
	   (y (cadr pair)))
      (message "%d + %d = %d" x y (+ x y)))))

I would like above rather than this one below, as I don't seek CL
compatibility:

(cl-loop for (x y) in '((1 2) (3 4) (5 6))
         do (message "%d + %d = %d" x y (+ x y)))

Or with `mapc':

(mapc (lambda (pair)
	(let ((x (car pair))
	      (y (cadr pair)))
	  (message "%d + %d = %d" x y (+ x y))))
      '((1 2) (3 4) (5 6)))

And then benchmark:

(benchmark 100000000
	   (let ((list '((1 2) (3 4) (5 6))))
	     (while list
	       (let* ((pair (pop list))
		      (x (car pair))
		      (y (cadr pair)))
		 (message "%d + %d = %d" x y (+ x y)))))) ⇒ "Elapsed time: 5.520809s"

(benchmark 100000000
	   (cl-loop for (x y) in '((1 2) (3 4) (5 6))
		    do (message "%d + %d = %d" x y (+ x y)))) ⇒ "Elapsed time: 5.784922s"

(benchmark 100000000
	   (let ()
	     (mapc (lambda (pair)
		     (let ((x (car pair))
			   (y (cadr pair)))
		       (message "%d + %d = %d" x y (+ x y))))
		   '((1 2) (3 4) (5 6)))
	     nil)) ⇒ "Elapsed time: 5.158536s"

I thint that benchmark says nothing much, the tests are vague and
they are about as fast. `while' is probably slowest.

`while' is giving me more clarity.

Yet your example still did not replace this function below, there
are no list of lists inside:

(defun outline-highlight-keywords ()
  (interactive)
  (let ((my-keywords '("TODO" hi-yellow
		       "DONE" hi-green
		       "URGENT" hi-red-b)))
    (while my-keywords
      (let ((keyword (pop my-keywords))
	    (highlight (pop my-keywords)))
	(highlight-regexp keyword highlight)))))

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-05 19:47                 ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 20:41                   ` Jean Louis
@ 2021-05-05 20:47                   ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-05 21:02                     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 21:11                     ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 2 replies; 35+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2021-05-05 20:47 UTC (permalink / raw)
  To: help-gnu-emacs

> (require 'cl)
> (cl-loop for (x y) in '((1 2) (3 4) (5 6))
>          do (message "%d + %d = %d" x y (+ x y)) )

(require 'cl) provides `loop`.
If you want `cl-loop`, then you need (require 'cl-lib).
Same functionality, different names.


        Stefan




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

* Re: Org to Markdown programmatically
  2021-05-05 20:38                   ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 20:54                     ` Jean Louis
  2021-05-05 21:07                       ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 35+ messages in thread
From: Jean Louis @ 2021-05-05 20:54 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-05 23:40]:
> When I applied the Android app "SEO Check" to the all the pages
> and fixed everything it suggested - and the suggestions were
> very good, not just classic SEO stuff (see previous posts).
> Also, the app is awesome, organized, fast, good interface, no
> ads or disruptive elements, none of the bad stuff we associate
> with smartphone apps...

I get it.

> Try it, and see if you can beat my 79% :)

Neither I use Google, nor proprietary software. Sorry.

On initially Android phones, I have them all replaced with either
Replicant or LineageOS. One Android device remains, it uses Aurora
Store (anonymous Google Play Store).

40 MB of unknown code from Germany to load on my phone? Ah, no. Though
I like Germany most, it is where I am, but I am not...

And they will not guarantee me any sales.

SEO is old fashioned in terms of money. Today what counts are
marketing methods. People without personal website and SEO can make
thousands and millions just by using good marketing methods. Funnel
marketing is what counts. It is cheaper than focusing on websites.

> This also score 79% now BTW:

I think that proprietary vendor you mention is using your data to sell
their application. If they would really know SEO, they would not sell
SEO tools. How many times I found that. If somebody is really skilled
in SEO as to bring specific sites on top, then why don't they make
millions? It is self-defeating advertising. SEO is myth and too much
of it, as of today, spoils Internet and makes negative
effects. Writing normal text withot exaggeration to put attention on
search engines is what counts more today.

> > I like popping. I don't know why would the word "iterate"
> > not relate to `while' here.
> 
> If you iterate the material naturally with a loop that fits
> the purpose you don't have to poop. It is a poor man's way of
> doing it.

Poop?

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-05 20:41                   ` Jean Louis
@ 2021-05-05 20:58                     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 21:14                       ` Jean Louis
  0 siblings, 1 reply; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 20:58 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

> Same with `while':
>
> (let ((list '((1 2) (3 4) (5 6))))
>   (while list
>     (let* ((pair (pop list))
> 	   (x (car pair))
> 	   (y (cadr pair)))
>       (message "%d + %d = %d" x y (+ x y)))))

Yes, it has the same issue I describe.

> Or with `mapc':
>
> (mapc (lambda (pair)
> 	(let ((x (car pair))
> 	      (y (cadr pair)))
> 	  (message "%d + %d = %d" x y (+ x y))))
>       '((1 2) (3 4) (5 6)))

Same.

> And then benchmark

Well, not an issue here. We don't ever want to write ugly,
error-prone code with the argument it'll run faster.
Which often it doesn't, either. Instead and more importantly
debug, devel, maintain and extend time, _our_ time, will grow
exponentially with every poorly written module we add.

> `while' is giving me more clarity.

When you grow custom to other, better methods they are
actually much clearer to you, and everyone else.

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 20:47                   ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2021-05-05 21:02                     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 21:11                     ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 21:02 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier via Users list for the GNU Emacs text editor wrote:

>> (require 'cl)
>> (cl-loop for (x y) in '((1 2) (3 4) (5 6))
>>          do (message "%d + %d = %d" x y (+ x y)) )
>
> (require 'cl) provides `loop`.
> If you want `cl-loop`, then you need (require 'cl-lib).
> Same functionality, different names.

OK, confusing, how did that happen?

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 20:54                     ` Jean Louis
@ 2021-05-05 21:07                       ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 21:33                         ` Jean Louis
  0 siblings, 1 reply; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 21:07 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

> SEO is old fashioned in terms of money. Today what counts
> are marketing methods. People without personal website and
> SEO can make thousands and millions just by using good
> marketing methods. Funnel marketing is what counts. It is
> cheaper than focusing on websites.

I was referring to the technology aspects of homepages, HTML,
CSS, the information/layout aspects, properties of text, and
so on.

True, you don't get rich by doing what I'm doing so rather do
the opposite if money is your goal, I'd say...

> SEO is myth [...]

Call it whatever you want, that app is great and can teach you
a lot about technology, I know.

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 20:47                   ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-05 21:02                     ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 21:11                     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 21:46                       ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-05 21:50                       ` Jean Louis
  1 sibling, 2 replies; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 21:11 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier via Users list for the GNU Emacs text editor wrote:

>> (require 'cl)
>> (cl-loop for (x y) in '((1 2) (3 4) (5 6))
>>          do (message "%d + %d = %d" x y (+ x y)) )
>
> (require 'cl) provides `loop`.
> If you want `cl-loop`, then you need (require 'cl-lib).
> Same functionality, different names.

And, what should you use?

I have the cl- prefix 117 times in my Elisp!

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 20:58                     ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 21:14                       ` Jean Louis
  0 siblings, 0 replies; 35+ messages in thread
From: Jean Louis @ 2021-05-05 21:14 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-05 23:58]:
> > `while' is giving me more clarity.
> 
> When you grow custom to other, better methods they are
> actually much clearer to you, and everyone else.

Phenomena is that that my subjective viewpoint changed. I did not know
Emacs Lisp, I knew only Common Lisp and used all kinds of loops. And
now it changed. 

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-05 21:07                       ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 21:33                         ` Jean Louis
  2021-05-05 21:42                           ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 35+ messages in thread
From: Jean Louis @ 2021-05-05 21:33 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-06 00:11]:
> Jean Louis wrote:
> 
> > SEO is old fashioned in terms of money. Today what counts
> > are marketing methods. People without personal website and
> > SEO can make thousands and millions just by using good
> > marketing methods. Funnel marketing is what counts. It is
> > cheaper than focusing on websites.
> 
> I was referring to the technology aspects of homepages, HTML,
> CSS, the information/layout aspects, properties of text, and
> so on.

I actually got the idea that it is so, I just did not mention it.

> > SEO is myth [...]
> 
> Call it whatever you want, that app is great and can teach you
> a lot about technology, I know.

Sorry, cannot install proprietary app...

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-05 21:33                         ` Jean Louis
@ 2021-05-05 21:42                           ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 22:51                             ` Jean Louis
  0 siblings, 1 reply; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 21:42 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>>> SEO is old fashioned in terms of money. Today what counts
>>> are marketing methods. People without personal website and
>>> SEO can make thousands and millions just by using good
>>> marketing methods. Funnel marketing is what counts. It is
>>> cheaper than focusing on websites.
>> 
>> I was referring to the technology aspects of homepages,
>> HTML, CSS, the information/layout aspects, properties of
>> text, and so on.
>
> I actually got the idea that it is so, I just did not mention it.

?

>>> SEO is myth [...]
>> 
>> Call it whatever you want, that app is great and can teach
>> you a lot about technology, I know.
>
> Sorry, cannot install proprietary app...

I have no idea, maybe there is FOSS in the Debian repos that
do that kinda things?

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 21:11                     ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 21:46                       ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-05 22:03                         ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 23:38                         ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 21:50                       ` Jean Louis
  1 sibling, 2 replies; 35+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2021-05-05 21:46 UTC (permalink / raw)
  To: help-gnu-emacs

> And, what should you use?

% grep "'cl'" etc/NEWS*
etc/NEWS.27:** The 'cl' package is now officially deprecated in favor of 'cl-lib'.
%

        Stefan




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

* Re: Org to Markdown programmatically
  2021-05-05 21:11                     ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 21:46                       ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2021-05-05 21:50                       ` Jean Louis
  2021-05-05 21:56                         ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 35+ messages in thread
From: Jean Louis @ 2021-05-05 21:50 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-06 00:37]:
> Stefan Monnier via Users list for the GNU Emacs text editor wrote:
> 
> >> (require 'cl)
> >> (cl-loop for (x y) in '((1 2) (3 4) (5 6))
> >>          do (message "%d + %d = %d" x y (+ x y)) )
> >
> > (require 'cl) provides `loop`.
> > If you want `cl-loop`, then you need (require 'cl-lib).
> > Same functionality, different names.
> 
> And, what should you use?
> 
> I have the cl- prefix 117 times in my Elisp!

66 here

No, I don't like cl- prefix in Emacs Lisp, somehow is not nice.

By the way, it was mostly for `cl-pushnew'.



-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-05 21:50                       ` Jean Louis
@ 2021-05-05 21:56                         ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 22:56                           ` Jean Louis
  0 siblings, 1 reply; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 21:56 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>> I have the cl- prefix 117 times in my Elisp!
>
> 66 here [...] it was mostly for `cl-pushnew'

:)

Sounds like you alright...

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 21:46                       ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2021-05-05 22:03                         ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 23:38                         ` Emanuel Berg via Users list for the GNU Emacs text editor
  1 sibling, 0 replies; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 22:03 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier via Users list for the GNU Emacs text editor wrote:

>> And, what should you use?
>
> % grep "'cl'" etc/NEWS*
> etc/NEWS.27:** The 'cl' package is now officially deprecated
> in favor of 'cl-lib'.
> %

King

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 21:42                           ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 22:51                             ` Jean Louis
  2021-05-05 23:05                               ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 35+ messages in thread
From: Jean Louis @ 2021-05-05 22:51 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-06 00:58]:
> I have no idea, maybe there is FOSS in the Debian repos that
> do that kinda things?

Not that I need it, not today. I just use my system, knowledge, W3.org
information, and sales and marketing knowledge. 

If I want long term income, websites are working well, people are
coming. It is good placing hyperlinks everywhere. Activities beyond
SEO and WWW can bring more and quicker money, like for example
physical posters in places where is target audience. Pay for new
leads when necessary, it works well.

The recent `rcd-template-eval' function helps in sales, as it is much
easier to write text that intepolates pieces of smaller information,
then writing programming code that yields with text.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-05 21:56                         ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 22:56                           ` Jean Louis
  2021-05-05 23:10                             ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 35+ messages in thread
From: Jean Louis @ 2021-05-05 22:56 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-06 01:01]:
> Jean Louis wrote:
> 
> >> I have the cl- prefix 117 times in my Elisp!
> >
> > 66 here [...] it was mostly for `cl-pushnew'
> 
> :)
> 
> Sounds like you alright...

I will remove all `cl-' prefixes as I don't like them, even if I need
to use aliases. This is not recommendation for programmers, it is so
personal preference.

(defalias 'cl-push 'newpush) -- why not...

I can even think of writing Lisp that may interpolate functions in
something totally different.

(⟦ cl-pushnew ⟧ "value" list) could then interpolate to anything:

(cl-pushnew "value" list) but also:

(new-thrust "value" list) or

(force-inside "value" list) or

(schieben-Sie-es-neu "value" list)

varför inte?

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-05 22:51                             ` Jean Louis
@ 2021-05-05 23:05                               ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-06  3:46                                 ` Jean Louis
  0 siblings, 1 reply; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 23:05 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

>> I have no idea, maybe there is FOSS in the Debian repos
>> that do that kinda things?
>
> Not that I need it, not today. I just use my system,
> knowledge, W3.org information, and sales and
> marketing knowledge.
>
> If I want long term income, websites are working well,
> people are coming. It is good placing hyperlinks everywhere.
> Activities beyond SEO and WWW can bring more and quicker
> money, like for example physical posters in places where is
> target audience. Pay for new leads when necessary, it
> works well.

OK, well glad to hear it, whatever it is you do. But, since
you seem to know your way around the economy so well, maybe
you can help me out, I want to get this book [1] published,
I wrote it in Emacs, did the LaTeX, all done. I also want to
write a book about this project [2] After that I'd like a job
where all my talents [3] come into play and I can do amazing
things, helping humanity all day long and earn the big bucks
while doing it... Got any pointers?

[1] https://dataswamp.org/~incal/borta/borta.pdf

[2] https://dataswamp.org/~incal/blog/index.html
    https://dataswamp.org/~incal/ut/ut.png
    (or https://dataswamp.org/~incal/ut/ut.webp )

[3] https://dataswamp.org/~incal/about/cv/cv.txt
    https://dataswamp.org/~incal

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 22:56                           ` Jean Louis
@ 2021-05-05 23:10                             ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 23:10 UTC (permalink / raw)
  To: help-gnu-emacs

Jean Louis wrote:

> I can even think of writing Lisp that may interpolate
> functions in something totally different.
>
> (⟦ cl-pushnew ⟧ "value" list) could then interpolate to anything:

if anything can start anew
then everything must continue

> (cl-pushnew "value" list) but also:
>
> (new-thrust "value" list) or
>
> (force-inside "value" list) or
>
> (schieben-Sie-es-neu "value" list)
>
> varför inte?

do it today
in a different way

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 21:46                       ` Stefan Monnier via Users list for the GNU Emacs text editor
  2021-05-05 22:03                         ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 23:38                         ` Emanuel Berg via Users list for the GNU Emacs text editor
  2021-05-05 23:54                           ` Stefan Monnier via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 35+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-05-05 23:38 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier via Users list for the GNU Emacs text editor wrote:

> % grep "'cl'" etc/NEWS*
> etc/NEWS.27:** The 'cl' package is now officially deprecated
> in favor of 'cl-lib'.

But... isn't this the same old stuff?

Don't require specific cl-*, use cl-lib?

I have 31 (require 'cl-lib) ...

and _zero_ (require 'cl)

so I guess I was able to foresee this cataclysmic shift :)

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Org to Markdown programmatically
  2021-05-05 23:38                         ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-05 23:54                           ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 35+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2021-05-05 23:54 UTC (permalink / raw)
  To: help-gnu-emacs

>> % grep "'cl'" etc/NEWS*
>> etc/NEWS.27:** The 'cl' package is now officially deprecated
>> in favor of 'cl-lib'.
>
> But... isn't this the same old stuff?
> Don't require specific cl-*, use cl-lib?

Yup.

> I have 31 (require 'cl-lib) ...
> and _zero_ (require 'cl)

Great.

> so I guess I was able to foresee this cataclysmic shift :)

Congratulations,


        Stefan




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

* Re: Org to Markdown programmatically
  2021-05-05 23:05                               ` Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-05-06  3:46                                 ` Jean Louis
  0 siblings, 0 replies; 35+ messages in thread
From: Jean Louis @ 2021-05-06  3:46 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> [2021-05-06 02:06]:
> OK, well glad to hear it, whatever it is you do. But, since
> you seem to know your way around the economy so well, maybe
> you can help me out, I want to get this book [1] published,
> I wrote it in Emacs, did the LaTeX, all done. I also want to
> write a book about this project [2] After that I'd like a job
> where all my talents [3] come into play and I can do amazing
> things, helping humanity all day long and earn the big bucks
> while doing it... Got any pointers?
> 
> [1] https://dataswamp.org/~incal/borta/borta.pdf

Oh yes, I was working in publishing company in Denmark. Some of my
friends in Germany self-publish all the time and make money on 1000 -
5000 copies only. One friend was handling very specific subjects, such
as pictures and stories of a local town. That sells for sure, long
term. Your book would need to be distributed to climbers or similar
groups. 

1. Obtain ISBN number:
   https://www.kb.se/in-english/about-us/swedish-isbn-agency.html
   https://www.slu.se/en/subweb/library/publish-and-analyse/register-and-publish/isbn/

2. Self-publish, invest some 1000 Euro, and make several copies. Start
   is not hard

3. Start making book reviews in local libraries, not forgetting to
   mention Emacs and free software

4. Use THIS book to make money:
   https://archive.org/details/selfpublishingma00poyn_0
 
   Self-publishing brings constant income over time.

TIP: User high quality, better pictures.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/




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

* Re: Org to Markdown programmatically
  2021-05-04 10:09   ` Colin Baxter
  2021-05-04 17:29     ` Jean Louis
@ 2021-05-22  8:26     ` Jean Louis
  1 sibling, 0 replies; 35+ messages in thread
From: Jean Louis @ 2021-05-22  8:26 UTC (permalink / raw)
  To: Colin Baxter; +Cc: help-gnu-emacs

* Colin Baxter <m43cap@yandex.com> [2021-05-04 13:24]:
> >>>>> Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> writes:
> 
>     > Jean Louis wrote:
>     >> As I am editing database strings, not files, I have to export
>     >> programmatically Org blobs into HTML.
> 
>     > See if pandoc can do this...
> 
> It can:
> 
> pandoc -o file.md file.org <RET>

Thanks. That would maybe export .org to Markdown. I have never tried
it and don't have intention as pandoc is not Emacs and cannot possibly
support full Org mode.

Database has its tables, that have columns with values. I am editing
column values with Emacs, but I could choose that Emacs invoke
external editor for editing. 

When inside of Emacs, it is faster to convert .Org to to Markdown then
to invoke external pandoc.

But you know Org, it can be so complicated... pandoc handles only
simple things. And is huge software, requires Haskell, which is about
non-reproducible.

I use pandoc for highlighting in some Markdown outputs.

Here is one handy function that may help user to capture the
selected/marked region in a browser and convert it to Markdown file. 

(defun clipboard-to-markdown-file ()
  "This function helps to capture HTML from web pages into files
in Markdown format. You would need to mark the parts of the HTML
page within your browser such as Iceweasel or IceCat. Then you
run this function in Emacs Lisp. It uses `pandoc' and `xclip'
shell commands to write Markdown file. Finally it opens file for
editing."
  (interactive)
  (let* ((markdown-dir "/home/data1/protected/Documents/HTML-Markdown/")
	 (filename (concat markdown-dir (rcd-timestamp) ".md"))
	 (clipboard (xclip-primary-selection-html))
	 (markdown (command-stream "pandoc" clipboard "-r" "html" "-w" "commonmark")))
    (string-to-file-force markdown filename)
    (find-file filename)))



-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/



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

end of thread, other threads:[~2021-05-22  8:26 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-04  8:48 Org to Markdown programmatically Jean Louis
2021-05-04  9:04 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-04 10:09   ` Colin Baxter
2021-05-04 17:29     ` Jean Louis
2021-05-04 20:23       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05  6:56         ` Jean Louis
2021-05-05  7:20           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05  8:34             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 11:58             ` Jean Louis
2021-05-05 15:36               ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 19:47                 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 20:41                   ` Jean Louis
2021-05-05 20:58                     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 21:14                       ` Jean Louis
2021-05-05 20:47                   ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-05 21:02                     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 21:11                     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 21:46                       ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-05 22:03                         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 23:38                         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 23:54                           ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-05-05 21:50                       ` Jean Louis
2021-05-05 21:56                         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 22:56                           ` Jean Louis
2021-05-05 23:10                             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 20:11                 ` Jean Louis
2021-05-05 20:38                   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 20:54                     ` Jean Louis
2021-05-05 21:07                       ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 21:33                         ` Jean Louis
2021-05-05 21:42                           ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-05 22:51                             ` Jean Louis
2021-05-05 23:05                               ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-05-06  3:46                                 ` Jean Louis
2021-05-22  8:26     ` Jean Louis

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.