erbot-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Erbot-cvs] Changes to erbot/erball.el


From: Michael W . Olson
Subject: [Erbot-cvs] Changes to erbot/erball.el
Date: Tue, 05 Jul 2005 22:32:26 -0400

Index: erbot/erball.el
diff -u erbot/erball.el:1.27 erbot/erball.el:1.28
--- erbot/erball.el:1.27        Sat Jul  2 16:47:02 2005
+++ erbot/erball.el     Wed Jul  6 02:32:25 2005
@@ -32,15 +32,17 @@
 This value is also added to the load-path.
 A trailing backslash is required.")
 
+(defun erball-assoc-string (key list)
+  "Like `assoc' but specifically for strings."
+  (if (fboundp 'assoc-string)
+      (assoc-string key list)
+    (catch 'found
+      (dolist (el list)
+        (when (string= key el)
+          (throw 'found el))))))
+
 (defvar erball-compiling-p
-  ;; For some reason, (assoc "--compile-erbot" command-line-args-left)
-  ;; doesn't seem to work with Emacs 22.  Maybe there's a stray space?
-  (if (save-match-data
-        (catch 'found
-          (dolist (arg command-line-args-left)
-            (when (string-match "\\b--compile-erbot\\b" arg)
-              (throw 'found t)))
-          nil))
+  (if (erball-assoc-string "--compile-erbot" command-line-args-left)
       (progn
         (message (concat "\nCompiling source in "
                          (file-name-nondirectory (expand-file-name "."))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]