From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: master b525f201ba: Allow specifying the color to use in image-elide Date: Wed, 14 Sep 2022 16:52:47 -0700 Message-ID: References: <166317972871.8462.16344173364399917298@vcs2.savannah.gnu.org> <20220914182209.04F50C00872@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34490"; mail-complaints-to="usenet@ciao.gmane.io" To: Lars Ingebrigtsen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 15 01:54:06 2022 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 1oYcCi-0008lE-Ua for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Sep 2022 01:54:04 +0200 Original-Received: from localhost ([::1]:36148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYcCh-0005ip-C1 for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Sep 2022 19:54:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYcBX-0004kq-G6 for emacs-devel@gnu.org; Wed, 14 Sep 2022 19:52:51 -0400 Original-Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]:45788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYcBV-0006UO-Pn for emacs-devel@gnu.org; Wed, 14 Sep 2022 19:52:51 -0400 Original-Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-127dca21a7dso45083945fac.12 for ; Wed, 14 Sep 2022 16:52:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date; bh=HNEokWPSkYSYgLPEfLZvVgxgaeSzV7e6T0HzCWuJsqM=; b=n1LT/mvhFKFd7hLzWN4XXDMEF0/6I+bKCcMHq/FiriztTQtJeUXGsjz+x6SC1IQAZ4 ruGptg6GY+vRGtZoU+9J8MkTrB56uShDWctg9zMtGwMK6IYhyFzeX115cxj5Xl4XUccR aZHNEmcbhrdKoilExoRlje/L/zsVFZ50laVGlVmMQkoaD9Ue1hxla07ljyjKg5DWWckG 7Gm8RXjj1IcGJh8afRY1l2aJ8bCdqLMlDaNeFAN/b8IwtqZ9AGSeJ1BokscW59C8yfWh icCzD0IFOT8n1/krTSMEsQsVgyUNXVg4Bv+MnZyh5Y60AD1oCvafNo6hnxyl7s74TgB8 G2BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-message-state:from:to:cc:subject:date; bh=HNEokWPSkYSYgLPEfLZvVgxgaeSzV7e6T0HzCWuJsqM=; b=oupDo5JDeaudfHDoEg48lc6e+72zpv3ExVRsKe/3pe3ulPc6pIfoX4vYey+mzYrVMM 2lOWzvNbSQN2qqFti7hXrqHxNXdbqdeCHIuhJ8rnQT3kmBfUC8sB9JX6w/en/jVdYbAx MeGWn0lHIdmNltdSt04++yrpxYpLA3tnjA54cv0/de2n0RT1J0PeeLVFVdaKSOdenQ3R mi4jJ4Kb3IMSrgEFbTVKpkfr+XOGLII7wunJwfZgj6KsKqthuqg/nkx5aQsOsgw3d9R7 hgvvphKXskdrseBOAj/ASHrUau+GC75C5tQpLK4SBgoSs3o1lIj13tFZSAE/YQ6XVf6G 6wAQ== X-Gm-Message-State: ACgBeo2OHsJJ5CR4g/ZaYa42lfrbjvkQpWsYK+1hBwzS+x3/Q73/oCeB 9F1MWeJmdyOySmVCgmKIIDsgCUMdKhhRLw9hQsg= X-Google-Smtp-Source: AA6agR5Rvg9WRl0oZ3fo+10ugLh825kHmqbwVqMVma+SfWIiMfbTPpWPxEcOPZLOxgiKMtOnOL4lj0Cy0d1RD5MvF8E= X-Received: by 2002:a05:6870:538c:b0:11b:e64f:ee1b with SMTP id h12-20020a056870538c00b0011be64fee1bmr3698775oan.92.1663199568325; Wed, 14 Sep 2022 16:52:48 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 14 Sep 2022 16:52:47 -0700 In-Reply-To: <20220914182209.04F50C00872@vcs2.savannah.gnu.org> X-Hashcash: 1:20:220914:emacs-diffs@gnu.org::hN34cGz7rHGxUHou:4xDN Received-SPF: pass client-ip=2001:4860:4864:20::2e; envelope-from=stefankangas@gmail.com; helo=mail-oa1-x2e.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.devel:295373 Archived-At: Lars Ingebrigtsen writes: > ;;;###autoload > -(defun image-elide (&optional square) > +(defun image-elide (color &optional square) > "Elide a square from the image under point. > If SQUARE (interactively, the prefix), elide a square instead of a > -rectangle from the image." > - (interactive "P") > - (image-crop square t)) > +rectangle from the image. > + > +Interatively, the user will be prompted for the color to use, and > +defaults to black." > + (interactive (list (read-color "Use color: ") > + current-prefix-arg)) > + (image-crop square (if (string-empty-p color) > + "black" color))) How about putting the color selection behind a prefix argument instead? How about also adding a defcustom for the default color (i.e. without a prefix argument)?