home *** CD-ROM | disk | FTP | other *** search
/ ftp.madoka.org / 2014.12.ftp.madoka.org.tar / ftp.madoka.org / pub / irchat-pj / irchat-pj-2.4.24.22.tar.gz / irchat-pj-2.4.24.22.tar / irchat-pj-2.4.24.22 / irchat-pj-modeline.el < prev    next >
Lisp/Scheme  |  2001-01-17  |  3KB  |  83 lines

  1. ;;; irchat-pj-modeline.el --- Mode line format definition for irchat-pj
  2.  
  3. ;; Copyright (C) 2000 by Project Pure.
  4.  
  5. ;; Author: SHIMADA Mitsunobu <simm@irc.fan.gr.jp>
  6. ;; Keywords: IRC, irchat-pj, mode-line-format
  7.  
  8. ;; $Id: irchat-pj-modeline.el,v 1.7 2001/01/17 14:36:01 simm Exp $
  9.  
  10. ;; This file is free software; you can redistribute it and/or modify
  11. ;; it under the terms of the GNU General Public License as published by
  12. ;; the Free Software Foundation; either version 2, or (at your option)
  13. ;; any later version.
  14.  
  15. ;; This file is distributed in the hope that it will be useful,
  16. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. ;; GNU General Public License for more details.
  19.  
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  22. ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  23. ;; Boston, MA 02111-1307, USA.
  24.  
  25. ;;; Commentary:
  26.  
  27. ;; 
  28.  
  29. ;;; Code:
  30.  
  31. ;; AWAY / FREEZE indicator: used as `mode-line-modified'
  32. (defvar irchat-pj-modeline-global-status
  33.   '((irchat-pj-away-p "A" "-")
  34.     (irchat-freeze "F" "-"))
  35.   "Global mode line setting, to display IRC status.
  36. This variable is used as `mode-line-modified', in Commands/Dialogue/Others buffer.")
  37. (defvar irchat-pj-modeline-local-status
  38.   '((irchat-pj-away-p "A" "-")
  39.     (irchat-freeze-local "F" "-")
  40.     (irchat-beep-local "B" "-")
  41.     (irchat-suppress-local "S" "-"))
  42.   "Local mode line setting, to display IRC status.
  43. This variable is used as `mode-line-modified', in Channel buffer.")
  44.  
  45. ;; NICK / SERVER NAME / CHANNEL indicator: use as `mode-line-buffer-identification'
  46. (defvar irchat-pj-modeline-Command-buffer
  47.   '("irchat-pj: " irchat-nickname " <" irchat-servername "> " irchat-chanbuf-indicator)
  48.   "Local mode line setting, to display IRC informations in Commands buffer.
  49. This variable is used as `mode-line-buffer-identification'.")
  50. (defvar irchat-pj-modeline-Dialogue-buffer
  51.   '("" irchat-chanbufs-indicator)
  52.   "Local mode setting, to display IRC informations in Dialogue buffer.
  53. This variable is used as `mode-line-buffer-identification'.")
  54. (defvar irchat-pj-modeline-Others-buffer
  55.   '("" irchat-chanbufs-indicator)
  56.   "Local mode setting, to display IRC informations in Others buffer.
  57. This variable is used as `mode-line-buffer-identification'.")
  58. (defvar irchat-pj-modeline-Channel-buffer
  59.   '("irchat-pj: " irchat-chanbuf-indicator)
  60.   "Local mode setting, to display IRC informations in Channel buffer.
  61. This variable is used as `mode-line-buffer-identification'.")
  62.  
  63. ;; set mode line
  64. (defun irchat-pj-modeline-set (status buffer-info &optional user-define)
  65.   "Set mode-line-format"
  66.   ;; common behaviour
  67.   (setq mode-line-modified              status
  68.     mode-line-buffer-identification buffer-info)
  69.   ;; to emulate older irchat-pj-modeline.el
  70.   (and user-define
  71.        (boundp user-define)
  72.        (symbol-value user-define)
  73.        (let ((candidate (symbol-value user-define)))
  74.      (if (not (symbolp candidate))
  75.          (setq mode-line-format candidate)
  76.        (if (boundp candidate)
  77.            (setq mode-line-format (symbol-value candidate)))))))
  78.  
  79. ;; That's all
  80. (provide 'irchat-pj-modeline)
  81.  
  82. ;;; irchat-pj-modeline.el ends here
  83.