[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Erbot-cvs] erbot erbc.el erbot-lispy.el erbot.el ChangeLog
From: |
D. Goel |
Subject: |
[Erbot-cvs] erbot erbc.el erbot-lispy.el erbot.el ChangeLog |
Date: |
Thu, 20 Apr 2006 18:34:04 +0000 |
CVSROOT: /cvsroot/erbot
Module name: erbot
Branch:
Changes by: D. Goel <address@hidden> 06/04/20 18:34:04
Modified files:
. : erbc.el erbot-lispy.el erbot.el ChangeLog
Log message:
improve erbot-safe-p, improve ,more pagination when using weird
erbn-charsa
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/erbot/erbot/erbc.el.diff?tr1=1.124&tr2=1.125&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/erbot/erbot/erbot-lispy.el.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/erbot/erbot/erbot.el.diff?tr1=1.51&tr2=1.52&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/erbot/erbot/ChangeLog.diff?tr1=1.44&tr2=1.45&r1=text&r2=text
Patches:
Index: erbot/ChangeLog
diff -u erbot/ChangeLog:1.44 erbot/ChangeLog:1.45
--- erbot/ChangeLog:1.44 Thu Apr 20 14:45:11 2006
+++ erbot/ChangeLog Thu Apr 20 18:34:04 2006
@@ -1,10 +1,20 @@
2006-04-20 D Goel <address@hidden>
+ * erbot.el (erbot-safe-p): Improve this function a bit.
+ (erbot-safe-nocontrol-p): new.
+
+ * erbot-lispy.el (erbot-lispy-safe-p): change name from
erbot-lispy-safep
+
+ * erbot.el (erbot-safe-p): change name from erbot-safep
+
* erbc.el (erbn-url-functions-p): new variable. Disallow url's
unless enabled here. Else potential freeze.
(erbn-internal-web-page-time): rename from the one below.
(fs-internal-web-page-time): rename to the one above
(erbn-url-functions-p): add bug discoverer's name in docstring.
+ (fsi-get-more-invocation-string): new function.
+ (fsi-limit-lines): Make the bot spit something useful instead of
+ ,more, when using weird erbn-char.
2006-04-19 D Goel <address@hidden>
Index: erbot/erbc.el
diff -u erbot/erbc.el:1.124 erbot/erbc.el:1.125
--- erbot/erbc.el:1.124 Thu Apr 20 14:45:11 2006
+++ erbot/erbc.el Thu Apr 20 18:34:04 2006
@@ -1,5 +1,5 @@
;;; erbc.el --- Erbot user-interface commands -- see also erbc5.el
-;; Time-stamp: <2006-04-20 10:41:48 deego>
+;; Time-stamp: <2006-04-20 14:29:33 deego>
;; Copyright (C) 2002 D. Goel
;; Emacs Lisp Archive entry
;; Filename: erbc.el
@@ -3114,7 +3114,7 @@
(setq more (buffer-substring new-point (point-max)))
(if
(string-match "[^ \t\n]" more )
- (setq ans (concat ans " ..[Type " erbn-char "more]"))
+ (setq ans (concat ans (fsi-get-more-invocation-string)))
(when nomorep (setq more "")))
)
)
@@ -3122,6 +3122,10 @@
(erbn-more-set more erbn-tgt)
ans))
+(defun fsi-get-more-invocation-string ()
+ (if (erbot-safe-nocontrol-p erbn-char)
+ (concat " ..[Type " erbn-char "more]")
+ (concat " ..[Type " erbot-nick ": more]")))
(defun fsi-limit-lines-old (str0 &rest ignored)
""
@@ -3375,7 +3379,7 @@
'(lambda (arg)
(format "%s" arg))
args " ")))
- (if (erbot-safep response) response
+ (if (erbot-safe-p response) response
(concat " " response))))
Index: erbot/erbot-lispy.el
diff -u erbot/erbot-lispy.el:1.6 erbot/erbot-lispy.el:1.7
--- erbot/erbot-lispy.el:1.6 Sat Jan 8 17:53:08 2005
+++ erbot/erbot-lispy.el Thu Apr 20 18:34:04 2006
@@ -1,5 +1,5 @@
;;; erbot-lispy.el --- ErBot integration in Lispy
-;; Time-stamp: <2005-01-08 12:52:18 deego>
+;; Time-stamp: <2006-04-20 14:14:33 deego>
;; Emacs Lisp Archive entry
;; Filename: erbot-lispy.el
;; Package: erbot
@@ -75,12 +75,12 @@
(mapc
(lambda (line)
(lispy-message (concat (if (string-match "^#" tgt)
- (if (erbot-lispy-safep line) "" " ")
+ (if (erbot-lispy-safe-p line) "" " ")
(format "tell %s " tgt)) line "\n")))
lines)))))
;; Mtp does not use prefixed commands, activate the right ones via aliases
-(defun erbot-lispy-safep (msg)
+(defun erbot-lispy-safe-p (msg)
(string-match "^/" line))
(defadvice erbot-install (after ad-erbot-install-lispy-after act)
Index: erbot/erbot.el
diff -u erbot/erbot.el:1.51 erbot/erbot.el:1.52
--- erbot/erbot.el:1.51 Thu Apr 20 14:37:03 2006
+++ erbot/erbot.el Thu Apr 20 18:34:04 2006
@@ -1,5 +1,5 @@
;;; erbot.el --- Another robot for ERC.
-;; Time-stamp: <2006-04-20 10:25:52 deego>
+;; Time-stamp: <2006-04-20 14:26:37 deego>
;; Emacs Lisp Archive entry
;; Filename: erbot.el
;; Package: erbot
@@ -652,7 +652,7 @@
(mapc
(lambda (line)
(when (and line
- (not (erbot-safep line)))
+ (not (erbot-safe-p line)))
(setq line (erbot-safe-make line)))
(goto-char (point-max))
(setq p (re-search-backward (erc-prompt)))
@@ -887,15 +887,16 @@
-(defun erbot-safep (reply)
+(defun erbot-safe-p (reply)
"Determine whether a reply is safe. Any newlines are simply
reported as unsafe.
If this functions deems a reply as unsafe, you should not send it to
-ERC. If an unsafe reply has no newlines, it may be rendered safe by
-appending a space in front of the reply."
+ERC but call `erbot-safe-make' first. "
(and
(not (string-match "[\n\r]" reply))
+ ;; err on the side of caution. Demand that the 1st char. be VERY
+ ;; safe.
(or
(string-match "^[0-9a-zA-Z]" reply)
;;(not (string-match "^/" reply)) -- this is bad.. since, control
@@ -903,9 +904,15 @@
;; Allow /me commands.. but only when the rest of the text has no
;; control characters..
- (and (equal 0 (string-match "^/me " reply))
- (let ((rlist (string-to-list reply)))
- (not (member-if (lambda (a) (< a 32)) rlist)))))))
+ (equal 0 (string-match "^/me " reply)))
+ ;; And there be no control characters whatsoever anywhere.
+ (erbot-safe-nocontrol-p reply)))
+
+(defun erbot-safe-nocontrol-p (reply)
+ (let ((rlist (string-to-list reply)))
+ (not (member-if (lambda (a) (< a 32)) rlist))))
+
+
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Erbot-cvs] erbot erbc.el erbot-lispy.el erbot.el ChangeLog,
D. Goel <=