From unknown Sat Aug 09 01:06:41 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#25294 <25294@debbugs.gnu.org> To: bug#25294 <25294@debbugs.gnu.org> Subject: Status: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer Reply-To: bug#25294 <25294@debbugs.gnu.org> Date: Sat, 09 Aug 2025 08:06:41 +0000 retitle 25294 26.0.50; Allow more catch-all values for cl-defmethod's &cont= ext plus major-mode specializer reassign 25294 emacs submitter 25294 Eric Abrahamsen severity 25294 wishlist tag 25294 moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 14:14:01 2016 Received: (at submit) by debbugs.gnu.org; 29 Dec 2016 19:14:01 +0000 Received: from localhost ([127.0.0.1]:59400 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMg9I-0003qg-Pm for submit@debbugs.gnu.org; Thu, 29 Dec 2016 14:14:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44165) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMg9H-0003qT-7I for submit@debbugs.gnu.org; Thu, 29 Dec 2016 14:13:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMg9A-00062b-Vl for submit@debbugs.gnu.org; Thu, 29 Dec 2016 14:13:53 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43213) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cMg9A-00062X-SW for submit@debbugs.gnu.org; Thu, 29 Dec 2016 14:13:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMg99-00010P-Pg for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 14:13:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMg96-00061D-K5 for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 14:13:51 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:46370) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cMg96-0005yh-Dd for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 14:13:48 -0500 Received: from localhost (71-212-13-2.tukw.qwest.net [71.212.13.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 7662FBC903 for ; Thu, 29 Dec 2016 19:13:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1483038821; bh=wDFFN5UXFxdpzMW0Ptfdk9rfhiEO0jjCwqa7tAhphgQ=; h=From:To:Subject:Date:From; b=LdkKRX2uxGl/O31d36yBNbxeFiVKnS0T0bkJ6wbIG3jijBAtxdXpvAykvRWiMr364 Y37h17oYASHPEGiDCB9ATNs1j6FSqR0QS0T+MEWSL+3DcZMj6HPtu7gf0xhMObtAeB ssuRJ5pJV8rHUBoOxzoBSrkEJogk/MnKGilS9afE= From: Eric Abrahamsen To: bug-gnu-emacs@gnu.org Subject: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer Date: Thu, 29 Dec 2016 11:13:40 -0800 Message-ID: <874m1mo8ez.fsf@ericabrahamsen.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) When defining a method using cl-defmethod with the &context and major-mode specializer, there should be more acceptable options for catch-all or fall-through methods. Ie, we want to create a method that fires regardless of the major mode. These signatures don't work, but should: (cl-defmethod example-method ((&context (major-mode fundamental-mode)))) (cl-defmethod example-method ((&context (major-mode nil))) (cl-defmethod example-method ((&context (major-mode t)))) Right now the only thing that works is: (cl-defmethod example-method ()) In GNU Emacs 26.0.50.9 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.5) of 2016-12-26 built on clem Repository revision: 65b997b95e284e2edc1266663e39791f68d76ad7 Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 Recent messages: Reading active file via nndraft...done Reading active file from MTester via nnmairix...done Checking new news...done Saving the EBDB... done Saving Gnus registry (4516 entries) to ~/Documents/Sync/plusone/gnus.registry.eieio... Saving Gnus registry (size 4516) to ~/Documents/Sync/plusone/gnus.registry.eieio...done Saving /home/eric/.emacs.d/.newsrc.eld... Saving file /home/eric/.emacs.d/.newsrc.eld... Wrote /home/eric/.emacs.d/.newsrc.eld Saving /home/eric/.emacs.d/.newsrc.eld...done Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 LIBSYSTEMD Important settings: value of $LC_CTYPE: zh_CN.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=fcitx locale-coding-system: utf-8-unix From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 23:34:08 2016 Received: (at 25294) by debbugs.gnu.org; 30 Dec 2016 04:34:08 +0000 Received: from localhost ([127.0.0.1]:59500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMotM-0002Fh-IA for submit@debbugs.gnu.org; Thu, 29 Dec 2016 23:34:08 -0500 Received: from mail-io0-f174.google.com ([209.85.223.174]:36328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMotL-0002FS-JZ for 25294@debbugs.gnu.org; Thu, 29 Dec 2016 23:34:08 -0500 Received: by mail-io0-f174.google.com with SMTP id h133so128736775ioe.3 for <25294@debbugs.gnu.org>; Thu, 29 Dec 2016 20:34:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=saxfPLky69EevljSiobqkGc8uDeBXdT7o0E3zW/D1kc=; b=Oy59OUqt2j6oI/7w16mc66uZVaGOPxbgrjom4Kw0E8U9sNGuQQL8oMBSJU3kuxetdX HKI3huxKAFffnlkzqldXbSQ2tGu3ho0TWQlMyZQ0JN6G5/8oL/vaCN8Uk9uUHHGrYMYr g/EwGvBb7jS15EDfuNX9nX4uUk5D+D3lagKP3A/iw1JFwRczF2gGZX5d1RTIajCm8AQf wm2+h2Q9IAUKRzHa3wJj6feHYCfk0lrgMN2A8/tDr6F99agiK542yYafAKHuCC0meVkm +Q0vhAd3Pt+JgVwBMjFbQimyMB6oSQA3x6hNgv0NI1R+lTYyGpwdAKbD0Myuw20Hisiq TVhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=saxfPLky69EevljSiobqkGc8uDeBXdT7o0E3zW/D1kc=; b=D3VJXX4bNatX6k0h7BWQB8eDRmVWex+29HWtzjwTHbmmlktdTXOIJWw3tHGmj6EXAF DS/H5lHyS/WRrICLqC1P+18vo8ZFH0M1MnLpyCjG1HUrQzIAfqZdcd6wRd6YTQPlkHPW 77K4cKxc0A5HMlUg/2Qs9C29w4BisekLwRqkb57+iO14d6NAA0zRtOn02oA8V3fm26Dk OPWFwublk3zlp7/5K29v1dUfxLa2mmP3pxPrwQKpZ2qrwW6ihDhyJtiVlapMQGj9ikn7 PrKVifEzd9jWBKNpGQZ8oyEHMbm2ZccehA6eWwyoSKU/Dz4OfRLIYE1+OZoGzMjWDVfI 5hiw== X-Gm-Message-State: AIkVDXIJqyuaHRR76La6U4suP7+w2O14xkhibYS1rlMta1l4g0naL048qFTovMMvnlgoSw== X-Received: by 10.107.3.168 with SMTP id e40mr32122942ioi.89.1483072441886; Thu, 29 Dec 2016 20:34:01 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id g188sm15783628itg.8.2016.12.29.20.34.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Dec 2016 20:34:01 -0800 (PST) From: npostavs@users.sourceforge.net To: Eric Abrahamsen Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer In-Reply-To: <874m1mo8ez.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 29 Dec 2016 11:13:40 -0800") References: <874m1mo8ez.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Date: Thu, 29 Dec 2016 23:35:05 -0500 Message-ID: <877f6i826e.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 25294 Cc: 25294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) Eric Abrahamsen writes: > When defining a method using cl-defmethod with the &context and > major-mode specializer, Is this about the undocumented specializer mentioned in cl-generic.el? ;;; Dispatch on major mode. ;; Two parts: ;; - first define a specializer (derived-mode ) to match symbols ;; representing major modes, while obeying the major mode hierarchy. ;; - then define a context-rewriter so you can write ;; "&context (major-mode c-mode)" rather than ;; "&context (major-mode (derived-mode c-mode))". > there should be more acceptable options for > catch-all or fall-through methods. Ie, we want to create a method that > fires regardless of the major mode. If you want to ignore the major mode, why do you want to use the major-mode specializer? > These signatures don't work, but > should: > > (cl-defmethod example-method ((&context (major-mode fundamental-mode)))) > Should that be (cl-defmethod example-method (&context (major-mode fundamental-mode))) The reason this doesn't work is because fundamental isn't actually the parent mode of text-mode or prog-mode, i.e., (get 'text-mode 'derived-mode-parent) => nil. > (cl-defmethod example-method ((&context (major-mode nil))) > > (cl-defmethod example-method ((&context (major-mode t)))) > > Right now the only thing that works is: > > (cl-defmethod example-method ()) From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 18:08:21 2016 Received: (at control) by debbugs.gnu.org; 31 Dec 2016 23:08:21 +0000 Received: from localhost ([127.0.0.1]:33543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNSlB-00005q-7J for submit@debbugs.gnu.org; Sat, 31 Dec 2016 18:08:21 -0500 Received: from mail-it0-f45.google.com ([209.85.214.45]:37059) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNSlA-00005c-6y for control@debbugs.gnu.org; Sat, 31 Dec 2016 18:08:20 -0500 Received: by mail-it0-f45.google.com with SMTP id o141so234315807itc.0 for ; Sat, 31 Dec 2016 15:08:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=0xd6cSueaHJiSlRMCQ+j1RwAV4UpHo2socFy4xmvH3w=; b=aD85o6aePJwcWnXchTwwGTG0f2rtnUFJcdNTMJd6mQ3q2Hho1Y/KaUswbJ5QQ0xFYL UgYvzzTi08EoC4f3tat/CgFTRYIGDQvJCpYdjrAxm56GkBF8y7q5ibh34hsZFOX/+TzQ teZHN5uIXOynoBF2fDHm1Ylr1mB4lXIPU30kWr+pTp9tjX+poR1FEP4tbteL9ZGGfG0E SIwRZm10H5RP4uSGGuNcfE0ypRjPzp6gg3rU16Gow+yvKsfzjZAixOyHcT0vGUMppiok Z0wxOdfKSjwr6yWoTRbkTu/wF1wFAn+oMb5NeKOHn1bBnviLsnZbyF6ThkTiid7/bCd9 thSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=0xd6cSueaHJiSlRMCQ+j1RwAV4UpHo2socFy4xmvH3w=; b=XtIBuCuLLw6PMJXeYXK6HImmoLprwm+y9ed/f3NquRmhtrNC8DhtuXc2vGHQPXA4mH Xl3SJv3wEeBVWtN7u+77BFpo9mDmGSgr5b5/+JjV8H5G6UMN4DMVgkQ1LXDrSdeSplLF lFtqxWmco0pACCGHAPxYNOltl6EA1AS1LbHmgMOHiyPb+C9gBGUi2gBWUTJohPUvUE+H AbBtiAhGukMwAqTRdpHHl0y0CI+YAc8ddWhIrCMq6jqJXPNeW6jRct5CbBC+mhNpMbzd DTD7E3gdCRiAEPeyoIzSZWruiKe/9azgQ0gUjHxAV/r9vETS9+IzuSIFy5gZnOP5saml w7uA== X-Gm-Message-State: AIkVDXLmF3aB7TvgX3EkAQBOT8u2RLu5O9+tdnF9F5s5OOZDtljOIVUumZmSvhRlA9xpzQ== X-Received: by 10.36.85.5 with SMTP id e5mr39229380itb.42.1483225693871; Sat, 31 Dec 2016 15:08:13 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id m4sm29431689iom.20.2016.12.31.15.08.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 31 Dec 2016 15:08:13 -0800 (PST) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer References: <874m1mo8ez.fsf@ericabrahamsen.net> <877f6i826e.fsf@users.sourceforge.net> Date: Sat, 31 Dec 2016 18:09:15 -0500 In-Reply-To: <877f6i826e.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Thu, 29 Dec 2016 23:35:05 -0500") Message-ID: <87shp37l2c.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) severity 25294 wishlist tags 25294 moreinfo quit npostavs@users.sourceforge.net writes: > >> there should be more acceptable options for >> catch-all or fall-through methods. Ie, we want to create a method that >> fires regardless of the major mode. > > If you want to ignore the major mode, why do you want to use the > major-mode specializer? > From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 11 18:57:20 2017 Received: (at 25294) by debbugs.gnu.org; 11 Dec 2017 23:57:20 +0000 Received: from localhost ([127.0.0.1]:57459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOXwm-0002WK-1G for submit@debbugs.gnu.org; Mon, 11 Dec 2017 18:57:20 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:59378) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOXwk-0002WB-DT for 25294@debbugs.gnu.org; Mon, 11 Dec 2017 18:57:18 -0500 Received: from localhost (71-212-75-109.tukw.qwest.net [71.212.75.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 7B5E1C0854; Mon, 11 Dec 2017 23:57:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1513036636; bh=RuJymF/rLLZaI4bGfet6/xysP2ErcGwlNpiwVaoWi6U=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=NLiI1ZJmJUthna33OeNkYA8q+vq545YJC25toL/YYQ74ksFHI4QEjAEGy2WIMAyNe Vt4LVxHuRwRoL+3ZSgVn19ZqEJE6OON0ig6r1yi+1jZppFj+wAVhuGBuRGYT0RLFfd PvYbHl1974EgraRu3ktpnYaZeHfc7MaFpJQtBQZg= From: Eric Abrahamsen To: npostavs@users.sourceforge.net Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer References: <874m1mo8ez.fsf@ericabrahamsen.net> <877f6i826e.fsf@users.sourceforge.net> Date: Mon, 11 Dec 2017 15:57:15 -0800 In-Reply-To: <877f6i826e.fsf@users.sourceforge.net> (npostavs's message of "Thu, 29 Dec 2016 23:35:05 -0500") Message-ID: <87374gstr8.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 25294 Cc: 25294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Ahem, I only just noticed (a year later) that there was a response to this when I searched for bug reports I'd opened -- sorry about that. > Is this about the undocumented specializer mentioned in cl-generic.el? > > ;;; Dispatch on major mode. > > ;; Two parts: > ;; - first define a specializer (derived-mode ) to match symbols > ;; representing major modes, while obeying the major mode hierarchy. > ;; - then define a context-rewriter so you can write > ;; "&context (major-mode c-mode)" rather than > ;; "&context (major-mode (derived-mode c-mode))". Yes, that's it. >> there should be more acceptable options for >> catch-all or fall-through methods. Ie, we want to create a method that >> fires regardless of the major mode. > > If you want to ignore the major mode, why do you want to use the > major-mode specializer? It's the equivalent of the "t" branch in a `cond' statement. You write methods to handle specific major modes, and write another method to handle the catch-all case of "all other modes". >> These signatures don't work, but >> should: >> >> (cl-defmethod example-method ((&context (major-mode fundamental-mode)))) >> > > Should that be > > (cl-defmethod example-method (&context (major-mode fundamental-mode))) > > The reason this doesn't work is because fundamental isn't actually the > parent mode of text-mode or prog-mode, i.e., (get 'text-mode > 'derived-mode-parent) => nil. Right -- I still think either t or nil should do it. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 11 19:08:50 2017 Received: (at 25294) by debbugs.gnu.org; 12 Dec 2017 00:08:50 +0000 Received: from localhost ([127.0.0.1]:57463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOY7u-0004jZ-3B for submit@debbugs.gnu.org; Mon, 11 Dec 2017 19:08:50 -0500 Received: from mail-it0-f51.google.com ([209.85.214.51]:33728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOY7s-0004jM-B1 for 25294@debbugs.gnu.org; Mon, 11 Dec 2017 19:08:48 -0500 Received: by mail-it0-f51.google.com with SMTP id o130so14953057itg.0 for <25294@debbugs.gnu.org>; Mon, 11 Dec 2017 16:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=NQkSWP8c5DNg3SZPszax0uqJam/IyiPB5fw++EY8Nvw=; b=J2ni3N1fJ2oW1aeCmnn8jXAxVguu5tvmpWbv6PSlSNc1UNYDBJo7BY6PXUVsKX8f98 TRdnH6of6bkAnVOwHWjUVTPZfaWRbMu8qsCElIO0EEfk2jN0o+NxoUo+fOhqXwWMJaHu rTqeh0eEka3NOFxaFepTEzrOLDc9McQVraFWwiv6PROQqvN1rjINKnaZgxtliwehucrY HA1PYWusVQPblBdAm04Cq1GIgztpI5wHvdSvTmRDgdBGdQHmGBNpx3g/v34OpyRKn1nt W19Vtv2H/iPLVMewlz6zISZ906IdMOYEZZvXgYcmsClLGPmAmOO5SV5ojOk442BX8Rrk /gQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=NQkSWP8c5DNg3SZPszax0uqJam/IyiPB5fw++EY8Nvw=; b=afa4Eh9GCUvJCe+iG7W8h8CwDsQ4npuv7EJMNeuoQyjiUR1Fde3IQozrHugT/qdHOL 41yr7YjfRFes5AUsD1FzYyhoznlyj5MuQIhoV+TLDNge8v+wzOco89nIZEj46O21+RWr Jvs+byecIP5KZ9s8O7NwTQS+ZijpFN8FsBaTjJIVoHaLu+Jpp/Ipjkqo/xR2IewTgh7x aTh7mvsxdxYAAsVe6KXsyvuppTvgvLiNaoXzdSXg72NhkRP2GdxktdIkYtgzi61QQyM1 CCVovVJPjFQadirKL4837DooiePSQ/PSVJLYecz2mOOn11KDbggIXaQmW3/ij4A3QGCg arWg== X-Gm-Message-State: AKGB3mIuzitg7BIEUFzopbmjDju8IVD96FVLFeg24gAxiwW0dB8wcRgD BGFnbPYyZ7dcH8BzKEN1Vnuyjw== X-Google-Smtp-Source: ACJfBosWivIqLOA3z9FNFx1VfCKfLxZHIuQ2ZcC+3+E6FldDSCzGKq9en4GiNQ07rHh9svdDitEJgQ== X-Received: by 10.107.142.72 with SMTP id q69mr2844417iod.205.1513037322687; Mon, 11 Dec 2017 16:08:42 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id k19sm6748225ioc.75.2017.12.11.16.08.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Dec 2017 16:08:41 -0800 (PST) From: Noam Postavsky To: Eric Abrahamsen Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer References: <874m1mo8ez.fsf@ericabrahamsen.net> <877f6i826e.fsf@users.sourceforge.net> <87374gstr8.fsf@ericabrahamsen.net> Date: Mon, 11 Dec 2017 19:08:40 -0500 In-Reply-To: <87374gstr8.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Mon, 11 Dec 2017 15:57:15 -0800") Message-ID: <87k1xserjr.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 25294 Cc: 25294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Eric Abrahamsen writes: > Ahem, I only just noticed (a year later) that there was a response to > this when I searched for bug reports I'd opened -- sorry about that. It's had lots of time to rest then :) >> If you want to ignore the major mode, why do you want to use the >> major-mode specializer? > > It's the equivalent of the "t" branch in a `cond' statement. You write > methods to handle specific major modes, and write another method to > handle the catch-all case of "all other modes". Still not really convinced by this, what's wrong with the last way you put in your OP: (cl-defmethod example-method ()) From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 11 20:39:38 2017 Received: (at 25294) by debbugs.gnu.org; 12 Dec 2017 01:39:38 +0000 Received: from localhost ([127.0.0.1]:57502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOZXm-0007B4-D3 for submit@debbugs.gnu.org; Mon, 11 Dec 2017 20:39:38 -0500 Received: from mail-it0-f47.google.com ([209.85.214.47]:41749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOZXk-0007Ar-Lc for 25294@debbugs.gnu.org; Mon, 11 Dec 2017 20:39:37 -0500 Received: by mail-it0-f47.google.com with SMTP id x28so20729411ita.0 for <25294@debbugs.gnu.org>; Mon, 11 Dec 2017 17:39:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version; bh=kmHKSmSzHkD8vX9yXfxmuewP1Ry4/ct8HSGZGzl9A0E=; b=OAedDAhPNy2kO+bCimdPlBiK4ASUY7s+FN+xD9pdjP6VBjLgoaAAZJ7Ybx6cmw19Bp EERc6IEOU1+IxNEAfRMKz3n/P1jcm3xuiKpBExII6d9BDO39gIc8qm4WbQR+HBXqeAsb U4yhvj81bcN2FA6AhiGh57tskODzpo3eeh2rSO0oC1f73m4yYblI5rBrxP8LKOvcu1MD 1+iLgSmPnDoAtX6aiNTjnlU7lCSUMGsq2d3SlTE5u0+JFAM6c3VP0ySQevh94FxrAoIt meMoBteu0NOaKBXH7ktVbV1Qx5uBJIwDngSqybrV0ysFQXPYMQeeSySq+Ds5hoXSxmYw jWbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version; bh=kmHKSmSzHkD8vX9yXfxmuewP1Ry4/ct8HSGZGzl9A0E=; b=OqwyyX0T4EkE7wE8x3R066XXKtH4a/dA+YgYigxoYkS3CcPMYYITg0O0Yt62Z6s4Ul yGOt1tR9Lixedzyht8e69KyR6/B+uJLI0VgW3kNfdlw8UKDx9TaAynZXA0fs5jBxuGXp y6bnONbd7QUEV1RWZUhbJ2SODaxKDM/Y2I8UfT7mRoGDMS/qnPRfitYxBG/TiRKtZIkH KdpivDraxP0dxBwkDoNk15ZsE/GRv2NzN5sNIKMTUSUVErgAMYdQnD8O1WAJXcWg/aW2 pkFLi+PIQUYxJA7+ehIaKjGLzggxtFrX9fI1hrs5SMse1J71S5JB0qXT8lwxtVLV71KU roHw== X-Gm-Message-State: AKGB3mL0vSkbaJrV2poZwkTFEV4mnY85SSOlsuubOf5Qtv1+HUS0Eau0 uLAK+3AF+QoGXTcp+i12Amw= X-Google-Smtp-Source: ACJfBosuMBkqy8PYC6vzh1hljhV0B/doMxq18+gvoVJ3YJR6VoBTBEVs9KONDg2vMAHSk6Tlyjn0BA== X-Received: by 10.36.221.147 with SMTP id t141mr406092itf.140.1513042771320; Mon, 11 Dec 2017 17:39:31 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id k188sm4452185itd.15.2017.12.11.17.39.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Dec 2017 17:39:30 -0800 (PST) From: Noam Postavsky To: 25294@debbugs.gnu.org Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer Date: Mon, 11 Dec 2017 20:39:28 -0500 Message-ID: <87efo0encf.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 25294 Cc: Eric Abrahamsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) --=-=-= Content-Type: text/plain [forwarding to list] --=-=-= Content-Type: message/rfc822 Content-Disposition: inline From: Eric Abrahamsen To: Noam Postavsky Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer References: <874m1mo8ez.fsf@ericabrahamsen.net> <877f6i826e.fsf@users.sourceforge.net> <87374gstr8.fsf@ericabrahamsen.net> <87k1xserjr.fsf@users.sourceforge.net> Date: Mon, 11 Dec 2017 16:49:14 -0800 In-Reply-To: <87k1xserjr.fsf@users.sourceforge.net> (Noam Postavsky's message of "Mon, 11 Dec 2017 19:08:40 -0500") Message-ID: <87y3m8rcs5.fsf@ericabrahamsen.net> X-Headers-End: 1eOYl7-0001Ed-RN MIME-Version: 1.0 Content-Type: text/plain On 12/11/17 19:08 PM, Noam Postavsky wrote: > Eric Abrahamsen writes: > >> Ahem, I only just noticed (a year later) that there was a response to >> this when I searched for bug reports I'd opened -- sorry about that. > > It's had lots of time to rest then :) > >>> If you want to ignore the major mode, why do you want to use the >>> major-mode specializer? >> >> It's the equivalent of the "t" branch in a `cond' statement. You write >> methods to handle specific major modes, and write another method to >> handle the catch-all case of "all other modes". > > Still not really convinced by this, what's wrong with the last way you > put in your OP: > > (cl-defmethod example-method ()) A year later, older and wiser, I agree that maybe all that's needed is more documentation. I just noticed that, at some point in the interim, the documentation for generic functions has been greatly expanded, which is nice! I'd like to add the following to the docs: 1. The &context thing has to come after the required arguments, but before any &optional or &rest things. 2. You can have an arbitrary number of forms following &context. 3. The &context arguments don't have to match the declared arguments in `cl-defgeneric'. 4. Ergo they can be left off altogether without needing to be specifically declared as nil or what have you, ie, my original bug report isn't really a bug. If this looks okay, I'll have at the docs. Eric --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 11 20:43:38 2017 Received: (at 25294) by debbugs.gnu.org; 12 Dec 2017 01:43:38 +0000 Received: from localhost ([127.0.0.1]:57506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOZbd-0007Ht-Ug for submit@debbugs.gnu.org; Mon, 11 Dec 2017 20:43:38 -0500 Received: from mail-it0-f49.google.com ([209.85.214.49]:45797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOZbc-0007He-7z for 25294@debbugs.gnu.org; Mon, 11 Dec 2017 20:43:36 -0500 Received: by mail-it0-f49.google.com with SMTP id z6so20703980iti.4 for <25294@debbugs.gnu.org>; Mon, 11 Dec 2017 17:43:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=e/Jhq5KANbEV8di1eSjo7bvnfYRT2WfWt1qCzYyaxpA=; b=oWzEDpOZQFCyirUvatjdKq5b1V+VMXga9+e6TunkRCxGEdaeRjpRjdX683OAguYcCO ggubiFl7XdN2ZftHsSRVIZI3iVv/aSzvcjLZGGgHTmwyAsbzxPzhRCX5Z6n7IZqSR9qr AOJs7dwWSZPVRt0zGs9JnClMipPgm+yZfL04cVEIAcST892p/Lgop3fNcIpp3bohQHOR WI73QrG77q2zjFRsgUy3C/aSfHPSWO+D4SbkYTX0ySolm4CzQA2pDk8fKs0QZe6AIL7M SqTAdwqyc8Z9I6fuajdS/+6XBhJs+3MqMT4QZJE5kFjx7QMBthYcFwsDSa+/d/jLY4gE H0ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=e/Jhq5KANbEV8di1eSjo7bvnfYRT2WfWt1qCzYyaxpA=; b=aK8YVm3U7FzDT6TCaR0XWJ8g2oQ1ddgo/nOmr3yBFtqyUwIfZVfphVRRVRBACaHCih /4v+SZgu9hwtbHPXdN4CawWVcFzUXFpRO37YGmw3XUp36Xa605IM0rMllvs1YqHexxx2 iTbB2Y4HM4JP4zjZDeC3SFV+cQN9R1jR54u6yd7GPLT8rM0ifY2y+bUx/LbXo43wSZNT viXrueYZdaK/sQ4T0WDJ5bRY81kMh+dlmoZLC5y1G0Hbxafvn//zHx4h26ncBiAlE1wb QFadKxooMNv/GnfkcviKr2fte4q/W/b54j3QGyV6yoLV88Jw5F131rzyIkH/qYxIGxB7 JaWw== X-Gm-Message-State: AKGB3mJxyFF1i8DDd0hHVdonDd/eAZ4/O/ff8jTaHbgnO9Ti3oIMSpBd MdnFQpsA+9INJ83g2SIQCAk= X-Google-Smtp-Source: ACJfBoudeTBl2U3/fh12rowsB9yRPcJ8KkZL0WYhDI3HDLbIXjAIfsyw3na1QDEiKbEFCEAGZhkEJg== X-Received: by 10.36.79.75 with SMTP id c72mr409030itb.146.1513043010755; Mon, 11 Dec 2017 17:43:30 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id e82sm6845101iof.34.2017.12.11.17.43.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Dec 2017 17:43:29 -0800 (PST) From: Noam Postavsky To: 25294@debbugs.gnu.org Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer References: <874m1mo8ez.fsf@ericabrahamsen.net> <87efo0encf.fsf@users.sourceforge.net> Date: Mon, 11 Dec 2017 20:43:28 -0500 In-Reply-To: <87efo0encf.fsf@users.sourceforge.net> (Noam Postavsky's message of "Mon, 11 Dec 2017 20:39:28 -0500") Message-ID: <87bmj4en5r.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 25294 Cc: Eric Abrahamsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) > From: Eric Abrahamsen > Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer > To: Noam Postavsky > Date: Mon, 11 Dec 2017 16:49:14 -0800 (51 minutes, 9 seconds ago) > >> Still not really convinced by this, what's wrong with the last way you >> put in your OP: >> >> (cl-defmethod example-method ()) > > A year later, older and wiser, I agree that maybe all that's needed is > more documentation. I just noticed that, at some point in the interim, > the documentation for generic functions has been greatly expanded, which > is nice! > > I'd like to add the following to the docs: > > 1. The &context thing has to come after the required arguments, but > before any &optional or &rest things. > 2. You can have an arbitrary number of forms following &context. > 3. The &context arguments don't have to match the declared arguments in > `cl-defgeneric'. > 4. Ergo they can be left off altogether without needing to be > specifically declared as nil or what have you, ie, my original bug > report isn't really a bug. > > If this looks okay, I'll have at the docs. Sounds good to me. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 12 00:42:49 2017 Received: (at 25294) by debbugs.gnu.org; 12 Dec 2017 05:42:49 +0000 Received: from localhost ([127.0.0.1]:57600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOdL7-0007I0-9b for submit@debbugs.gnu.org; Tue, 12 Dec 2017 00:42:49 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:59905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOdL4-0007Hr-Pl for 25294@debbugs.gnu.org; Tue, 12 Dec 2017 00:42:47 -0500 Received: from localhost (71-212-75-109.tukw.qwest.net [71.212.75.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id B2CC9C05DA; Tue, 12 Dec 2017 05:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1513057365; bh=cizLKv/r8nG1+irQ9gENfzMj95sDPIJylv4DK0MgW5w=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=I2Qaar+MwBkpq50uRDbw14iD6TM4NUpv11XkIG/JmD+msKXBtB3WScYlRJB7/Yb1/ vEuYLVdxSQ7oSKCXum5D/Ez6J/+lt6urOSla5w1l3OktyFZDDtmBgrhZ5jG6D98iI8 k9fhn8lLCH77O7cMretpnga8VZ3/Yb+CQRHlZa8g= From: Eric Abrahamsen To: Noam Postavsky Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer References: <874m1mo8ez.fsf@ericabrahamsen.net> <87efo0encf.fsf@users.sourceforge.net> Date: Mon, 11 Dec 2017 21:42:43 -0800 In-Reply-To: <87efo0encf.fsf@users.sourceforge.net> (Noam Postavsky's message of "Mon, 11 Dec 2017 20:39:28 -0500") Message-ID: <87d13kqz70.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 25294 Cc: 25294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Noam Postavsky writes: > [forwarding to list] Whoops, sorry. [...] >> A year later, older and wiser, I agree that maybe all that's needed is >> more documentation. I just noticed that, at some point in the interim, >> the documentation for generic functions has been greatly expanded, which >> is nice! >> >> I'd like to add the following to the docs: >> >> 1. The &context thing has to come after the required arguments, but >> before any &optional or &rest things. >> 2. You can have an arbitrary number of forms following &context. >> 3. The &context arguments don't have to match the declared arguments in >> `cl-defgeneric'. >> 4. Ergo they can be left off altogether without needing to be >> specifically declared as nil or what have you, ie, my original bug >> report isn't really a bug. >> >> If this looks okay, I'll have at the docs. > Sounds good to me. Here's my diff. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=context-spec-docs.diff diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 466a12f7a4..6b98a3d639 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -1252,15 +1252,21 @@ Generic Functions Extensions for GNU Emacs Lisp}), or of one of its parent classes. @end table -Alternatively, the argument specializer can be of the form -@code{&context (@var{expr} @var{spec})}, in which case the value of -@var{expr} must be compatible with the specializer provided by -@var{spec}; @var{spec} can be any of the forms described above. In -other words, this form of specializer uses the value of @var{expr} -instead of arguments for the decision whether the method is -applicable. For example, @code{&context (overwrite-mode (eql t))} -will make the method compatible only when @code{overwrite-mode} is -turned on. +Generic functions provide a new argument-list keyword, +@code{&context}, which can be used to introduce extra specializers +that test the general environment in which the method is run. This +keyword should appear after the list of required arguments, but before +any @code{&rest} or @code{&optional} keywords. The @code{&context} +specializers look much like regular argument +specializers---(@var{expr} @var{spec})---except that @var{expr} is an +expression to be evaluated in the current context, and the @var{spec} +is a value to compare against. For example, @code{&context +(overwrite-mode (eql t))} will make the method applicable only when +@code{overwrite-mode} is turned on. The @code{&context} keyword can +be followed by any number of context specializers. Because the +context specializers are not part of the generic function's required +argument signature, they may be omitted in methods that don't require +them. The type specializer, @code{(@var{arg} @var{type})}, can specify one of the @dfn{system types} in the following list. When a parent type --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 12 18:58:43 2017 Received: (at 25294) by debbugs.gnu.org; 12 Dec 2017 23:58:43 +0000 Received: from localhost ([127.0.0.1]:59095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOuRe-0003EF-MU for submit@debbugs.gnu.org; Tue, 12 Dec 2017 18:58:42 -0500 Received: from mail-it0-f43.google.com ([209.85.214.43]:37835) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOuRd-0003E3-Di for 25294@debbugs.gnu.org; Tue, 12 Dec 2017 18:58:41 -0500 Received: by mail-it0-f43.google.com with SMTP id d137so1596835itc.2 for <25294@debbugs.gnu.org>; Tue, 12 Dec 2017 15:58:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jnaL/xAdung+WjlIp0CWSs+cWVVoYaOY/cZUmA6NUxo=; b=Bg1nIrZdJMAokBS75rvPtRicktJUtumPCWl96lTTTHecPln/kWscTb2GkCmQcqcHXK wJcnCB1Ch6H+ldCFji3BX2wc+6/h70uvuBWczPb/e2uOYzxLCBs03HvIkoI7Qz2UpFej 7oOQp0JqRNXjzyplaamysa6Qy50WRSypMdbdgRn4k9CgTTGPM3JzPsIoRsWisCojesyn NQ4HgPiHhXcexqzxGa/IMOb5DjwRLO09UG7j8kVVEZqUmFHiC17dMyg1ijkfY/VHGZUH hXduKBwJU44+93sQnALlH96g0hNKikbtdur3KR47Cnk5KyHdJyplM2G0pDdBt6vQPNfn vowQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=jnaL/xAdung+WjlIp0CWSs+cWVVoYaOY/cZUmA6NUxo=; b=YHFupk3bK2omdMKMwyzv4uwNHgAK+vDOmkZlleuP+pw+NngB49FCvJ30RPtf/MnbBn 80aEQtn7/zX0C2bYj/XAj83TNOdlNsyOJA7MvrUGyrEkhWuCu9JV1V/UOZN0bPxQQz5G zw1SGHlcxO+shEJcv8AftSFl6h5Lx2hSaRhg8e2mNtywA3nBuVqfSWeX8HIk5c3ou1dK i0OaVAFFg40xlPeeYuQlHHYPMyjVdhuel0SBPYoKip+xMcsTgWUtjZAJir4lZ/ze6C2C ErLPJxHFniRnUwXBGxc/JFyT3dQqAdpuK4WbwvcMHEsF++oIg/nOjwXNTf5m2xic2vmX ZMGQ== X-Gm-Message-State: AKGB3mKK6JZ7h/GhOWY1C4z04X5jigaa0uHC8GlGDt2relUem/+gM+xG 6oXGP55EcdOblkH2671qBIh4niP9 X-Google-Smtp-Source: ACJfBouaUKaOBNrhaWts6TCPjcKjr/zEPlGJgKTzXDqpm4tNGgHYAq7Cmhp4w7cQrWGIV2zLMgUoiQ== X-Received: by 10.36.60.212 with SMTP id m203mr696128ita.96.1513123115612; Tue, 12 Dec 2017 15:58:35 -0800 (PST) Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id e36sm354764itd.27.2017.12.12.15.58.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2017 15:58:34 -0800 (PST) From: Noam Postavsky To: Eric Abrahamsen Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer References: <874m1mo8ez.fsf@ericabrahamsen.net> <87efo0encf.fsf@users.sourceforge.net> <87d13kqz70.fsf@ericabrahamsen.net> Date: Tue, 12 Dec 2017 18:58:32 -0500 In-Reply-To: <87d13kqz70.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Mon, 11 Dec 2017 21:42:43 -0800") Message-ID: <87lgi7cxcn.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 25294 Cc: 25294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Eric Abrahamsen writes: > +Generic functions provide a new argument-list keyword, The way you phrased this might lead me to think that the &context keyword should go in the cl-defgeneric form (maybe it's not so bad when seeing in context under cl-defmethod, in patch form it's a bit disconnected). > +@code{&context}, which can be used to introduce extra specializers > +that test the general environment in which the method is run. This > +keyword should appear after the list of required arguments, but before > +any @code{&rest} or @code{&optional} keywords. I wonder if it would be clearer to add this to the @defmac header? @defmac cl-defmethod name [qualifier] arguments [&context (expr spec)@dots{}] &rest [docstring] body Hmm, maybe that ends up being too long. > The @code{&context} > +specializers look much like regular argument > +specializers---(@var{expr} @var{spec})---except that @var{expr} is an > +expression to be evaluated in the current context, and the @var{spec} > +is a value to compare against. For example, @code{&context > +(overwrite-mode (eql t))} will make the method applicable only when > +@code{overwrite-mode} is turned on. The @code{&context} keyword can > +be followed by any number of context specializers. Because the > +context specializers are not part of the generic function's required > +argument signature, they may be omitted in methods that don't require > +them. Otherwise looks fine. From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 13 19:06:43 2017 Received: (at 25294) by debbugs.gnu.org; 14 Dec 2017 00:06:43 +0000 Received: from localhost ([127.0.0.1]:32778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePH2x-0006Dv-BG for submit@debbugs.gnu.org; Wed, 13 Dec 2017 19:06:43 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:43446) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePH2v-0006Dm-PO for 25294@debbugs.gnu.org; Wed, 13 Dec 2017 19:06:42 -0500 Received: from localhost (71-212-75-109.tukw.qwest.net [71.212.75.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id C55C9C033F; Thu, 14 Dec 2017 00:06:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1513210001; bh=FtC17QUV68d9nqVAFZ6+ZHWqsp3PDJdpHcaXS8AdzX4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=e+zIk5mZnxFFHopFoyr+yMddtqAyQ4bsuNUgJYTeNVkS67ynJX1CD3NDTIzxRXgtf ED7QrwSdQrN0Zuir2atKkGvO/5rYnqyNZzPJFeXLEd/tfBhZKpOKyd7PihGCizSwZ9 Yp0R25puF2VJoZ2f+u14bUzxmW4+XxOg1mfpWFSs= From: Eric Abrahamsen To: Noam Postavsky Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer References: <874m1mo8ez.fsf@ericabrahamsen.net> <87efo0encf.fsf@users.sourceforge.net> <87d13kqz70.fsf@ericabrahamsen.net> <87lgi7cxcn.fsf@users.sourceforge.net> Date: Wed, 13 Dec 2017 16:06:39 -0800 In-Reply-To: <87lgi7cxcn.fsf@users.sourceforge.net> (Noam Postavsky's message of "Tue, 12 Dec 2017 18:58:32 -0500") Message-ID: <87r2ry6uls.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 25294 Cc: 25294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Noam Postavsky writes: > Eric Abrahamsen writes: > >> +Generic functions provide a new argument-list keyword, > > The way you phrased this might lead me to think that the &context > keyword should go in the cl-defgeneric form (maybe it's not so bad when > seeing in context under cl-defmethod, in patch form it's a bit > disconnected). Maybe so, yes. I'll look at it in context and see if I can't make that a little clearer. >> +@code{&context}, which can be used to introduce extra specializers >> +that test the general environment in which the method is run. This >> +keyword should appear after the list of required arguments, but before >> +any @code{&rest} or @code{&optional} keywords. > > I wonder if it would be clearer to add this to the @defmac header? > > @defmac cl-defmethod name [qualifier] arguments [&context (expr spec)@dots{}] &rest [docstring] body > > Hmm, maybe that ends up being too long. I never found those things very helpful, and that does look a little long... From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 14 16:01:03 2017 Received: (at 25294) by debbugs.gnu.org; 14 Dec 2017 21:01:03 +0000 Received: from localhost ([127.0.0.1]:34169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePacp-0002k6-G2 for submit@debbugs.gnu.org; Thu, 14 Dec 2017 16:01:03 -0500 Received: from mail.ericabrahamsen.net ([50.56.99.223]:49750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePaco-0002iI-5j; Thu, 14 Dec 2017 16:01:02 -0500 Received: from localhost (71-212-75-109.tukw.qwest.net [71.212.75.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 34AE8BBC92; Thu, 14 Dec 2017 21:01:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mail.ericabrahamsen.net; s=mail; t=1513285261; bh=yPx5x+hDw9pazoOIcZfrBVccMUsC30RO/iIMN8ahABY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=NwY9XMVcUNnMTtwDEPtckKKVXHGMFmrwJexD86YBFnyDHxRfHq7jy0UadVGdDaZR0 JBqGP1fdefD4ePamXvYoV80Bwcr38gF/zSElESmszVVUKX97wxLn3eXPlBKCf8wf/c tdaqxZ2e6zKsF5LPPLzEgVHOOhzCFWiaTySR8GCQ= From: Eric Abrahamsen To: Noam Postavsky Subject: Re: bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer References: <874m1mo8ez.fsf@ericabrahamsen.net> <87efo0encf.fsf@users.sourceforge.net> <87d13kqz70.fsf@ericabrahamsen.net> <87lgi7cxcn.fsf@users.sourceforge.net> Date: Thu, 14 Dec 2017 13:01:00 -0800 In-Reply-To: <87lgi7cxcn.fsf@users.sourceforge.net> (Noam Postavsky's message of "Tue, 12 Dec 2017 18:58:32 -0500") Message-ID: <87zi6lowhf.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 25294 Cc: 25294@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) close 25294 quit On 12/12/17 18:58 PM, Noam Postavsky wrote: > Eric Abrahamsen writes: > >> +Generic functions provide a new argument-list keyword, > > The way you phrased this might lead me to think that the &context > keyword should go in the cl-defgeneric form (maybe it's not so bad when > seeing in context under cl-defmethod, in patch form it's a bit > disconnected). > >> +@code{&context}, which can be used to introduce extra specializers >> +that test the general environment in which the method is run. This >> +keyword should appear after the list of required arguments, but before >> +any @code{&rest} or @code{&optional} keywords. > > I wonder if it would be clearer to add this to the @defmac header? > > @defmac cl-defmethod name [qualifier] arguments [&context (expr spec)@dots{}] &rest [docstring] body > > Hmm, maybe that ends up being too long. > >> The @code{&context} >> +specializers look much like regular argument >> +specializers---(@var{expr} @var{spec})---except that @var{expr} is an >> +expression to be evaluated in the current context, and the @var{spec} >> +is a value to compare against. For example, @code{&context >> +(overwrite-mode (eql t))} will make the method applicable only when >> +@code{overwrite-mode} is turned on. The @code{&context} keyword can >> +be followed by any number of context specializers. Because the >> +context specializers are not part of the generic function's required >> +argument signature, they may be omitted in methods that don't require >> +them. > > Otherwise looks fine. > Okay, that's pushed, I ended up adding the bit to the defmac statement after all, it wraps and shouldn't be too big a deal. Thanks, Eric From unknown Sat Aug 09 01:06:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 12 Jan 2018 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator