From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Handling defaults values for both interactive and non-interactive use Date: Tue, 10 Sep 2024 17:29:44 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38801"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 10 19:30:34 2024 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 1so4hF-0009tb-OW for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 10 Sep 2024 19:30:33 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so4gh-0001vx-Az; Tue, 10 Sep 2024 13:29:59 -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 1so4gc-0001kb-UH for help-gnu-emacs@gnu.org; Tue, 10 Sep 2024 13:29:54 -0400 Original-Received: from mail-40137.protonmail.ch ([185.70.40.137]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1so4gb-0003jn-0J for help-gnu-emacs@gnu.org; Tue, 10 Sep 2024 13:29:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1725989389; x=1726248589; bh=8A3inmaomEdKEDcLv9wtMMeSl9knrDTLsdr+9gLgU9c=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=mR26EEB7GY1SP6Sim1CJzFGGmxjjiymr+O3etR6ltwMFfyywABTaUTsYHSSIbVuhq 6Smh7LGK7w3MRnXEWNehNbYGA3bAFGlyEVW+0/twWxF5IGjKKhV1cKUwdznfVFgTA3 6eeHXJzySKu5RRGDkn8LyIeFSZXEuMWR4JFiul96YFxUSF8b4zSbHnci2KjbpJip+8 d+SvhdhxEJdUjJNiglST1x4tKbZyYcyGQGfo0rMzlPxuTtxMsl8DMoCIU8TIgqKce4 0j4+eDPhkzKyYXhyVto1sod79mI+SeidX/Erkt5QYSv3NfoLHpEh/zlPwZep7nE/qN GVyYjWelOCJ0A== In-Reply-To: Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 703dff158ceaaade1d75b8eb37cd28f2861ea567 Received-SPF: pass client-ip=185.70.40.137; envelope-from=heimeborgia@protonmail.com; helo=mail-40137.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TO_EQ_FM_DIRECT_MX=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147948 Archived-At: Sent with Proton Mail secure email. On Tuesday, September 10th, 2024 at 3:37 PM, Heime wrote: > How is one to handle setting defaults for both interactive > and non-interactive use, properly ? >=20 > (defun xiakos-context (search-text &optional n bfrn) >=20 > (setq n (or n 8)) > (setq bfrn (or bfrn "Context")) >=20 > (interactive > (list > (read-string " Search Text: ") > (read-number " Number of Context Lines: ") > (read-string " Buffer Name: "))) >=20 > (if (string-match-p "^\\s-*$" bfrn) "Context") Would one handle the default non-interactive and default interactive separately ? Or does one handle the defaults=20 after having parsed the non-interactive or the interactive=20 part ? In summary, would the default values be handled=20 after the interactive clause ? Or does one set the default for the interactive part inside the interactive clause ?