David Rod <[EMAIL PROTECTED]> writes:

> (defun david-r-turn-on-text-stuff ()
>   (flyspell-mode 1)
>   (abbrev-mode 1)
>  )
>
> (add-hook 'text-mode-hook 'david-r-turn-on-text-stuff)
>
> this works fine.  I want to add a (mark-whole-buffer)
> (canonically-space-region)
> Whenever I try this, this renders new messages and follow-ups
>  by gnus inoperable 

You probably got a better response on how to call
canonically-space-region with point-min and point-max, but it's good
style to call elisp code that indirectly manipulates the point or mark
inside a save-excursion block as well.  (text-mode-hook might get called
in a context where the point is assumed to be somewhere else, like the
start of the message body.)  The help I have for `C-h f
mark-whole-buffer' states that "it is usually a mistake for a Lisp
function to use any subrouten that uses or sets the mark".

> Also another question.  is there a hook by killing a buffer which
> contains a file with the extension as .txt ?

Not a Gnus question per se, but kill-buffer-hook gets called with the
buffer being killed as the current buffer, so you can look at
buffer-local variables like major-mode to see.

  --dzm
_______________________________________________
info-gnus-english mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to