changeset 83038:30ccd595ccb0

Merged in changes from CVS HEAD Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-98 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-99 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-100 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-101 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-102 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-78
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 18 Feb 2004 17:10:32 +0000
parents 03a73693678e (current diff) ef73d23d7cb5 (diff)
children e3c68dad44a0
files ChangeLog lisp/ChangeLog src/Makefile.in src/keyboard.c src/xdisp.c
diffstat 53 files changed, 797 insertions(+), 324 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Feb 17 01:52:25 2004 +0000
+++ b/ChangeLog	Wed Feb 18 17:10:32 2004 +0000
@@ -1,3 +1,13 @@
+2004-02-18  Kim F. Storm  <storm@cua.dk>
+
+	* INSTALL.CVS: Add info about ssh/cvs related problems and
+	work-around.
+
+2004-02-16  Eli Zaretskii  <eliz@elta.co.il>
+
+	* make-dist: Don't link index.*perm and permute-index into
+	tempdir.
+
 2004-02-14  Jonathan Yavner  <jyavner@member.fsf.org>
 
 	* AUTHORS (JonathanYavner): Rename testcover-*.el to tcover-*.el
--- a/INSTALL.CVS	Tue Feb 17 01:52:25 2004 +0000
+++ b/INSTALL.CVS	Wed Feb 18 17:10:32 2004 +0000
@@ -48,3 +48,29 @@
 should be sent to emacs-pretest-bug@gnu.org rather than gnu.emacs.help
 or gnu.emacs.bug.  Ideally, use M-x report-emacs-bug RET which will
 send it to the proper place.
+
+
+Note on using SSH to access the CVS repository from inside emacs
+----------------------------------------------------------------
+
+Write access to the CVS repository requires using SSH v2.
+
+If you execute cvs commands inside emacs, specifically if you use
+pcl-cvs, output from CVS may be lost due to a problem in the
+interface between ssh, cvs, and emacs.  Corrupted checkins are
+also been reported to have happened.
+
+To fix the problem, save the following script into a file, make it
+executable, and set CVS_RSH to the file name of the script:
+
+#!/bin/bash
+exec 2> >(exec cat >&2 2>/dev/null)
+exec ssh "$@"
+
+This may be combined with the following entry in ~/.ssh/config to
+simplify accessing the CVS repository:
+
+Host subversions.gnu.org
+     Protocol 2
+     ForwardX11 no
+     User YOUR_USERID
--- a/etc/ChangeLog	Tue Feb 17 01:52:25 2004 +0000
+++ b/etc/ChangeLog	Wed Feb 18 17:10:32 2004 +0000
@@ -1,3 +1,7 @@
+2004-02-16  Klaus Zeitler  <kzeitler@lucent.com>
+
+	* PROBLEMS: Document crashes on X when build with GCC and GNU ld.
+
 2004-02-08  Andreas Schwab  <schwab@suse.de>
 
 	* NEWS: Fix typo.
--- a/etc/NEWS	Tue Feb 17 01:52:25 2004 +0000
+++ b/etc/NEWS	Wed Feb 18 17:10:32 2004 +0000
@@ -1860,7 +1860,7 @@
 +++
 ** New function `delete-dups' destructively removes `equal' duplicates
 from a list.  Of several `equal' occurrences of an element in the list,
-the last one is kept.
+the first one is kept.
 
 +++
 ** `declare' is now a macro.  This change was made mostly for
--- a/etc/PROBLEMS	Tue Feb 17 01:52:25 2004 +0000
+++ b/etc/PROBLEMS	Wed Feb 18 17:10:32 2004 +0000
@@ -58,6 +58,20 @@
 running make) will solve the problem.  It appears to be caused by some
 problems with the unexec code and its interaction with libSystem.B.
 
+* Emacs crashes with SIGSEGV on Solaris in XtInitializeWidgetClass
+
+It crashes on X, but runs fine when called with option "-nw".
+
+This has been observed when emacs is linked with GNU ld instead of
+Solaris ld. To check which ld is used by gcc add "-V" to
+TEMACS_LDFLAGS in src/Makefile. Alternatively the executable size may
+be used as an indication of which linker is used. The size is
+approximately 15M when linked with solaris ld compared to 9M when
+linked with GNU ld.
+
+The fix is to reconfigure/install gcc, making sure that the SUN linker
+is used.
+
 * Characters from the mule-unicode charsets aren't displayed under X.
 
 XFree86 4 contains many fonts in iso10646-1 encoding which have
--- a/lisp/ChangeLog	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/ChangeLog	Wed Feb 18 17:10:32 2004 +0000
@@ -1,3 +1,104 @@
+2004-02-17  Eli Zaretskii  <eliz@elta.co.il>
+
+	* mail/rmail.el (rmail-get-new-mail): Don't reference
+	rmail-use-spam-filter if rmail-spam-filter is not loaded.
+
+2004-02-16  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* autorevert.el (auto-revert-buffer-p): Only revert dired buffers
+	if one of global-auto-revert-non-file-buffers or autorevert-mode
+	is non-nil.
+
+2004-02-16  Eli Zaretskii  <eliz@elta.co.il>
+
+	* subr.el (delete-dups): A better implementation from Karl Heuer
+	<kwzh@gnu.org>.
+
+2004-02-16  Matt Hodges  <matt@stchem.bham.ac.uk>  (tiny change)
+
+	* net/telnet.el (telnet-interrupt-subjob): Move doc string to the
+	correct place.
+	* progmodes/icon.el (icon-indent-command): Ditto.
+	* textmodes/paragraphs.el (repunctuate-sentences): Ditto.
+
+2004-02-16  Eli Zaretskii  <eliz@elta.co.il>
+
+	* progmodes/grep.el (grep-compute-defaults): Undo change from
+	2004-01-29: don't use executable-command-find-posix-p.
+
+2004-02-16  Richard Sharman  <rsharman@pobox.com>
+
+	* hilit-chg.el: Use require instead of eval-and-compile.
+	(highlight-compare-buffers): New function.
+
+2004-02-16  John Basrai  <jbasrai@comcast.net>  (tiny change)
+
+	* man.el (Man-fontify-manpage): Render section headings in
+	`Man-overstrike-face' even when overstrike was not used by man
+	formatter for section headings.
+
+2004-02-16  Eli Tziperman  <eli@deas.harvard.edu>
+
+	* rmail-spam-filter.el: (vm-use-spam-filter)
+	(rsf-min-region-length-added-to-spam-list): New	variables.
+	(rsf-bbdb-auto-delete-spam-bbdb-entries): Renamed from
+	rmail-bbdb-auto-delete-spam-entries.  Added cc: to recipients for
+	spam testing.  Don't delete spam message if automatic deletion
+	after output via variable rmail-delete-after-output is turned on.
+	(rsf-bbdb-dont-create-entries-for-deleted-messages): Renamed from
+	rsf-bbdb-dont-create-entries-for-spam.
+	(check-field): New function, extracted from code in
+	rmail-spam-filter to ease addition of header fields like
+	content-type.
+	(message-content-type): New variable to check the content-type:
+	field added, also in defcustom of rsf-definitions-alist.
+	(rmail-spam-filter): Replace repeated test code for header fields
+	by calls to check-field; change the call to
+	rmail-output-to-rmail-file such that rmail-current-message stays
+	the same to avoid wrong deletion of unseen
+	flags.
+	(rsf-add-contents-type): New function to convert old format
+	of rmail-spam-definitions-alist into new one.
+	Changed prefixes of all variables and functions from
+	rmail-spam-filter- or spam-filter- or rmail-spam- to rsf-.
+
+2004-02-16  Eli Zaretskii  <eliz@elta.co.il>
+
+	* loadhist.el (unload-hook-features-list): New defvar.
+
+2004-02-16  Dave Love  <fx@gnu.org>
+
+	* loadhist.el (unload-feature): Doc fix.  Rename flist to
+	unload-hook-features-list.
+
+2004-02-16  Jay Belanger  <belanger@truman.edu>  (tiny change).
+
+	* calc/calc-embed.el (calc-do-embedded-activate): Add autoload
+	cookie.  Don't check if we are looking-at open-formula.
+
+2004-02-16  Jesper Harder  <harder@ifa.au.dk>  (tiny change)
+
+	* subr.el (match-string-no-properties): Use substring-no-properties.
+
+2004-02-16  Eli Zaretskii  <eliz@elta.co.il>
+
+	* emacs-lisp/rx.el (rx-check, rx-check-any, rx-check-not)
+	(rx-repeat, rx-check-backref, rx-syntax, rx-to-string): Use
+	lower-case "rx" in all error message.
+
+2004-02-16  Dave Love  <fx@gnu.org>
+
+	* emacs-lisp/rx.el (rx-or): Put group around result.
+	(rx-constituents): Add backref.
+	(rx-syntax): Add string-delimiter, comment-delimiter.
+	(rx-categories): Add combining-diacritic.
+	(rx-check-not, rx-greedy, rx): Doc fix.
+	(rx-backref, rx-check-backref): New.
+
+2004-02-16  Jesper Harder  <harder@ifa.au.dk>
+
+	* newcomment.el (uncomment-region): Allow eob as comment end.
+
 2004-02-16  Jari Aalto  <jari.aalto@poboxes.com>  (tiny change)
 
 	* filecache.el: All message and error commands now use prefix
@@ -5,13 +106,16 @@
 
 2004-02-16  Jari Aalto  <jari.aalto@poboxes.com>
 
-	Autorevert: Add support to detect changed dired buffers.
+	Autorevert: Add support to detect changed dired buffers and for
+	VC controlled files.
 	* autorevert.el (auto-revert-active-p, auto-revert-list-diff)
 	(auto-revert-dired-file-list, auto-revert-dired-changed-p)
 	(auto-revert-handler, auto-revert-active-p): New functions.
 	(auto-revert-buffers): Moved revert logic to `auto-revert-handler'
 	and `auto-revert-active-p'.
-	(eval-when-compile): Defvar dired-directory.
+	(eval-when-compile): Defvar dired-directory and vc-mode.
+	(auto-revert-vc-cvs-file-version, auto-revert-vc-buffer-p)
+	(auto-revert-handler-vc): New functions.
 
 2004-02-16  Alfred M. Szmidt  <ams@kemisten.nu>  (tiny change)
 
@@ -22,7 +126,7 @@
 
 2004-02-16  Dave Love  <fx@gnu.org>
 
-	* newcomment.el (comment-insert-comment-function) 
+	* newcomment.el (comment-insert-comment-function)
 	(comment-region-function, uncomment-region-function): New.
 	(comment-indent): Use comment-insert-comment-function.
 	(uncomment-region): Use uncomment-region-function.
--- a/lisp/autorevert.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/autorevert.el	Wed Feb 18 17:10:32 2004 +0000
@@ -71,9 +71,12 @@
 
 (require 'timer)
 (autoload 'dired-get-filename "dired")
+(autoload 'vc-workfile-version "vc-hooks")
+(autoload 'vc-mode-line        "vc-hooks")
 
 (eval-when-compile
   (defvar dired-directory)
+  (defvar vc-mode)
   (require 'cl))
 
 
@@ -294,9 +297,15 @@
 
 (defun auto-revert-buffer-p ()
   "Check if current buffer should be reverted."
-  ;;  Always include dired buffers to list. It would be too expensive
+  ;;  - Always include dired buffers to list.  It would be too expensive
   ;;  to test the "revert" status here each time timer launches.
-  (or (eq major-mode 'dired-mode)
+  ;;  - Same for VC buffers.
+  (or (and (eq major-mode 'dired-mode)
+	   (or (and global-auto-revert-mode
+		    global-auto-revert-non-file-buffers)
+	       auto-revert-mode))
+      (and (not (buffer-modified-p))
+	   (auto-revert-vc-buffer-p))
       (and (not (buffer-modified-p))
 	   (if (buffer-file-name)
 	       (and (file-readable-p (buffer-file-name))
@@ -306,23 +315,81 @@
 			   global-auto-revert-non-file-buffers)
 		      auto-revert-mode))))))
 
+(defun auto-revert-vc-cvs-file-version (file)
+  "Get version of FILE by reading control file on disk."
+  (let* ((control "CVS/Entries")
+	 (name	  (file-name-nondirectory file))
+	 (path	  (format "%s/%s"
+			  (file-name-directory file)
+			  control)))
+    (when (file-exists-p path)
+      (with-temp-buffer
+	(insert-file-contents-literally path)
+	(goto-char (point-min))
+	(when (re-search-forward
+	       ;; /file.txt/1.3/Mon Sep 15 18:43:20 2003//
+	       (format "%s/\\([.0-9]+\\)" (regexp-quote name))
+	       nil t)
+	  (match-string 1))))))
+
+(defun auto-revert-vc-buffer-p ()
+  "Check if buffer is version controlled."
+  (and (boundp 'vc-mode)
+       (string-match "[0-9]" (or vc-mode ""))))
+
+(defun auto-revert-handler-vc ()
+  "Check if version controlled buffer needs revert."
+  ;; [Emacs 1]
+  ;; 1. File is saved	  (*)
+  ;; 2. checkin is done 1.1 -> 1.2
+  ;; 3. VC reverts, so that updated version number is shown in mode line
+  ;;
+  ;; Suppose the same file has been opened in another Emacs and
+  ;; autorevert.el is on.
+  ;;
+  ;; [Emacs 2]
+  ;; 1. Step (1) is detected and buffer is reverted.
+  ;; 2. But check in does not always change the file in dis, but possibly only
+  ;;	control files like CVS/Entries
+  ;; 3. The buffer is not reverted to update VC version line.
+  ;;	Incorrect version number 1.1 is shown in this Emacs
+  ;;
+  (when (featurep 'vc)
+    (let* ((file	   (buffer-file-name))
+	   (backend	   (vc-backend (buffer-file-name)))
+	   (version-buffer (vc-workfile-version file)))
+      (when (stringp version-buffer)
+	(cond
+	 ((eq backend 'CVS)
+	  (let ((version-file
+		 (auto-revert-vc-cvs-file-version (buffer-file-name))))
+	    (and (stringp version-file)
+		 (not (string-match version-file version-buffer)))))
+	 ((eq backend 'RCS)
+	  ;; TODO:
+	  ))))))
+
 (defun auto-revert-handler ()
   "Revert current buffer."
-  (let (done)
+  (let (revert)
     (cond
      ((eq major-mode 'dired-mode)
       ;;  Dired includes revert-buffer-function
       (when (and revert-buffer-function
 		 (auto-revert-dired-changed-p))
-	(setq done t)
-	(revert-buffer t t t)))
+	(setq revert t)))
+     ((auto-revert-vc-buffer-p)
+      (when (auto-revert-handler-vc)
+	(setq revert 'vc)))
      ((or (buffer-file-name)
 	  revert-buffer-function)
-      (setq done t)
-      (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)))
-    (if (and done
-	     auto-revert-verbose)
-	(message "Reverting buffer `%s'." (buffer-name)))))
+      (setq revert t)))
+    (when revert
+      (revert-buffer 'ignore-auto 'dont-ask 'preserve-modes)
+      (if (eq revert 'vc)
+	  (vc-mode-line buffer-file-name))
+      (if auto-revert-verbose
+	  (message "Reverting buffer `%s'." (buffer-name))))))
 
 (defun auto-revert-buffers ()
   "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode.
--- a/lisp/calc/calc-embed.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/calc/calc-embed.el	Wed Feb 18 17:10:32 2004 +0000
@@ -320,6 +320,7 @@
       (aset info 8 val)
       (calc-embedded-update info 14 t t))))
 
