From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: 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> References: <874m1mo8ez.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1513042813 19934 195.159.176.226 (12 Dec 2017 01:40:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 12 Dec 2017 01:40:13 +0000 (UTC) Cc: Eric Abrahamsen To: 25294@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 12 02:40:09 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOZYG-0004zY-3J for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Dec 2017 02:40:08 +0100 Original-Received: from localhost ([::1]:56299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOZYN-00018k-6R for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Dec 2017 20:40:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32902) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOZYE-000187-B8 for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2017 20:40:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOZYA-0005sy-E3 for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2017 20:40:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48821) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eOZYA-0005sq-8m for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2017 20:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eOZYA-0007Bs-0s for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2017 20:40:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <874m1mo8ez.fsf@ericabrahamsen.net> Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Dec 2017 01:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25294 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 25294-submit@debbugs.gnu.org id=B25294.151304277827598 (code B ref 25294); Tue, 12 Dec 2017 01:40:01 +0000 Original-Received: (at 25294) by debbugs.gnu.org; 12 Dec 2017 01:39:38 +0000 Original-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 Original-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 Original-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) Original-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) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140963 Archived-At: --=-=-= 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 --=-=-=--