From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: "fall-through" generic function args plus &context Date: Mon, 26 Dec 2016 12:34:46 -0800 Message-ID: <87r34u8m55.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1482789805 883 195.159.176.226 (26 Dec 2016 22:03:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Dec 2016 22:03:25 +0000 (UTC) User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 26 23:03:21 2016 Return-path: Envelope-to: geh-help-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 1cLdMT-0007nB-7T for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Dec 2016 23:03:17 +0100 Original-Received: from localhost ([::1]:51848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLdMY-0006NL-61 for geh-help-gnu-emacs@m.gmane.org; Mon, 26 Dec 2016 17:03:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLbzC-0002Gg-0Q for help-gnu-emacs@gnu.org; Mon, 26 Dec 2016 15:35:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLbz8-00033H-Ql for help-gnu-emacs@gnu.org; Mon, 26 Dec 2016 15:35:09 -0500 Original-Received: from [195.159.176.226] (port=33222 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cLbz8-0002zk-LX for help-gnu-emacs@gnu.org; Mon, 26 Dec 2016 15:35:06 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1cLbyx-0001ye-7C for help-gnu-emacs@gnu.org; Mon, 26 Dec 2016 21:34:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 24 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:13e7OIHovlK12iBtDAJ47Sdwxq8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 X-Mailman-Approved-At: Mon, 26 Dec 2016 17:02:28 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112002 Archived-At: I have a few defmethods that use the &context construct to dispatch on the value of major mode: (cl-defmethod my-make-buffer-name (&context (major-mode gnus-summary-mode)) ;; etc... ) I need a catch-all method, for default behavior when we're in other modes that aren't targeted by an existing method. I've tried things like: (&context _major-mode) (&context (major-mode t)) (&context (major-mode nil)) (&context (major-mode (eql _nuthin)) And a few other things. Everything raises cl-no-applicable-method. What's the correct way to do this? Or do I need to override `cl-no-applicable-method' and catch the error? Thanks, Eric