From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: How to rename files to numbers in Eshell? Date: Fri, 1 Oct 2021 00:42:31 +0300 Message-ID: References: <87tuirckxp.fsf@inka.de> <87ee9u2neh.fsf@inka.de> <87r1d6o9eb.fsf@inka.de> <875yuii4nk.fsf@inka.de> <87h7e2krgb.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7746"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0.7+183 (3d24855) (2021-05-28) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 30 23:46:08 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mW3sV-0001ih-Nl for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Sep 2021 23:46:07 +0200 Original-Received: from localhost ([::1]:35080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mW3sU-00006e-Do for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 30 Sep 2021 17:46:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW3s1-00006Q-FV for help-gnu-emacs@gnu.org; Thu, 30 Sep 2021 17:45:37 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:59709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mW3ry-0005oI-NO for help-gnu-emacs@gnu.org; Thu, 30 Sep 2021 17:45:37 -0400 Original-Received: from localhost ([::ffff:41.75.188.156]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000037E59.0000000061562FFB.000003CB; Thu, 30 Sep 2021 14:45:30 -0700 Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87h7e2krgb.fsf@zoho.eu> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133458 Archived-At: * Emanuel Berg via Users list for the GNU Emacs text editor [2021-09-30 18:48]: > Felix E. Klee wrote: > > >> Pipes may be replaced by buffers, capturing information in > >> a buffer and processing it thereafter. > > > > ... which makes it super slow > > But Jean is re-writing all his Bash to Elisp so he surely has > a lot of time :) Or maybe there is not much of Bash as my "Bash" scripts were mostly Common Lisp, Perl, etc. > No, seriously, Jean, while in general I absolutely cannot > understand this idea or see the benefits, I'm sure there are > many cases where a Lisp solution (Elisp solution from Emacs) > is as good or even better - so when you stumble upon those > cases in your translating efforts, by all means do show it > to us! I guess that is hard to believe as you are in Emacs Lisp mailing list, it is hard to believe you cannot understand the idea of using Emacs Lisp, you who has hundreds of Emacs Lisp scripts. Bash is different environment to Emacs, when person works in one environment then person tends to integrate missing peaces. Would I work in Racket, I would most probably rewrite it all to Racket. > Post the code here as you do, it is appreciated despite my > style issues with your code ... I care only if it works. Here are few examples that invoke `yad' dialog generator from Emacs. (defun call-process-to-string (program &optional infile display &rest args) (with-temp-buffer (apply #'call-process program infile t display args) (buffer-string))) (defun rcd-command-output-from-input (program input &rest args) "Return output string from PROGRAM with given INPUT string and optional ARGS." (let* ((output (with-temp-buffer (insert input) (apply #'call-process-region nil nil program t t nil args) (buffer-string)))) output)) ;;;; ↝ YAD DIALOGS (defun yad-command (&rest args) (apply 'call-process "yad" nil nil nil args)) (defun yad-calendar-date () (string-trim (call-process-to-string "yad" nil nil "--calendar" "--center" "--date-format=%Y-%m-%d"))) (defun yad-text (title text body &optional center no-buttons text-align width height) "TEXT-ALIGN can be left, center, right and full." (let* ((center (when center "--center")) (text-align (when text-align text-align)) (no-buttons (when no-buttons "--no-buttons")) (width (when width (format "--width=%s" width))) (height (when height (format "--height=%s" height))) (list (delq nil (list center text-align no-buttons width height)))) (apply 'rcd-command-output-from-input "yad" body "--text-info" "--title" title "--text" text "--fontname=DejaVu 18" list))) -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/