unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: miles@gnu.org, monnier+gnu/emacs@rum.cs.yale.edu,
	Kai.Grossjohann@CS.Uni-Dortmund.DE, emacs-devel@gnu.org
Subject: Re: Bugs caused by recent use of define-derived-mode
Date: Tue, 10 Sep 2002 23:30:07 -0500 (CDT)	[thread overview]
Message-ID: <200209110430.XAA13198@eel.dms.auburn.edu> (raw)
In-Reply-To: <E17onzz-0008MS-00@fencepost.gnu.org> (message from Richard Stallman on Tue, 10 Sep 2002 12:36:23 -0400)

Richard Stallman wrote:

   If a user manually creates a separate abbrev table for Mail mode, I
   think he will find it easy to understand the results of initializing
   it as a copy of the Text mode abbrev table.  As a form of
   "inheritance", it is inadequate, but if thought of as "copying", the
   user will think it works fine.

   So I think we should provide a function copy-abbrev-table which the
   user could call to make a copy of text-mode-abbrev-table for use in
   Mail mode.

Once the table is defined, the user could also "initialize" by killing
and yanking using M-x edit-abbrevs.  However, the function you suggest
would be more convenient.

If I understand you correctly, this would be strictly for
initialization.

There might actually be a way to relatively easily provide for
automatic updating similar to the present system, but in a bug-free
and unambiguous way.  It seems to require a lot less work than any other
solution we have been discussing.  I believe I might be able to
implement it myself, if desired, although I might first have to check
whether I am not underestimating certain difficulties.  I could not
promise anything before actually having done it.

The price to pay would be a moderate amount of added code and the need
to explain to non Lisp programmers how to set everything up in their
.emacs.  The code could either be added to abbrev.el or go into
a separate small new file. 

One way to achieve bug-free updating might conceivably be to use a new
variable, say inheriting-abbrev-table-list, whose value is a list of
abbrev tables, and two new commands: modified versions of
add-mode-abbrev and inverse-add-mode-abbrev.  The user could then
rebind C-x a l and C-x a i l to those new commands in the modes
involved (in our example, text-mode).

The behavior would be the following.

The user could, say, define a separate mail-mode-abbrev-table,
plain-tex-mode-abbrev-table and latex-mode-abbrev-table and set
inheriting-abbrev-table-list locally in text-mode to a list of these
three tables.  Then (s)he rebinds C-x a (i) l in text-mode to the new
modified variants.  The effect is that any abbrev defined using C-x a
(i) l in text-mode gets automatically inherited by these three
abbrev-tables, except when the abbrev already has an expansion in some
of these tables.  Then the commands ask the user whether (s)he wants
to redefine the abbrev, printing the mode involved.

The user could also keep the usual C-x a (i) l bindings and bind the
new commands to other key sequences of his or her choice.  That way
(s)he can decide on a case by case basis whether or not the abbrev
should be inherited by related modes.

Abbrevs defined using M-x edit-abbrevs would remain the user's
responsibility.  (S)he is already editing that buffer anyway, so it is
relatively easy to kill and yank.

Sincerely,

Luc.

  reply	other threads:[~2002-09-11  4:30 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-02  2:37 Bugs caused by recent use of define-derived-mode Luc Teirlinck
2002-09-02 16:29 ` Stefan Monnier
2002-09-02 23:02   ` Luc Teirlinck
2002-09-02 23:20     ` Stefan Monnier
2002-09-02 23:25       ` Luc Teirlinck
2002-09-02 23:29         ` Stefan Monnier
2002-09-02 23:46           ` Luc Teirlinck
2002-09-03  0:26             ` Stefan Monnier
2002-09-03  1:21       ` Luc Teirlinck
2002-09-03  2:08         ` Stefan Monnier
2002-09-03  2:04       ` Luc Teirlinck
2002-09-03  2:07         ` Stefan Monnier
2002-09-03 14:05     ` Kai Großjohann
2002-09-03 15:06       ` Stefan Monnier
2002-09-03 15:36         ` Luc Teirlinck
2002-09-03 21:23           ` Luc Teirlinck
2002-09-04  0:01             ` Luc Teirlinck
2002-09-04  3:28               ` Luc Teirlinck
2002-09-04  3:49                 ` Miles Bader
2002-09-04 12:31                   ` Luc Teirlinck
2002-09-05  2:46               ` Richard Stallman
2002-09-05  4:37                 ` Luc Teirlinck
2002-09-08 12:54                   ` Richard Stallman
2002-09-09  0:14                     ` Luc Teirlinck
2002-09-09  1:36                       ` Luc Teirlinck
2002-09-09 23:33                         ` Richard Stallman
2002-09-10  0:12                           ` Luc Teirlinck
2002-09-09  2:35                       ` Luc Teirlinck
2002-09-09 13:49                       ` Miles Bader
2002-09-09 15:25                         ` Kim F. Storm
2002-09-09 18:42                         ` Luc Teirlinck
2002-09-10 16:36                           ` Richard Stallman
2002-09-11  4:30                             ` Luc Teirlinck [this message]
2002-09-11 20:03                               ` Richard Stallman
2002-09-09 19:15                       ` Richard Stallman
2002-09-05 11:07                 ` Kai Großjohann
2002-09-06  1:26                   ` Miles Bader
2002-09-06  2:11                     ` Luc Teirlinck
2002-09-06  2:26                       ` Miles Bader
2002-09-06  2:31                         ` Luc Teirlinck
2002-09-06  2:31                       ` Miles Bader
2002-09-06 10:52                       ` Kai Großjohann
2002-09-07  3:16                         ` Richard Stallman
2002-09-06 20:03                     ` Richard Stallman
2002-09-06 15:11                   ` Richard Stallman
2002-09-04 14:13   ` Richard Stallman
2002-09-04 16:01     ` Stefan Monnier
2002-09-03 13:26 ` Richard Stallman
2002-09-03 14:57   ` Stefan Monnier
2002-09-05  2:46     ` Richard Stallman
2002-09-06 16:07       ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200209110430.XAA13198@eel.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=Kai.Grossjohann@CS.Uni-Dortmund.DE \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    --cc=monnier+gnu/emacs@rum.cs.yale.edu \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).