Gnus development mailing list
 help / color / mirror / Atom feed
* Default for message-tab-body-function
@ 2001-11-29  8:50 Kai Großjohann
  2001-11-29 15:49 ` Simon Josefsson
  0 siblings, 1 reply; 5+ messages in thread
From: Kai Großjohann @ 2001-11-29  8:50 UTC (permalink / raw)


I think the default behavior for TAB in the body of a message should
be whatever TAB in text-mode does.  (Even if the user has changed
what TAB in text-mode does.)

Is there a way to achieve this, or to come close?

kai
-- 
Simplification good!  Oversimplification bad!  (Larry Wall)



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

* Re: Default for message-tab-body-function
  2001-11-29  8:50 Default for message-tab-body-function Kai Großjohann
@ 2001-11-29 15:49 ` Simon Josefsson
  2001-11-29 16:45   ` Kai Großjohann
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Josefsson @ 2001-11-29 15:49 UTC (permalink / raw)
  Cc: ding

Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> I think the default behavior for TAB in the body of a message should
> be whatever TAB in text-mode does.  (Even if the user has changed
> what TAB in text-mode does.)
>
> Is there a way to achieve this, or to come close?

Like this?  Message even runs text-mode-hook, so frobing text-mode-map
from that hook should work using Message as well.

--- message.el.~6.170.~	Thu Nov 29 16:21:44 2001
+++ message.el	Thu Nov 29 16:47:14 2001
@@ -5183,7 +5183,7 @@
   :group 'message
   :type '(alist :key-type regexp :value-type function))
 
-(defcustom message-tab-body-function 'indent-relative
+(defcustom message-tab-body-function (lookup-key text-mode-map "\t")
   "*Function to execute when `message-tab' (TAB) is executed in the body."
   :group 'message
   :type 'function)




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

* Re: Default for message-tab-body-function
  2001-11-29 15:49 ` Simon Josefsson
@ 2001-11-29 16:45   ` Kai Großjohann
  2001-11-29 16:59     ` ShengHuo ZHU
  0 siblings, 1 reply; 5+ messages in thread
From: Kai Großjohann @ 2001-11-29 16:45 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> writes:

> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
>
>> I think the default behavior for TAB in the body of a message should
>> be whatever TAB in text-mode does.  (Even if the user has changed
>> what TAB in text-mode does.)
>>
>> Is there a way to achieve this, or to come close?
>
> Like this?  Message even runs text-mode-hook, so frobing text-mode-map
> from that hook should work using Message as well.

This of course looks up the key at the time when message.el* is
loaded.  So it does not work to do

    (require 'message)
    (define-key text-mode-map (kbd "TAB") ...)

But then, maybe that's not necessary.  Maybe your suggestion is good
enough.

kai
-- 
Simplification good!  Oversimplification bad!  (Larry Wall)



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

* Re: Default for message-tab-body-function
  2001-11-29 16:45   ` Kai Großjohann
@ 2001-11-29 16:59     ` ShengHuo ZHU
  2001-11-29 17:09       ` Kai Großjohann
  0 siblings, 1 reply; 5+ messages in thread
From: ShengHuo ZHU @ 2001-11-29 16:59 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> Simon Josefsson <jas@extundo.com> writes:
>
>> Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:
>>
>>> I think the default behavior for TAB in the body of a message should
>>> be whatever TAB in text-mode does.  (Even if the user has changed
>>> what TAB in text-mode does.)
>>>
>>> Is there a way to achieve this, or to come close?
>>
>> Like this?  Message even runs text-mode-hook, so frobing text-mode-map
>> from that hook should work using Message as well.
>
> This of course looks up the key at the time when message.el* is
> loaded.  So it does not work to do
>
>     (require 'message)
>     (define-key text-mode-map (kbd "TAB") ...)
>
> But then, maybe that's not necessary.  Maybe your suggestion is good
> enough.

How about the following code?

(defcustom message-tab-body-function nil
           ...)

(defun message-tab ()
      ...
    (funcall (or (cdar alist) message-tab-body-function 
                 (lookup-key text-mode-map "\t")))
   )

ShengHuo



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

* Re: Default for message-tab-body-function
  2001-11-29 16:59     ` ShengHuo ZHU
@ 2001-11-29 17:09       ` Kai Großjohann
  0 siblings, 0 replies; 5+ messages in thread
From: Kai Großjohann @ 2001-11-29 17:09 UTC (permalink / raw)


ShengHuo ZHU <zsh@cs.rochester.edu> writes:

> How about the following code?
>
> (defcustom message-tab-body-function nil
>            ...)
>
> (defun message-tab ()
>       ...
>     (funcall (or (cdar alist) message-tab-body-function 
>                  (lookup-key text-mode-map "\t")))
>    )

Great!  Yes!  Yes!

kai
-- 
Simplification good!  Oversimplification bad!  (Larry Wall)



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

end of thread, other threads:[~2001-11-29 17:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-29  8:50 Default for message-tab-body-function Kai Großjohann
2001-11-29 15:49 ` Simon Josefsson
2001-11-29 16:45   ` Kai Großjohann
2001-11-29 16:59     ` ShengHuo ZHU
2001-11-29 17:09       ` Kai Großjohann

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