[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Erc-commit] [commit][emacs22] Fix bug in erc-toggle-debug-irc-protocol
From: |
mwolson |
Subject: |
[Erc-commit] [commit][emacs22] Fix bug in erc-toggle-debug-irc-protocol |
Date: |
Sun, 14 Oct 2007 00:49:02 -0400 |
commit 634d4fd5b3894ab5b8aaf8e9c119ee7af30150f3
Author: Michael Olson <address@hidden>
Date: Sun Jun 3 21:29:53 2007 +0000
Fix bug in erc-toggle-debug-irc-protocol
2007-06-03 Michael Olson <address@hidden>
* erc-compat.el (erc-view-mode-enter): Make this its own function,
in order to document what we do, and provide sane fallback
behavior.
* erc.el (erc-toggle-debug-irc-protocol): Don't pass any arguments
to erc-view-mode-enter, since we don't do anything special with
the exit function. This fixes a bug with Emacs 21 and Emacs 22.
Thanks to Leo for noticing.
git-archimport-id: address@hidden/erc--main--0--patch-147
diff --git a/ChangeLog b/ChangeLog
index ebe438a..ea0786e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-06-03 Michael Olson <address@hidden>
+
+ * erc-compat.el (erc-view-mode-enter): Make this its own function,
+ in order to document what we do, and provide sane fallback
+ behavior.
+
+ * erc.el (erc-toggle-debug-irc-protocol): Don't pass any arguments
+ to erc-view-mode-enter, since we don't do anything special with
+ the exit function. This fixes a bug with Emacs 21 and Emacs 22.
+ Thanks to Leo for noticing.
+
2007-05-30 Michael Olson <address@hidden>
* erc-compat.el (erc-user-emacs-directory): New variable that
diff --git a/erc-compat.el b/erc-compat.el
index dc36820..58afcb0 100644
--- a/erc-compat.el
+++ b/erc-compat.el
@@ -154,11 +154,21 @@ See `erc-encoding-coding-alist'."
;; But note Emacs view-mode: (view-mode &optional ARG)
-(defalias 'erc-view-mode-enter
- (if (and (fboundp 'view-mode)
- (not (fboundp 'view-mode-enter)))
- 'view-mode
- 'view-mode-enter))
+(defun erc-view-mode-enter (&optional return-to exit-action)
+ "Enter View mode.
+See either `view-mode-enter' (if using Emacs)
+or `view-mode' (if using XEmacs)
+to determine what the arguments accomplish.
+
+If we cannot find a suitable way of passing the arguments, we
+default to just entering View mode."
+ (cond ((fboundp 'view-mode-enter)
+ (view-mode-enter return-to exit-action))
+ ((featurep 'xemacs)
+ (condition-case nil
+ (view-mode return-to exit-action)
+ (view-mode 1)))
+ (t nil)))
;; if we're in emacs21 CVS, we use help-function-arglist which is more
;; sophisticated and can handle subrs, etc
diff --git a/erc.el b/erc.el
index fce4b9a..08cda2e 100644
--- a/erc.el
+++ b/erc.el
@@ -2230,7 +2230,7 @@ If ARG is non-nil, show the *erc-protocol* buffer."
(interactive "P")
(let* ((buf (get-buffer-create "*erc-protocol*")))
(with-current-buffer buf
- (erc-view-mode-enter 1)
+ (erc-view-mode-enter)
(when (null (current-local-map))
(let ((inhibit-read-only t))
(insert (erc-make-notice "This buffer displays all IRC protocol
traffic exchanged with each server.\n"))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Erc-commit] [commit][emacs22] Fix bug in erc-toggle-debug-irc-protocol,
mwolson <=