From: Noam Postavsky <npostavs@users.sourceforge.net>
To: 25294@debbugs.gnu.org
Cc: Eric Abrahamsen <eric@ericabrahamsen.net>
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 [thread overview]
Message-ID: <87efo0encf.fsf@users.sourceforge.net> (raw)
In-Reply-To: <874m1mo8ez.fsf@ericabrahamsen.net>
[-- Attachment #1: Type: text/plain, Size: 22 bytes --]
[forwarding to list]
[-- Attachment #2: Type: message/rfc822, Size: 2127 bytes --]
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Noam Postavsky <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
Date: Mon, 11 Dec 2017 16:49:14 -0800
Message-ID: <87y3m8rcs5.fsf@ericabrahamsen.net>
On 12/11/17 19:08 PM, Noam Postavsky wrote:
> Eric Abrahamsen <eric@ericabrahamsen.net> 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
next prev parent reply other threads:[~2017-12-12 1:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-29 19:13 bug#25294: 26.0.50; Allow more catch-all values for cl-defmethod's &context plus major-mode specializer Eric Abrahamsen
2016-12-30 4:35 ` npostavs
2017-12-11 23:57 ` Eric Abrahamsen
2017-12-12 0:08 ` Noam Postavsky
2017-12-12 1:39 ` Noam Postavsky [this message]
2017-12-12 1:43 ` Noam Postavsky
2017-12-12 5:42 ` Eric Abrahamsen
2017-12-12 23:58 ` Noam Postavsky
2017-12-14 0:06 ` Eric Abrahamsen
2017-12-14 21:01 ` Eric Abrahamsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87efo0encf.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=25294@debbugs.gnu.org \
--cc=eric@ericabrahamsen.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.