home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / help-lucid-emacs / text0233.txt < prev    next >
Encoding:
Text File  |  1993-07-14  |  3.3 KB  |  86 lines

  1. Excerpt of message (sent 30 April 93) by Lars Nyman:
  2.  
  3.   lars>   Hmmm, I tried it but get some errors.  First, when lemacs fires up
  4.   lars>   and .emacs is loaded I get: "Symbol's function definition is void:
  5.   lars>   unless".  So, I changed "(unless ... ...)" to "(if (not ...) ...)".
  6.  
  7.   lars>   That allows lemacs to come up ok.  Then, when I enter 'M-X gnus' a
  8.   lars>   new screen comes up allright, but I get: "Autoloading failed to
  9.   lars>   define function real-gnus" in the new screen - and thus I failed to
  10.   lars>   enter into gnus mode...
  11.  
  12.   lars>   Btw, there should be no other interaction with other stuff I have in
  13.   lars>   my original .emacs file, as I removed it and put just what you sent
  14.   lars>   me in my new .emacs file.  Any clues ?
  15.  
  16.   Sorry, I was too quick off the mark. I've cleaned it all up so that it should
  17. work from anyone's environment, and put all you need into a separate file which
  18. you should byte-compile and load from your .emacs.
  19.  
  20. --
  21. Regards, David
  22.  
  23. 8< ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CUT HERE for file: mygnus.el
  24. ;; stuff for GNUS in a separate screen
  25. ;; David Hughes 30th April 1993
  26. (load "gnus" nil t)
  27.  
  28. (setq gnus-nntp-server "rhubarb"
  29.       gnus-user-full-name (user-full-name)
  30.       gnus-large-newsgroup 100
  31.       gnus-default-article-saver (function gnus-Subject-save-in-mail))
  32.  
  33. (add-hook 'gnus-Article-mode-hook
  34.           (function (lambda () (setq screen-icon-title-format "GNUS"))))
  35.  
  36. (add-hook 'gnus-Group-mode-hook
  37.           (function (lambda () (setq screen-icon-title-format "GNUS"))))
  38.  
  39. (add-hook 'gnus-Subject-mode-hook
  40.           (function (lambda () (setq screen-icon-title-format "GNUS"))))
  41.  
  42. (defvar gnus-screen nil
  43.   "Screen to use for running gnus")
  44.  
  45. (or (fboundp 'real-gnus)
  46.     (fset 'real-gnus (symbol-function 'gnus)))
  47.  
  48. (defvar message-header-colour "brown"
  49.   "Colour in which mail headers are displayed")
  50.  
  51. (defun gnus (&optional confirm)
  52.   "Read network news.
  53. onal argument CONFIRM is non-nil, ask NNTP server."
  54.   (interactive "P")
  55.   (or (and (screenp gnus-screen)
  56.            (condition-case err (deiconify-screen gnus-screen) (error nil)))
  57.       (setq gnus-screen (x-create-screen nil)))
  58.   (select-screen gnus-screen)
  59.   (real-gnus confirm)
  60.   (gnus-Group-get-new-news)
  61.   (let ((gnus-subject (get-buffer "*Subject*"))
  62.         (gnus-article (get-buffer "*Article*")))
  63.     (if (locate-file "highlight-headers" load-path ":.el")
  64.         (progn
  65.           (load "highlight-headers" nil t)
  66.           (if (x-color-display-p)
  67.               (set-face-foreground
  68.                'message-cited-text message-header-colour)
  69.             (set-face-font 'message-header-contents (face-font 'bold))
  70.             (set-face-foreground
  71.              'message-header-contents message-header-colour))))
  72.     (select-window
  73.      (or (and (bufferp gnus-subject)
  74.               (eq (symbol-buffer-value 'major-mode gnus-subject) 'gnus-Subject-mode)
  75.               (window-visible-p (get-buffer-window gnus-subject)))
  76.          (and (bufferp gnus-article)
  77.               (eq (symbol-buffer-value 'major-mode gnus-article) 'gnus-Article-mode)
  78.               (window-visible-p (get-buffer-window gnus-article)))
  79.          (selected-window)))
  80.     (case major-mode
  81.       (gnus-Subject-mode
  82.        (gnus-Subject-show-article))
  83.       (gnus-Article-mode
  84.        (gnus-Article-show-subjects)))))
  85.  
  86.