Toggle the automatic beep notice when the channel message is received.
* liece-handle.el (liece-handle-privmsg-message): added it.
* liece-misc.el (liece-beep): New function.
* liece-vars.el (liece-default-beep): New variable.
(liece-beep-when-invited): Ditto.
(liece-beep-when-privmsg): Ditto.
(liece-beep-words-list): Ditto.
* liece.el (liece-dialogue-mode-map): Bind "\C-B" to liece-dialogue-beep.
+2000-07-16 Akira Ohashi <bg66@luck.gr.jp>
+
+ * liece-commands.el (liece-command-beep): New function.
+ Toggle the automatic beep notice when the channel message is received.
+
+ * liece.el (liece-dialogue-mode-map):
+ Bind "\C-B" to liece-dialogue-beep.
+
+ * liece-vars.el (liece-default-beep): New variable.
+ (liece-beep-when-invited): Ditto.
+ (liece-beep-when-privmsg): Ditto.
+ (liece-beep-words-list): Ditto.
+
2000-05-07 Daiki Ueno <ueno@unixuser.org>
* liece-tcp.el
liece-dialogue-buffer)
(if arg (prefix-numeric-value arg))))
+(defun liece-command-beep (&optional arg)
+ "Toggle the automatic beep notice when the channel message is received."
+ (interactive "P")
+ (liece-beep (if liece-channel-buffer-mode
+ liece-channel-buffer
+ liece-dialogue-buffer)
+ (if arg (prefix-numeric-value arg))))
+
(defun liece-command-quit (&optional arg)
"Quit IRC.
If prefix argument ARG is non-nil, leave signoff message."
(defvar liece-command-buffer-mode-indicator "Channels")
(defvar liece-channel-status-indicator "")
+(defvar liece-beep-indicator nil)
(defvar liece-freeze-indicator nil)
(defvar liece-own-freeze-indicator nil)
+(defvar liece-beep nil)
(defvar liece-freeze nil)
(defvar liece-own-freeze nil)
(defun* liece-handle-privmsg-message (prefix rest)
(if (liece-handle-message-check-ignored prefix rest)
(return-from liece-handle-privmsg-message))
- (and (string-match "\007" rest) liece-beep-on-bells
- (beep t))
(with-liece-decryption (rest prefix)
(if (run-hook-with-args-until-success 'liece-privmsg-cleartext-hook
prefix rest)
(setq chnl (liece-channel-virtual chnl))
+ ; beep
+ (if liece-beep-on-bells
+ (progn
+ (and (string-match "\007" rest) (beep t))
+ (if (liece-nick-equal chnl liece-real-nickname)
+ (and liece-beep-when-privmsg (beep t))
+ (with-current-buffer (if liece-channel-buffer-mode
+ (format liece-channel-buffer-format
+ chnl)
+ liece-dialogue-buffer)
+ (and liece-beep (beep t))))
+ (let ((i 0)
+ (word (nth 0 liece-beep-words-list)))
+ (while word
+ (and (string-match word rest) (beep t))
+ (setq i (1+ i))
+ (setq word (nth i liece-beep-words-list))))))
+
;; Append timestamp if we are being away.
(and (string-equal "A" liece-away-indicator)
(liece-nick-equal chnl liece-real-nickname)
(defun* liece-handle-invite-message (prefix rest)
(or (string-match " +:" rest)
(return-from liece-handle-invite-message))
+ (and liece-beep-when-invited liece-beep-on-bells
+ (beep t))
(let ((chnl (liece-channel-virtual (substring rest (match-end 0)))))
(liece-insert-info (append liece-D-buffer liece-O-buffer)
(format "%s invites you to channel %s\n"
(if liece-display-frame-title
(liece-set-frame-title-format)))
+(defun liece-beep (buffer &optional arg)
+ (with-current-buffer buffer
+ (setq liece-beep (if arg (plusp arg) (not liece-beep))
+ liece-beep-indicator (if liece-beep "B" "-"))
+ (force-mode-line-update)))
+
(defun liece-freeze (buffer &optional arg)
(with-current-buffer buffer
(setq liece-freeze (if arg (plusp arg) (not liece-freeze))
:type 'integer
:group 'liece-look)
+(defcustom liece-default-beep nil
+ "If non nil, channel buffer local beep flag is on at starting."
+ :type 'boolean
+ :group 'liece-look)
+
(defcustom liece-default-freeze nil
"If non nil, channel buffer local freeze flag is on at starting."
:type 'boolean
:type '(radio (const :tag "Always" always) (const :tag "No" nil))
:group 'liece-vars)
+(defcustom liece-beep-when-invited nil
+ "If non-nil, beep when invited."
+ :type 'boolean
+ :group 'liece-vars)
+
+(defcustom liece-beep-when-privmsg nil
+ "If non-nil, beep when received privmsg."
+ :type 'boolean
+ :group 'liece-vars)
+
+(defcustom liece-beep-words-list nil
+ "This list used for user defined beep rules."
+ :type '(repeat (string :tag "Beep Rules List"))
+ :group 'liece-vars)
+
(defcustom liece-system-fqdname (system-name)
"The fully qualified domain name of the system.
Default is what (system-name) returns."
"|" liece-command-show-last-kill
"a" liece-command-away
"b" liece-command-submit-bug-report
+ "B" liece-dialogue-beep
"c" liece-command-point-back-to-command-buffer
"f" liece-command-finger
"F" liece-dialogue-freeze
liece-privmsg-partner nil
liece-private-indicator nil
liece-away-indicator "-"
+ liece-beep-indicator "-"
liece-freeze-indicator "-"
liece-own-freeze-indicator "-"
mode-line-buffer-identification
liece-private-indicator
liece-away-indicator
liece-crypt-indicator
- "- " liece-current-channel " " liece-real-nickname)))
+ "-- " liece-current-channel " " liece-real-nickname)))
(liece-suppress-mode-line-format)
(use-local-map liece-command-mode-map)
\\{liece-dialogue-mode-map}"
(kill-all-local-variables)
+ (make-local-variable 'liece-beep)
+ (make-local-variable 'liece-beep-indicator)
(make-local-variable 'liece-freeze)
(make-local-variable 'liece-freeze-indicator)
(make-local-variable 'liece-own-freeze)
(make-local-variable 'liece-own-freeze-indicator)
(make-local-variable 'tab-stop-list)
- (setq liece-freeze liece-default-freeze
+ (setq liece-beep liece-default-beep
+ liece-beep-indicator (if liece-beep "B" "-")
+ liece-freeze liece-default-freeze
liece-freeze-indicator (if liece-freeze "F" "-")
liece-own-freeze liece-default-own-freeze
liece-own-freeze-indicator (if liece-own-freeze "M" "-")
'("Liece: "
mode-line-modified
liece-away-indicator
+ liece-beep-indicator
liece-crypt-indicator
liece-freeze-indicator
liece-own-freeze-indicator
'("Liece: "
mode-line-modified
liece-away-indicator
+ liece-beep-indicator
liece-crypt-indicator
liece-freeze-indicator
liece-own-freeze-indicator
(use-local-map liece-nick-mode-map)
(run-hooks 'liece-nick-mode-hook))
+(fset 'liece-dialogue-beep 'liece-command-beep)
(fset 'liece-dialogue-freeze 'liece-command-freeze)
(fset 'liece-dialogue-own-freeze 'liece-command-own-freeze)