[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Erc-commit] [commit][emacs22] Fix display bug for paths that look like
From: |
mwolson |
Subject: |
[Erc-commit] [commit][emacs22] Fix display bug for paths that look like commands |
Date: |
Sun, 14 Oct 2007 00:48:42 -0400 |
commit 7485a803c2e380648e952d4df5505b1971b26ddf
Author: Michael Olson <address@hidden>
Date: Sat Jan 13 19:35:02 2007 +0000
Fix display bug for paths that look like commands
2007-01-13 Michael Olson <address@hidden>
* erc.el (erc-command-regexp): New variable that is used to match
a command.
(erc-send-input): Use it. This fixes a bug where paths --
"/usr/bin/foo", for example -- were being displayed as commands,
but still sent correctly.
(erc-extract-command-from-line): Use it.
git-archimport-id: address@hidden/erc--main--0--patch-90
diff --git a/ChangeLog b/ChangeLog
index 22e9deb..1598161 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-01-13 Michael Olson <address@hidden>
+
+ * erc.el (erc-command-regexp): New variable that is used to match
+ a command.
+ (erc-send-input): Use it. This fixes a bug where paths --
+ "/usr/bin/foo", for example -- were being displayed as commands,
+ but still sent correctly.
+ (erc-extract-command-from-line): Use it.
+
2007-01-11 Diane Murray <address@hidden>
* erc.el (erc-find-parsed-property): Moved here from erc-track.el
diff --git a/erc.el b/erc.el
index 44560a6..5d82269 100644
--- a/erc.el
+++ b/erc.el
@@ -4921,6 +4921,9 @@ Specifically, return the position of `erc-insert-marker'."
erc-input-marker
(erc-end-of-input-line)))
+(defvar erc-command-regexp "^/\\([A-Za-z]+\\)\\(\\s-+.*\\|\\s-*\\)$"
+ "Regular expression used for matching commands in ERC.")
+
(defun erc-send-input (input)
"Treat INPUT as typed in by the user. It is assumed that the input
and the prompt is already deleted.
@@ -4942,7 +4945,7 @@ This returns non-nil only iff we actually send anything."
(run-hook-with-args 'erc-send-pre-hook input)
(when erc-send-this
(if (or (string-match "\n" str)
- (not (char-equal (aref str 0) ?/)))
+ (not (string-match erc-command-regexp str)))
(mapc
(lambda (line)
(mapc
@@ -5007,7 +5010,7 @@ current position."
"Extract command and args from the input LINE.
If no command was given, return nil. If command matches, return a
list of the form: (command args) where both elements are strings."
- (when (string-match "^/\\([A-Za-z]+\\)\\(\\s-+.*\\|\\s-*\\)$" line)
+ (when (string-match erc-command-regexp line)
(let* ((cmd (erc-command-symbol (match-string 1 line)))
;; note: return is nil, we apply this simply for side effects
(canon-defun (while (and cmd (symbolp (symbol-function cmd)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Erc-commit] [commit][emacs22] Fix display bug for paths that look like commands,
mwolson <=