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:51:39 +0200 Message-ID: <87sevczugk.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> <87wmkozvt9.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2348"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:01V57K0PZzVXV+4vk7sMmDgl0dI= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 10 10:11:36 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 1schCK-0000Qi-1C for ged-emacs-devel@m.gmane-mx.org; Sat, 10 Aug 2024 10:11:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1schBk-0002AF-S3; Sat, 10 Aug 2024 04:11:00 -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 1scgtE-000895-4K for emacs-devel@gnu.org; Sat, 10 Aug 2024 03:51:52 -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 1scgtB-0001uo-AG for emacs-devel@gnu.org; Sat, 10 Aug 2024 03:51:51 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1scgt8-00023R-7r for emacs-devel@gnu.org; Sat, 10 Aug 2024 09:51:46 +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 04:10:57 -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:322614 Archived-At: >> 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. There, at least we solved the problem for my function, now with an interface setup of 1079 chars :) Usually it isn't that hard to go from hard-coded individual case to the general case, well, it isn't as hard as one thinks anyway. Good, because this time - I think it's gonna be pretty hard :) Zzz ;;; -*- 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 do-ps end step i) (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)) (num-str (format "%s %s %s" (or end end-def) (or step step-def) (or i i-def))) (def-str (format "%s %s %s" (nth 0 def) (nth 1 def) (nth 2 def))) (str (if do-ps (read-string (format "end step i [RET %s]: " def-str) nil nil def-str) num-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 t) RET ; 73 10 0 ;; (input-args t) 73 100 RET ; 73 10 0 ;; (input-args t) 73 1 RET ; 73 2 0 ;; (input-args t) 55 RET ; 55 10 0 ;; (input-args nil 1 2 3) ; 1 2 3 ;; (input-args nil 1 2) ; 1 2 0 ;; (input-args nil 1) ; 1 10 0 ;; (input-args nil -1) ; DNC ;; (input-args nil 1 -1) ; DNC ;; (input-args nil 1 1 -1) ; DNC ;; (input-args nil 1 1 0) ; 1 2 0 (provide 'iihf) -- underground experts united https://dataswamp.org/~incal