-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathnavi2ch-e21.el
80 lines (67 loc) · 2.91 KB
/
navi2ch-e21.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
;;; navi2ch-e21.el --- GNU Emacs 21 module for navi2ch -*- coding: iso-2022-7bit; -*-
;; Copyright (C) 2001, 2002, 2004 by Navi2ch Project
;; Copyright (C) 2000,2001 Katsumi Yamaoka <[email protected]>
;; Copyright (C) 2000,2001 Yuuichi Teranishi <[email protected]>
;; Author: UEYAMA Rui <[email protected]>
;; Keywords: network, 2ch
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Commentary:
;;
;;; Code:
(provide 'navi2ch-e21)
(defconst navi2ch-e21-ident
"$Id$")
(require 'navi2ch)
;;; $B0J2<!"(BWanderlust (wl-e21.el) $B$+$i$[$H$s$I%3%T%Z!#$3$l:G6/!#(B
(add-hook 'navi2ch-hook 'navi2ch-offline-init-icons)
(eval-when-compile
(navi2ch-defalias-maybe 'display-mouse-p 'ignore)
(navi2ch-defalias-maybe 'make-mode-line-mouse-map 'ignore)
(navi2ch-defalias-maybe 'display-images-p 'ignore)
(navi2ch-defalias-maybe 'image-type-available-p 'ignore)
(navi2ch-defalias-maybe 'find-image 'ignore)
(defmacro navi2ch-e21-display-image-p ()
'(and (display-images-p)
(image-type-available-p 'xpm))))
(defvar navi2ch-online-image nil)
(defvar navi2ch-offline-image nil)
(defun navi2ch-offline-init-icons ()
(let ((props (when (display-mouse-p)
(list 'local-map (purecopy (make-mode-line-mouse-map
'mouse-2 #'navi2ch-toggle-offline))
'help-echo "mouse-2 toggles offline mode"))))
(if (navi2ch-e21-display-image-p)
(progn
(unless navi2ch-online-image
(let ((load-path (cons navi2ch-icon-directory load-path)))
(setq navi2ch-online-image (find-image
`((:type xpm
:file ,navi2ch-online-icon
:ascent center)))
navi2ch-offline-image (find-image
`((:type xpm
:file ,navi2ch-offline-icon
:ascent center))))))
(setq navi2ch-modeline-online
(apply 'navi2ch-propertize navi2ch-online-indicator
`(display ,navi2ch-online-image ,@props))
navi2ch-modeline-offline
(apply 'navi2ch-propertize navi2ch-offline-indicator
`(display ,navi2ch-offline-image ,@props))))
(when props
(setq navi2ch-modeline-online
(apply 'navi2ch-propertize navi2ch-online-indicator props)
navi2ch-modeline-offline
(apply 'navi2ch-propertize navi2ch-offline-indicator props))))))
;;; navi2ch-e21.el ends here