is enabled.
(riece-uninstall-addon): Don't use riece-remprop.
(riece-enable-addon): Put 'riece-addon-enabled property on the
add-on feature.
(riece-disable-addon): Ditto.
(riece-command-list-addons): Check 'riece-addon-enabled property
instead of riece-*-enabled variables.
2005-08-27 Daiki Ueno <ueno@unixuser.org>
+ * riece-addon.el (riece-uninstall-addon): Don't check the add-on
+ is enabled.
+ (riece-uninstall-addon): Don't use riece-remprop.
+ (riece-enable-addon): Put 'riece-addon-enabled property on the
+ add-on feature.
+ (riece-disable-addon): Ditto.
+ (riece-command-list-addons): Check 'riece-addon-enabled property
+ instead of riece-*-enabled variables.
+
+2005-08-27 Daiki Ueno <ueno@unixuser.org>
+
* riece-options.el (riece-shrink-buffer-idle-time-delay):
Abolished; moved to riece-shrink-buffer.el.
(riece-max-buffer-size): Ditto.
(if verbose
(message "Add-on %S is not insinuated" addon))
(let ((entry (assq addon riece-addon-dependencies))
- (enabled (intern-soft (concat (symbol-name addon) "-enabled")))
(uninstall (intern-soft (concat (symbol-name addon) "-uninstall"))))
(if entry
(if (cdr entry)
(error "%s depend on %S"
(mapconcat #'symbol-name (cdr entry) ", ")
addon))
- (if (and enabled
- (boundp enabled)
- (symbol-value enabled))
- (riece-disable-addon addon verbose))
+ (riece-disable-addon addon verbose)
(if (and uninstall
(fboundp uninstall))
(funcall uninstall))
(setq riece-addon-dependencies
(delq entry riece-addon-dependencies))
- (riece-remprop addon 'riece-addon-insinuated)
+ (put addon 'riece-addon-insinuated nil)
(setq riece-addons (delq addon riece-addons)
riece-save-variables-are-dirty t
riece-addon-dependencies
(defun riece-enable-addon (addon &optional verbose)
(unless (get addon 'riece-addon-insinuated)
(error "Add-on %S is not insinuated" addon))
- (let ((enabled (intern-soft (concat (symbol-name addon) "-enabled"))))
- (if (or (null enabled)
- (not (boundp enabled)))
+ (let ((enable (intern-soft (concat (symbol-name addon) "-enable"))))
+ (if (or (null enable)
+ (not (fboundp enable)))
(if verbose
(message "Add-on %S doesn't support enable/disable" addon))
- (if (symbol-value enabled)
+ (if (get addon 'riece-addon-enabled)
(if verbose
(message "Add-on %S is already enabled" addon))
- (funcall (intern (concat (symbol-name addon) "-enable")))
+ (funcall enable)
+ (put addon 'riece-addon-enabled t)
(if verbose
(message "Add-on %S enabled" addon))))))
(defun riece-disable-addon (addon &optional verbose)
(unless (get addon 'riece-addon-insinuated)
(error "Add-on %S is not insinuated" addon))
- (let ((enabled (intern-soft (concat (symbol-name addon) "-enabled"))))
- (if (or (null enabled)
- (not (boundp enabled)))
+ (let ((disable (intern-soft (concat (symbol-name addon) "-disable"))))
+ (if (or (null disable)
+ (not (fboundp disable)))
(if verbose
(message "Add-on %S doesn't support enable/disable" addon))
- (if (symbol-value enabled)
+ (if (get addon 'riece-addon-enabled)
(progn
- (funcall (intern (concat (symbol-name addon) "-disable")))
+ (funcall disable)
+ (put addon 'riece-addon-enabled nil)
(if verbose
(message "Add-on %S disabled" addon)))
(if verbose
buffer-read-only
(pointer riece-addon-dependencies)
module-description-alist
- description enabled point)
+ description enable point)
(while pointer
(setq description (intern-soft (concat (symbol-name (car (car pointer)))
"-description"))
(string-lessp (symbol-name (car entry1))
(symbol-name (car entry2))))))
(while pointer
- (setq enabled (intern-soft (concat (symbol-name (car (car pointer)))
- "-enabled")))
+ (setq enable (intern-soft (concat (symbol-name (car (car pointer)))
+ "-enable")))
(setq point (point))
(insert (format "%c %-15S %s\n"
(if (not (featurep (car (car pointer))))
(if (not (get (car (car pointer))
'riece-addon-insinuated))
??
- (if (null enabled)
+ (if (or (null enable)
+ (not (fboundp enable)))
?!
- (if (symbol-value enabled)
+ (if (get (car (car pointer)) 'riece-addon-enabled)
?+
?-))))
(car (car pointer))
+ The add-on is enabled.
- The add-on is disabled.
- ! The add-on doesn't support enable/disable operation.
- ? The add-on is not insinuated.
- The add-on is not loaded.
+ ! The add-on doesn't support enable/disable operation.
+ ? The add-on is not insinuated.
+ The add-on is not loaded.
")
(insert (substitute-command-keys "
Useful keys:
:type 'list
:group 'riece-alias)
-(defvar riece-alias-enabled nil)
-
(defconst riece-alias-description
"Define aliases for IRC names.")
#'riece-alias-abbrev-identity-string
riece-expand-identity-string-function
#'riece-alias-expand-identity-string)
- (riece-emit-signal 'channel-list-changed)
- (setq riece-alias-enabled t))
+ (riece-emit-signal 'channel-list-changed))
(defun riece-alias-disable ()
(setq riece-abbrev-identity-string-function nil
riece-expand-identity-string-function nil)
- (riece-emit-signal 'channel-list-changed)
- (setq riece-alias-enabled nil))
+ (riece-emit-signal 'channel-list-changed))
(provide 'riece-alias)
(defvar riece-biff-mode-string 'riece-biff-default-mode-string)
-(defvar riece-biff-enabled nil)
-
(defconst riece-biff-description
"Be notified if messages arrives.")
(defun riece-biff-after-display-message-function (message)
- (when (and riece-biff-enabled
+ (when (and (get 'riece-biff 'riece-addon-enabled)
(not (or (eq (window-buffer (selected-window))
(get-buffer riece-command-buffer))
(riece-message-own-p message)
(setq riece-biff-mode-string 'riece-biff-biff-mode-string))))
(defun riece-biff-clear (&optional dummy)
- (when riece-biff-enabled
+ (when (get 'riece-biff 'riece-addon-enabled)
(setq riece-biff-mode-string 'riece-biff-default-mode-string)))
(defun riece-biff-insinuate ()
(append '("" riece-biff-mode-string)
(remove "" global-mode-string)))
(t
- global-mode-string)))
- (setq riece-biff-enabled t))
+ global-mode-string))))
(defun riece-biff-disable ()
(setq global-mode-string
(remq 'riece-biff-mode-string global-mode-string))
(t
global-mode-string)))
- (riece-biff-clear)
- (setq riece-biff-enabled nil))
+ (riece-biff-clear))
(provide 'riece-biff)
["Set +v" riece-user-button-set-speakers])
"Menu for user buttons.")
-(defvar riece-button-enabled nil)
-
(defconst riece-button-description
"Display useful buttons in IRC buffers.")
(defvar riece-identity-button-map)
(defun riece-button-add-identity-button (start end)
- (if riece-button-enabled
+ (if (get 'riece-button 'riece-addon-enabled)
(riece-scan-property-region
'riece-identity
start end
'riece-button-add-identity-button))
(defun riece-button-enable ()
- (setq riece-button-enabled t)
(let ((pointer riece-buffer-list))
(while pointer
(with-current-buffer (car pointer)
(riece-emit-signal 'channel-list-changed)))
(defun riece-button-disable ()
- (setq riece-button-enabled nil)
(save-excursion
(let ((pointer riece-buffer-list))
(while pointer
(defvar riece-dialogue-mode-map)
-(defvar riece-ctcp-enabled nil)
-
(defconst riece-ctcp-description
"CTCP (Client To Client Protocol) support.")
(defun riece-handle-ctcp-request (prefix string)
- (when (and riece-ctcp-enabled prefix string
+ (when (and (get 'riece-ctcp 'riece-addon-enabled) prefix string
(riece-prefix-nickname prefix))
(let* ((parameters (riece-split-parameters string))
(targets (split-string (car parameters) ","))
"\n"))))
(defun riece-handle-ctcp-response (prefix string)
- (when (and riece-ctcp-enabled prefix string
+ (when (and (get 'riece-ctcp 'riece-addon-enabled) prefix string
(riece-prefix-nickname prefix))
(let* ((parameters (riece-split-parameters string))
(targets (split-string (car parameters) ","))
(define-key riece-dialogue-mode-map "\C-cp" 'riece-command-ctcp-ping)
(define-key riece-dialogue-mode-map "\C-ca" 'riece-command-ctcp-action)
(define-key riece-dialogue-mode-map "\C-cc" 'riece-command-ctcp-clientinfo)
- (define-key riece-dialogue-mode-map "\C-ct" 'riece-command-ctcp-time)
- (setq riece-ctcp-enabled t))
+ (define-key riece-dialogue-mode-map "\C-ct" 'riece-command-ctcp-time))
(defun riece-ctcp-disable ()
(define-key riece-dialogue-mode-map "\C-cv" nil)
(define-key riece-dialogue-mode-map "\C-cp" nil)
(define-key riece-dialogue-mode-map "\C-ca" nil)
(define-key riece-dialogue-mode-map "\C-cc" nil)
- (define-key riece-dialogue-mode-map "\C-ct" nil)
- (setq riece-ctcp-enabled nil))
+ (define-key riece-dialogue-mode-map "\C-ct" nil))
(provide 'riece-ctcp)
(defvar riece-ctlseq-face-cache nil)
(defvar riece-ctlseq-face-counter 0)
-(defvar riece-ctlseq-enabled nil)
-
(defconst riece-ctlseq-description
"Mark up control sequences in IRC buffers.")
attrs)))
(defun riece-ctlseq-message-filter (message)
- (if riece-ctlseq-enabled
+ (if (get 'riece-ctlseq 'riece-addon-enabled)
(let ((start 0)
(end (length (riece-message-text message)))
attrs)
(remove-hook 'riece-message-filter-functions 'riece-ctlseq-message-filter))
(defun riece-ctlseq-enable ()
- (setq riece-ctlseq-enabled t))
+ )
(defun riece-ctlseq-disable ()
- (setq riece-ctlseq-enabled nil))
+ )
(provide 'riece-ctlseq)
(defvar riece-doctor-patients nil)
-(defvar riece-doctor-enabled nil)
-
(defconst riece-doctor-description
"Pretend to be a psychotherapist.")
(riece-send-string (format "NOTICE %s :%s\r\n" target string)))
(defun riece-doctor-after-privmsg-hook (prefix string)
- (if riece-doctor-enabled
+ (if (get 'riece-doctor 'riece-addon-enabled)
(let* ((user (riece-prefix-nickname prefix))
(parameters (riece-split-parameters string))
(targets (split-string (car parameters) ","))
(remove-hook 'riece-after-privmsg-hook 'riece-doctor-after-privmsg-hook))
(defun riece-doctor-enable ()
- (setq riece-doctor-enabled t))
+ )
(defun riece-doctor-disable ()
- (setq riece-doctor-enabled nil))
+ )
(provide 'riece-doctor)
:type 'string
:group 'riece-eval-ruby)
-(defvar riece-eval-ruby-enabled nil)
-
(defconst riece-eval-ruby-description
"Evaluate input string as a Ruby program.")
'notice))))
(defun riece-eval-ruby-display-message-function (message)
- (if (and riece-eval-ruby-enabled
+ (if (and (get 'riece-eval-ruby 'riece-addon-enabled)
(riece-message-own-p message)
(string-match riece-eval-ruby-prefix-regexp
(riece-message-text message)))
'riece-eval-ruby-display-message-function))
(defun riece-eval-ruby-enable ()
- (setq riece-eval-ruby-enabled t))
+ )
(defun riece-eval-ruby-disable ()
- (setq riece-eval-ruby-enabled nil))
+ )
(provide 'riece-eval-ruby)
:type 'boolean
:group 'riece-eval)
-(defvar riece-eval-enabled nil)
-
(defconst riece-eval-description
"Evaluate an input string as an elisp form.")
(defun riece-eval-display-message-function (message)
- (when (and riece-eval-enabled
+ (when (and (get 'riece-eval 'riece-addon-enabled)
(riece-message-own-p message)
(string-match riece-eval-regexp (riece-message-text message)))
(let* ((form (match-string 1 (riece-message-text message)))
'riece-eval-display-message-function))
(defun riece-eval-enable ()
- (setq riece-eval-enabled t))
+ )
(defun riece-eval-disable ()
- (setq riece-eval-enabled nil))
+ )
(provide 'riece-eval)
(require 'riece-identity)
(require 'riece-display))
-(defvar riece-foolproof-enabled nil)
-
(defconst riece-foolproof-description
"Prevent miss-operation in the command buffer.")
identity riece-channel-buffer-alist))))
(defun riece-foolproof-command-send-message-function ()
- (when riece-foolproof-enabled
+ (when (get 'riece-foolproof 'riece-addon-enabled)
(unless (or (not riece-channel-buffer-mode)
(riece-foolproof-get-channel-window
riece-current-channel))
'riece-foolproof-command-send-message-function))
(defun riece-foolproof-enable ()
- (setq riece-foolproof-enabled t))
+ )
(defun riece-foolproof-disable ()
- (setq riece-foolproof-enabled nil))
+ )
(provide 'riece-foolproof)
(defconst riece-google-regexp
"^go\\(o+\\)gle\\(:\\([a-z]+\\)\\)?>\\s-*\\(.*\\)")
-(defvar riece-google-enabled nil)
-
(defconst riece-google-description
"Search keywords by Google.")
(defvar riece-google-target nil)
(defun riece-google-display-message-function (message)
- (when (and riece-google-enabled
+ (when (and (get 'riece-google 'riece-addon-enabled)
(stringp riece-google-license-key)
(string-match riece-google-regexp (riece-message-text message)))
(let ((keywords (match-string 4 (riece-message-text message)))
'riece-google-display-message-function))
(defun riece-google-enable ()
- (setq riece-google-enabled t))
+ )
(defun riece-google-disable ()
- (setq riece-google-enabled nil))
+ )
(provide 'riece-google)
:type '(repeat function)
:group 'riece-guess)
-(defvar riece-guess-enabled nil)
-
(defconst riece-guess-description
"Guess the next channel, using multiple methods.")
(define-key riece-dialogue-mode-map
"g" 'riece-command-guess-switch-to-channel)
(define-key riece-channel-list-mode-map
- "g" 'riece-command-guess-switch-to-channel)
- (setq riece-guess-enabled t))
+ "g" 'riece-command-guess-switch-to-channel))
(defun riece-guess-disable ()
(define-key riece-command-mode-map
(define-key riece-dialogue-mode-map
"g" nil)
(define-key riece-channel-list-mode-map
- "g" nil)
- (setq riece-guess-enabled nil))
+ "g" nil))
(provide 'riece-guess)
(defvar riece-hangman-player-context-alist nil)
(defvar riece-hangman-words-buffer nil)
-(defvar riece-hangman-enabled nil)
-
(defconst riece-hangman-description
"Allow channel members to play the hangman game.")
"")))))
(defun riece-hangman-after-privmsg-hook (prefix string)
- (if riece-hangman-enabled
+ (if (get 'riece-hangman 'riece-addon-enabled)
(let* ((user (riece-prefix-nickname prefix))
(parameters (riece-split-parameters string))
(targets (split-string (car parameters) ","))
(remove-hook 'riece-after-privmsg-hook 'riece-hangman-after-privmsg-hook))
(defun riece-hangman-enable ()
- (random t)
- (setq riece-hangman-enabled t))
+ (random t))
(defun riece-hangman-disable ()
- (setq riece-hangman-enabled nil))
+ )
(provide 'riece-hangman)
(set-face-foreground 'riece-modeline-current-face
(face-foreground 'riece-channel-list-current-face)))
-(defvar riece-highlight-enabled nil)
-
(defconst riece-highlight-description
"Highlight IRC buffers.")
(make-local-hook 'after-change-functions)
(add-hook 'after-change-functions
'riece-highlight-hide-prefix nil t)
- (if riece-highlight-enabled
+ (if (get 'riece-highlight 'riece-addon-enabled)
(font-lock-mode 1)))
(defun riece-highlight-setup-channel-list ()
;; In XEmacs, auto-initialization of font-lock is not affective
;; when buffer-file-name is not set.
(font-lock-set-defaults)
- (if riece-highlight-enabled
+ (if (get 'riece-highlight 'riece-addon-enabled)
(font-lock-mode 1)))
(defun riece-highlight-hide-prefix (start end length)
(put-text-property (match-beginning 1) (match-end 1) 'invisible t))))
(defun riece-highlight-put-overlay-faces (start end)
- (if riece-highlight-enabled
+ (if (get 'riece-highlight 'riece-addon-enabled)
(riece-scan-property-region
'riece-overlay-face
start end
(defun riece-highlight-format-identity-for-channel-list-indicator (index
identity)
- (if (and riece-highlight-enabled
+ (if (and (get 'riece-highlight 'riece-addon-enabled)
(riece-identity-equal identity riece-current-channel))
(let ((string (riece-format-identity identity))
(start 0))
'(riece-dialogue-mode riece-channel-list-mode))
(with-current-buffer (car buffers)
(font-lock-mode 1)))
- (setq buffers (cdr buffers))))
- (setq riece-highlight-enabled t))
+ (setq buffers (cdr buffers)))))
(defun riece-highlight-disable ()
(let ((buffers riece-buffer-list))
'(riece-dialogue-mode riece-channel-list-mode))
(with-current-buffer (car buffers)
(font-lock-mode 0)))
- (setq buffers (cdr buffers))))
- (setq riece-highlight-enabled nil))
+ (setq buffers (cdr buffers)))))
(provide 'riece-highlight)
(defvar riece-channel-history nil)
-(defvar riece-history-enabled nil)
-
(defconst riece-history-description
"Manage history of channel shifting.")
(nreverse result)))
(defun riece-history-format-identity-for-channel-list-buffer (index identity)
- (if (and riece-history-enabled
+ (if (and (get 'riece-history 'riece-addon-enabled)
(not (ring-empty-p riece-channel-history))
(riece-identity-equal identity (ring-ref riece-channel-history 0)))
(concat (format "%2d:+" index)
(defun riece-history-format-identity-for-channel-list-indicator (index
identity)
- (if (and riece-history-enabled
+ (if (and (get 'riece-history 'riece-addon-enabled)
(not (ring-empty-p riece-channel-history))
(riece-identity-equal identity (ring-ref riece-channel-history 0)))
(let ((string (riece-format-identity identity))
;;; '(riece-guess)))
(defun riece-history-after-switch-to-channel-functions (last)
- (if (and riece-history-enabled last
+ (if (and (get 'riece-history 'riece-addon-enabled) last
(not (riece-identity-equal last riece-current-channel)))
(ring-insert riece-channel-history last)))
(defun riece-history-enable ()
(setq riece-channel-history
(make-ring riece-channel-history-length))
- (setq riece-history-enabled t)
(riece-emit-signal 'channel-list-changed))
(defun riece-history-disable ()
- (setq riece-channel-history nil
- riece-history-enabled nil)
+ (setq riece-channel-history nil)
(riece-emit-signal 'channel-list-changed))
(provide 'riece-history)
\" @@@@@@@@@@@ \",
\" \"};")
-(defvar riece-icon-enabled nil)
-
(defconst riece-icon-description
"Display icons in IRC buffers.")
'rear-nonsticky (list 'display)))))))
(defun riece-icon-update-user-list-buffer ()
- (if riece-icon-enabled
+ (if (get 'riece-icon 'riece-addon-enabled)
(let ((images (riece-icon-make-images riece-user-list-icons)))
(save-excursion
(goto-char (point-min))
(1- (point)) (point)))))))
(defun riece-icon-update-channel-list-buffer ()
- (if riece-icon-enabled
+ (if (get 'riece-icon 'riece-addon-enabled)
(let ((images (riece-icon-make-images riece-channel-list-icons)))
(save-excursion
(goto-char (point-min))
(defalias 'riece-mode-line-buffer-identification
'riece-icon-modeline-buffer-identification)
(riece-icon-update-mode-line-buffer-identification)
- (setq riece-icon-enabled t)
(if riece-current-channel
(riece-emit-signal 'user-list-changed riece-current-channel))
(riece-emit-signal 'channel-list-changed))
(fset 'riece-mode-line-buffer-identification
riece-icon-original-mode-line-buffer-identification)
(riece-icon-update-mode-line-buffer-identification)
- (setq riece-icon-enabled nil)
(if riece-current-channel
(riece-emit-signal 'user-list-changed riece-current-channel))
(riece-emit-signal 'channel-list-changed))
(defvar riece-ignore-buffer nil)
-(defvar riece-ignore-enabled nil)
-
(defconst riece-ignore-description
"Ignore messages from some users.")
(defvar riece-ignored-user-list nil)
(eval-when-compile
(autoload 'riece-dialogue-mode "riece"))
(defun riece-ignore-message-filter (message)
- (if (and riece-ignore-enabled
+ (if (and (get 'riece-ignore 'riece-addon-enabled)
(riece-identity-member (riece-message-speaker message)
riece-ignored-user-list))
(if riece-ignore-discard-message
(defun riece-ignore-enable ()
(define-key riece-command-mode-map
- "\C-ck" 'riece-ignore-user)
- (setq riece-ignore-enabled t))
+ "\C-ck" 'riece-ignore-user))
(defun riece-ignore-disable ()
(define-key riece-command-mode-map
- "\C-ck" nil)
- (setq riece-ignore-enabled nil))
+ "\C-ck" nil))
(provide 'riece-ignore)
;;; Code:
-(defvar riece-kakasi-enabled nil)
-
(defconst riece-kakasi-description
"Convert Japanese to roman string by KAKASI.")
(delete-region (point-min) (point)))))
(defun riece-kakasi-message-filter (message)
- (if riece-kakasi-enabled
+ (if (get 'riece-kakasi 'riece-addon-enabled)
(riece-message-set-text message
(riece-kakasi-convert-string
(riece-message-text message))))
"kakasi" "-Ha" "-Ka" "-Ja" "-Ea" "-ka"))
(with-current-buffer (process-buffer riece-kakasi-process)
(buffer-disable-undo)
- (erase-buffer))
- (setq riece-kakasi-enabled t))
+ (erase-buffer)))
(defun riece-kakasi-disable ()
- (kill-buffer (process-buffer riece-kakasi-process))
- (setq riece-kakasi-enabled nil))
+ (kill-buffer (process-buffer riece-kakasi-process)))
(provide 'riece-kakasi)
:group 'riece-highlight-faces)
(defvar riece-keyword-face 'riece-keyword-face)
-(defvar riece-keyword-enabled nil)
-
(defconst riece-keyword-description
"Detect keywords in IRC buffers.")
;;; The old XEmacs package doesn't have autoload setting for regexp-opt.
(autoload 'regexp-opt "regexp-opt")
(defun riece-keyword-message-filter (message)
- (if (and riece-keyword-enabled
+ (if (and (get 'riece-keyword 'riece-addon-enabled)
riece-keywords
;; Ignore messages which belongs to myself.
(not (riece-message-own-p message)))
(remove-hook 'riece-message-filter-functions 'riece-keyword-message-filter))
(defun riece-keyword-enable ()
- (setq riece-keyword-enabled t))
+ )
(defun riece-keyword-disable ()
- (setq riece-keyword-enabled nil))
+ )
(provide 'riece-keyword)
(defconst riece-log-file-name-regexp
(concat (riece-make-interval-regexp "[0-9]" 8) "\\.txt\\(\\.\\(.*\\)\\)?$"))
-(defvar riece-log-enabled nil)
-
(defconst riece-log-description
"Save IRC logs.")
(defun riece-log-display-message-function (message)
- (if riece-log-enabled
+ (if (get 'riece-log 'riece-addon-enabled)
(let* ((coding-system-for-write
(if (featurep 'mule)
(or riece-log-coding-system
(defvar riece-command-mode-map)
(defun riece-log-enable ()
- (define-key riece-command-mode-map "\C-cd" 'riece-log-dired)
- (setq riece-log-enabled t))
+ (define-key riece-command-mode-map "\C-cd" 'riece-log-dired))
(defun riece-log-disable ()
- (define-key riece-command-mode-map "\C-cd" nil)
- (setq riece-log-enabled nil))
+ (define-key riece-command-mode-map "\C-cd" nil))
(provide 'riece-log)
(defvar riece-lsdb-cache nil)
-(defvar riece-lsdb-enabled nil)
-
(defconst riece-lsdb-description
"Help register nicknames in LSDB rolodex program.")
(define-key riece-command-mode-map
"\C-c\C-ll" 'riece-lsdb-display-records)
(define-key riece-command-mode-map
- "\C-c\C-la" 'riece-lsdb-add-user)
- (setq riece-lsdb-enabled t))
+ "\C-c\C-la" 'riece-lsdb-add-user))
(defun riece-lsdb-disable ()
(define-key riece-command-mode-map
"\C-c\C-ll" nil)
(define-key riece-command-mode-map
- "\C-c\C-la" nil)
- (setq riece-lsdb-enabled nil))
+ "\C-c\C-la" nil))
(provide 'riece-lsdb)
(defvar riece-mini-backlog-history nil)
(defvar riece-mini-backlog-shown nil)
-(defvar riece-mini-enabled nil)
-
(defconst riece-mini-description
"Use Riece only on the minibuffer.")
(cdr riece-mini-backlog-history)))
(setq riece-mini-backlog-history
(reverse (cons string (reverse riece-mini-backlog-history))))
- (when (and riece-mini-enabled
+ (when (and (get 'riece-mini 'riece-addon-enabled)
(not (or (eq (window-buffer (selected-window))
(get-buffer riece-command-buffer))
(riece-message-own-p message)
(resize-mini-windows t))
(setq riece-mini-backlog-shown t)
(when (and (memq 'riece-biff riece-addons)
- riece-biff-enabled)
+ (get 'riece-biff 'riece-addon-enabled))
(riece-biff-clear))
(riece-mini-message-no-log
"%s" (mapconcat #'identity riece-mini-backlog-history "\n"))))))
(remove-hook 'pre-command-hook 'riece-mini-pre-command))
(defun riece-mini-enable ()
- (setq riece-mini-enabled t))
+ )
(defun riece-mini-disable ()
- (setq riece-mini-enabled nil))
+ )
(provide 'riece-mini)
(defvar riece-ndcc-request-user nil)
(defvar riece-ndcc-request-size nil)
-(defvar riece-ndcc-enabled nil)
-
(defconst riece-ndcc-description
"DCC file sending protocol support (written in elisp.)")
(defun riece-handle-dcc-request (prefix target message)
(let ((case-fold-search t))
- (when (and riece-ndcc-enabled
+ (when (and (get 'riece-ndcc 'riece-addon-enabled)
(string-match
"SEND \\([^ ]+\\) \\([^ ]+\\) \\([^ ]+\\) \\([^ ]+\\)"
message))
(defvar riece-rdcc-temp-file nil)
(defvar riece-rdcc-received-size nil)
-(defvar riece-rdcc-enabled nil)
-
(defconst riece-rdcc-description
"DCC file sending protocol support (written in Ruby.)")
(defun riece-handle-dcc-request (prefix target message)
(let ((case-fold-search t))
- (when (and riece-rdcc-enabled
+ (when (and (get 'riece-rdcc 'riece-addon-enabled)
(string-match
"SEND \\(\\([^ ]+\\)\\|\"\\(.+\\)\"\\) \\([^ ]+\\) \\([^ ]+\\) \\([^ ]+\\)"
message))
(defun riece-rdcc-enable ()
(define-key riece-dialogue-mode-map "\C-ds" 'riece-command-dcc-send)
- (define-key riece-dialogue-mode-map "\C-dr" 'riece-command-dcc-receive)
- (setq riece-rdcc-enabled t))
+ (define-key riece-dialogue-mode-map "\C-dr" 'riece-command-dcc-receive))
(defun riece-rdcc-disable ()
(define-key riece-dialogue-mode-map "\C-ds" nil)
- (define-key riece-dialogue-mode-map "\C-dr" nil)
- (setq riece-rdcc-enabled nil))
+ (define-key riece-dialogue-mode-map "\C-dr" nil))
(provide 'riece-rdcc)
(defconst riece-shrink-buffer-description
"Free old IRC messages to save memory usage.")
-(defvar riece-shrink-buffer-enabled nil)
-
(defun riece-shrink-buffer-idle-timer ()
(let ((buffers riece-buffer-list))
(while buffers
- (if (and riece-shrink-buffer-enabled
+ (if (and (get 'riece-shrink-buffer 'riece-addon-enabled)
(buffer-live-p (car buffers))
(eq (derived-mode-class
(with-current-buffer (car buffers)
'riece-shrink-buffer-exit-hook))
(defun riece-shrink-buffer-enable ()
- (setq riece-shrink-buffer-enabled t))
+ )
(defun riece-shrink-buffer-disable ()
- (setq riece-shrink-buffer-enabled nil))
+ )
(provide 'riece-shrink-buffer)
(eval-when-compile (require 'riece))
-(defvar riece-skk-kakutei-enabled nil)
-
(defconst riece-skk-kakutei-description
"Remove SKK's preedit mark before sending messages.")
(defun riece-skk-kakutei-enable ()
(riece-define-keys riece-command-mode-map
"\r" riece-skk-kakutei-command-enter-message
- [(control return)] riece-skk-kakutei-command-enter-message-as-notice)
- (setq riece-skk-kakutei-enabled t))
+ [(control return)] riece-skk-kakutei-command-enter-message-as-notice))
(defun riece-skk-kakutei-disable ()
(riece-define-keys riece-command-mode-map
"\r" riece-command-enter-message
- [(control return)] riece-command-enter-message-as-notice)
- (setq riece-skk-kakutei-enabled nil))
+ [(control return)] riece-command-enter-message-as-notice))
(provide 'riece-skk-kakutei)
(defvar riece-unread-channels nil)
-(defvar riece-unread-enabled nil)
-
(defconst riece-unread-description
"Mark channels where new messages arrived.")
(defun riece-unread-after-display-message-function (message)
- (if riece-unread-enabled
+ (if (get 'riece-unread 'riece-addon-enabled)
(let ((target (if (riece-message-private-p message)
(riece-message-speaker message)
(riece-message-target message))))
(riece-emit-signal 'channel-list-changed)))))
(defun riece-unread-after-switch-to-channel-function (last)
- (if riece-unread-enabled
+ (if (get 'riece-unread 'riece-addon-enabled)
(setq riece-unread-channels
(delq (car (riece-identity-member riece-current-channel
riece-unread-channels))
riece-unread-channels))))
(defun riece-unread-format-identity-for-channel-list-buffer (index identity)
- (if (and riece-unread-enabled
+ (if (and (get 'riece-unread 'riece-addon-enabled)
(riece-identity-member identity riece-unread-channels))
(concat (format "%2d:!" index)
(riece-format-identity identity))))
(defun riece-unread-format-identity-for-channel-list-indicator (index identity)
- (if (and riece-unread-enabled
+ (if (and (get 'riece-unread 'riece-addon-enabled)
(riece-identity-member identity riece-unread-channels))
(let ((string (riece-format-identity identity))
(start 0))
(define-key riece-dialogue-mode-map
"u" 'riece-unread-switch-to-channel)
(define-key riece-channel-list-mode-map
- "u" 'riece-unread-switch-to-channel)
- (setq riece-unread-enabled t)
+ "u" 'riece-unread-switch-to-channel)
(riece-emit-signal 'channel-list-changed))
(defun riece-unread-disable ()
"u" nil)
(define-key riece-channel-list-mode-map
"u" nil)
- (setq riece-unread-channels nil
- riece-unread-enabled nil)
+ (setq riece-unread-channels nil)
(riece-emit-signal 'channel-list-changed))
(provide 'riece-unread)
(defvar riece-urls nil
"A list of URL which appears in Riece buffers.")
-(defvar riece-url-enabled nil)
-
(defconst riece-url-description
"Collect URL in IRC buffers.")
'riece-url-command-mode-hook))
(defun riece-url-enable ()
- (define-key riece-dialogue-mode-map "U" 'riece-command-browse-url)
- (setq riece-url-enabled t))
+ (define-key riece-dialogue-mode-map "U" 'riece-command-browse-url))
(defun riece-url-disable ()
- (define-key riece-dialogue-mode-map "U" nil)
- (setq riece-url-enabled nil))
+ (define-key riece-dialogue-mode-map "U" nil))
(provide 'riece-url)
(require 'riece-display)
(require 'riece-lsdb)
-(defvar riece-xface-enabled nil)
-
(defconst riece-xface-description
"Display X-Face in IRC buffers.")
(defvar lsdb-insert-x-face-function)
(defun riece-xface-update-user-list-buffer ()
- (if riece-xface-enabled
+ (if (get 'riece-xface 'riece-addon-enabled)
(riece-scan-property-region
'riece-identity (point-min)(point-max)
(lambda (start end)
'riece-xface-user-list-mode-hook))
(defun riece-xface-enable ()
- (setq riece-xface-enabled t)
(if riece-current-channel
(riece-emit-signal 'user-list-changed riece-current-channel)))
(defun riece-xface-disable ()
- (setq riece-xface-enabled nil)
(if riece-current-channel
(riece-emit-signal 'user-list-changed riece-current-channel)))
(defconst riece-yank-description
"Enter the element of kill-ring.")
-(defvar riece-yank-enabled nil)
-
(defun riece-yank-insinuate ()
)
(defvar riece-command-mode-map)
(defun riece-yank-enable ()
- (define-key riece-command-mode-map "\C-cy" 'riece-command-yank)
- (setq riece-yank-enabled t))
+ (define-key riece-command-mode-map "\C-cy" 'riece-command-yank))
(defun riece-yank-disable ()
- (define-key riece-command-mode-map "\C-cy" 'undefined)
- (setq riece-yank-enabled nil))
+ (define-key riece-command-mode-map "\C-cy" 'undefined))
(defun riece-yank-strip-space (string)
(with-temp-buffer