From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#20420: 25.0.50; eieio methods with optional arguments now fail Date: Sat, 25 Apr 2015 10:41:40 -0400 Message-ID: References: <87d22tpbqr.fsf@gmail.com> <878udhp0ay.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1429972950 2238 80.91.229.3 (25 Apr 2015 14:42:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Apr 2015 14:42:30 +0000 (UTC) Cc: 20420@debbugs.gnu.org To: Vitalie Spinu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 25 16:42:15 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ym1Ha-0001lE-Pn for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Apr 2015 16:42:14 +0200 Original-Received: from localhost ([::1]:48568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym1Ha-0001hH-8X for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Apr 2015 10:42:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym1HV-0001a3-60 for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2015 10:42:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ym1HO-0002Xo-Gk for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2015 10:42:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ym1HO-0002Xh-EJ for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2015 10:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Ym1HO-0003D2-7Z for bug-gnu-emacs@gnu.org; Sat, 25 Apr 2015 10:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Apr 2015 14:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20420 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20420-submit@debbugs.gnu.org id=B20420.142997290412304 (code B ref 20420); Sat, 25 Apr 2015 14:42:02 +0000 Original-Received: (at 20420) by debbugs.gnu.org; 25 Apr 2015 14:41:44 +0000 Original-Received: from localhost ([127.0.0.1]:39901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ym1H5-0003CO-S3 for submit@debbugs.gnu.org; Sat, 25 Apr 2015 10:41:44 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:47510) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ym1H3-0003CG-Hy for 20420@debbugs.gnu.org; Sat, 25 Apr 2015 10:41:41 -0400 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t3PEfeJ0018997; Sat, 25 Apr 2015 10:41:40 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 3895C250C; Sat, 25 Apr 2015 10:41:40 -0400 (EDT) In-Reply-To: <878udhp0ay.fsf@gmail.com> (Vitalie Spinu's message of "Sat, 25 Apr 2015 01:35:17 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5287=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5287> : inlines <2795> : streams <1428395> : uri <1915543> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:102025 Archived-At: >> Hmmm... I think this really only worked by accident and wasn't >> explicitly supported by Emacs-24's doc. And adding support for such >> degenerate methods might not be straightforward in eieio-compat.el, so >> I'm wondering where you've seen such use, to see how important it is to >> provide that level of backward compatibility. > I was using function xx that, when called with no arguments, dispatched > methods with the same name on a local object in the current buffer. That tells me *how* you used it, not *where*. > As we are on this topic how about allowing for implicit dispatch on the > arbitrary context? I mean something along the following lines: Quoting from cl-generic.el: ;; TODO: [...] ;; - A way to dispatch on the context (e.g. the major-mode, some global ;; variable, you name it). [...] ;;; Just for kicks: dispatch on major-mode ;; ;; Here's how you'd use it: ;; (cl-defmethod foo ((x (major-mode text-mode)) y z) ...) ;; And then ;; (foo 'major-mode toto titi) ;; ;; FIXME: Better would be to do that via dispatch on an "implicit argument". ;; E.g. (cl-defmethod foo (y z &context (major-mode text-mode)) ...) IOW, patch welcome. Stefan