changeset 68481:52b6d55ff868

Revision: emacs@sv.gnu.org/emacs--devo--0--patch-27 Creator: Michael Olson <mwolson@gnu.org> Merge ERC-related Viper hacks into Viper.
author Miles Bader <miles@gnu.org>
date Mon, 30 Jan 2006 03:16:50 +0000
parents a0bef9d6fe54
children 98d72e1824e4
files lisp/ChangeLog lisp/emulation/viper.el lisp/erc/ChangeLog lisp/erc/erc-viper.el
diffstat 4 files changed, 21 insertions(+), 75 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Jan 30 02:08:05 2006 +0000
+++ b/lisp/ChangeLog	Mon Jan 30 03:16:50 2006 +0000
@@ -47,6 +47,15 @@
 	mh-tool-bar.el, mh-xface.el.  Remove mh-customize.el, mh-init.el.
 	(mh-autoloads): Don't use comments on otherwise empty lines.
 
+2006-01-29  Edward O'Connor  <ted@oconnor.cx>
+
+	* emulation/viper.el (viper-major-mode-modifier-list): Add
+	insert-state and vi-state entries for erc-mode.
+	(viper-go-away, viper-set-hooks): Add and remove
+	viper-comint-mode-hook from erc-mode-hook as appropriate.
+
+	* emulation/viper.el (viper-insert-state-mode-list): Add erc-mode.
+
 2006-01-29  Juanma Barranquero  <lekktu@gmail.com>
 
 	* bs.el (bs--format-aux): Implement `middle' alignment as
--- a/lisp/emulation/viper.el	Mon Jan 30 02:08:05 2006 +0000
+++ b/lisp/emulation/viper.el	Mon Jan 30 03:16:50 2006 +0000
@@ -458,6 +458,7 @@
   '(internal-ange-ftp-mode
     comint-mode
     inferior-emacs-lisp-mode
+    erc-mode
     eshell-mode
     shell-mode)
   "*A list of major modes that should come up in Vi Insert state."
@@ -494,6 +495,8 @@
     (gnus-summary-mode emacs-state viper-gnus-modifier-map)
     (Info-mode emacs-state viper-slash-and-colon-map)
     (Buffer-menu-mode emacs-state viper-slash-and-colon-map)
+    (erc-mode insert-state viper-comint-mode-modifier-map)
+    (erc-mode vi-state viper-comint-mode-modifier-map)
     )
   "List specifying how to modify the various major modes to enable some Viperisms.
 The list has the structure: ((mode viper-state keymap) (mode viper-state
@@ -768,6 +771,7 @@
   ;; remove all hooks set by viper
   (mapatoms 'viper-remove-hooks)
   (remove-hook 'comint-mode-hook 'viper-comint-mode-hook)
+  (remove-hook 'erc-mode-hook 'viper-comint-mode-hook)
   (remove-hook 'minibuffer-setup-hook 'viper-minibuffer-setup-sentinel)
   (remove-hook 'change-major-mode-hook 'viper-major-mode-change-sentinel)
   (remove-hook 'post-command-hook 'viper-minibuffer-post-command-hook)
@@ -913,6 +917,7 @@
 
   ;; Emacs shell, ange-ftp, and comint-based modes
   (add-hook 'comint-mode-hook 'viper-comint-mode-hook) ; comint
+  (add-hook 'erc-mode-hook 'viper-comint-mode-hook) ; ERC
 
   (add-hook 'eshell-mode-hook
 	    (lambda () (setq viper-auto-indent nil)))
--- a/lisp/erc/ChangeLog	Mon Jan 30 02:08:05 2006 +0000
+++ b/lisp/erc/ChangeLog	Mon Jan 30 03:16:50 2006 +0000
@@ -17,6 +17,11 @@
 	sections may be skipped if using the version of ERC that comes
 	with Emacs.
 
+2006-01-29  Edward O'Connor  <ted@oconnor.cx>
+
+	* erc-viper.el: Remove. Now that ERC is included in Emacs, these
+	work-arounds live in Viper itself.
+
 2006-01-28  Michael Olson  <mwolson@gnu.org>
 
 	* erc-*.el, erc.texi, NEWS: Add Arch taglines as per Emacs
@@ -200,7 +205,8 @@
 	* erc.el, erc-backend.el, erc-ezbounce.el, erc-list.el,
 	erc-log.el, erc-match.el, erc-nets.el, erc-netsplit.el,
 	erc-nicklist.el, erc-nickserv.el, erc-notify.el, erc-pcomplete.el:
-	Use (eval-when-compile 'cl), so that compilation doesn't fail.
+	Use (eval-when-compile (require 'cl)), so that compilation doesn't
+	fail.
 
 	* erc-fill.el, erc-truncate.el: Whitespace munging.
 
--- a/lisp/erc/erc-viper.el	Mon Jan 30 02:08:05 2006 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-;;; erc-viper.el --- Viper compatibility hacks for ERC
-
-;; Copyright (C) 2005 Free Software Foundation, Inc.
-
-;; Author: Edward O'Connor <ted@oconnor.cx>
-;; Keywords: emulation
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; 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., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;; Viper is a VI emulation mode for Emacs. ERC and Viper don't quite get
-;; along by default; the code in this file fixes that. A simple
-;;   (require 'erc-viper)
-;; in your ~/.ercrc.el should be all it takes for you to use ERC and
-;; Viper together happily.
-
-;;; Code:
-
-(require 'viper)
-
-;; We need this for `erc-mode-hook' and `erc-buffer-list'. Perhaps it
-;; would be better to use an `eval-after-load', so that there could be
-;; some autodetection / loading of this file from within erc.el?
-(require 'erc)
-
-;; Fix RET in ERC buffers, by telling Viper to pass RET through to the
-;; normal keymap.
-
-(add-to-list 'viper-major-mode-modifier-list
-             '(erc-mode insert-state viper-comint-mode-modifier-map))
-(add-to-list 'viper-major-mode-modifier-list
-             '(erc-mode vi-state viper-comint-mode-modifier-map))
-
-(viper-apply-major-mode-modifiers)
-
-;; Ensure that ERC buffers come up in insert state.
-(add-to-list 'viper-insert-state-mode-list 'erc-mode)
-
-;; Fix various local variables in Viper.
-(add-hook 'erc-mode-hook 'viper-comint-mode-hook)
-
-;; Fix ERC buffers that already exist (buffers in which `erc-mode-hook'
-;; has already been run).
-(mapc (lambda (buf)
-        (with-current-buffer buf
-          (viper-comint-mode-hook)
-          ;; If there *is* a final newline in this buffer, delete it, as
-          ;; it interferes with ERC /-commands.
-          (let ((last (1- (point-max))))
-            (when (eq (char-after last) ?\n)
-              (goto-char last)
-              (delete-char 1)))))
-      (erc-buffer-list))
-
-(provide 'erc-viper)
-
-;; arch-tag: 659fa645-e9ad-428c-ad53-8304d9f900f6
-;;; erc-viper.el ends here