From: Jean Louis <bugs@gnu.support>
To: Arthur Miller <arthur.miller@live.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Maybe we can improve this function call-process-to-string?
Date: Thu, 8 Apr 2021 21:32:20 +0300 [thread overview]
Message-ID: <YG9MNMWyXMhQooJT@protected.localdomain> (raw)
In-Reply-To: <AM9PR09MB4977F5191AC267DC38A3C43896749@AM9PR09MB4977.eurprd09.prod.outlook.com>
* Arthur Miller <arthur.miller@live.com> [2021-04-08 20:21]:
> I would also not use a string for the final result(s), just do everyting
> in that buffer, remove text you don't need and construct your link(s) in
> that buffer, it will probably be faster than creating temp buffer and
> taking buffer strings.
Thank you Arthur, just that I need it in programmed way. I don't
construct links myself interactively, I may interactively select files
in Dired, then functions do the rest and construct links.
Of course if I wish to inject some output from a system command
interactively, I have it built in into my fingers.
C-u M-! and there it goes. I need to reconstruct how to write that
command, as it is just built in the body.
Those needs are integrated, for example selecting bunch of directories
in Dired, and letting functions traverse and construct Markdown WWW
links or other WWW links, transferring it as a reference to somebody
or into the database or into the page.
> > (push (shell-command-to-string command) list)))
> > (kill-new (with-temp-buffer
> > (dolist (item list)
> > (insert item))
> > (buffer-string)))))
>
> It is really inneficient to push result form the command to a list to
> traverse it later and insert into buffer, when Emacs does that already
> for you by default.
I would like to agree, but don't understand it. I don't like
dolist/dotimes any more, so I am replacing it with `while' here
below. There is still pushing into the list.
How would I do it by default?
(defun md-image-hyperlink ()
(interactive)
(let ((files (dired-get-marked-files))
(list '()))
(while files
(let* ((file (pop files))
(small-image (public-html-rest file))
(large-image (replace-regexp-in-string "/320/\\|/400/\\|/640/\\|/800/" "/1536/" small-image))
(command (format "identify -format '[![%s](%s =%%wx%%h \"%s\")](%s \"%s\")' '%s'" small-image small-image small-image large-image large-image file)))
;; (message "%s" command)
(push (shell-command-to-string command) list)))
(kill-new (with-temp-buffer
(while list
(insert (pop list)))
(buffer-string)))))
> Your website looks very deceptive to me. I don't remember the name of
> that guy that used to post on this list for a while that was rude to
> you, but looking at your site now I understand what he ment. I have no
> idea who you are or what you do, but something tells me that is not an
> official GNU support site, isn't it?
There was no domain with support.gnu, so I took gnu.support
> Maybe you have all best intentions, but it looks shady, more akin to
> a scam page.
OK, did you get maybe some offer to buy? Did you have any relation
with the site? Lost something?
_ ___ _
| | / _ \| |
| | | | | | |
| |__| |_| | |___
|_____\___/|_____|
I really admire programmers, but sometimes I get stunned with
nonsensical illogical reasoning.
> Hopefully that form on the front page looks so ugly so nobody will
> fall for it
Do I really care? Does anybody care? Do I need to care?
> but if I would you and value GNU movement as much as you do, I would
> probably change that domain name and removed that from the web, as
> well as changed that email from "bugs@gnu.support" to something less
> deceptive, because it also looks shady to me.
Enjoy your impressions, I will rather watch SF.
> I am by no mean associated with GNU, more than being a mere user of
> GNU software, so I can only express my personal feeling when I saw
> it.
That is totally fine, thank you for sharing. Recommended reading:
https://nowandme.com/
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
Sign an open letter in support of Richard M. Stallman
https://rms-support-letter.github.io/
next prev parent reply other threads:[~2021-04-08 18:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 7:40 Maybe we can improve this function call-process-to-string? Jean Louis
2021-04-08 7:55 ` Eli Zaretskii
2021-04-08 11:53 ` Jean Louis
2021-04-08 13:39 ` Eli Zaretskii
2021-04-08 15:56 ` Jean Louis
2021-04-08 16:25 ` Eli Zaretskii
2021-04-08 18:17 ` Jean Louis
2021-04-08 18:36 ` Eli Zaretskii
2021-04-08 18:44 ` Jean Louis
2021-04-08 17:18 ` Arthur Miller
2021-04-08 18:32 ` Jean Louis [this message]
2021-04-08 19:41 ` Arthur Miller
2021-04-09 8:52 ` Jean Louis
2021-04-09 10:07 ` tomas
2021-04-08 13:08 ` Michael Albinus
2021-04-08 15:50 ` Jean Louis
2021-04-08 17:49 ` Stefan Monnier
2021-04-08 18:33 ` Jean Louis
2021-04-08 18:40 ` Jean Louis
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=YG9MNMWyXMhQooJT@protected.localdomain \
--to=bugs@gnu.support \
--cc=arthur.miller@live.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.