home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / lemacs-19.6 / lisp / gnus / gnus-user-sxa.el < prev    next >
Encoding:
Text File  |  1992-06-29  |  5.0 KB  |  151 lines

  1. ;;; User Contributed Software for GNUS newsreader
  2. ;; Copyright (C) 1989 Masanobu UMEDA
  3.  
  4. ;; This file is part of GNU Emacs.
  5.  
  6. ;; GNU Emacs is distributed in the hope that it will be useful,
  7. ;; but WITHOUT ANY WARRANTY.  No author or distributor
  8. ;; accepts responsibility to anyone for the consequences of using it
  9. ;; or for whether it serves any particular purpose or works at all,
  10. ;; unless he says so in writing.  Refer to the GNU Emacs General Public
  11. ;; License for full details.
  12.  
  13. ;; Everyone is granted permission to copy, modify and redistribute
  14. ;; GNU Emacs, but only under the conditions described in the
  15. ;; GNU Emacs General Public License.   A copy of this license is
  16. ;; supposed to have been given to you along with GNU Emacs so you
  17. ;; can know your rights and responsibilities.  It should be in a
  18. ;; file named COPYING.  Among other things, the copyright notice
  19. ;; and this notice must be preserved on all copies.
  20.  
  21. ;; The program in this file is contributed by Sakaeda
  22. ;; <saka@mickey.trad.pf.fujitsu.junet>, and is not part of the
  23. ;; standard distribution of GNUS.  This may be included in the future
  24. ;; releases of GNUS.  Please do not send me any flame on it.
  25.  
  26. ;;Return-Path: <saka@mickey.trad.pfu.fujitsu.junet>
  27. ;;To: umerin@photon.stars.flab.fujitsu.junet (Masanobu UMEDA)
  28. ;;Subject: Re: GNUS 3.11 on SX/A EMACS. 
  29. ;;In-Reply-To: Your message of Mon, 03 Apr 89 12:43:11 +0900.
  30. ;;             <8904030343.AA00729@photon.stars.flab.fujitsu.junet> 
  31. ;;Date: Thu, 06 Apr 89 11:32:41 JST
  32. ;;From: Sakaeda <saka@mickey.trad.pf.fujitsu.junet>
  33.  
  34. ;; This file contains patches for very old version of GNU Emacs such
  35. ;; as SX/A Emacs (17.64!).
  36.  
  37. (provide 'gnus-user-sxa)
  38.  
  39. ;; To load SX/A specific patches, use the following hooks:
  40. ;;(setq gnus-Group-mode-hook
  41. ;;      '(lambda ()
  42. ;;     (require 'gnus-user-sxa)))
  43. ;;
  44. ;; To show NNTP server name in mode line, use the following hook:
  45. ;;(setq gnus-Startup-hook
  46. ;;      '(lambda ()
  47. ;;     (gnus-user-sxa-show-server-name)))
  48.  
  49. (defun gnus-user-sxa-show-server-name ()
  50.   "Show NNTP server name in mode line."
  51.   (setq mode-name (concat mode-name mode-line-process)))
  52.  
  53. (defun gnus-Subject-set-mode-line ()
  54.   "Set Subject mode line string."
  55.   ;; For ooold GNU Emacs such as SX/A Emacs. by Yas.Itoh at PFU '88.11.24
  56.   (setq mode-line-format 
  57.     (format "--- GNUS: %17s %%[(%%m)%%]----%%3p-%%-"
  58.         (if gnus-current-headers
  59.             (nntp-header-subject gnus-current-headers)
  60.           gnus-newsgroup-name)))
  61.   (set-buffer-modified-p t))
  62.  
  63. (defun gnus-Article-set-mode-line ()
  64.   "Set Article mode line string."
  65.   (let ((unmarked
  66.      (- (length gnus-newsgroup-unreads) (length gnus-newsgroup-marked))))
  67.     (setq mode-line-format 
  68.        (concat "--- GNUS:"
  69.            (format "%17s"
  70.               (format " %s{%d} %s"
  71.                   gnus-newsgroup-name
  72.                   gnus-current-article
  73.                   ;; This is proposed by tale@pawl.rpi.edu.
  74.                   (if (zerop unmarked)
  75.                       "      "
  76.                     (format "%d more" unmarked))
  77.                   ))
  78.           " %[(%m)%]----%3p-%-")))
  79.   (set-buffer-modified-p t))
  80.  
  81.  
  82. ;; The following definitions are only for compatibility with *OOOOOLD*
  83. ;; Emacs, especially SX/A Emacs (a variant of GNU Emacs).
  84. ;; By Yasunari,Itoh and Sakaeda at PFU limited.
  85.  
  86. (defvar news-inews-program "inews"
  87.   "Function to post news.")
  88. (defvar news-path "/usr/spool/news/"
  89.   "The root directory below which all news files are stored.")
  90.  
  91. (fset 'load-library (symbol-function 'load))
  92. (fset 'process-send-string (symbol-function 'send-string))
  93. (fset 'process-send-region (symbol-function 'send-region))
  94.  
  95. ;; Save original funcitons.
  96. (or (fboundp 'load-org)
  97.     (fset 'load-org (symbol-function 'load)))
  98. (or (fboundp 'bury-buffer-org)
  99.     (fset 'bury-buffer-org (symbol-function 'bury-buffer)))
  100. (or (fboundp 'apply-org)
  101.     (fset 'apply-org (symbol-function 'apply)))
  102.  
  103. (load "backquote")
  104.  
  105. (defun one-window-p (&optional win)
  106.   (if (or (not win)(eq win t)) (setq win (selected-window)))
  107.   (eq (selected-window)(next-window win)))
  108.  
  109. (defun bury-buffer (&optional buffer)
  110.   (let ((buf (or buffer (current-buffer))))
  111.     (bury-buffer-org buf)
  112.     ;; By Sakaeda and Itoh at PFU '89.02.28
  113.     (or buffer (switch-to-buffer (other-buffer)))
  114.     nil
  115.     ))
  116.  
  117. (defun apply (func &rest args)
  118.   (let* ((last (car (reverse args)))
  119.      (before (reverse (cdr (reverse args))))
  120.      (org-arg (append before last)))
  121.     (apply-org func org-arg)))
  122.  
  123. (defun file-name-as-directory (filename &optional expand-filename)
  124.   (let* ((expanded 
  125.       (if expand-filename (expand-file-name filename)
  126.         filename))
  127.      (tail-ix (1- (length expanded))))
  128.     (if (and (> tail-ix 0)
  129.          (= (aref expanded tail-ix) ?/)) expanded
  130.       (concat expanded "/"))))
  131.  
  132. (defun load (file &optional missing-ok nomessage dum)
  133.   "Load FILE."
  134.   (interactive "sLoad file: ")
  135.   (load-org file missing-ok nomessage))
  136.  
  137. (defun insert-char (chr count)
  138.   "Insert COUNT (second arg) copies of CHAR (first arg).
  139. Both arguments are required."
  140.   (while (> count 0)
  141.     (insert chr)
  142.     (setq count (1- count))))
  143.  
  144. ;; Fixed by H.Tsujimura(PFU) for GNUS 3.13.
  145.  
  146. (defun current-window-configuration ()
  147.   (current-buffer))
  148.  
  149. (defun set-window-configuration (window-config)
  150.   (switch-to-buffer window-config))
  151.