From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen 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: Thu, 14 Dec 2017 13:01:00 -0800 Message-ID: <87zi6lowhf.fsf@ericabrahamsen.net> References: <874m1mo8ez.fsf@ericabrahamsen.net> <87efo0encf.fsf@users.sourceforge.net> <87d13kqz70.fsf@ericabrahamsen.net> <87lgi7cxcn.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1513285330 16578 195.159.176.226 (14 Dec 2017 21:02:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 14 Dec 2017 21:02:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 25294@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 14 22:02:06 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 1ePadp-0003yx-Ev for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Dec 2017 22:02:05 +0100 Original-Received: from localhost ([::1]:43046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePadw-0000ru-KY for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Dec 2017 16:02:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePadq-0000qx-FX for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2017 16:02:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePadn-0001BX-6K for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2017 16:02:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53723) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePadn-0001BD-1c for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2017 16:02:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ePadm-0003ZP-Im for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2017 16:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Dec 2017 21:02:02 +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.151328526310573 (code B ref 25294); Thu, 14 Dec 2017 21:02:02 +0000 Original-Received: (at 25294) by debbugs.gnu.org; 14 Dec 2017 21:01:03 +0000 Original-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 Original-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 Original-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= In-Reply-To: <87lgi7cxcn.fsf@users.sourceforge.net> (Noam Postavsky's message of "Tue, 12 Dec 2017 18:58:32 -0500") 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:141076 Archived-At: 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