From: Eli Zaretskii <eliz@gnu.org>
To: Sebastian Wiesner <lunaryorn@gmail.com>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Derived modes and mode hooks
Date: Sat, 09 Mar 2013 21:31:48 +0200 [thread overview]
Message-ID: <83wqtgwesb.fsf@gnu.org> (raw)
In-Reply-To: <CALf2awQnHAJk-Aj=SULsMoud9ESmkyDoGxR4hRbAgZp71x3udg@mail.gmail.com>
> Date: Sat, 9 Mar 2013 19:58:11 +0100
> From: Sebastian Wiesner <lunaryorn@gmail.com>
> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
>
> 2013/3/9 Eli Zaretskii <eliz@gnu.org>:
> >> In order to completely disable automatic filling I'd add a function
> >> which simply returns t to this list?
> >
> > That's one possibility; I'm sure there are others, less radical ones.
> >
> >> That sounds like a nasty hack to me.
> >
> > I don't see why. It is certainly not as nasty as overriding user
> > customizations.
>
> So your proposed solution effectively inhibits auto filling and thus
> also *effectively overrides* the user's customization, but in a
> convoluted way, abusing a variable which is obviously intended for a
> different purpose, and which most likely only few users even know
> about.
>
> Yet you actually *prefer* this crude way of effectively overriding the
> user's customization over simply disabling the mode, *the* obvious way
> of inhibiting auto filling, more over clearly indicated to the user by
> the absence of the corresponding entry in the mode line.
>
> Did I get that correctly?
No. I did say I'm sure there are less radical ways of doing this,
didn't I?
> > The whole business of inheriting from a mode makes sense only when the
> > child mode is compatible with its parent.
>
> I wonder how you define “compatible”, for I cannot see any applicable
> definition of this term that would make plain "text-mode" and an
> advanced mode like AUCTeX' "latex-mode" “compatible”. They behave
> completely different, and I doubt that any *user* of AUCTeX would
> actually call them “compatible”.
They are "compatible" because TeX documents are plain text documents,
albeit with markup.
> I hitherto thought the main point of derived modes was simply to allow
> re-use of code
Reuse doesn't make sense if you need to disable most of the inherited
code. Might as well write your mode from scratch in that case.
> I do not want to *change* the user's customization. The user's
> customization will still be in effect, where it makes sense, i.e. in
> other modes derived from text-mode.
Customizations made to FOO-mode-hook are supposed to be in effect in
any mode which inherits from FOO.
In any case, you misunderstand what I meant: I meant not to modify the
hook itself. It is okay to make the same effect in other ways.
next prev parent reply other threads:[~2013-03-09 19:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-09 14:06 Derived modes and mode hooks Sebastian Wiesner
2013-03-09 14:31 ` Xue Fuqiao
2013-03-09 14:43 ` Sebastian Wiesner
2013-03-09 15:56 ` Stefan Monnier
2013-03-09 16:25 ` Sebastian Wiesner
2013-03-09 16:43 ` Eli Zaretskii
2013-03-09 17:03 ` Sebastian Wiesner
2013-03-09 17:51 ` Eli Zaretskii
2013-03-09 18:58 ` Sebastian Wiesner
2013-03-09 19:31 ` Eli Zaretskii [this message]
2013-03-09 19:49 ` Sebastian Wiesner
2013-03-09 20:22 ` chad
2013-03-10 5:53 ` Stefan Monnier
2013-03-10 15:34 ` Sebastian Wiesner
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=83wqtgwesb.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=lunaryorn@gmail.com \
--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.