Gnus development mailing list
 help / color / mirror / Atom feed
* who is unsetting local-abbrev-table in message.el?
@ 1997-12-24 18:07 Randal Schwartz
  1997-12-24 18:31 ` Michael R Cook
  0 siblings, 1 reply; 5+ messages in thread
From: Randal Schwartz @ 1997-12-24 18:07 UTC (permalink / raw)



I got tired of typing the same things over and over again in my
mail.  I've never used abbrev modes before, but I scanned the elisp
manual and "text-mode" enough to the point where I think I got it.

So I added to my .gnus.el the following:

    (defun MERLYN-message-mode-hook ()
      (define-abbrev-table 'message-mode-abbrev-table
	'(
	  ("uwt" "http://www.stonehenge.com/merlyn/WebTechniques" nil 0)
	  ))
      (setq local-abbrev-table message-mode-abbrev-table)
      (abbrev-mode 1))
    (add-hook 'message-mode-hook 'MERLYN-message-mode-hook)

And sure enough, the next time I went into message mode for a compose,
mode-line says abbrev is on, message-mode-mode-abbrev-table looked
fine, *but* local-abbrev-table was nil!  How come?  How many times do
I have to set it? :-)

I suppose the workaround is to add my abbrevs to the text-mode abbrev
table (which it seems to want to do by default), but I'd rather not.
It'd be nicer to understand why this doesn't work first.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

* Re: who is unsetting local-abbrev-table in message.el?
  1997-12-24 18:07 who is unsetting local-abbrev-table in message.el? Randal Schwartz
@ 1997-12-24 18:31 ` Michael R Cook
  1997-12-24 18:47   ` Michael R Cook
  0 siblings, 1 reply; 5+ messages in thread
From: Michael R Cook @ 1997-12-24 18:31 UTC (permalink / raw)
  Cc: ding

>>>>> "RS" == Randal Schwartz <merlyn@stonehenge.com> writes:

 RS> And sure enough, the next time I went into message mode for a compose,
 RS> mode-line says abbrev is on, message-mode-mode-abbrev-table looked
 RS> fine, *but* local-abbrev-table was nil!  How come?

For me, local-abbrev-table is setup correctly initially (typing C-h
v local-abbrev-table immediately upon entering message mode, I see
that the symbol is set as expected--non-nil), but type a little and
check again, and the symbol has been magically set to nil.

Typing, say, "xxx" is not enough to cause local-abbrev-table to
become nil.  But typing "xxx!" is (the "!" would cause abbrev
expansion).

Offhand, I'd guess that at the first attempt to expand an
abbreviation, Emacs detects some kind of problem, and reacts by
quietly setting local-abbrev-table to nil.

Michael.


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

* Re: who is unsetting local-abbrev-table in message.el?
  1997-12-24 18:31 ` Michael R Cook
@ 1997-12-24 18:47   ` Michael R Cook
  1997-12-24 19:57     ` Randal Schwartz
  0 siblings, 1 reply; 5+ messages in thread
From: Michael R Cook @ 1997-12-24 18:47 UTC (permalink / raw)


>>>>> "MRC" == Michael R Cook <mcook@cognex.com> writes:
>>>>> "RS" == Randal Schwartz <merlyn@stonehenge.com> writes:

 RS> And sure enough, the next time I went into message mode for a compose,
 RS> mode-line says abbrev is on, message-mode-mode-abbrev-table looked
 RS> fine, *but* local-abbrev-table was nil!  How come?

 MRC> For me, local-abbrev-table is setup correctly initially (typing C-h
 MRC> v local-abbrev-table immediately upon entering message mode, I see
 MRC> that the symbol is set as expected--non-nil), but type a little and
 MRC> check again, and the symbol has been magically set to nil.

`mailabbrev.el' is the culprit.  `sendmail-pre-abbrev-expand-hook'
tries to dynamically select between two abbrev tables
(mail-mode-abbrev-table and mail-abbrevs) based on point.

So, you could put your abbrevs into `mail-mode-abbrev-table' rather
than `message-mode-abbrev-table'.  Dunno whether to call that a
workaround or a fix.

Michael.


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

* Re: who is unsetting local-abbrev-table in message.el?
  1997-12-24 18:47   ` Michael R Cook
@ 1997-12-24 19:57     ` Randal Schwartz
  1998-01-04  9:44       ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: Randal Schwartz @ 1997-12-24 19:57 UTC (permalink / raw)
  Cc: ding

>>>>> "Michael" == Michael R Cook <mcook@cognex.com> writes:

Michael> So, you could put your abbrevs into `mail-mode-abbrev-table' rather
Michael> than `message-mode-abbrev-table'.  Dunno whether to call that a
Michael> workaround or a fix.

And, in further observation, the mailabbrev.el also sets the syntax
table to mail-mode-syntax-table.  So, neither message-abbrev-table nor
message-mode-syntax-table are being used, except for the first few
proper keystrokes in the body.

Some would call this a bug.  Others, an unfortunate collision of
message-mode trying to completely override mail-mode.

How to resolve?

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

* Re: who is unsetting local-abbrev-table in message.el?
  1997-12-24 19:57     ` Randal Schwartz
@ 1998-01-04  9:44       ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-01-04  9:44 UTC (permalink / raw)


Randal Schwartz <merlyn@stonehenge.com> writes:

> And, in further observation, the mailabbrev.el also sets the syntax
> table to mail-mode-syntax-table.  So, neither message-abbrev-table nor
> message-mode-syntax-table are being used, except for the first few
> proper keystrokes in the body.
> 
> Some would call this a bug.  Others, an unfortunate collision of
> message-mode trying to completely override mail-mode.
> 
> How to resolve?

Hm.  I don't know.  Anybody have any suggestions?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

end of thread, other threads:[~1998-01-04  9:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-24 18:07 who is unsetting local-abbrev-table in message.el? Randal Schwartz
1997-12-24 18:31 ` Michael R Cook
1997-12-24 18:47   ` Michael R Cook
1997-12-24 19:57     ` Randal Schwartz
1998-01-04  9:44       ` Lars Magne Ingebrigtsen

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 NNTP newsgroup(s).