+;;;###autoload
 (defun calc-do-embedded-activate (arg cbuf)
   (calc-plain-buffer-only)
   (if arg
@@ -341,8 +342,8 @@
 	      (setcdr active (delq (car info) (cdr active)))))
 	(goto-char (point-min))
 	(while (re-search-forward pat nil t)
-	  (if (looking-at calc-embedded-open-formula)
-	      (goto-char (match-end 1)))
+;;;	  (if (looking-at calc-embedded-open-formula)
+;;;	      (goto-char (match-end 1)))
 	  (setq info (calc-embedded-make-info (point) cbuf nil))
 	  (or (eq (car-safe (aref info 8)) 'error)
 	      (goto-char (aref info 5))))))
--- a/lisp/emacs-lisp/rx.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/emacs-lisp/rx.el	Wed Feb 18 17:10:32 2004 +0000
@@ -120,6 +120,7 @@
     (optional		. zero-or-one)
     (minimal-match	. (rx-greedy 1 1))
     (maximal-match	. (rx-greedy 1 1))
+    (backref		. (rx-backref 1 1 rx-check-backref))
     (line-start		. "^")
     (line-end		. "$")
     (string-start	. "\\`")
@@ -175,7 +176,9 @@
     (escape		. ?\\)
     (character-quote	. ?/)
     (comment-start	. ?<)
-    (comment-end	. ?>))
+    (comment-end	. ?>)
+    (string-delimiter	. ?|)
+    (comment-delimiter	. ?!))
   "Alist mapping Rx syntax symbols to syntax characters.
 Each entry has the form (SYMBOL . CHAR), where SYMBOL is a valid
 symbol in `(syntax SYMBOL)', and CHAR is the syntax character
@@ -204,6 +207,7 @@
     (japanese-katakana-two-byte . ?K)
     (korean-hangul-two-byte	. ?N)
     (cyrillic-two-byte		. ?Y)
+    (combining-diacritic	. ?^)
     (ascii			. ?a)
     (arabic			. ?b)
     (chinese			. ?c)
@@ -255,16 +259,16 @@
 	 (type-pred (nth 3 rx)))
     (when (and (not (null min-args))
 	       (< nargs min-args))
-      (error "Rx form `%s' requires at least %d args"
+      (error "rx form `%s' requires at least %d args"
 	     (car form) min-args))
     (when (and (not (null max-args))
 	       (> nargs max-args))
-      (error "Rx form `%s' accepts at most %d args"
+      (error "rx form `%s' accepts at most %d args"
 	     (car form) max-args))
     (when (not (null type-pred))
       (dolist (sub-form (cdr form))
 	(unless (funcall type-pred sub-form)
-	  (error "Rx form `%s' requires args satisfying `%s'"
+	  (error "rx form `%s' requires args satisfying `%s'"
 		 (car form) type-pred))))))
 
 
@@ -310,10 +314,10 @@
    "Check arg ARG for Rx `any'."
    (cond ((integerp arg) t)
 	 ((and (stringp arg) (zerop (length arg)))
-	  (error "String arg for Rx `any' must not be empty"))
+	  (error "String arg for rx `any' must not be empty"))
 	 ((stringp arg) t)
 	 (t
-	  (error "Rx `any' requires string or character arg"))))
+	  (error "rx `any' requires string or character arg"))))
 
 
 (defun rx-any (form)
@@ -330,15 +334,15 @@
 	   (concat "[" (rx-quote-for-set (cadr form)) "]")))))
 
 
-(defun rx-check-not (form)
-  "Check arguments of FORM.  FORM is `(not ...)'."
+(defun rx-check-not (arg)
+  "Check arg ARG for Rx `not'."
   (unless (or (memq form
 		    '(digit control hex-digit blank graphic printing
 			    alphanumeric letter ascii nonascii lower
 			    punctuation space upper word))
 	      (and (consp form)
 		   (memq (car form) '(not any in syntax category:))))
-    (error "Rx `not' syntax error: %s" form))
+    (error "rx `not' syntax error: %s" form))
     t)
 
 
@@ -376,14 +380,14 @@
   (cond ((= (length form) 3)
 	 (unless (and (integerp (nth 1 form))
 		      (> (nth 1 form) 0))
-	   (error "Rx `repeat' requires positive integer first arg"))
+	   (error "rx `repeat' requires positive integer first arg"))
 	 (format "%s\\{%d\\}" (rx-to-string (nth 2 form)) (nth 1 form)))
 	((or (not (integerp (nth 2 form)))
 	     (< (nth 2 form) 0)
 	     (not (integerp (nth 1 form)))
 	     (< (nth 1 form) 0)
 	     (< (nth 2 form) (nth 1 form)))
-	 (error "Rx `repeat' range error"))
+	 (error "rx `repeat' range error"))
 	(t
 	 (format "%s\\{%d,%d\\}" (rx-to-string (nth 3 form))
 		 (nth 1 form) (nth 2 form)))))
@@ -396,6 +400,16 @@
 		     (cdr form) nil)
 	  "\\)"))
 
+(defun rx-backref (form)
+  "Parse and produce code from FORM, which is `(backref N)'."
+  (rx-check form)
+  (format "\\%d" (nth 1 form)))
+
+(defun rx-check-backref (arg)
+  "Check arg ARG for Rx `backref'."
+  (or (and (integerp arg) (>= arg 1) (<= arg 9))
+      (error "rx `backref' requires numeric 1<=arg<=9: %s" arg)))
+
 (defun rx-kleene (form)
   "Parse and produce code from FORM.
 FORM is `(OP FORM1)', where OP is one of the `zero-or-one',
@@ -484,10 +498,10 @@
 
 
 (defun rx-greedy (form)
-  "Parse and produce code from FORM.  If FORM is '(minimal-match
-FORM1)', non-greedy versions of `*', `+', and `?' operators will be
-used in FORM1.  If FORM is '(maximal-match FORM1)', greedy operators
-will be used."
+  "Parse and produce code from FORM.
+If FORM is '(minimal-match FORM1)', non-greedy versions of `*',
+`+', and `?' operators will be used in FORM1.  If FORM is
+'(maximal-match FORM1)', greedy operators will be used."
   (rx-check form)
   (let ((rx-greedy-flag (eq (car form) 'maximal-match)))
     (rx-to-string (cadr form))))
@@ -513,19 +527,19 @@
 	   (cond ((stringp info)
 		  info)
 		 ((null info)
-		  (error "Unknown Rx form `%s'" form))
+		  (error "Unknown rx form `%s'" form))
 		 (t
 		  (funcall (nth 0 info) form)))))
 	((consp form)
 	 (let ((info (rx-info (car form))))
 	   (unless (consp info)
-	     (error "Unknown Rx form `%s'" (car form)))
+	     (error "Unknown rx form `%s'" (car form)))
 	   (let ((result (funcall (nth 0 info) form)))
 	     (if (or no-group (string-match "\\`\\\\[(]" result))
 		 result
 	       (concat "\\(?:" result "\\)")))))
 	(t
-	 (error "Rx syntax error at `%s'" form))))
+	 (error "rx syntax error at `%s'" form))))
 
 
 ;;;###autoload
@@ -666,6 +680,8 @@
      `character-quote'		(\\s/)
      `comment-start'		(\\s<)
      `comment-end'		(\\s>)
+     `string-delimiter'		(\\s|)
+     `comment-delimiter'	(\\s!)
 
 `(not (syntax SYNTAX))'
      matches a character that has not syntax SYNTAX.
@@ -694,6 +710,7 @@
      `japanese-katakana-two-byte'	(\\cK)
      `korean-hangul-two-byte'		(\\cN)
      `cyrillic-two-byte'		(\\cY)
+     `combining-diacritic'              (\\c^)
      `ascii'				(\\ca)
      `arabic'				(\\cb)
      `chinese'				(\\cc)
@@ -733,7 +750,7 @@
 
 `(minimal-match SEXP)'
      produce a non-greedy regexp for SEXP.  Normally, regexps matching
-     zero or more occurrances of something are \"greedy\" in that they
+     zero or more occurrences of something are \"greedy\" in that they
      match as much as they can, as long as the overall regexp can
      still match.  A non-greedy regexp matches as little as possible.
 
