home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / emacs / help / 5150 < prev    next >
Encoding:
Text File  |  1992-12-22  |  3.7 KB  |  100 lines

  1. Xref: sparky gnu.emacs.help:5150 gnu.emacs.gnus:1426
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!spool.mu.edu!agate!naughty-peahen
  3. From: Jym Dyer <jym@mica.berkeley.edu>
  4. Newsgroups: gnu.emacs.help,gnu.emacs.gnus
  5. Subject: Re: Two suggestions on changes in gnus (sig-inclusion and fill-mode)
  6. Date: 22 Dec 1992 00:44:44 GMT
  7. Organization: The Naughty Peahen Party Line
  8. Lines: 85
  9. Message-ID: <Jym.21Dec1992.1644@naughty-peahen>
  10. References: <KREJ.92Dec17132445@lithiumx.electrum.kth.se>
  11.         <9212171838.AA23722@acorn.co.uk>
  12. NNTP-Posting-Host: remarque.berkeley.edu
  13. In-reply-to: pd@x.co.UK's message of 17 Dec 92 14:05:47 GMT
  14.  
  15. [I've added gnu.emacs.help to this thread, since my replies
  16. apply to rnews as well as to gnus.]
  17.  
  18. >> [Suggestion One]  I would like to have a variable which
  19. >> changes [gnus'] behavior to that of elm; the signature is
  20. >> appended automatically before I start to write the article.
  21.  
  22. =+= This can be done in both gnus and rnewspost by setting the
  23. news-setup-hook variable.  Here's an example (which will only
  24. insert signature files for gnus, but won't break rnewspost):
  25.  
  26. =============8<=============Cut-Here=============8<=============
  27. (setq news-setup-hook
  28.   (function
  29.     (lambda ()
  30.       (let ((sigfile
  31.              (nth 1 (assoc (eval (make-local-variable
  32.          'gnus-newsgroup-name))
  33.                            '(("alt.angst" "angst.sig")
  34.                              ("alt.tv.simpsons" "hell.sig")
  35.                              ("rec.arts.comics.misc"
  36.                  "moore.sig")
  37.                              ("rec.arts.comics.strips"
  38.                  "hobbes.sig") )))))
  39.         (if (stringp sigfile)
  40.             (progn
  41.               (goto-char (point-max))
  42.               (insert "--\n")
  43.               (insert-file (concat "~/" (eval sigfile))) )) ))))
  44. =============>8=============Cut-Here=============>8=============
  45.  
  46. =+= A few notes:
  47.  
  48.   o The above code actually selects from a number of signature
  49.     files, each tailored to specific newsgroups.  If you want to
  50.     insert just one file, unconditionally, something like this
  51.     would suffice:
  52.  
  53.       (goto-char (point-max)
  54.       (insert "--\n")
  55.       (insert-file "~/.signature")
  56.  
  57.   o The mucking about with (eval) and (make-local-variable) is
  58.     because rnews doesn't know the gnus-newsgroup-name variable.
  59.  
  60.   o Unfortunately, you're always going to be left with your
  61.     cursor set *after* the signature, because the function
  62.     that runs this hook always does a (goto-char (point-max))
  63.     afterwards.  This can't be fixed without changing the
  64.     rnewspost.el file in the Emacs lisp library.
  65.  
  66. >> [Suggestion Two]  It would be nice to have an easy way to
  67. >> make emacs toggle into auto-fill-mode when starting to write
  68. >> on an article . . .
  69.  
  70. =+= For this you use the news-reply-mode-hook variable.  Here's
  71. how mine is set:
  72.  
  73. =============8<=============Cut-Here=============8<=============
  74. (setq news-reply-mode-hook
  75.   (function
  76.    (lambda ()
  77.      (auto-fill-mode 1) )))
  78. =============>8=============Cut-Here=============>8=============
  79.  
  80. Setting text-mode-hook to the same value will have the same
  81. effect.
  82.  
  83. =+= If you don't like the default value of the fill column,
  84. you can't change it everywhere just by changing the value of
  85. the fill-column variable.  This variable "automatically becomes
  86. local when set in any fashion."  If you want to set it to
  87. another value, you need to use (setq-default):
  88.  
  89. =============8<=============Cut-Here=============8<=============
  90. (setq-default fill-column 64)
  91. =============>8=============Cut-Here=============>8=============
  92.  
  93. > If you do do this I've found my subject and other header lines
  94. > can get filled with bad (illegal header) results when you
  95. > modify them.
  96.  
  97. =+= This is a hassle, but on balance I find it easier to fix
  98. those header lines by hand than to fill the text by hand.
  99.     <_Jym_>
  100.