projects
/
riece
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't use old-style backquote in doc/ptexinfmt.el.
[riece]
/
lisp
/
riece-hangman.el
diff --git
a/lisp/riece-hangman.el
b/lisp/riece-hangman.el
index
8865638
..
426935e
100644
(file)
--- a/
lisp/riece-hangman.el
+++ b/
lisp/riece-hangman.el
@@
-18,8
+18,8
@@
;; 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
;; 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., 5
9 Temple Place - Suite 330
,
-;; Boston, MA 0211
1-1307
, USA.
+;; Free Software Foundation, Inc., 5
1 Franklin Street, Fifth Floor
,
+;; Boston, MA 0211
0-1301
, USA.
;;; Commentary:
;;; Commentary:
@@
-55,8
+55,6
@@
(defvar riece-hangman-player-context-alist nil)
(defvar riece-hangman-words-buffer nil)
(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.")
(defconst riece-hangman-description
"Allow channel members to play the hangman game.")
@@
-98,14
+96,12
@@
The wordlist is read from `riece-hangman-words-file'."
(unless (and riece-hangman-words-buffer
(buffer-name riece-hangman-words-buffer))
(setq riece-hangman-words-buffer (generate-new-buffer " *riece-hangman*"))
(unless (and riece-hangman-words-buffer
(buffer-name riece-hangman-words-buffer))
(setq riece-hangman-words-buffer (generate-new-buffer " *riece-hangman*"))
- (save-excursion
- (set-buffer riece-hangman-words-buffer)
+ (with-current-buffer riece-hangman-words-buffer
(buffer-disable-undo)
(insert-file-contents riece-hangman-words-file)
(let ((case-fold-search nil))
(delete-non-matching-lines "^[a-z][a-z][a-z][a-z][a-z][a-z]+"))))
(buffer-disable-undo)
(insert-file-contents riece-hangman-words-file)
(let ((case-fold-search nil))
(delete-non-matching-lines "^[a-z][a-z][a-z][a-z][a-z][a-z]+"))))
- (save-excursion
- (set-buffer riece-hangman-words-buffer)
+ (with-current-buffer riece-hangman-words-buffer
(goto-char (1+ (random (buffer-size))))
(if (eobp)
(beginning-of-line -1)
(goto-char (1+ (random (buffer-size))))
(if (eobp)
(beginning-of-line -1)
@@
-140,7
+136,7
@@
The wordlist is read from `riece-hangman-words-file'."
"")))))
(defun riece-hangman-after-privmsg-hook (prefix string)
"")))))
(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) ","))
(let* ((user (riece-prefix-nickname prefix))
(parameters (riece-split-parameters string))
(targets (split-string (car parameters) ","))
@@
-227,12
+223,11
@@
The wordlist is read from `riece-hangman-words-file'."
(defun riece-hangman-insinuate ()
(add-hook 'riece-after-privmsg-hook 'riece-hangman-after-privmsg-hook))
(defun riece-hangman-insinuate ()
(add-hook 'riece-after-privmsg-hook 'riece-hangman-after-privmsg-hook))
-(defun riece-hangman-enable ()
- (random t)
- (setq riece-hangman-enabled t))
+(defun riece-hangman-uninstall ()
+ (remove-hook 'riece-after-privmsg-hook 'riece-hangman-after-privmsg-hook))
-(defun riece-hangman-
dis
able ()
- (
setq riece-hangman-enabled nil
))
+(defun riece-hangman-
en
able ()
+ (
random t
))
(provide 'riece-hangman)
(provide 'riece-hangman)