diff -r -u readline/extconf.rb readline-pb/extconf.rb
--- readline/extconf.rb	Fri Apr 13 00:40:07 2001
+++ readline-pb/extconf.rb	Tue Nov 13 17:22:25 2001
@@ -8,9 +8,14 @@
 
 if have_header("readline/readline.h") and
     have_header("readline/history.h") and
-    have_library("readline", "readline")
-  if have_func("rl_filename_completion_function")
-    $CFLAGS += "-DREADLINE_42_OR_LATER"
+  if have_library("readline", "readline")
+    RL = "readline"
+    if have_func("rl_filename_completion_function")
+      $CFLAGS += "-DREADLINE_42_OR_LATER"
+    end
+  elsif have_library("edit", "readline")
+    RL = "edit"
+    $CFLAGS += "-DEDITLINE"
   end
   create_makefile("readline")
 end
diff -r -u readline/readline.c readline-pb/readline.c
--- readline/readline.c	Fri Jul  6 02:35:00 2001
+++ readline-pb/readline.c	Tue Nov 13 17:22:19 2001
@@ -21,6 +21,7 @@
 # define rl_completion_matches completion_matches
 #endif
 
+#ifdef HAS_EVENT_HOOK
 static int
 readline_event()
 {
@@ -28,6 +29,7 @@
     rb_thread_schedule();
     return 0;
 }
+#endif
 
 static VALUE
 readline_readline(argc, argv, self)
@@ -204,6 +206,7 @@
     return rb_str_new2("HISTORY");
 }
 
+#ifndef EDITLINE
 static VALUE
 hist_get(self, index)
     VALUE self;
@@ -237,6 +240,7 @@
     replace_history_entry(i, STR2CSTR(str), NULL);
     return str;
 }
+#endif
 
 static VALUE
 hist_push(self, str)
@@ -262,6 +266,7 @@
     return self;
 }
 
+#ifndef EDITLINE
 static VALUE
 hist_pop(self)
     VALUE self;
@@ -348,6 +353,7 @@
     entry = remove_history(NUM2INT(index));
     return rb_str_new2(entry->line);
 }
+#endif
 
 static VALUE
 filename_completion_proc_call(self, str)
@@ -433,16 +439,20 @@
     histary = rb_obj_alloc(rb_cObject);
     rb_extend_object(histary, rb_mEnumerable);
     rb_define_singleton_method(histary,"to_s", hist_to_s, 0);
+#ifndef EDITLINE
     rb_define_singleton_method(histary,"[]", hist_get, 1);
     rb_define_singleton_method(histary,"[]=", hist_set, 2);
+#endif
     rb_define_singleton_method(histary,"<<", hist_push, 1);
     rb_define_singleton_method(histary,"push", hist_push_method, -1);
+#ifndef EDITLINE
     rb_define_singleton_method(histary,"pop", hist_pop, 0);
     rb_define_singleton_method(histary,"shift", hist_shift, 0);
     rb_define_singleton_method(histary,"each", hist_each, 0);
     rb_define_singleton_method(histary,"length", hist_length, 0);
     rb_define_singleton_method(histary,"empty?", hist_empty_p, 0);
     rb_define_singleton_method(histary,"delete_at", hist_delete_at, 1);
+#endif
     rb_define_const(mReadline, "HISTORY", histary);
 
     fcomp = rb_obj_alloc(rb_cObject);
@@ -455,8 +465,10 @@
 			       username_completion_proc_call, 1);
     rb_define_const(mReadline, "USERNAME_COMPLETION_PROC", ucomp);
 
+#ifndef EDITLINE
     rl_attempted_completion_function
 	= (CPPFunction *) readline_attempted_completion_function;
     rl_event_hook = readline_event;
     rl_clear_signals();
+#endif
 }