--- a/lisp/hilit-chg.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/hilit-chg.el	Wed Feb 18 17:10:32 2004 +0000
@@ -61,7 +61,8 @@
 ;;
 ;; You can also use the command highlight-compare-with-file to show changes
 ;; in this file compared with another file (typically the previous version
-;; of the file).
+;; of the file).  The command highlight-compare-buffers can be used to
+;; compare two buffers.
 ;;
 ;;
 ;; There are currently three hooks run by `highlight-changes-mode':
@@ -147,6 +148,7 @@
 ;; highlight-changes-remove-highlight
 ;; highlight-changes-rotate-faces
 ;; highlight-compare-with-file
+;; highlight-compare-buffers
 
 ;;
 ;; You can automatically rotate faces when the buffer is saved;
@@ -174,7 +176,7 @@
 
 ;;; History:
 
-;; R Sharman (rsharman@magma.ca) Feb 1998:
+;; R Sharman (rsharman@pobox.com) Feb 1998:
 ;; - initial release as change-mode.
 ;; Jari Aalto <jari.aalto@ntc.nokia.com> Mar 1998
 ;; - fixes for byte compile errors
@@ -187,7 +189,9 @@
 ;; - Changed to use overlays
 ;; August 98
 ;; - renamed to Highlight Changes mode.
-
+;; Dec 2003
+;; - Use require for ediff stuff
+;; - Added highlight-compare-buffers
 
 ;;; Code:
 
@@ -401,17 +405,8 @@
 (make-variable-buffer-local 'hilit-chg-string)
 
 
-
-(eval-and-compile
-  ;;  For highlight-compare-with-file
-  (defvar ediff-number-of-differences)
-  (autoload 'ediff-setup		"ediff")
-  (autoload 'ediff-with-current-buffer	"ediff")
-  (autoload 'ediff-really-quit		"ediff")
-  (autoload 'ediff-make-fine-diffs	"ediff")
-  (autoload 'ediff-get-fine-diff-vector "ediff")
-  (autoload 'ediff-get-difference	"ediff"))
-
+(require 'ediff-init)
+(require 'ediff-util)
 
 
 ;;; Functions...
@@ -803,16 +798,108 @@
   nil)
 
 ;; ========================================================================
-;; Comparing with an existing file.
-;; This uses ediff to find the differences.
+;; Comparing buffers/files
+;; These use ediff to find the differences.
+
+(defun highlight-markup-buffers
+  (buf-a file-a buf-b file-b &optional markup-a-only)
+  "Get differences between two buffers and set highlight changes.
+Both buffers are done unless optional parameter MARKUP-A-ONLY
+is non-nil."
+  (save-window-excursion
+    (let* (change-info
+	   change-a change-b
+	   a-start a-end len-a
+	   b-start b-end len-b
+	   (bufa-modified (buffer-modified-p buf-a))
+	   (bufb-modified (buffer-modified-p buf-b))
+	   (buf-a-read-only (with-current-buffer buf-a buffer-read-only))
+	   (buf-b-read-only (with-current-buffer buf-b buffer-read-only))
+	   temp-a temp-b)
+      (if (and file-a bufa-modified)
+	  (if (y-or-n-p (format "Save buffer %s?  " buf-a))
+	      (with-current-buffer buf-a
+		(save-buffer)
+		(setq bufa-modified (buffer-modified-p buf-a)))
+	    (setq file-a nil)))
+      (or file-a
+	  (setq temp-a (setq file-a (ediff-make-temp-file buf-a nil))))
+
+      (if (and file-b bufb-modified)
+	  (if (y-or-n-p (format "Save buffer %s?  " buf-b))
+	      (with-current-buffer buf-b
+		(save-buffer)
+		(setq bufb-modified (buffer-modified-p buf-b)))
+	    (setq file-b nil)))
+      (or file-b
+	  (setq temp-b (setq file-b (ediff-make-temp-file buf-b nil))))
+      (set-buffer buf-a)
+      (highlight-changes-mode 'active)
+      (or markup-a-only (with-current-buffer buf-b
+			  (highlight-changes-mode 'active)))
+      (setq change-info (hilit-chg-get-diff-info buf-a file-a buf-b file-b))
+
+
+      (setq change-a (car change-info))
+      (setq change-b (car (cdr change-info)))
+      
+      (hilit-chg-make-list)
+      (while change-a
+	(setq a-start (nth 0 (car change-a)))
+	(setq a-end (nth 1 (car change-a)))
+	(setq b-start (nth 0 (car change-b)))
+	(setq b-end (nth 1 (car change-b)))
+	(setq len-a (- a-end a-start))
+	(setq len-b (- b-end b-start))
+	(set-buffer buf-a)
+	(hilit-chg-set-face-on-change a-start a-end len-b buf-a-read-only)
+	(or markup-a-only
+	    (with-current-buffer buf-b
+	      (hilit-chg-set-face-on-change b-start b-end len-a
+					    buf-b-read-only)
+	      ))
+	(setq change-a (cdr change-a))
+	(setq change-b (cdr change-b)))
+      (or bufa-modified
+	  (with-current-buffer buf-a (set-buffer-modified-p nil)))
+      (or bufb-modified
+	  (with-current-buffer buf-b (set-buffer-modified-p nil)))
+      (if temp-a
+	  (delete-file temp-a))
+      (if temp-b
+	  (delete-file temp-b)))
+    ))
+
+;;;###autoload
+(defun highlight-compare-buffers (buf-a buf-b)
+"Compare two buffers and highlight the differences.
+
+The default is the current buffer and the one in the next window.
+
+If either buffer is modified and is visiting a file, you are prompted
+to save the file.
+
+Unless the buffer is unmodified and visiting a file,  the buffer is
+written to a temporary file for comparison.
+
+If a buffer is read-only, differences will be highlighted but no property
+changes are made, so \\[highlight-changes-next-change] and
+\\[highlight-changes-previous-change] will not work."
+  (interactive
+   (list 
+    (get-buffer (read-buffer "buffer-a " (current-buffer) t))
+    (get-buffer
+     (read-buffer "buffer-b "
+		  (window-buffer (next-window (selected-window))) t)))) 
+  (let ((file-a (buffer-file-name buf-a))
+	(file-b (buffer-file-name buf-b)))
+    (highlight-markup-buffers buf-a file-a buf-b file-b)
+    ))
 
 ;;;###autoload
 (defun highlight-compare-with-file (file-b)
   "Compare this buffer with a file, and highlight differences.
 
-The current buffer must be an unmodified buffer visiting a file,
-and must not be read-only.
-
 If the buffer has a backup filename, it is used as the default when
 this function is called interactively.
 
@@ -829,64 +916,24 @@
 	       ""			;; directory
 	       nil			;; default
 	       'yes			;; must exist
-	       (let ((f (make-backup-file-name
-			 (or (buffer-file-name (current-buffer))
-			     (error "no file for this buffer")))))
-		 (if (file-exists-p f) f "")))))
-
+	       (let ((f (buffer-file-name (current-buffer))))
+		 (if f 
+		     (progn
+		       (setq f (make-backup-file-name f))
+		       (or (file-exists-p f) 
+			   (setq f nil)))
+		   )
+		 f))))
   (let* ((buf-a (current-buffer))
-	 (buf-a-read-only buffer-read-only)
-	 (orig-pos (point))
 	 (file-a (buffer-file-name))
 	 (existing-buf (get-file-buffer file-b))
 	 (buf-b (or existing-buf
 		    (find-file-noselect file-b)))
-	 (buf-b-read-only (with-current-buffer buf-b buffer-read-only))
-	 xy  xx yy p q
-	 a-start a-end len-a
-	 b-start b-end len-b)
-
-    ;; We use the fact that the buffer is not marked modified at the
-    ;; end where we clear its modified status
-    (if (buffer-modified-p buf-a)
-	(if (y-or-n-p (format "OK to save %s?  " file-a))
-		       (save-buffer buf-a)
-	  (error "Buffer must be saved before comparing with a file")))
-    (if (and existing-buf (buffer-modified-p buf-b))
-	(if (y-or-n-p (format "OK to save %s?  " file-b))
-		       (save-buffer buf-b)
-	  (error "Cannot compare with a file in an unsaved buffer")))
-    (highlight-changes-mode 'active)
-    (if existing-buf (with-current-buffer buf-b
-		       (highlight-changes-mode 'active)))
-    (save-window-excursion
-      (setq xy (hilit-chg-get-diff-info buf-a file-a buf-b file-b)))
-    (setq xx (car xy))
-    (setq p xx)
-    (setq yy (car (cdr xy)))
-    (setq q yy)
-    (hilit-chg-make-list)
-    (while p
-      (setq a-start (nth 0 (car p)))
-      (setq a-end (nth 1 (car p)))
-      (setq b-start (nth 0 (car q)))
-      (setq b-end (nth 1 (car q)))
-      (setq len-a (- a-end a-start))
-      (setq len-b (- b-end b-start))
-      (set-buffer buf-a)
-      (hilit-chg-set-face-on-change a-start a-end len-b buf-a-read-only)
-      (set-buffer-modified-p nil)
-      (goto-char orig-pos)
-      (if existing-buf
-	  (with-current-buffer buf-b
-	    (hilit-chg-set-face-on-change b-start b-end len-a
-					  buf-b-read-only )
-	    ))
-      (setq p (cdr p))
-      (setq q (cdr q)))
-    (if existing-buf
-	(set-buffer-modified-p nil)
-      (kill-buffer buf-b))))
+	 (buf-b-read-only (with-current-buffer buf-b buffer-read-only)))
+    (highlight-markup-buffers buf-a file-a buf-b file-b (not existing-buf))
+    (unless existing-buf
+      (kill-buffer buf-b))
+    ))
 
 
 (defun hilit-chg-get-diff-info (buf-a file-a buf-b file-b)
--- a/lisp/loadhist.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/loadhist.el	Wed Feb 18 17:10:32 2004 +0000
@@ -116,11 +116,27 @@
 `-hook' or `-hooks', from which `unload-feature' tries to remove
 pertinent symbols.")
 
+(defvar unload-hook-features-list nil
+  "List of features of the package being unloaded.
+
+This is meant to be used by FEATURE-unload-hook hooks, see the
+documentation of `unload-feature' for details.")
+
 ;;;###autoload
 (defun unload-feature (feature &optional force)
   "Unload the library that provided FEATURE, restoring all its autoloads.
 If the feature is required by any other loaded code, and prefix arg FORCE
-is nil, raise an error."
+is nil, raise an error.
+
+This function tries to undo modifications made by the package to
+hooks.  Packages may define a hook FEATURE-unload-hook that is called
+instead of the normal heuristics for doing this.  Such a hook should
+undo all the relevant global state changes that may have been made by
+loading the package or executing functions in it.  It has access to
+the package's feature list (before anything is unbound) in the
+variable `unload-hook-features-list' and could remove features from it
+in the event that the package has done something normally-ill-advised,
+such as redefining an Emacs function."
   (interactive (list (read-feature "Feature: ") current-prefix-arg))
   (if (not (featurep feature))
       (error "%s is not a currently loaded feature" (symbol-name feature)))
@@ -130,8 +146,8 @@
 	(if dependents
 	    (error "Loaded libraries %s depend on %s"
 		   (prin1-to-string dependents) file))))
-  (let* ((flist (feature-symbols feature))
-         (file (car flist))
+  (let* ((unload-hook-features-list (feature-symbols feature))
+         (file (car unload-hook-features-list))
          (unload-hook (intern-soft (concat (symbol-name feature)
                                            "-unload-hook"))))
     ;; Try to avoid losing badly when hooks installed in critical
@@ -155,10 +171,10 @@
                       (string-match "-hooks?\\'" (symbol-name x)))
                  (and (boundp x)       ; Known abnormal hooks etc.
                       (memq x unload-feature-special-hooks)))
-	     (dolist (y (cdr flist))
+	     (dolist (y (cdr unload-hook-features-list))
 	       (remove-hook x y))))))
     (if (fboundp 'elp-restore-function)	; remove ELP stuff first
-	(dolist (elt (cdr flist))
+	(dolist (elt (cdr unload-hook-features-list))
 	  (if (symbolp elt)
 	      (elp-restore-function elt))))
     (mapc
@@ -183,7 +199,7 @@
 		(fmakunbound x)
 		(let ((aload (get x 'autoload)))
 		  (if aload (fset x (cons 'autoload aload))))))))
-     (cdr flist))
+     (cdr unload-hook-features-list))
     ;; Delete the load-history element for this file.
     (let ((elt (assoc file load-history)))
       (setq load-history (delq elt load-history)))))
--- a/lisp/mail/rmail-spam-filter.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/mail/rmail-spam-filter.el	Wed Feb 18 17:10:32 2004 +0000
@@ -1,7 +1,7 @@
 ;;; rmail-spam-filter.el  --- spam filter for rmail, the emacs mail reader.
 
-;; Copyright (C) 2002 Free Software Foundation, Inc.
-
+;; Copyright (C) 2002 
+;;		Free Software Foundation, Inc.
 ;; Keywords: email, spam, filter, rmail
 ;; Author: Eli Tziperman <eli AT deas.harvard.edu>
 
@@ -28,7 +28,7 @@
 ;;; Automatically recognize and delete junk email before it is
 ;;; displayed in rmail/rmail-summary.  Spam emails are defined by
 ;;; specifying one or more of the sender, subject and contents.
-;;; URL: http://deas.harvard.edu/climate/eli/Downloads/rmail-spam-filter/
+;;; URL: http://www.weizmann.ac.il/~eli/Downloads/rmail-spam-filter/
 
 ;;; Usage:
 ;;; ------
@@ -83,7 +83,9 @@
 ;;; sender's bbdb entry as well _if_ it was created at the same day.
 
 (require 'rmail)
-(require 'rmailsum)
+(if (> emacs-major-version 20)
+    (require 'rmailsum)
+  (if (not (fboundp 'rmail-make-summary-line)) (load-library "rmailsum")))
 
 ;; For find-if and other cool common lisp functions we may want to use.
 (eval-when-compile
@@ -93,7 +95,6 @@
   "Spam filter for RMAIL, the mail reader for Emacs."
   :group 'rmail)
 
-;;;###autoload
 (defcustom rmail-use-spam-filter nil
   "*Non-nil to activate the rmail spam filter.
 Specify `rsf-definitions-alist' to define what you consider spam
@@ -214,7 +215,7 @@
 
 ;; the advantage over the automatic filter definitions is the AND conjunction
 ;; of in-one-definition-elements
-(defun rsf-check-field (field-symbol message-data definition result)
+(defun check-field (field-symbol message-data definition result)
   "Check if field-symbol is in `rsf-definitions-alist'.
 Capture maybe-spam and this-is-a-spam-email in a cons in result,
 where maybe-spam is in first and this-is-a-spam-email is in rest. 
@@ -313,7 +314,7 @@
                   this-is-a-spam-email nil))
 
         ;; maybe-spam is in first, this-is-a-spam-email in rest, this
-        ;; simplifies the call to rsf-check-field
+        ;; simplifies the call to check-field
         (setq maybe-spam (cons maybe-spam this-is-a-spam-email))
 
 	;; scan all elements of the list rsf-definitions-alist
@@ -344,18 +345,18 @@
 	    ;; scanned, AND if "from" field does not appear in spam
 	    ;; definitions for this element, this may still be spam
 	    ;; due to another element...
-            (rsf-check-field 'from message-sender definition maybe-spam)
+            (check-field 'from message-sender definition maybe-spam)
  	    ;; next, if spam was not ruled out already, check recipients:
-            (rsf-check-field 'to message-recipients definition maybe-spam)
+            (check-field 'to message-recipients definition maybe-spam)
  	    ;; next, if spam was not ruled out already, check subject:
-            (rsf-check-field 'subject message-subject definition maybe-spam)
+            (check-field 'subject message-subject definition maybe-spam)
  	    ;; next, if spam was not ruled out already, check content-type:
-            (rsf-check-field 'content-type message-content-type 
+            (check-field 'content-type message-content-type 
                          definition maybe-spam)
 	    ;; next, if spam was not ruled out already, check
 	    ;; contents: if contents field is not specified, this may
 	    ;; still be spam due to another element...
-            (rsf-check-field 'contents 
+            (check-field 'contents 
                          (buffer-substring
                           (rmail-msgbeg msg) (rmail-msgend msg))
                          definition maybe-spam)
--- a/lisp/mail/rmail.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/mail/rmail.el	Wed Feb 18 17:10:32 2004 +0000
@@ -1448,7 +1448,8 @@
 			 (if (or file-name rmail-inbox-list)
 			     (message "(No new mail has arrived)")))
 		;; check new messages to see if any of them is spam:
-		(if rmail-use-spam-filter
+		(if (and (featurep 'rmail-spam-filter)
+			 rmail-use-spam-filter)
 		    (let*
 			((old-messages (- rmail-total-messages new-messages))
                          (rsf-scanned-message-number (1+ old-messages))
@@ -1486,7 +1487,9 @@
 		(message "%d new message%s read%s"
 			 new-messages (if (= 1 new-messages) "" "s")
 			 ;; print out a message on number of spam messages found:
-			 (if (and rmail-use-spam-filter (> rsf-number-of-spam 0))
+			 (if (and (featurep 'rmail-spam-filter)
+				  rmail-use-spam-filter
+				  (> rsf-number-of-spam 0))
 			     (if (= 1 new-messages)
 				 ", and found to be a spam message"
 			       (if (> rsf-number-of-spam 1)
@@ -1494,7 +1497,9 @@
 					   rsf-number-of-spam)
 				 ", one of which found to be a spam message"))
 			   ""))
-		(if (and rmail-use-spam-filter (> rsf-number-of-spam 0))
+		(if (and (featurep 'rmail-spam-filter)
+			 rmail-use-spam-filter
+			 (> rsf-number-of-spam 0))
 		    (progn (if rmail-spam-filter-beep (beep t))
 			   (sleep-for rmail-spam-sleep-after-message)))
 
--- a/lisp/man.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/man.el	Wed Feb 18 17:10:32 2004 +0000
@@ -801,6 +801,11 @@
   ;; Try to recognize common forms of cross references.
   (Man-highlight-references)
   (Man-softhyphen-to-minus)
+  (goto-char (point-min))
+  (while (re-search-forward Man-heading-regexp nil t)
+    (put-text-property (match-beginning 0)
+		       (match-end 0)
+		       'face Man-overstrike-face))
   (message "%s man page formatted" Man-arguments))
 
 (defun Man-highlight-references ()
--- a/lisp/net/telnet.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/net/telnet.el	Wed Feb 18 17:10:32 2004 +0000
@@ -89,8 +89,8 @@
 rejecting one login and prompting again for a username and password.")
 
 (defun telnet-interrupt-subjob ()
+  "Interrupt the program running through telnet on the remote host."
   (interactive)
-  "Interrupt the program running through telnet on the remote host."
   (send-string nil telnet-interrupt-string))
 
 (defun telnet-c-z ()
--- a/lisp/newcomment.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/newcomment.el	Wed Feb 18 17:10:32 2004 +0000
@@ -698,7 +698,7 @@
 comment markers."
   (interactive "*r\nP")
   (comment-normalize-vars)
-  (if (> beg end) (let (mid) (setq mid beg beg end end mid)))
+  (when (> beg end) (setq beg (prog1 end (setq end beg))))
   (save-excursion
     (if uncomment-region-function
 	(funcall uncomment-region-function beg end arg)
@@ -716,7 +716,35 @@
 		;; Find the end of the comment.
 		(ept (progn
 		       (goto-char spt)
-		       (unless (comment-forward)
+		       (unless
+			   (or
+			    (comment-forward)
+			    ;; Allow eob as comment-end instead of \n.
+			    (and
+			     (eobp)
+			     (let ((s1 (aref (syntax-table) (char-after spt)))
+				   (s2 (aref (syntax-table)
+					     (or (char-after (1+ spt)) 0)))
+				   (sn (aref (syntax-table) ?\n))
+				   (flag->b (car (string-to-syntax "> b")))
+				   (flag-1b (car (string-to-syntax "  1b")))
+				   (flag-2b (car (string-to-syntax "  2b"))))
+			       (cond
+				;; One-character comment-start terminated by
+				;; \n.
+				((and
+				  (equal sn (string-to-syntax ">"))
+				  (equal s1 (string-to-syntax "<")))
+				 (insert-char ?\n 1)
+				 t)
+				;; Two-character type b comment-start
+				;; terminated by \n.
+				((and
+				  (= (logand (car sn) flag->b) flag->b)
+				  (= (logand (car s1) flag-1b) flag-1b)
+				  (= (logand (car s2) flag-2b) flag-2b))
+				 (insert-char ?\n 1)
+				 t)))))
 			 (error "Can't find the comment end"))
 		       (point)))
 		(box nil)
--- a/lisp/progmodes/grep.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/progmodes/grep.el	Wed Feb 18 17:10:32 2004 +0000
@@ -318,12 +318,7 @@
 	      'gnu)))
   (unless grep-find-command
     (setq grep-find-command
-          (cond ((not (executable-command-find-posix-p "find"))
-		 (message
-		  (concat "compile.el: Posix-style find(1) not found. "
-			  "Please set `grep-find-command'."))
-		 nil)
-		((eq grep-find-use-xargs 'gnu)
+          (cond ((eq grep-find-use-xargs 'gnu)
 		 (format "%s . -type f -print0 | xargs -0 -e %s"
 			 find-program grep-command))
 		(grep-find-use-xargs
--- a/lisp/progmodes/icon.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/progmodes/icon.el	Wed Feb 18 17:10:32 2004 +0000
@@ -243,7 +243,6 @@
       (self-insert-command (prefix-numeric-value arg)))))
 
 (defun icon-indent-command (&optional whole-exp)
-  (interactive "P")
   "Indent current line as Icon code, or in some cases insert a tab character.
 If `icon-tab-always-indent' is non-nil (the default), always indent current
 line.  Otherwise, indent the current line only if point is at the left margin
@@ -253,6 +252,7 @@
 lines of the expression starting after point so that this line becomes
 properly indented.  The relative indentation among the lines of the
 expression are preserved."
+  (interactive "P")
   (if whole-exp
       ;; If arg, always indent this line as Icon
       ;; and shift remaining lines of expression the same amount.
--- a/lisp/subr.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/subr.el	Wed Feb 18 17:10:32 2004 +0000
@@ -210,18 +210,14 @@
 	   x))))
 
 (defun delete-dups (list)
-  "Destructively return LIST, with `equal' duplicates removed.
-LIST must be a proper list.  The value of LIST after a call to
-this function is undefined.  Use \(setq LIST (delete-dups LIST))
-if you want to store the return value in LIST.  Of several
-`equal' occurrences of an element in LIST, the last one is kept."
-  (while (member (car list) (cdr list))
-    (pop list))
+  "Destructively remove `equal' duplicates from LIST.
+Store the result in LIST and return it.  LIST must be a proper list.
+Of several `equal' occurrences of an element in LIST, the first
+one is kept."
   (let ((tail list))
     (while tail
-      (while (member (cadr tail) (cddr tail))
-	(setcdr tail (cddr tail)))
-      (pop tail)))
+      (setcdr tail (delete (car tail) (cdr tail)))
+      (setq tail (cdr tail))))
   list)
 
 (defun number-sequence (from &optional to inc)
@@ -1985,10 +1981,8 @@
 STRING should be given if the last search was by `string-match' on STRING."
   (if (match-beginning num)
       (if string
-	  (let ((result
-		 (substring string (match-beginning num) (match-end num))))
-	    (set-text-properties 0 (length result) nil result)
-	    result)
+	  (substring-no-properties string (match-beginning num)
+				   (match-end num))
 	(buffer-substring-no-properties (match-beginning num)
 					(match-end num)))))
 
--- a/lisp/textmodes/paragraphs.el	Tue Feb 17 01:52:25 2004 +0000
+++ b/lisp/textmodes/paragraphs.el	Wed Feb 18 17:10:32 2004 +0000
@@ -430,9 +430,9 @@
     (constrain-to-field nil opoint t)))
 
 (defun repunctuate-sentences ()
-  (interactive)
   "Put two spaces at the end of sentences from point to the end of buffer.
 It works using `query-replace-regexp'."
+  (interactive)
   (query-replace-regexp "\\([]\"')]?\\)\\([.?!]\\)\\([]\"')]?\\) +"
 			"\\1\\2\\3  "))
 
--- a/lispref/ChangeLog	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/ChangeLog	Wed Feb 18 17:10:32 2004 +0000
@@ -1,3 +1,74 @@
+2004-02-16  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* lists.texi (Sets And Lists): Update description of delete-dups.
+
+2004-02-16  Jesper Harder  <harder@ifa.au.dk>  (tiny change)
+
+	* keymaps.texi (Tool Bar): tool-bar-item => tool-bar-button.
+
+2004-02-16  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* frames.texi (Parameter Access): frame-parameters arg is optional.
+	modify-frame-parameters handles nil for FRAME.
+	(Window Frame Parameters): menu-bar-lines and tool-bar-lines
+	are all-or-nothing for certain toolkits.
+	Mention parameter wait-for-wm.
+	(Frames and Windows): In frame-first-window and frame-selected-window
+	the arg is optional.
+	(Input Focus): In redirect-frame-focus the second arg is optional.
+	(Window System Selections): Mention selection type CLIPBOARD.
+	Mention data-type UTF8_STRING.
+	Mention numbering of cut buffers.
+	(Resources): Describe x-resource-name.
+
+2004-02-16  Richard M. Stallman  <rms@gnu.org>
+
+	* windows.texi (Buffers and Windows): Delete false table
+	about all-frames.
+
+	* syntax.texi (Parsing Expressions): Delete old caveat
+	about parse-sexp-ignore-comments.
+
+	* streams.texi (Output Variables): Add print-quoted.
+
+	* lists.texi (Building Lists): Minor cleanup.
+
+	* hash.texi (Creating Hash): Correct and clarify doc of WEAK values.
+
+	* display.texi (Overlays): Explain overlays use markers.
+	(Managing Overlays): Explain front-advance and rear-advance
+	in more detail.
+
+	* loading.texi (Unloading): Document unload-feature-special-hooks.
+	Get rid of fns-NNN.el file.
+
+2004-02-16  Matthew Mundell  <matt@mundell.ukfsn.org>  (tiny change)
+
+	* help.texi (Describing Characters): Fix text-char-description
+	example output.
+
+	* edebug.texi (Using Edebug): Fix example.
+
+	* debugging.texi (Internals of Debugger): Fix return value.
+
+	* files.texi (Changing Files): Fix argname.
+
+	* calendar.texi: Fix parens, and default values.
+
+	* display.texi, frames.texi, internals.texi, modes.texi: Minor fixes.
+	* nonascii.texi, objects.texi, os.texi: Minor fixes.
+	* searching.texi, text.texi, tips.texi, windows.text: Minor fixes.
+
+	* positions.texi (Text Lines): Don't add -1 in current-line.
+
+2004-02-16  Richard M. Stallman  <rms@gnu.org>
+
+	* compile.texi (Compiler Errors): if-boundp feature applies to cond.
+
+2004-02-16  Jesper Harder  <harder@ifa.au.dk>  (tiny change)
+
+	* processes.texi (Low-Level Network): Fix a typo.
+
 2004-02-12  Kim F. Storm  <storm@cua.dk>
 
 	* display.texi (Fringes): Use consistent wording.
--- a/lispref/buffers.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/buffers.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -678,7 +678,7 @@
 
 @defun barf-if-buffer-read-only
 This function signals a @code{buffer-read-only} error if the current
-buffer is read-only.  @xref{Interactive Call}, for another way to
+buffer is read-only.  @xref{Using Interactive}, for another way to
 signal an error if the current buffer is read-only.
 @end defun
 
--- a/lispref/calendar.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/calendar.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -259,8 +259,8 @@
                    (calendar-gregorian-from-absolute
                     (1+ (calendar-dayname-on-or-before
                           1 (+ 6 (calendar-absolute-from-gregorian
-                                  (list 11 1 year))))))
-              "US Presidential Election"))
+                                  (list 11 1 year)))))))
+              "US Presidential Election")
 @end smallexample
 
 @noindent
@@ -967,7 +967,7 @@
 @table @code
 @item appt-message-warning-time
 The time in minutes before an appointment that the reminder begins.  The
-default is 10 minutes.
+default is 12 minutes.
 @item appt-audible
 If this is non-@code{nil}, Emacs rings the
 terminal bell for appointment reminders.  The default is @code{t}.
@@ -988,7 +988,7 @@
 message window, when its time is up.
 @item appt-display-duration
 The number of seconds to display an appointment message.  The default
-is 5 seconds.
+is 10 seconds.
 @end table
 
 @ignore
--- a/lispref/compile.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/compile.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -448,9 +448,11 @@
 @end example
 
 @noindent
-The call to @var{func} must be in the @var{then-form} of the @code{if},
-and @var{func} must appear quoted in the call to @code{fboundp}.
-Likewise, you can suppress a compiler warning for an unbound variable
+The call to @var{func} must be in the @var{then-form} of the
+@code{if}, and @var{func} must appear quoted in the call to
+@code{fboundp}.  (This feature operates for @code{cond} as well.)
+
+  Likewise, you can suppress a compiler warning for an unbound variable
 @var{variable} by conditionalizing its use on a @code{boundp} test,
 like this:
 
--- a/lispref/debugging.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/debugging.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -551,7 +551,7 @@
                          (1+ var)
                          (list 'testing (backtrace))))))))
 
-     @result{} nil
+     @result{} (testing nil)
 @end group
 
 @group
--- a/lispref/display.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/display.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -445,7 +445,7 @@
 @end defvar
 
 @defvar warning-prefix-function
-If non-@code{nil}, te value is a function to generate prefix text for
+If non-@code{nil}, the value is a function to generate prefix text for
 warnings.  Programs can bind the variable to a suitable function.
 @code{display-warning} calls this function with the warnings buffer
 current, and the function can insert text in it.  That text becomes
@@ -454,7 +454,7 @@
 The function is called with two arguments, the severity level and its
 entry in @code{warning-levels}.  It should return a list to use as the
 entry (this value need not be an actual member of
-@code{warning-levels}).  By constructing this value, the function to
+@code{warning-levels}).  By constructing this value, the function can
 change the severity of the warning, or specify different handling for
 a given severity level.
 
@@ -466,7 +466,7 @@
 Programs can bind this variable to @code{t} to say that the next
 warning should begin a series.  When several warnings form a series,
 that means to leave point on the first warning of the series, rather
-than keep move it for each warning so that it appears on the last one.
+than keep moving it for each warning so that it appears on the last one.
 The series ends when the local binding is unbound and
 @code{warning-series} becomes @code{nil} again.
 
@@ -600,7 +600,7 @@
 @end defun
 
 @defun remove-from-invisibility-spec element
-This removeds the element @var{element} from
+This removes the element @var{element} from
 @code{buffer-invisibility-spec}.  This does nothing if @var{element}
 is not in the list.
 @end defun
@@ -966,6 +966,12 @@
 beginning and end.  It also has properties that you can examine and set;
 these affect the display of the text within the overlay.
 
+An overlays uses markers to record its beginning and end; thus,
+editing the text of the buffer adjusts the beginning and end of each
+overlay so that it stays with the text.  When you create the overlay,
+you can specify whether text inserted at the beginning should be
+inside the overlay or outside, and likewise for the end of the overlay.
+
 @menu
 * Overlay Properties::  How to read and set properties.
 			What properties do to the screen display.
@@ -1195,7 +1201,11 @@
 
 The arguments @var{front-advance} and @var{rear-advance} specify the
 insertion type for the start of the overlay and for the end of the
-overlay, respectively.  @xref{Marker Insertion Types}.
+overlay, respectively.  @xref{Marker Insertion Types}.  If
+@var{front-advance} is non-@code{nil}, text inserted at the beginning
+of the overlay is excluded from the overlay.  If @var{read-advance} is
+non-@code{nil}, text inserted at the beginning of the overlay is
+included in the overlay.
 @end defun
 
 @defun overlay-start overlay
@@ -1923,7 +1933,7 @@
 
 @tindex face-attribute-relative-p
 @defun face-attribute-relative-p attribute value
-This function returns non-@code{nil} if @var{value}, when used as a
+This function returns non-@code{nil} if @var{value}, when used as
 the value of the face attribute @var{attribute}, is relative (that is,
 if it modifies an underlying or inherited value of @var{attribute}).
 @end defun
@@ -2496,7 +2506,7 @@
 use the font name @var{fontname} for the character @var{character}.
 
 If @var{name} is @code{nil}, this function modifies the default
-fontset of which short name is @samp{fontset-default}.
+fontset, whose short name is @samp{fontset-default}.
 
 @var{character} may be a cons; @code{(@var{from} . @var{to})}, where
 @var{from} and @var{to} are non-generic characters.  In that case, use
@@ -2536,7 +2546,7 @@
 
   The @dfn{fringes} of a window are thin vertical strips down the
 sides that are used for displaying bitmaps that indicate truncation,
-continuation, and horizontal scrolling, the overlay arrow.  The
+continuation, horizontal scrolling, and the overlay arrow.  The
 fringes normally appear between the display margins and the window
 text, but you can put them outside the display margins for a specific
 buffer by setting @code{fringes-outside-margins} buffer-locally to a
@@ -2559,10 +2569,11 @@
 
   The values of these variables take effect when you display the
 buffer in a window.  If you change them while the buffer is visible,
-you can call @code{set-window-buffer} to display it in a window again.
+you can call @code{set-window-buffer} to display it once again in the
+same window, to make the changes take effect.
 
 @defun set-window-fringes window left &optional right outside-margins
-This function sets the fringe widthes of window @var{window}.
+This function sets the fringe widths of window @var{window}.
 If @var{window} is @code{nil}, the selected window is used.
 
 The argument @var{left} specifies the width in pixels of the left
--- a/lispref/edebug.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/edebug.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -124,7 +124,7 @@
 @example
 (defun fac (n)
   .(if .(< 0 n.).
-      .(* n. .(fac (1- n.).).).
+      .(* n. .(fac .(1- n.).).).
     1).)
 @end example
 
--- a/lispref/files.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/files.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -1341,7 +1341,7 @@
 @end deffn
 
 @defun define-logical-name varname string
-This function defines the logical name @var{name} to have the value
+This function defines the logical name @var{varname} to have the value
 @var{string}.  It is available only on VMS.
 @end defun
 
--- a/lispref/frames.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/frames.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -56,7 +56,7 @@
 * Input Focus::			Specifying the selected frame.
 * Visibility of Frames::	Frames may be visible or invisible, or icons.
 * Raising and Lowering::	Raising a frame makes it hide other windows;
-				  lowering it makes the others hide them.
+				  lowering it makes the others hide it.
 * Frame Configurations::	Saving the state of all frames.
 * Mouse Tracking::		Getting events that say when the mouse moves.
 * Mouse Position::		Asking where the mouse is, or moving it.
@@ -212,9 +212,10 @@
 selected  frame's parameter.
 @end defun
 
-@defun frame-parameters frame
+@defun frame-parameters &optional frame
 The function @code{frame-parameters} returns an alist listing all the
-parameters of @var{frame} and their values.
+parameters of @var{frame} and their values.  If @var{frame} is
+@code{nil} or omitted, this returns the selected frame's parameters
 @end defun
 
 @defun modify-frame-parameters frame alist
@@ -222,7 +223,8 @@
 elements of @var{alist}.  Each element of @var{alist} has the form
 @code{(@var{parm} . @var{value})}, where @var{parm} is a symbol naming a
 parameter.  If you don't mention a parameter in @var{alist}, its value
-doesn't change.
+doesn't change.  If @var{frame} is @code{nil}, it defaults to the selected
+frame.
 @end defun
 
 @defun modify-all-frames-parameters alist
@@ -505,9 +507,8 @@
 
 @vindex cursor-type
 The buffer-local variable @code{cursor-type} overrides the value of
-the @code{cursor-type} frame parameter, and can in addition have
-values @code{t} (use the cursor specified for the frame) and
-@code{nil} (don't display a cursor).
+the @code{cursor-type} frame parameter, but if it is @code{t}, that
+means to use the cursor specified for the frame.
 
 @item border-width
 The width in pixels of the window border.
@@ -542,7 +543,7 @@
 @item menu-bar-lines
 The number of lines to allocate at the top of the frame for a menu bar.
 The default is 1.  @xref{Menu Bar}.  (In Emacs versions that use the X
-toolkit, there is only one menu bar line; all that matters about the
+toolkit or GTK, there is only one menu bar line; all that matters about the
 number you specify is whether it is greater than zero.)
 
 @item screen-gamma
@@ -566,7 +567,9 @@
 
 @item tool-bar-lines
 The number of lines to use for the toolbar.  A value of @code{nil} means
-don't display a tool bar.
+don't display a tool bar.  (In Emacs versions that use GTK, there is
+only one tool bar line; all that matters about the number you specify
+is whether it is greater than zero.)
 
 @item line-spacing
 Additional space put below text lines in pixels (a positive integer).
@@ -634,6 +637,12 @@
 If non-@code{nil}, the color for the background of scroll bars.  It is
 equivalent to the @code{:background} attribute of the
 @code{scroll-bar} face.
+
+@item wait-for-wm
+If non-@code{nil}, tell Xt to wait for the window manager to confirm
+geometry changes.  Some window managers, including versions of Fvwm2
+and KDE, fail to confirm, so Xt hangs.  Set this to @code{nil} to
+prevent hanging with those window managers.
 @end table
 
 @node Size and Position
@@ -909,8 +918,9 @@
 the lower right corner (always the minibuffer window, if the frame has
 one), and then it moves back to the top.  @xref{Cyclic Window Ordering}.
 
-@defun frame-first-window frame
+@defun frame-first-window &optional frame
 This returns the topmost, leftmost window of frame @var{frame}.
+If omitted or @code{nil}, @var{frame} defaults to the selected frame.
 @end defun
 
 At any time, exactly one window on any frame is @dfn{selected within the
@@ -918,9 +928,9 @@
 frame also selects this window.  You can get the frame's current
 selected window with @code{frame-selected-window}.
 
-@defun frame-selected-window frame
+@defun frame-selected-window  &optional frame
 This function returns the window on @var{frame} that is selected within
-@var{frame}.
+@var{frame}.  If omitted or @code{nil}, @var{frame} defaults to the selected frame.
 @end defun
 
 @defun set-frame-selected-window frame window
@@ -1026,14 +1036,14 @@
 Don't call it for any other reason.
 @end deffn
 
-@defun redirect-frame-focus frame focus-frame
+@defun redirect-frame-focus frame &optional focus-frame
 This function redirects focus from @var{frame} to @var{focus-frame}.
 This means that @var{focus-frame} will receive subsequent keystrokes and
 events intended for @var{frame}.  After such an event, the value of
 @code{last-event-frame} will be @var{focus-frame}.  Also, switch-frame
 events specifying @var{frame} will instead select @var{focus-frame}.
 
-If @var{focus-frame} is @code{nil}, that cancels any existing
+If @var{focus-frame} is omitted or @code{nil}, that cancels any existing
 redirection for @var{frame}, which therefore once again receives its own
 events.
 
@@ -1458,9 +1468,10 @@
 selection values.
 
 Each possible @var{type} has its own selection value, which changes
-independently.  The usual values of @var{type} are @code{PRIMARY} and
-@code{SECONDARY}; these are symbols with upper-case names, in accord
-with X Window System conventions.  The default is @code{PRIMARY}.
+independently.  The usual values of @var{type} are @code{PRIMARY},
+@code{SECONDARY} and @code{CLIPBOARD}; these are symbols with upper-case
+names, in accord with X Window System conventions.  The default is
+@code{PRIMARY}.
 @end defun
 
 @defun x-get-selection &optional type data-type
@@ -1472,6 +1483,7 @@
 The @var{data-type} argument specifies the form of data conversion to
 use, to convert the raw data obtained from another X client into Lisp
 data.  Meaningful values include @code{TEXT}, @code{STRING},
+@code{UTF8_STRING},
 @code{TARGETS}, @code{LENGTH}, @code{DELETE}, @code{FILE_NAME},
 @code{CHARACTER_POSITION}, @code{LINE_NUMBER}, @code{COLUMN_NUMBER},
 @code{OWNER_OS}, @code{HOST_NAME}, @code{USER}, @code{CLASS},
@@ -1481,13 +1493,14 @@
 @end defun
 
 @cindex cut buffer
-The X server also has a set of numbered @dfn{cut buffers} which can
+The X server also has a set of eight numbered @dfn{cut buffers} which can
 store text or other data being moved between applications.  Cut buffers
 are considered obsolete, but Emacs supports them for the sake of X
-clients that still use them.
+clients that still use them.  Cut buffers are numbered from 0 to 7.
 
-@defun x-get-cut-buffer n
+@defun x-get-cut-buffer &optional n
 This function returns the contents of cut buffer number @var{n}.
+If omitted @var{n} defaults to 0.
 @end defun
 
 @defun x-set-cut-buffer string &optional push
@@ -1693,7 +1706,7 @@
 
 @defun x-get-resource attribute class &optional component subclass
 The function @code{x-get-resource} retrieves a resource value from the X
-Windows defaults database.
+Window defaults database.
 
 Resources are indexed by a combination of a @dfn{key} and a @dfn{class}.
 This function searches using a key of the form
@@ -1715,6 +1728,12 @@
 variable to some other string, around a call to @code{x-get-resource}.
 @end defvar
 
+@defvar x-resource-name
+This variable specifies the instance name that @code{x-get-resource}
+should look up.  The default value is the name Emacs was invoked with,
+or the value specified with the @samp{-name} or @samp{-rn} switches.
+@end defvar
+
   @xref{X Resources,, X Resources, emacs, The GNU Emacs Manual}.
 
 @node Display Feature Testing
--- a/lispref/hash.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/hash.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -109,19 +109,19 @@
 anywhere else); if a particular value does get collected, the
 corresponding association is removed from the hash table.
 
-If @var{weak} is @code{key-or-value} or @code{t}, the hash table does
-not protect either keys or values from garbage collection; if either
-one is collected as garbage, the association is removed.
+If @var{weak} is @code{key-and-value} or @code{t}, both the key and
+the value must be live in order to preserve the association.  Thus,
+the hash table does not protect either keys or values from garbage
+collection; if either one is collected as garbage, that removes the
+association.
 
-If @var{weak} is @code{key-and-value}, associations are removed from
-the hash table when both their key and value would be collected as
-garbage, again not considering references to the key and value from
-weak hash tables.
+If @var{weak} is @code{key-or-value}, either the key or
+the value can preserve the association.  Thus, associations are
+removed from the hash table when both their key and value would be
+collected as garbage (if not for references from weak hash tables).
 
 The default for @var{weak} is @code{nil}, so that all keys and values
-referenced in the hash table are preserved from garbage collection.  If
-@var{weak} is @code{t}, neither keys nor values are protected (that is,
-both are weak).
+referenced in the hash table are preserved from garbage collection.
 
 @item :size @var{size}
 This specifies a hint for how many associations you plan to store in the
--- a/lispref/help.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/help.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -432,7 +432,8 @@
 standard Emacs notation for characters that appear in text---like
 @code{single-key-description}, except that control characters are
 represented with a leading caret (which is how control characters in
-Emacs buffers are usually displayed).
+Emacs buffers are usually displayed) and character codes 128
+and above are not treated as Meta characters.
 
 @smallexample
 @group
@@ -441,11 +442,11 @@
 @end group
 @group
 (text-char-description ?\M-m)
-     @result{} "M-m"
+     @result{} "\xed"
 @end group
 @group
 (text-char-description ?\C-\M-m)
-     @result{} "M-^M"
+     @result{} "\x8d"
 @end group
 @end smallexample
 @end defun
--- a/lispref/internals.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/internals.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -13,7 +13,7 @@
 internal aspects of GNU Emacs that may be of interest to C programmers.
 
 @menu
-* Building Emacs::      How to the dumped Emacs is made.
+* Building Emacs::      How the dumped Emacs is made.
 * Pure Storage::        A kludge to make preloaded Lisp functions sharable.
 * Garbage Collection::  Reclaiming space for Lisp objects no longer used.
 * Memory Usage::        Info about total size of Lisp objects made so far.
@@ -1297,7 +1297,7 @@
 
 @item redisplay_end_trigger
 If redisplay in this window goes beyond this buffer position, it runs
-run the @code{redisplay-end-trigger-hook}.
+the @code{redisplay-end-trigger-hook}.
 
 @ignore
 @item orig_height
@@ -1396,7 +1396,7 @@
 The associated buffer of the process.
 
 @item pid
-An integer, the Unix process @acronym{ID}.
+An integer, the operating system's process @acronym{ID}.
 
 @item childp
 A flag, non-@code{nil} if this is really a child process.
--- a/lispref/keymaps.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/keymaps.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -2324,7 +2324,7 @@
 @tindex tool-bar-add-item
 This function adds an item to the tool bar by modifying
 @code{tool-bar-map}.  The image to use is defined by @var{icon}, which
-is the base name of an XPM, XBM or PBM image file to located by
+is the base name of an XPM, XBM or PBM image file to be located by
 @code{find-image}.  Given a value @samp{"exit"}, say, @file{exit.xpm},
 @file{exit.pbm} and @file{exit.xbm} would be searched for in that order
 on a color display.  On a monochrome display, the search order is
@@ -2375,22 +2375,22 @@
 frame's height.
 @end defvar
 
-@tindex auto-raise-tool-bar-items
-@defvar auto-raise-tool-bar-items
+@tindex auto-raise-tool-bar-buttons
+@defvar auto-raise-tool-bar-buttons
 If this variable is non-@code{nil}, tool bar items display
 in raised form when the mouse moves over them.
 @end defvar
 
-@tindex tool-bar-item-margin
-@defvar tool-bar-item-margin
+@tindex tool-bar-button-margin
+@defvar tool-bar-button-margin
 This variable specifies an extra margin to add around tool bar items.
-The value is an integer, a number of pixels.  The default is 1.
+The value is an integer, a number of pixels.  The default is 4.
 @end defvar
 
-@tindex tool-bar-item-relief
-@defvar tool-bar-item-relief
+@tindex tool-bar-button-relief
+@defvar tool-bar-button-relief
 This variable specifies the shadow width for tool bar items.
-The value is an integer, a number of pixels.  The default is 3.
+The value is an integer, a number of pixels.  The default is 1.
 @end defvar
 
   You can define a special meaning for clicking on a tool bar item with
--- a/lispref/lists.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/lists.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -448,7 +448,7 @@
 code for Emacs than @code{cons}.
 
 @defun cons object1 object2
-This function is the fundamental function used to build new list
+This function is the fundamental function for building new list
 structure.  It creates a new cons cell, making @var{object1} the
 @sc{car}, and @var{object2} the @sc{cdr}.  It then returns the new cons
 cell.  The arguments @var{object1} and @var{object2} may be any Lisp
@@ -1436,16 +1436,9 @@
 
 @defun delete-dups list
 This function destructively removes all @code{equal} duplicates from
-@var{list} and returns the result.  Of several @code{equal}
-occurrences of an element in @var{list}, @code{delete-dups} keeps the
-last one.
-
-The value of @var{list} after a call to this function is undefined.
-Usually, we store the return value back in @var{list}:
-
-@example
-(setq list (delete-dups list))
-@end example
+@var{list}, stores the result in @var{list} and returns it.  Of
+several @code{equal} occurrences of an element in @var{list},
+@code{delete-dups} keeps the first one.
 @end defun
 
   See also the function @code{add-to-list}, in @ref{Setting Variables},
--- a/lispref/loading.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/loading.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -173,7 +173,7 @@
 
   The value of @code{load-path} is initialized from the environment
 variable @code{EMACSLOADPATH}, if that exists; otherwise its default
-value is specified in @file{emacs/src/paths.h} when Emacs is built.
+value is specified in @file{emacs/src/epaths.h} when Emacs is built.
 Then the list is expanded by adding subdirectories of the directories
 in the list.
 
@@ -790,18 +790,7 @@
 by adding the symbols defined to the element for the file being visited,
 rather than replacing that element.  @xref{Eval}.
 
-  Preloaded libraries don't contribute initially to @code{load-history}.
-Instead, preloading writes information about preloaded libraries into a
-file, which can be loaded later on to add information to
-@code{load-history} describing the preloaded files.  This file is
-installed in @code{exec-directory} and has a name of the form
-@file{fns-@var{emacsversion}.el}.
-
-@findex symbol-file
-  See the source for the function @code{symbol-file}, for an example of
-code that loads this file to find functions in preloaded libraries.
-
-@defvar loadhist-special-hooks
+@defvar unload-feature-special-hooks
 This variable holds a list of hooks to be scanned before unloading a
 library, to remove functions defined in the library.
 @end defvar
--- a/lispref/modes.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/modes.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -203,7 +203,7 @@
 @kbd{C-j}.  Please keep this distinction uniform for all major modes.
 
 @item
-Major modes should not alter options that are primary a matter of user
+Major modes should not alter options that are primarily a matter of user
 preference, such as whether Auto-Fill mode is enabled.  Leave this to
 each user to decide.  However, a major mode should customize other
 variables so that Auto-Fill mode will work usefully @emph{if} the user
--- a/lispref/nonascii.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/nonascii.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -17,7 +17,7 @@
 * Selecting a Representation::  Treating a byte sequence as unibyte or multi.
 * Character Codes::         How unibyte and multibyte relate to
                                 codes of individual characters.
-* Character Sets::          The space of possible characters codes
+* Character Sets::          The space of possible character codes
                                 is divided into various character sets.
 * Chars and Bytes::         More information about multibyte encodings.
 * Splitting Characters::    Converting a character to its byte sequence.
@@ -503,6 +503,14 @@
 own particular translation tables; there are also default translation
 tables which apply to all other coding systems.
 
+  For instance, the coding-system @code{utf-8} has a translation table
+that maps characters of various charsets (e.g.,
+@code{latin-iso8859-@var{x}}) into Unicode character sets.  This way,
+it can encode Latin-2 characters into UTF-8.  Meanwhile,
+@code{unify-8859-on-decoding-mode} operates by specifying
+@code{standard-translation-table-for-decode} to translate
+Latin-@var{x} characters into corresponding Unicode characters.
+
 @defun make-translation-table &rest translations
 This function returns a translation table based on the argument
 @var{translations}.  Each element of @var{translations} should be a
@@ -558,6 +566,10 @@
 Self-inserting characters are translated through this translation
 table before they are inserted.  This variable automatically becomes
 buffer-local when set.
+
+@code{set-buffer-file-coding-system} sets this variable so that your
+keyboard input gets translated into the character sets that the buffer
+is likely to contain.
 @end defvar
 
 @node Coding Systems
@@ -1065,7 +1077,7 @@
 @example
 ;; @r{Read the file with no character code conversion.}
 ;; @r{Assume @acronym{crlf} represents end-of-line.}
-(let ((coding-system-for-write 'emacs-mule-dos))
+(let ((coding-system-for-read 'emacs-mule-dos))
   (insert-file-contents filename))
 @end example
 
--- a/lispref/objects.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/objects.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -1499,7 +1499,7 @@
 @cindex @samp{#@var{n}=} read syntax
 @cindex @samp{#@var{n}#} read syntax
 
-  In Emacs 21, to represent shared or circular structure within a
+  In Emacs 21, to represent shared or circular structures within a
 complex of Lisp objects, you can use the reader constructs
 @samp{#@var{n}=} and @samp{#@var{n}#}.
 
--- a/lispref/os.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/os.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -1306,7 +1306,7 @@
 function, because quitting out of many timer functions can leave
 things in an inconsistent state.  This is normally unproblematical
 because most timer functions don't do a lot of work.  Indeed, for a
-timer to calls a function that takes substantial time to run is likely
+timer to call a function that takes substantial time to run is likely
 to be annoying.
 
 @defun run-at-time time repeat function &rest args
--- a/lispref/positions.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/positions.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -403,8 +403,7 @@
 (defun current-line ()
   "Return the vertical position of point@dots{}"
   (+ (count-lines (window-start) (point))
-     (if (= (current-column) 0) 1 0)
-     -1))
+     (if (= (current-column) 0) 1 0)))
 @end group
 @end example
 @end defun
--- a/lispref/processes.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/processes.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -1860,7 +1860,7 @@
 
 @item :keepalive @var{keepalive-flag}
 If @var{keepalive-flag} is non-@code{nil} for a stream connection,
-enable exchange of low-level keep-alive messa
+enable exchange of low-level keep-alive messages.
 
 @item :linger @var{linger-arg}
 If @var{linger-arg} is non-@code{nil}, wait for successful
--- a/lispref/searching.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/searching.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -20,8 +20,8 @@
 * Regexp Search::         Searching for a match for a regexp.
 * POSIX Regexps::         Searching POSIX-style for the longest match.
 * Search and Replace::	  Internals of @code{query-replace}.
-* Match Data::            Finding out which part of the text matched
-                            various parts of a regexp, after regexp search.
+* Match Data::            Finding out which part of the text matched,
+                            after a string or regexp search.
 * Searching and Case::    Case-independent or case-significant searching.
 * Standard Regexps::      Useful regexps for finding sentences, pages,...
 @end menu
@@ -497,7 +497,7 @@
 @samp{caaar}, @samp{cdddr}, @samp{cadar}, and so on.
 
 @item \@{@var{m},@var{n}\@}
-is more general postfix operator that specifies repetition with a
+is a more general postfix operator that specifies repetition with a
 minimum of @var{m} repeats and a maximum of @var{n} repeats.  If @var{m}
 is omitted, the minimum is 0; if @var{n} is omitted, there is no
 maximum.
@@ -1206,10 +1206,9 @@
 @cindex match data
 
   Emacs keeps track of the start and end positions of the segments of
-text found during a regular expression search.  This means, for example,
-that you can search for a complex pattern, such as a date in an Rmail
-message, and then extract parts of the match under control of the
-pattern.
+text found during a search.  This means, for example, that you can
+search for a complex pattern, such as a date in an Rmail message, and
+then extract parts of the match under control of the pattern.
 
   Because the match data normally describe the most recent search only,
 you must be careful not to do another search inadvertently between the
@@ -1665,7 +1664,7 @@
 
 This means a period, question mark or exclamation mark (the actual
 default value also lists their alternatives in other character sets),
-followed optionally by a closing parenthetical character, followed by
+followed optionally by closing parenthetical characters, followed by
 tabs, spaces or new lines.
 
 For a detailed explanation of this regular expression, see @ref{Regexp
--- a/lispref/streams.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/streams.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -687,6 +687,13 @@
 that print functions use when the @var{stream} argument is @code{nil}.
 @end defvar
 
+@defvar print-quoted
+If this is non-@code{nil}, that means to print quoted forms using
+abbreviated reader syntax.  @code{(quote foo)} prints as @code{'foo},
+@code{(function foo)} as @code{#'foo}, and backquoted forms print
+using modern backquote syntax.
+@end defvar
+
 @defvar print-escape-newlines
 @cindex @samp{\n} in print
 @cindex escape characters
--- a/lispref/syntax.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/syntax.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -761,12 +761,6 @@
 @cindex skipping comments
 If the value is non-@code{nil}, then comments are treated as
 whitespace by the functions in this section and by @code{forward-sexp}.
-
-In older Emacs versions, this feature worked only when the comment
-terminator is something like @samp{*/}, and appears only to end a
-comment.  In languages where newlines terminate comments, it was
-necessary make this variable @code{nil}, since not every newline is the
-end of a comment.  This limitation no longer exists.
 @end defvar
 
 @vindex parse-sexp-lookup-properties
--- a/lispref/text.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/text.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -159,7 +159,7 @@
 @node Buffer Contents
 @section Examining Buffer Contents
 
-  This section describes two functions that allow a Lisp program to
+  This section describes functions that allow a Lisp program to
 convert any portion of the text in the buffer into a string.
 
 @defun buffer-substring start end
@@ -351,9 +351,10 @@
 
 This function is unlike the other insertion functions in that it
 relocates markers initially pointing at the insertion point, to point
-after the inserted text.  If an overlay begins the insertion point, the
-inserted text falls outside the overlay; if a nonempty overlay ends at
-the insertion point, the inserted text falls inside that overlay.
+after the inserted text.  If an overlay begins at the insertion point,
+the inserted text falls outside the overlay; if a nonempty overlay
+ends at the insertion point, the inserted text falls inside that
+overlay.
 @end defun
 
 @defun insert-char character count &optional inherit
@@ -2988,9 +2989,9 @@
 @code{point-left} functions are called first, followed by all the
 @code{point-entered} functions.
 
-It is possible using @code{char-after} to examine characters at various
-positions without moving point to those positions.  Only an actual
-change in the value of point runs these hook functions.
+It is possible with @code{char-after} to examine characters at various
+buffer positions without moving point to those positions.  Only an
+actual change in the value of point runs these hook functions.
 @end table
 
 @defvar inhibit-point-motion-hooks
--- a/lispref/tips.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/tips.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -251,7 +251,7 @@
 
 @item
 Avoid using macros that define functions and variables with names that
-are constructed.  It is best for maintenance wen the name of the
+are constructed.  It is best for maintenance when the name of the
 function or variable being defined is given explicitly in the source
 code, as the second element of the list---as it is when you use
 @code{defun}, @code{defalias}, @code{defvar} and @code{defopt}.
--- a/lispref/windows.texi	Tue Feb 17 01:52:25 2004 +0000
+++ b/lispref/windows.texi	Wed Feb 18 17:10:32 2004 +0000
@@ -18,7 +18,7 @@
 * Selecting Windows::       The selected window is the one that you edit in.
 * Cyclic Window Ordering::  Moving around the existing windows.
 * Buffers and Windows::     Each window displays the contents of a buffer.
-* Displaying Buffers::      Higher-lever functions for displaying a buffer
+* Displaying Buffers::      Higher-level functions for displaying a buffer
                               and choosing a window for it.
 * Choosing Window::	    How to choose a window for displaying a buffer.
 * Window Point::            Each window has its own location of point.
@@ -720,21 +720,6 @@
 like the single optional argument of @code{get-buffer-window}.  Perhaps
 we should change @code{get-buffer-window} in the future to make it
 compatible with the other functions.
-
-The argument @var{all-frames} controls which windows to consider.
-
-@itemize @bullet
-@item
-If it is @code{nil}, consider windows on the selected frame.
-@item
-If it is @code{t}, consider windows on all frames.
-@item
-If it is @code{visible}, consider windows on all visible frames.
-@item
-If it is 0, consider windows on all visible or iconified frames.
-@item
-If it is a frame, consider windows on that frame.
-@end itemize
 @end defun
 
 @defvar buffer-display-time
--- a/make-dist	Tue Feb 17 01:52:25 2004 +0000
+++ b/make-dist	Wed Feb 18 17:10:32 2004 +0000
@@ -616,8 +616,8 @@
 echo "Making links to \`lispref'"
 (cd lispref
  ln `ls -1 *.texi` ../${tempdir}/lispref
- ln *.aux *.cps *.fns *.kys *.vrs index.*perm ../${tempdir}/lispref
- ln *.txt *.el spellfile permute-index tindex.pl ../${tempdir}/lispref
+ ln *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/lispref
+ ln *.txt *.el spellfile tindex.pl ../${tempdir}/lispref
  test -f README && ln README ../${tempdir}/lispref
  test -f Makefile.in && ln Makefile.in ../${tempdir}/lispref
  ln ChangeLog ../${tempdir}/lispref
--- a/src/ChangeLog	Tue Feb 17 01:52:25 2004 +0000
+++ b/src/ChangeLog	Wed Feb 18 17:10:32 2004 +0000
@@ -1,3 +1,38 @@
+2004-02-17  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (fast_find_position): Fix return value of new version;
+	it was inverted compared to the 21.1 version.
+	(get_window_cursor_type): Don't look at glyph if NULL.
+	(display_and_set_cursor): Set glyph to NULL if cursor in fringe.
+
+	* keyboard.c: Rework previous change; it didn't consider that the
+	buf array was allocated on the stack.
+	(prev_read): Remove variable.
+	(read_avail_input_buf): New static event buffer array.
+	(in_read_avail_input): New static variable to handle re-entrancy.
+	(read_avail_input): Change buf to pinter to read_avail_input_buf.
+	Use in_read_avail_input to handle re-entrance; when re-entered,
+	fully initialize and use tmp_buf array instead of read_avail_input_buf.
+	Do not initialize read_avail_input_buf in full here; instead assume it
+	is always cleared on entry.  To ensure that, we clear (just) the
+	entries that were used before we return.
+	(init_keyboard): Initialize read_avail_input_buf here.
+
+2004-02-16  Jesper Harder  <harder@ifa.au.dk>  (tiny change)
+
+	* cmds.c (Fend_of_line): Doc fix.
+
+2004-02-16  Dmitry Antipov  <dmitry.antipov@mail.ru>  (tiny change)
+
+	* keyboard.c (prev_read): New static variable.
+	(read_avail_input): Use it to zero out only those slots in buf[]
+	that were used last time we were called.
+
+2004-02-16  Eli Zaretskii  <eliz@elta.co.il>
+
+	* Makefile.in (obj): Move fringe.o from here...
+	(XOBJ, MAC_OBJ): ...to here.
+
 2004-02-16  Stephen Eglen  <stephen@gnu.org>
 
 	* fringe.c (init_fringe_bitmap): Define j in MAC_OS code.
--- a/src/Makefile.in	Tue Feb 17 01:52:25 2004 +0000
+++ b/src/Makefile.in	Wed Feb 18 17:10:32 2004 +0000
@@ -310,9 +310,9 @@
 /* Include xmenu.o in the list of X object files.  */
 
 #ifdef USE_GTK
-XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o gtkutil.o
+XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o gtkutil.o fringe.o
 #else
-XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o
+XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o
 #endif
 
 /* The X Menu stuff is present in the X10 distribution, but missing
@@ -334,7 +334,7 @@
 
 /* Otherwise, omit xmenu.o from the list of X object files, and
    don't worry about the menu library at all.  */
-XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o
+XOBJ= xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o
 LIBXMENU=
 #endif /* not HAVE_MENUS */
 
@@ -562,7 +562,7 @@
 #ifdef HAVE_CARBON
 mac = $(dot)$(dot)/mac/
 XMENU_OBJ =
-MAC_OBJ = mac.o macterm.o macfns.o macmenu.o fontset.o
+MAC_OBJ = mac.o macterm.o macfns.o macmenu.o fontset.o fringe.o
 emacsapp = $(PWD)/$(mac)Emacs.app/
 emacsappsrc = ${srcdir}/../mac/Emacs.app/
 #else
@@ -571,7 +571,7 @@
 
 /* lastfile must follow all files
    whose initialized data areas should be dumped as pure by dump-emacs.  */
-obj=    dispnew.o frame.o scroll.o xdisp.o fringe.o $(XMENU_OBJ) window.o \
+obj=    dispnew.o frame.o scroll.o xdisp.o $(XMENU_OBJ) window.o \
 	charset.o coding.o category.o ccl.o \
 	cm.o term.o xfaces.o $(XOBJ) \
 	emacs.o keyboard.o macros.o keymap.o sysdep.o \
--- a/src/cmds.c	Tue Feb 17 01:52:25 2004 +0000
+++ b/src/cmds.c	Wed Feb 18 17:10:32 2004 +0000
@@ -181,7 +181,7 @@
        doc: /* Move point to end of current line.
 With argument N not nil or 1, move forward N - 1 lines first.
 If point reaches the beginning or end of buffer, it stops there.
-To ignore intangibility, bind `inhibit-text-motion-hooks' to t.
+To ignore intangibility, bind `inhibit-point-motion-hooks' to t.
 
 This command does not move point across a field boundary unless doing so
 would move beyond there to a different line; if N is nil or 1, and
--- a/src/keyboard.c	Tue Feb 17 01:52:25 2004 +0000
+++ b/src/keyboard.c	Wed Feb 18 17:10:32 2004 +0000
@@ -6560,6 +6560,14 @@
 
 #ifndef VMS
 
+/* We make the read_avail_input buffer static to avoid zeroing out the
+   whole struct input_event buf on every call.  */
+static struct input_event read_avail_input_buf[KBD_BUFFER_SIZE];
+
+/* I don't know whether it is necessary, but make read_avail_input 
+   re-entrant.  */
+static int in_read_avail_input = 0;
+
 /* Read any terminal input already buffered up by the system
    into the kbd_buffer, but do not wait.
 
@@ -6576,14 +6584,21 @@
 read_avail_input (expected)
      int expected;
 {
-  struct input_event buf[KBD_BUFFER_SIZE];
+  struct input_event *buf = read_avail_input_buf;
+  struct input_event tmp_buf[KBD_BUFFER_SIZE];
   register int i;
-  struct display *d;
   int nread = 0;
+  struct display *d;
   
-  for (i = 0; i < KBD_BUFFER_SIZE; i++)
-    EVENT_INIT (buf[i]);
-
+  /* Trivial hack to make read_avail_input re-entrant.  */
+  if (in_read_avail_input++)
+    {
+      buf = tmp_buf;
+      for (i = 0; i < KBD_BUFFER_SIZE; i++)
+	EVENT_INIT (buf[i]);
+    }
+
+  /* Loop through the available displays, and call their input hooks. */
   d = display_list;
   while (d)
     {
@@ -6593,7 +6608,7 @@
         /* No need for FIONREAD or fcntl; just say don't wait.  */
         nread = (*d->read_socket_hook) (d, buf, KBD_BUFFER_SIZE, expected);
 
-      if (nread == -2)
+      if (nread == -2)          /* -2 means non-transient error */
         {
           /* The display device terminated; it should be closed. */
 
@@ -6627,6 +6642,11 @@
 	break;
     }
 
+  /* Clear used events */
+  if (--in_read_avail_input == 0)
+    for (i = 0; i < nread; i++)
+      EVENT_INIT (buf[i]);
+
   return nread;
 }
 
@@ -6647,13 +6667,12 @@
   unsigned char cbuf[KBD_BUFFER_SIZE - 1];
   int n_to_read, i;
   struct tty_display_info *tty = display->display_info.tty;
-  Lisp_Object frame;
   int nread = 0;
   
   if (display->type != output_termcap)
     abort ();
   
-  /* XXX I think the following code should be moved to separate
+  /* XXX I think the following code should be moved to separate hook
      functions in system-dependent files. */
 #ifdef WINDOWSNT
   return 0;
@@ -6668,7 +6687,7 @@
   
 #else /* not MSDOS */
 
-  if (! tty->term_initted)
+  if (! tty->term_initted)      /* In case we get called during bootstrap. */
     return 0;
         
   /* Determine how many characters we should *try* to read.  */
@@ -6704,20 +6723,16 @@
          process group won't get SIGHUP's at logout time.  BSDI adheres to
          this part standard and returns -1 from read (0) with errno==EIO
          when the control tty is taken away.
-         Jeffrey Honig <jch@bsdi.com> says this is generally safe.  */
+         Jeffrey Honig <jch@bsdi.com> says this is generally safe. */
       if (nread == -1 && errno == EIO)
-        {
-          return -2;          /* Close this display. */
-        }
+        return -2;          /* Close this display. */
 #if defined (AIX) && (! defined (aix386) && defined (_BSD))
       /* The kernel sometimes fails to deliver SIGHUP for ptys.
          This looks incorrect, but it isn't, because _BSD causes
          O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
          and that causes a value other than 0 when there is no input.  */
       if (nread == 0)
-        {
-          return -2;          /* Close this display. */
-        }
+        return -2;          /* Close this display. */
 #endif
     }
   while (
@@ -6751,11 +6766,6 @@
 #endif /* not MSDOS */
 #endif /* not WINDOWSNT */
   
-  /* Select the frame corresponding to the active tty.  Note that the
-     value of selected_frame is not reliable here, redisplay tends to
-     temporarily change it. */
-  frame = tty->top_frame;
-  
   for (i = 0; i < nread; i++)
     {
       buf[i].kind = ASCII_KEYSTROKE_EVENT;
@@ -6766,7 +6776,10 @@
         cbuf[i] &= ~0x80;
       
       buf[i].code = cbuf[i];
-      buf[i].frame_or_window = frame;
+      /* Set the frame corresponding to the active tty.  Note that the
+         value of selected_frame is not reliable here, redisplay tends
+         to temporarily change it. */
+      buf[i].frame_or_window = tty->top_frame;
       buf[i].arg = Qnil;
     }
 
@@ -10658,6 +10671,13 @@
   do_mouse_tracking = Qnil;
 #endif
   input_pending = 0;
+#ifndef VMS
+  {
+    int i;
+    for (i = 0; i < KBD_BUFFER_SIZE; i++)
+      EVENT_INIT (read_avail_input_buf[i]);
+  }
+#endif
 
   /* This means that command_loop_1 won't try to select anything the first
      time through.  */
--- a/src/xdisp.c	Tue Feb 17 01:52:25 2004 +0000
+++ b/src/xdisp.c	Wed Feb 18 17:10:32 2004 +0000
@@ -19028,7 +19028,7 @@
     cursor_type = get_specified_cursor_type (b->cursor_type, width);
 
   /* Use normal cursor if not blinked off.  */
-  if (!w->cursor_off_p)
+  if (!w->cursor_off_p && glyph != NULL)
     {
       if (glyph->type == IMAGE_GLYPH) {
 	if (cursor_type == FILLED_BOX_CURSOR)
@@ -19367,7 +19367,8 @@
 
   current_glyphs = w->current_matrix;
   glyph_row = MATRIX_ROW (current_glyphs, vpos);
-  glyph = glyph_row->glyphs[TEXT_AREA] + hpos;
+  glyph = (glyph_row->cursor_in_fringe_p ? NULL
+	   : glyph_row->glyphs[TEXT_AREA] + hpos);
 
   /* If cursor row is not enabled, we don't really know where to
      display the cursor.  */
@@ -19655,7 +19656,7 @@
       if (charpos < MATRIX_ROW_START_CHARPOS (first))
 	{
 	  *x = *y = *hpos = *vpos = 0;
-	  return 0;
+	  return 1;
 	}
       else
 	{
@@ -19695,7 +19696,7 @@
     }
 
   *hpos = glyph - row->glyphs[TEXT_AREA];
-  return past_end;
+  return !past_end;
 }
 
 #else /* not 1 */