From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dr Rainer Woitok Newsgroups: gmane.emacs.help Subject: Re: (interactive) and &optional Date: Sat, 25 Mar 2023 13:05:14 +0100 Message-ID: <25630.58233.939785.855@woitok.gmail.com> References: <25628.42021.832534.376361@woitok.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="834"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help-Gnu-Emacs@Gnu.Org To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 25 13:06:05 2023 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 1pg2er-000AbI-5V for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 25 Mar 2023 13:06:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pg2eF-0001Zj-LW; Sat, 25 Mar 2023 08:05:27 -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 1pg2eB-0001Ys-R4 for Help-Gnu-Emacs@gnu.org; Sat, 25 Mar 2023 08:05:24 -0400 Original-Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pg2e6-00061t-Vr for Help-Gnu-Emacs@gnu.org; Sat, 25 Mar 2023 08:05:21 -0400 Original-Received: by mail-wm1-x32e.google.com with SMTP id l8-20020a05600c1d0800b003ef6708bbf6so333932wms.5 for ; Sat, 25 Mar 2023 05:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679745916; h=references:in-reply-to:subject:cc:to:message-id :content-transfer-encoding:mime-version:date:from:from:to:cc:subject :date:message-id:reply-to; bh=FzvRBXmy31YehtO9ljsyBOMmHw0AOBhQ0YxqCBo8hHE=; b=ahKoZhl4mbXEQWqXT0NDd5l1dUSQxN19n9SUMyhRVhhckjjo9WtyLYRCsHloGS5ZuH 1sITWqortW4xU+7j4TMrCpqUaI5S4AniPWO48KFJfkZH9Q7uvSZ+mr24Y3px78OgoBLk WGkTXwVGni1+SIciuxjAgdE6v/ZrgXBNH/cB1DyMFfexR98QZN/1vqIsLYjIkH041WSn UhtxEjOL/OWM6dCoA9Lqq1qnStkOm8KQNVkOdX7FDaBOBuRGHcvZeYEb/HfvYqJi8lJ3 ik5UgJueCTo1FpbRoLztO47Eyp0/emCS9LH71J2A1YDVXEWcQGXIBh7iLQQ9kg93YLtd rkXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679745916; h=references:in-reply-to:subject:cc:to:message-id :content-transfer-encoding:mime-version:date:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FzvRBXmy31YehtO9ljsyBOMmHw0AOBhQ0YxqCBo8hHE=; b=nAt3a5TDzZFQOudO5j711fjbG8yQfGJh2jmN8HN3GLWdI9vqPxrHezQgg20GMmOJLa 0ptdS1aWEWQvRkJ7zbFXCNupXaNI515zAdVflc9hThW6IN5mnIOkk9DpIdUkyvda+PTQ Il2qIteV5m1ooS8kGaiM4cFl//OBVVYbLJoxg9f+0M1yReH6B1LX+A4/EspZhPWCxeae SXNTj5EAglJvtPUQO1GtaWV7splfjGEZ4a2vrOfVLwJFcfNJ3caRac9kck1OiQwcfC+K undNW9AKF4JmxoovFRsxb/p35hb8+u6wXAlgSaHd9xmu3J6T4BZS2bKCm8E0dwWEBvOp GAow== X-Gm-Message-State: AO0yUKXGXFeJc/61ad8rS4w1OAmjoT/ZCLqnxP26GUCzCRtYeF95zECF QfeFfaCsGgKzPc5L6cNh8RYDE5TSDWM= X-Google-Smtp-Source: AK7set9wh9NvwmFj+EfCGNmvPQ5A3kX6KnJBFjV1wqooKgfbS13aAnRtnF8xtq2YLkVsLneZD+OUnA== X-Received: by 2002:a05:600c:214:b0:3ee:1084:aa79 with SMTP id 20-20020a05600c021400b003ee1084aa79mr3829609wmi.20.1679745916055; Sat, 25 Mar 2023 05:05:16 -0700 (PDT) Original-Received: from gmail.com (p200300df0703367dec9d611ecd73f259.dip0.t-ipconnect.de. [2003:df:703:367d:ec9d:611e:cd73:f259]) by smtp.gmail.com with ESMTPSA id t14-20020a05600c198e00b003ef66c89af0sm1205143wmq.0.2023.03.25.05.05.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Mar 2023 05:05:15 -0700 (PDT) X-Google-Original-From: Dr Rainer Woitok In-Reply-To: Msg of 2023-03-24 12:23:29 +0300 from bugs@gnu.support X-Mailer: VM 8.2.0b under 28.2 (x86_64-pc-linux-gnu) Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=rainer.woitok@gmail.com; helo=mail-wm1-x32e.google.com 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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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.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:143107 Archived-At: Jean, On Friday, 2023-03-24 12:23:29 +0300, you wrote: > ... > I do not like involving `interactive' at all, so I do the handling by > providing optional argument and telling function to check for it, or > ask for it. > > (defun search-something (&optional query) > "Search something by using QUERY." > (interactive) > (let* ((query (or query (read-from-minibuffer "Query: ")))) > (do-the-search query))) Correct me if I'm wrong, but doesn't this unconditionally call "read- from-minibuffer" when non-interactively called without argument? Non- interactively I would like the function to simply use my default value. Anyway, many thanks to you and the others having taken part in this dis- cussion -- I've learned a few things :-) Sincerely, Rainer