all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Eric M. Ludlam" <eric@siege-engine.com>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Matthew Dempsky <matthew@dempsky.org>, emacs-devel@gnu.org
Subject: Re: Codifications of rules
Date: Mon, 07 Dec 2009 19:03:17 -0500	[thread overview]
Message-ID: <4B1D97C5.9050809@siege-engine.com> (raw)
In-Reply-To: <jwvk4wy4gj6.fsf-monnier+emacs@gnu.org>

Hi,

The mode-local tool that came in with the CEDET stuff has a notion of 
"mode local" functions.  A tool maintainer will mark a function as being 
overloadable, and a major-mode author defines the same function as 
overloaded for a particular mode.

In this way a tool (like Semantic) can define a bunch of core feature 
function APIs, and major modes can easily define that custom behavior. 
Functions like beginning/end of defun have ways to override with special 
variables.  Mode local does something similar, but the macros allow 
codification of rules.  For example, it ensures the doc-string specifies 
it can be overloaded.  If additional "rules" are needed to help, they 
could be added to the macros.

Some of the things listed in the thread so far would be easily handled 
by mode-local.

Eric

Stefan Monnier wrote:
>>> It binds TAB to ruby-indent-line. That is against the rules. ;-)
>> Out of curiosity, are 'rules' like this codified anywhere?
> 
> Not much, sadly.  There Elisp manual has a section about coventions to
> follow for major modes, so the info should be there, but there's a lot
> more conventions than the documented ones.
> 
> But as a general rule, if you want key K to do something it's preferable
> to do it by setting some variables that affect K's default binding than
> by rebinding it to another command.
> 
> I.e. better set indent-line-function, fill-paragraph-function,
> completion-at-point-functions, rather than rebing TAB, M-q , M-TAB, ...
> 
> The general goal should be to make it easier for a user to state
> global preferences that affect all modes.
> 
>> As I've started using Emacs seriously again, I've started noticing
>> a lot of little inconsistencies between extensions (e.g., how
>> temporary windows are displayed/destroyed).  I'd be happy to submit
>> patches to help improve this if someone could point out the
>> correct behavior.
> 
> These are usually welcome here (although they also tend to be delicate
> because users get quickly used to the old behavior and then show
> resistance to change).
> 
> 
>         Stefan
> 
> 
> 




      parent reply	other threads:[~2009-12-08  0:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07 19:55 Codifications of rules (was Re: bug#5119: ruby-mode binds TAB) Matthew Dempsky
2009-12-07 20:56 ` David Reitter
2009-12-08  1:23   ` Stephen J. Turnbull
2009-12-08  2:03     ` Codifications of rules Stefan Monnier
2009-12-08  5:00     ` Codifications of rules (was Re: bug#5119: ruby-mode binds TAB) David Reitter
2009-12-08  1:57   ` Codifications of rules Stefan Monnier
2009-12-07 21:37 ` Stefan Monnier
2009-12-07 22:13   ` Matthew Dempsky
2009-12-08  0:03   ` Eric M. Ludlam [this message]

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=4B1D97C5.9050809@siege-engine.com \
    --to=eric@siege-engine.com \
    --cc=emacs-devel@gnu.org \
    --cc=matthew@dempsky.org \
    --cc=monnier@IRO.UMontreal.CA \
    /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.