From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.devel Subject: Re: how to speed up Lisp devel time Date: Sat, 10 Aug 2024 09:22:26 +0200 Message-ID: <87wmkozvt9.fsf@dataswamp.org> References: <87y156413v.fsf@dataswamp.org> <86sevekvjy.fsf@gnu.org> <87v80a402y.fsf@dataswamp.org> <86ikwakmdg.fsf@gnu.org> <87frre3pxa.fsf@dataswamp.org> <86ed6xlx9r.fsf@gnu.org> <87a5hl4x9b.fsf@dataswamp.org> <86bk21lp53.fsf@gnu.org> <871q2x4ra3.fsf@dataswamp.org> <87h6bt15vx.fsf@dataswamp.org> <87zfpkzz9b.fsf@dataswamp.org> 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="30393"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:BX5pLIyGDYac71i/Kxf7bLlGWfo= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 10 09:35:16 2024 Return-path: Envelope-to: ged-emacs-devel@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 1scgdA-0007l5-EJ for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Aug 2024 09:35:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1scgcH-0005zS-8G; Sat, 10 Aug 2024 03:34:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scgQx-00050i-U7 for emacs-devel@gnu.org; Sat, 10 Aug 2024 03:22:39 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scgQv-00077h-Rc for emacs-devel@gnu.org; Sat, 10 Aug 2024 03:22:39 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1scgQr-0006BW-Og for emacs-devel@gnu.org; Sat, 10 Aug 2024 09:22:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io 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, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 10 Aug 2024 03:34:18 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322613 Archived-At: Yuri Khan wrote: > I do not necessarily want them on the same line. > Depending on how often or rarely I use that command, I might > want labels reminding me what each argument is for. You got: same line, with labels. ;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/iihf.el (require 'cl-lib) ;; [ ;; end :d 73 :r 0< :pa mxd od ;; step :d end/10 :r 0< :r 2-10 c ;; i :d 0 :r 0<= ;; ] (defun input-args (&optional num-str) (interactive) (let* (( end-def 73) (step-def (max 10 (min 2 (/ end-def 10)))) ( i-def 0) (def (list end-def step-def i-def)) (def-str (format "%s %s %s" (nth 0 def) (nth 1 def) (nth 2 def))) (str (or num-str (read-string (format "1-3 numbers [RET %s]: " def-str) nil nil def-str))) (spl (split-string str " ")) (res (cl-mapcar (lambda (a) (string-to-number a)) spl)) (all `(,@res ,@(cl-subseq def (length res)))) (end (nth 0 all)) (step (nth 1 all)) ( i (nth 2 all))) (unless (and (< 0 end) (< 0 step) (<= 0 i)) (error "DNC")) (let ((min 2) (max 10)) (setq step (cond ( (< step min) min ) ( (< max step) max ) ( step ))) (list end step i)))) ;; (input-args) RET ; 73 10 0 ;; (input-args) 73 100 RET ; 73 10 0 ;; (input-args) 73 1 RET ; 73 2 0 ;; (input-args) 55 RET ; 55 10 0 ;; (input-args "1 2 3") ; 1 2 3 ;; (input-args "1 2") ; 1 2 0 ;; (input-args "1") ; 1 10 0 ;; (input-args "-1") ; DNC ;; (input-args "1 -1") ; DNC ;; (input-args "1 1 0") ; 1 2 0 ;; (input-args "1 1 -1") ; DNC (provide 'iihf) > Do a query-replace. Then invoke it again and press M-p. > The last search string and replacement string are recalled > to the prompt at the same time, separated with an intangible > arrow label. Yes, I see. I am good at → it :) >> That is, of course, possible. What information would you >> like outputted, and how, for three integers with default >> values and some tests to validate? > > If defaults are reasonable and I rarely need to stray from > them (alternatively, if the last used value gets saved in > history and automatically reused), I would like not to enter > them at all, and not even a RET to acknowledge the default. > When I do need to change them, I'd see that option at the > transient screen, type the corresponding key and type the > new value, and press RET. At that point, validation can be > performed, as long as C-g returns me to the transient with > the value reverted to its previous valid value (rather than > canceling the whole command). > > Have you used Magit? Do a diff or log, see all the options > they offer. I'm not familiar with transient and Magit, but default values and validation are all solved above. But do tell exactly what interface you like, after you try it. -- underground experts united https://dataswamp.org/~incal