unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* derived-mode should provide default abbrev-table
@ 2011-07-01  8:12 Andreas Röhler
  2011-07-01 16:42 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Röhler @ 2011-07-01  8:12 UTC (permalink / raw)
  To: Emacs developers

Hi,

with resp. to

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8910

`define-derived-mode' says:

:abbrev-table TABLE
	Use TABLE instead of the default.
	A nil value means to simply use the same abbrev-table as the parent.


Two issues:

- If the slot isn't served, no abbrev-table exists AFAIS. A bug IMHO: 
Specification should be required only for non-defaults. Ie 
":abbrev-table nil" should be the default.

- If a name is given which doesn't represent a valid table, the mode 
hook should make an empty one from it silently.

Cheers,

Andreas



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: derived-mode should provide default abbrev-table
  2011-07-01  8:12 derived-mode should provide default abbrev-table Andreas Röhler
@ 2011-07-01 16:42 ` Stefan Monnier
  2011-07-01 17:48   ` Andreas Röhler
  2011-07-02  7:59   ` Andreas Röhler
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Monnier @ 2011-07-01 16:42 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: Emacs developers

> `define-derived-mode' says:
> :abbrev-table TABLE
> 	Use TABLE instead of the default.
> 	A nil value means to simply use the same abbrev-table as the parent.
> Two issues:
> - If the slot isn't served, no abbrev-table exists AFAIS.

As the doc says, it just uses the same as the parent (if the parent
doesn't use any, then the child won't use any either).

> A bug IMHO: Specification should be required only for non-defaults. Ie
> ":abbrev-table nil" should be the default.

I agree.  And yes, I'm guilty of making this design choice back then.
It was an unfortunate decision but I'm not sure it's worth changing now.

> - If a name is given which doesn't represent a valid table, the mode hook
> should make an empty one from it silently.

No, that's not how it works: we do not want to encourage the use of
non-standard abbrev-table names.


        Stefan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: derived-mode should provide default abbrev-table
  2011-07-01 16:42 ` Stefan Monnier
@ 2011-07-01 17:48   ` Andreas Röhler
  2011-07-04 15:23     ` Stefan Monnier
  2011-07-02  7:59   ` Andreas Röhler
  1 sibling, 1 reply; 5+ messages in thread
From: Andreas Röhler @ 2011-07-01 17:48 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs developers


>
>> - If a name is given which doesn't represent a valid table, the mode hook
>> should make an empty one from it silently.
>
> No, that's not how it works: we do not want to encourage the use of
> non-standard abbrev-table names.
>
>
>          Stefan
>

Hm, that's not plausible for me. Could you tell the reason?

A derived mode will probable deserve a new table of it's own, if the 
parent table is not suitable.

What kind of standard you see in danger here which respect to mode-name?

Or to say: to give a choice but making it complicate using it, sounds a 
little bit, hmm...

Andreas




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: derived-mode should provide default abbrev-table
  2011-07-01 16:42 ` Stefan Monnier
  2011-07-01 17:48   ` Andreas Röhler
@ 2011-07-02  7:59   ` Andreas Röhler
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Röhler @ 2011-07-02  7:59 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs developers

[ ... ]

Hi Stefan,

still some thought's as I think `define-derived-mode'
is a very interesting tool, just some tweaks away from
being another big joy.

It's doku gives the reasons why to use it with the
following example:

  article-mode sgml-mode "Article"
     "Major mode for editing technical articles."
     (setq case-fold-search nil))

Well, imagine a translator with a couple of hundred abbrevs around.

Not just "Article" might deserve a derived mode, but
different kinds of articles, topics.

That's because handy abbrevs are limited and you might
not want to redefine useful old ones.

Then, let's say defining derived mode "steel-wheels"
should not distract users from their work.

Opening an own abbrev-space might be the basic reason.

BTW per default a derived-mode should inherit -ie read-- the
parents abbrevs, but not write it's own back.

So far,

Andreas




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: derived-mode should provide default abbrev-table
  2011-07-01 17:48   ` Andreas Röhler
@ 2011-07-04 15:23     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2011-07-04 15:23 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: Emacs developers

>>> - If a name is given which doesn't represent a valid table, the mode hook
>>> should make an empty one from it silently.
>> No, that's not how it works: we do not want to encourage the use of
>> non-standard abbrev-table names.
> Hm, that's not plausible for me. Could you tell the reason?

Because it would be non-standard and that having standard names makes it
easier to find things?

> What kind of standard you see in danger here which respect to mode-name?

I said "abbrev-table names", not "mode name".


        Stefan



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-07-04 15:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-01  8:12 derived-mode should provide default abbrev-table Andreas Röhler
2011-07-01 16:42 ` Stefan Monnier
2011-07-01 17:48   ` Andreas Röhler
2011-07-04 15:23     ` Stefan Monnier
2011-07-02  7:59   ` Andreas Röhler

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).