changeset 83010:82554ed1aed8

Merged in changes from CVS HEAD Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-22 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-23 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-24 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-25 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-26 Fix permission bogosities * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-27 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-28 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-29 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-30 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-50
author Karoly Lorentey <lorentey@elte.hu>
date Sat, 10 Jan 2004 13:27:38 +0000
parents b2b37c85b00a (current diff) bf35ae17f543 (diff)
children c4d4cbf86260
files ChangeLog lib-src/emacsclient.c lisp/ChangeLog lisp/bindings.el src/dispextern.h src/dispnew.c src/fontset.c src/keyboard.c src/keyboard.h src/print.c src/process.c src/xdisp.c src/xmenu.c
diffstat 32 files changed, 544 insertions(+), 326 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Jan 10 12:56:22 2004 +0000
+++ b/ChangeLog	Sat Jan 10 13:27:38 2004 +0000
@@ -1,3 +1,7 @@
+2004-01-06  Eric Hanchrow <offby1@blarg.net> (tiny change)
+
+	* make-dist (tempdir): Include cursors in nt/icons
+
 2003-12-30  Eli Zaretskii  <eliz@elta.co.il>
 
 	* INSTALL.CVS: Renamed from INSTALL-CVS to avoid file-name
@@ -5745,7 +5749,7 @@
 	to match build-install and paths.h.
 
 ;; Local Variables:
-;; coding: iso-2022-7bit-unix
+;; coding: iso-2022-7bit
 ;; End:
 
     Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
--- a/etc/NEWS	Sat Jan 10 12:56:22 2004 +0000
+++ b/etc/NEWS	Sat Jan 10 13:27:38 2004 +0000
@@ -1792,14 +1792,18 @@
 *** Mouse clicks on fringes now generates left-fringe or right-fringes
 events, rather than a text area click event.
 
+*** Mouse clicks in the left and right marginal areas now includes a
+sensible buffer position corresponding to the first character in the
+corresponding text row.
+
+*** Function `mouse-set-point' now works for events outside text area.
+
 +++
 *** Mouse events now includes buffer position for all event types.
 
 +++
 *** `posn-point' now returns buffer position for non-text area events.
 
-*** Function `mouse-set-point' now works for events outside text area.
-
 +++
 *** New function `posn-area' returns window area clicked on (nil means
 text area).
@@ -1817,9 +1821,15 @@
 *** Mouse events include relative x and y pixel coordinates relative to
 the top left corner of the object (image or character) clicked on.
 
-*** New functions 'posn-object' and 'posn-object-x-y' return the image
-or string object of a mouse click, and the x and y pixel coordinates
-relative to the top left corner of that object.
++++
+*** Mouse events include the pixel width and height of the object
+(image or character) clicked on.
+
++++
+*** New functions 'posn-object', 'posn-object-x-y', and
+'posn-object-width-height' return the image or string object of a mouse
+click, the x and y pixel coordinates relative to the top left corner
+of that object, and the total width and height of that object.
 
 ** New function `force-window-update' can initiate a full redisplay of
 one or all windows.  Normally, this is not needed as changes in window
--- a/etc/PROBLEMS	Sat Jan 10 12:56:22 2004 +0000
+++ b/etc/PROBLEMS	Sat Jan 10 13:27:38 2004 +0000
@@ -966,7 +966,7 @@
 
   x-complement-fontset-spec: "Wrong type argument: stringp, nil"
 
-This can be another symptom of stale *.elc files in your classpath.
+This can be another symptom of stale *.elc files in your load-path.
 The following command will print any duplicate Lisp files that are
 present in load-path:
 
--- a/lib-src/ChangeLog	Sat Jan 10 12:56:22 2004 +0000
+++ b/lib-src/ChangeLog	Sat Jan 10 13:27:38 2004 +0000
@@ -1,3 +1,7 @@
+2004-01-08  Andreas Schwab  <schwab@suse.de>
+
+	* emacsclient.c (main): Save errno from socket_status.
+
 2004-01-04  Andreas Schwab  <schwab@suse.de>
 
 	* emacsclient.c (main): Fix socket name when using another user.
--- a/lib-src/emacsclient.c	Sat Jan 10 12:56:22 2004 +0000
+++ b/lib-src/emacsclient.c	Sat Jan 10 13:27:38 2004 +0000
@@ -432,7 +432,7 @@
 
   {
     int sock_status = 0;
-    int oerrno = 0;
+    int saved_errno = 0;
     
     if (! socket_name)
       {
@@ -452,7 +452,7 @@
 
     /* See if the socket exists, and if it's owned by us. */
     sock_status = socket_status (server.sun_path);
-    oerrno = errno;
+    saved_errno = errno;
     if (sock_status)
       {
 	/* Failing that, see if LOGNAME or USER exist and differ from
@@ -473,7 +473,7 @@
 		sprintf (server.sun_path, "/tmp/emacs%d-%s/server",
 			 (int) pw->pw_uid, system_name);
 		sock_status = socket_status (server.sun_path);
-                oerrno = errno;
+                saved_errno = errno;
 	      }
 	  }
       }
@@ -492,14 +492,14 @@
 
        case 2:
 	 /* `stat' failed */
-	 if (errno == ENOENT)
+	 if (saved_errno == ENOENT)
 	   fprintf (stderr,
 		    "%s: Can't find socket; have you started the server?\n\
 To start the server in Emacs, type \"M-x server-start\".\n",
 		    argv[0]);
 	 else
 	   fprintf (stderr, "%s: Can't stat %s: %s\n",
-		    argv[0], server.sun_path, strerror (oerrno));
+		    argv[0], server.sun_path, strerror (saved_errno));
 	 fail ();
 	 break;
        }
--- a/lisp/ChangeLog	Sat Jan 10 12:56:22 2004 +0000
+++ b/lisp/ChangeLog	Sat Jan 10 13:27:38 2004 +0000
@@ -1,3 +1,61 @@
+2004-01-09  John Paul Wallington  <jpw@gnu.org>
+
+	* bindings.el (mode-line-change-eol): Add EVENT parameter.
+	Temporarily select EVENT's window for changing eol type.
+
+2004-01-09  Deepak Goel  <deego@gnufans.org>
+
+	* calendar/diary-lib.el (diary-entry-time):
+	Also accept time in the form XX[.XX][am/pm/AM/PM].
+	(fancy-diary-font-lock-keywords): Likewise.
+	(diary-font-lock-keywords): Likewise.
+	* calendar/appt.el (appt-add): Likewise.
+	(appt-make-list): Likewise.
+	(appt-convert-time): Likewise.
+
+2004-01-08  Nick Roberts  <nick@nick.uklinux.net>
+
+	* gdb-ui.el (gdb-ann3): Revert previous change.
+	(gdb-source-info): Allow for case of where compilation directory
+	is not recorded.
+
+2004-01-08  John Paul Wallington  <jpw@gnu.org>
+
+	* emerge.el (emerge-restore-buffer-characteristics): Doc fix.
+
+2004-01-07  Nick Roberts  <nick@nick.uklinux.net>
+
+	* progmodes/gud.el (gdb-first-prompt): Renamed from
+	gdb-first-pre-prompt
+
+	* gdb-ui.el (gdba): Avoid duplication, use gdb-ann3.
+	(gdb-ann3): Use GDB command "set width 0" to prevent word wrapping
+	problems.
+	(gdb-prompt): Set (renamed) gdb-first-prompt to nil in gdb-ann3.
+
+2004-01-07  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* files.el (write-file-functions, write-contents-functions):
+	Clarify docstrings.
+
+2004-01-07  Kenichi Handa  <handa@m17n.org>
+
+	* international/mule.el (set-auto-coding): Fix for the case that
+	end-of-line is only CR.
+
+2004-01-07  Kim F. Storm  <storm@cua.dk>
+
+	* subr.el (event-start, event-end): Doc fix.
+	(posn-string, posn-image): New defuns.
+	(posn-object): Return either image or string object.
+	(posn-object-x-y): Return 8th element of position.
+	(posn-object-width-height): New defun.
+
+2004-01-06  Andreas Schwab  <schwab@suse.de>
+
+	* gdb-ui.el (gdb-frame-handler): Handle word wrapping anywhere in
+	output.
+
 2004-01-05  Karl Berry  <karl@gnu.org>
 
 	* emacs-lisp/copyright.el (copyright-regexp): might as well allow
@@ -149,7 +207,7 @@
 	(term-sentinel): New function.
 	(term-handle-exit): New function.
 
-	* subr.el (assoc-ignore-case, assoc-ignore-representation): 
+	* subr.el (assoc-ignore-case, assoc-ignore-representation):
 	Use assoc-string, and mark them obsolete.
 	(delay-mode-hooks): Mark as permanent local.
 
@@ -833,7 +891,7 @@
 	* xml.el (xml-parse-region): Allow comments to appear after the
 	topmost element has closed.
 	(xml-ns-parse-ns-attrs, xml-ns-expand-el)
-	(xml-ns-expand-attr): New functions to do namespace handling.	
+	(xml-ns-expand-attr): New functions to do namespace handling.
 	(xml-intern-attrlist): Back-compatible handling of attribute
 	names.
 	(xml-parse-tag): Move namespace handling to seperate functions.
--- a/lisp/bindings.el	Sat Jan 10 12:56:22 2004 +0000
+++ b/lisp/bindings.el	Sat Jan 10 13:27:38 2004 +0000
@@ -135,12 +135,14 @@
   "Local keymap for the coding-system part of the mode line.")
 
 
-(defun mode-line-change-eol ()
+(defun mode-line-change-eol (event)
   "Cycle through the various possible kinds of end-of-line styles."
-  (interactive)
-  (let ((eol (coding-system-eol-type buffer-file-coding-system)))
-    (set-buffer-file-coding-system
-     (cond ((eq eol 0) 'dos) ((eq eol 1) 'mac) (t 'unix)))))
+  (interactive "e")
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (let ((eol (coding-system-eol-type buffer-file-coding-system)))
+      (set-buffer-file-coding-system
+       (cond ((eq eol 0) 'dos) ((eq eol 1) 'mac) (t 'unix))))))
 
 (defvar mode-line-eol-desc-cache nil)
 
--- a/lisp/calendar/appt.el	Sat Jan 10 12:56:22 2004 +0000
+++ b/lisp/calendar/appt.el	Sat Jan 10 13:27:38 2004 +0000
@@ -437,7 +437,8 @@
 The time should be in either 24 hour format or am/pm format."
 
   (interactive "sTime (hh:mm[am/pm]): \nsMessage: ")
-  (if (string-match "[0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?" new-appt-time)
+  (if (string-match "[0-9]?[0-9][:.][0-9][0-9]\\(am\\|pm\\)?"
+		    new-appt-time)
       nil
     (error "Unacceptable time-string"))
 
@@ -519,7 +520,7 @@
 			   (calendar-current-date) (car (car entry-list))))
 		(let ((time-string (cadr (car entry-list))))
 		  (while (string-match
-			  "\\([0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?\\).*"
+			  "\\([0-9]?[0-9][:.][0-9][0-9]\\(am\\|pm\\)?\\).*"
 			  time-string)
 		    (let* ((beg (match-beginning 0))
 			   ;; Get just the time for this appointment.
@@ -527,7 +528,7 @@
 			   ;; Find the end of this appointment
 			   ;; (the start of the next).
 			   (end (string-match
-				 "^[ \t]*[0-9]?[0-9]:[0-9][0-9]\\(am\\|pm\\)?"
+				 "^[ \t]*[0-9]?[0-9][:.][0-9][0-9]\\(am\\|pm\\)?"
 				 time-string
 				 (match-end 0)))
 			   ;; Get the whole string for this appointment.
@@ -586,17 +587,17 @@
 
 
 (defun appt-convert-time (time2conv)
-  "Convert hour:min[am/pm] format to minutes from midnight."
-
+  "Convert hour:min[am/pm] format to minutes from midnight.
+Also try to accept the hour.min[am/pm] format."
   (let ((conv-time 0)
         (hr 0)
         (min 0))
 
-    (string-match ":\\([0-9][0-9]\\)" time2conv)
+    (string-match "[:.]\\([0-9][0-9]\\)" time2conv)
     (setq min (string-to-int
                (match-string 1 time2conv)))
 
-    (string-match "[0-9]?[0-9]:" time2conv)
+    (string-match "[0-9]?[0-9][:.]" time2conv)
     (setq hr (string-to-int
               (match-string 0 time2conv)))
 
--- a/lisp/calendar/diary-lib.el	Sat Jan 10 12:56:22 2004 +0000
+++ b/lisp/calendar/diary-lib.el	Sat Jan 10 13:27:38 2004 +0000
@@ -636,7 +636,7 @@
                                                    (symbol-name sym)))
                                               marks))))
                          faceinfo)
-                    ;; Remove :face info from the marks, 
+                    ;; Remove :face info from the marks,
                     ;; copy the face info into temp-face
                     (setq faceinfo marks)
                     (while (setq faceinfo (memq :face faceinfo))
@@ -1097,12 +1097,15 @@
 (defun diary-entry-time (s)
   "Return time at the beginning of the string S as a military-style integer.
 For example, returns 1325 for 1:25pm.
-Returns `diary-unknown-time' (default value -9999) if no time is recognized.  The recognized forms are XXXX, X:XX, or
-XX:XX (military time), and XXam, XXAM, XXpm, XXPM, XX:XXam, XX:XXAM XX:XXpm,
-or XX:XXPM."
+
+Returns `diary-unknown-time' (default value -9999) if no time is recognized.
+The recognized forms are XXXX, X:XX, or XX:XX (military time), and XXam,
+XXAM, XXpm, XXPM, XX:XXam, XX:XXAM XX:XXpm, or XX:XXPM.  We also try to
+accept time in the form XX[.XX][am/pm/AM/PM]]."
   (let ((case-fold-search nil))
     (cond ((string-match        ; Military time
-	    "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\):?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" s)
+	    "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)"
+            s)
 	   (+ (* 100 (string-to-int
 		      (substring s (match-beginning 1) (match-end 1))))
 	      (string-to-int (substring s (match-beginning 2) (match-end 2)))))
@@ -1114,7 +1117,7 @@
 	      (if (equal ?a (downcase (aref s (match-beginning 2))))
 		  0 1200)))
 	  ((string-match        ; Hour and minute  XX:XXam or XX:XXpm
-	    "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\):\\([0-9][0-9]\\)\\([ap]\\)m\\>" s)
+	    "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.][\\([0-9][0-9]\\)\\([ap]\\)m\\>" s)
 	   (+ (* 100 (% (string-to-int
 			   (substring s (match-beginning 1) (match-end 1)))
 			  12))
@@ -1286,7 +1289,7 @@
 
 Marking these entries is *extremely* time consuming, so these entries are
 best if they are nonmarking."
-  (let ((s-entry (concat "\\(\\`\\|\^M\\|\n\\)" 
+  (let ((s-entry (concat "\\(\\`\\|\^M\\|\n\\)"
                          (regexp-quote diary-nonmarking-symbol)
                          "?"
                          (regexp-quote sexp-diary-entry-symbol)
@@ -1753,7 +1756,7 @@
    '("^\\(Erev \\)?Rosh Hodesh.*" . font-lock-function-name-face)
    '("^Day.*omer.*$" . font-lock-builtin-face)
    '("^Parashat.*$" . font-lock-comment-face)
-   '("^[ \t]*[0-9]?[0-9]\\(:?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)?\\(-[0-9]?[0-9]\\(:?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)?\\)?"
+   '("^[ \t]*[0-9]?[0-9]\\([:.]?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)?\\(-[0-9]?[0-9]\\([:.]?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)?\\)?"
      . font-lock-variable-name-face))
   "Keywords to highlight in fancy diary display")
 
@@ -1848,7 +1851,7 @@
                  "?\\(" (regexp-quote islamic-diary-entry-symbol) "\\)")
          '(1 font-lock-reference-face))
         '(font-lock-diary-sexps . font-lock-keyword-face)
-        '("[0-9]?[0-9]\\(:?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)\\(-[0-9]?[0-9]\\(:?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)\\)?"
+        '("[0-9]?[0-9]\\([:.]?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)\\(-[0-9]?[0-9]\\([:.]?[0-9][0-9]\\)?\\(am\\|pm\\|AM\\|PM\\)\\)?"
           . font-lock-function-name-face)))
       "Forms to highlight in diary-mode")
 
--- a/lisp/emerge.el	Sat Jan 10 12:56:22 2004 +0000
+++ b/lisp/emerge.el	Sat Jan 10 13:27:38 2004 +0000
@@ -1454,7 +1454,7 @@
 				     emerge-merging-values)))))
 
 (defun emerge-restore-buffer-characteristics ()
-  "Restores characteristics saved by `emerge-remember-buffer-characteristics'."
+  "Restore characteristics saved by `emerge-remember-buffer-characteristics'."
   (let ((A-values emerge-A-buffer-values)
 	(B-values emerge-B-buffer-values))
     (emerge-eval-in-buffer emerge-A-buffer
@@ -3112,7 +3112,7 @@
 		  (setq unread-command-events (list c)))))
 	(erase-buffer)))))
 
-;; Improved auto-save gfile names.
+;; Improved auto-save file names.
 ;; This function fixes many problems with the standard auto-save file names:
 ;; Auto-save files for non-file buffers get put in the default directory
 ;; for the buffer, whether that makes sense or not.
--- a/lisp/files.el	Sat Jan 10 12:56:22 2004 +0000
+++ b/lisp/files.el	Sat Jan 10 13:27:38 2004 +0000
@@ -375,7 +375,12 @@
 the visited file name with \\[set-visited-file-name], but not when you
 change the major mode.
 
-See also `write-contents-functions'.")
+This hook is not run if any of the functions in
+`write-contents-functions' returns non-nil.  Both hooks pertain
+to how to save a buffer to file, for instance, choosing a suitable
+coding system and setting mode bits.  (See Info
+node `(elisp)Saving Buffers'.)  To perform various checks or
+updates before the buffer is saved, use `before-save-hook' .")
 (put 'write-file-functions 'permanent-local t)
 (defvaralias 'write-file-hooks 'write-file-functions)
 (make-obsolete-variable 'write-file-hooks 'write-file-functions "21.4")
@@ -395,7 +400,11 @@
 `set-visited-file-name' does not clear this variable; but changing the
 major mode does clear it.
 
-See also `write-file-functions'.")
+For hooks that _do_ pertain to the particular visited file, use
+`write-file-functions'.  Both this variable and
+`write-file-functions' relate to how a buffer is saved to file.
+To perform various checks or updates before the buffer is saved,
+use `before-save-hook'.")
 (make-variable-buffer-local 'write-contents-functions)
 (defvaralias 'write-contents-hooks 'write-contents-functions)
 (make-obsolete-variable 'write-contents-hooks 'write-contents-functions "21.4")
--- a/lisp/gdb-ui.el	Sat Jan 10 12:56:22 2004 +0000
+++ b/lisp/gdb-ui.el	Sat Jan 10 13:27:38 2004 +0000
@@ -4,7 +4,7 @@
 ;; Maintainer: FSF
 ;; Keywords: unix, tools
 
-;; Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004  Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -116,7 +116,9 @@
   ;;
   ;; Let's start with a basic gud-gdb buffer and then modify it a bit.
   (gdb command-line)
-  ;;
+  (gdb-ann3))
+
+(defun gdb-ann3 ()
   (set (make-local-variable 'gud-minor-mode) 'gdba)
   (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter)
   ;;
@@ -160,7 +162,7 @@
   (setq gdb-selected-view 'source)
   (setq gdb-var-list nil)
   (setq gdb-var-changed nil)
-  (setq gdb-first-pre-prompt nil)
+  (setq gdb-first-prompt nil)
   ;;
   (mapc 'make-local-variable gdb-variables)
   (setq gdb-buffer-type 'gdba)
@@ -686,9 +688,7 @@
 (defun gdb-prompt (ignored)
   "An annotation handler for `prompt'.
 This sends the next command (if any) to gdb."
-  (when gdb-first-pre-prompt
-      (gdb-ann3)
-      (setq gdb-first-pre-prompt nil))
+  (when gdb-first-prompt (gdb-ann3))
   (let ((sink (gdb-get-output-sink)))
     (cond
      ((eq sink 'user) t)
@@ -708,66 +708,6 @@
 	(gdb-set-prompting t)
 	(gud-display-frame)))))
 
-(defun gdb-ann3 ()
-  (set (make-local-variable 'gud-minor-mode) 'gdba)
-  (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter)
-  ;;
-  (gud-def gud-break (if (not (string-equal mode-name "Machine"))
-			 (gud-call "break %f:%l" arg)
-		       (save-excursion
-			 (beginning-of-line)
-			 (forward-char 2)
-			 (gud-call "break *%a" arg)))
-	   "\C-b" "Set breakpoint at current line or address.")
-  ;;
-  (gud-def gud-remove (if (not (string-equal mode-name "Machine"))
-			  (gud-call "clear %f:%l" arg)
-			(save-excursion
-			  (beginning-of-line)
-			  (forward-char 2)
-			  (gud-call "clear *%a" arg)))
-	   "\C-d" "Remove breakpoint at current line or address.")
-  ;;
-  (gud-def gud-until  (if (not (string-equal mode-name "Machine"))
-			  (gud-call "until %f:%l" arg)
-			(save-excursion
-			  (beginning-of-line)
-			  (forward-char 2)
-			  (gud-call "until *%a" arg)))
-	   "\C-u" "Continue to current line or address.")
-
-  (define-key gud-minor-mode-map [left-margin mouse-1]
-    'gdb-mouse-toggle-breakpoint)
-  (define-key gud-minor-mode-map [left-fringe mouse-1]
-    'gdb-mouse-toggle-breakpoint)
-
-  (setq comint-input-sender 'gdb-send)
-  ;;
-  ;; (re-)initialise
-  (setq gdb-current-address "main")
-  (setq gdb-previous-address nil)
-  (setq gdb-previous-frame nil)
-  (setq gdb-current-frame "main")
-  (setq gdb-view-source t)
-  (setq gdb-selected-view 'source)
-  (setq gdb-var-list nil)
-  (setq gdb-var-changed nil)
-  ;;
-  (mapc 'make-local-variable gdb-variables)
-  (setq gdb-buffer-type 'gdba)
-  ;;
-  (gdb-clear-inferior-io)
-  ;;
-  (if (eq window-system 'w32)
-      (gdb-enqueue-input (list "set new-console off\n" 'ignore)))
-  (gdb-enqueue-input (list "set height 0\n" 'ignore))
-  ;; find source file and compilation directory here
-  (gdb-enqueue-input (list "server list main\n"   'ignore))   ; C program
-  (gdb-enqueue-input (list "server list MAIN__\n" 'ignore))   ; Fortran program
-  (gdb-enqueue-input (list "server info source\n" 'gdb-source-info))
-  ;;
-  (run-hooks 'gdba-mode-hook))
-
 (defun gdb-subprompt (ignored)
   "An annotation handler for non-top-level prompts."
   (gdb-set-prompting t))
@@ -1765,14 +1705,13 @@
 buffers."
   (goto-char (point-min))
   (if (search-forward "directory is " nil t)
-      (progn
-	(if (looking-at "\\S-*:\\(\\S-*\\)")
-	    (setq gdb-cdir (match-string 1))
-	  (looking-at "\\S-*")
-	  (setq gdb-cdir (match-string 0)))
-	(search-forward "Located in ")
+      (if (looking-at "\\S-*:\\(\\S-*\\)")
+	  (setq gdb-cdir (match-string 1))
 	(looking-at "\\S-*")
-	(setq gdb-main-file (match-string 0)))
+	(setq gdb-cdir (match-string 0))))
+  (if (search-forward "Located in " nil t)
+      (if (looking-at "\\S-*")
+	  (setq gdb-main-file (match-string 0)))
     (setq gdb-view-source nil))
   (delete-other-windows)
   (switch-to-buffer gud-comint-buffer)
@@ -1985,7 +1924,7 @@
   (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
     (goto-char (point-min))
     (forward-line)
-    (if (looking-at ".*= 0x\\(\\S-*\\) in \\(\\S-*\\)")
+    (if (looking-at ".*=\\s-+0x\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*\\)")
 	(progn
 	  (setq gdb-current-frame (match-string 2))
 	  (let ((address (match-string 1)))
@@ -1994,7 +1933,7 @@
 		(setq gdb-current-address
 		      (concat "0x" (match-string 1 address)))
 	      (setq gdb-current-address (concat "0x" address))))
-	  (if (or (if (not (looking-at ".*(\\S-*:[0-9]*)"))
+	  (if (or (if (not (re-search-forward "(\\S-*:[0-9]*);" nil t))
 		      (progn (setq gdb-view-source nil) t))
 		  (eq gdb-selected-view 'assembler))
 	      (progn
@@ -2003,8 +1942,7 @@
 		 (gdb-get-create-buffer 'gdb-assembler-buffer))
 		;;update with new frame for machine code if necessary
 		(gdb-invalidate-assembler))))))
-    (forward-line)
-    (if (looking-at " source language \\(\\S-*\\)\.")
+    (if (re-search-forward " source language \\(\\S-*\\)\." nil t)
 	(setq gdb-current-language (match-string 1))))
 
 (provide 'gdb-ui)
--- a/lisp/international/mule.el	Sat Jan 10 12:56:22 2004 +0000
+++ b/lisp/international/mule.el	Sat Jan 10 13:27:38 2004 +0000
@@ -1662,31 +1662,36 @@
 		  (setq coding-system nil)))))
 
 	;; If no coding: tag in the head, check the tail.
+	;; Here we must pay attention to the case that the end-of-line
+	;; is just "\r" and we can't use "^" nor "$" in regexp.
 	(when (and tail-found (not coding-system))
 	  (goto-char tail-start)
-	  (search-forward "\n\^L" nil t)
+	  (re-search-forward "[\r\n]\^L" nil t)
 	  (if (re-search-forward
-	       "^\\(.*\\)[ \t]*Local Variables:[ \t]*\\(.*\\)$" tail-end t)
-	  ;; The prefix is what comes before "local variables:" in its
-	   ;; line.  The suffix is what comes after "local variables:"
+	       "[\r\n]\\([^[\r\n]*\\)[ \t]*Local Variables:[ \t]*\\([^\r\n]*\\)[\r\n]" 
+	       tail-end t)
+	      ;; The prefix is what comes before "local variables:" in its
+	      ;; line.  The suffix is what comes after "local variables:"
 	      ;; in its line.
 	      (let* ((prefix (regexp-quote (match-string 1)))
 		     (suffix (regexp-quote (match-string 2)))
 		     (re-coding
 		      (concat
-		       "^" prefix
+		       "[\r\n]" prefix
 		       ;; N.B. without the \n below, the regexp can
 		       ;; eat newlines.
-		       "[ \t]*coding[ \t]*:[ \t]*\\([^ \t\n]+\\)[ \t]*"
-		       suffix "$"))
+		       "[ \t]*coding[ \t]*:[ \t]*\\([^ \t\r\n]+\\)[ \t]*"
+		       suffix "[\r\n]"))
 		     (re-unibyte
 		      (concat
-		       "^" prefix
-		       "[ \t]*unibyte[ \t]*:[ \t]*\\([^ \t\n]+\\)[ \t]*"
-		       suffix "$"))
+		       "[\r\n]" prefix
+		       "[ \t]*unibyte[ \t]*:[ \t]*\\([^ \t\r\n]+\\)[ \t]*"
+		       suffix "[\r\n]"))
 		     (re-end
-		      (concat "^" prefix "[ \t]*End *:[ \t]*" suffix "$"))
-		     (pos (point)))
+		      (concat "[\r\n]" prefix "[ \t]*End *:[ \t]*" suffix 
+			      "[\r\n]?"))
+		     (pos (1- (point))))
+		(forward-char -1)	; skip back \r or \n.
 		(re-search-forward re-end tail-end 'move)
 		(setq tail-end (point))
 		(goto-char pos)
--- a/lisp/progmodes/gud.el	Sat Jan 10 12:56:22 2004 +0000
+++ b/lisp/progmodes/gud.el	Sat Jan 10 13:27:38 2004 +0000
@@ -508,7 +508,7 @@
      gud-minibuffer-local-map nil
      hist-sym)))
 
-(defvar gdb-first-pre-prompt t)
+(defvar gdb-first-prompt t)
 
 ;;;###autoload
 (defun gdb (command-line)
@@ -540,7 +540,7 @@
   (local-set-key "\C-i" 'gud-gdb-complete-command)
   (setq comint-prompt-regexp "^(.*gdb[+]?) *")
   (setq paragraph-start comint-prompt-regexp)
-  (setq gdb-first-pre-prompt t)
+  (setq gdb-first-prompt t)
   (run-hooks 'gdb-mode-hook))
 
 ;; One of the nice features of GDB is its impressive support for
--- a/lisp/subr.el	Sat Jan 10 12:56:22 2004 +0000
+++ b/lisp/subr.el	Sat Jan 10 13:27:38 2004 +0000
@@ -665,7 +665,8 @@
 of the event.
 If EVENT is a drag, this returns the drag's starting position.
 The return value is of the form
-   (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW))
+   (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)
+    IMAGE (DX . DY) (WIDTH . HEIGHT))
 The `posn-' functions access elements of such lists."
   (if (consp event) (nth 1 event)
     (list (selected-window) (point) '(0 . 0) 0)))
@@ -674,7 +675,8 @@
   "Return the ending location of EVENT.  EVENT should be a click or drag event.
 If EVENT is a click event, this function is the same as `event-start'.
 The return value is of the form
-   (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW))
+   (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)
+    IMAGE (DX . DY) (WIDTH . HEIGHT))
 The `posn-' functions access elements of such lists."
   (if (consp event) (nth (if (consp (nth 2 event)) 2 1) event)
     (list (selected-window) (point) '(0 . 0) 0)))
@@ -757,17 +759,35 @@
 and `event-end' functions." 
   (nth 3 position))
 
-(defsubst posn-object (position)
-  "Return the object of POSITION.
+(defsubst posn-string (position)
+  "Return the string object of POSITION, or nil if a buffer position.
 POSITION should be a list of the form returned by the `event-start'
 and `event-end' functions." 
   (nth 4 position))
 
+(defsubst posn-image (position)
+  "Return the image object of POSITION, or nil if a not an image.
+POSITION should be a list of the form returned by the `event-start'
+and `event-end' functions." 
+  (nth 7 position))
+
+(defsubst posn-object (position)
+  "Return the object (image or string) of POSITION.
+POSITION should be a list of the form returned by the `event-start'
+and `event-end' functions." 
+  (or (posn-image position) (posn-string position)))
+
 (defsubst posn-object-x-y (position)
   "Return the x and y coordinates relative to the object of POSITION.
 POSITION should be a list of the form returned by the `event-start'
 and `event-end' functions." 
-  (nth 7 position))
+  (nth 8 position))
+
+(defsubst posn-object-width-height (position)
+  "Return the pixel width and height of the object of POSITION.
+POSITION should be a list of the form returned by the `event-start'
+and `event-end' functions." 
+  (nth 9 position))
 
 
 ;;;; Obsolescent names for functions.
--- a/lispref/ChangeLog	Sat Jan 10 12:56:22 2004 +0000
+++ b/lispref/ChangeLog	Sat Jan 10 13:27:38 2004 +0000
@@ -1,3 +1,18 @@
+2004-01-07  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* files.texi (Saving Buffers): Clarify descriptions of
+	`write-contents-functions' and `before-save-hook'.
+	Make the defvar's for `before-save-hook' and `after-save-hook'
+	into defopt's.
+
+2004-01-07  Kim F. Storm  <storm@cua.dk>
+
+	* commands.texi (Click Events): Describe new image and
+	width/height elements of click events.
+	(Accessing Events): Add posn-string, posn-image, and
+	posn-object-width-height.  Change posn-object to return either
+	image or string object.
+
 2004-01-01  Simon Josefsson  <jas@extundo.com>
 
 	* hooks.texi (Standard Hooks): Add before-save-hook.
--- a/lispref/commands.texi	Sat Jan 10 12:56:22 2004 +0000
+++ b/lispref/commands.texi	Sat Jan 10 13:27:38 2004 +0000
@@ -1156,7 +1156,8 @@
 
 @example
 (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp}
- @var{object} @var{text-pos} (@var{col} . @var{row}) (@var{dx} . @var{dy}))
+ @var{object} @var{text-pos} (@var{col} . @var{row}) 
+ @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height}))
 @end example
 
 @table @asis
@@ -1181,10 +1182,9 @@
 
 @item @var{object}
 This is the object on which the click occurred.  It is either
-@code{nil} if there is no string property or image at the position
-clicked on, or it has the form (@var{string} . @var{string-pos}) when
-there is a string-type text property at the click position, or it is
-an image object as returned by @code{find-image} if click was in an image.
+@code{nil} if there is no string property, or it has the form
+(@var{string} . @var{string-pos}) when there is a string-type text
+property at the click position.
 
 @item @var{string}
 This is the string on which the click occurred, including any
@@ -1205,6 +1205,11 @@
 @var{y} position, possibly padded with default character width
 glyphs if @var{x} is beyond the last glyph on the line.
 
+@item @var{image}
+This is the image object on which the click occurred.  It is either
+@code{nil} if there is no image at the position clicked on, or it is
+an image object as returned by @code{find-image} if click was in an image.
+
 @item @var{dx}, @var{dy}
 These are the pixel-denominated coordinates of the click, relative to
 the top left corner of @var{object}, which is @code{(0 . 0)}.  If
@@ -1669,7 +1674,8 @@
 
 @example
 (@var{window} @var{pos-or-area} (@var{x} . @var{y}) @var{timestamp}
- @var{object} @var{text-pos} (@var{col} . @var{row}) (@var{dx} . @var{dy}))
+ @var{object} @var{text-pos} (@var{col} . @var{row})
+ @var{image} (@var{dx} . @var{dy}) (@var{width} . @var{height}))
 @end example
 
 @defun event-start event
@@ -1730,15 +1736,33 @@
 case, @code{posn-col-row} can be used to get approximate values.
 @end defun
 
+@defun posn-string position
+Return the string object in @var{position}, either @code{nil}, or a
+cons cell @code{(@var{string} . @var{string-pos})}.
+@end defun
+
+@defun posn-image position
+Return the image object in @var{position}, either @code{nil}, or an
+image @code{(image ...)}.
+@end defun
+
 @defun posn-object position
-Return the object in @var{position}, either @code{nil}, a cons
-cell @code{(@var{string} . @var{string-pos})}, or an image
-@code{(image ...)}.
+Return the image or string object in @var{position}, either
+@code{nil}, an image @code{(image ...)}, or a cons cell
+@code{(@var{string} . @var{string-pos})}.
 @end defun
 
 @defun posn-object-x-y position
 Return the pixel-based x and y coordinates relative to the upper left
-corner of the object in @var{position}, as a cons cell @code{(@var{dx} . @var{dy})}.
+corner of the object in @var{position} as a cons cell @code{(@var{dx}
+. @var{dy})}.  If the @var{position} is a buffer position, return the
+relative position in the character at that position.
+@end defun
+
+@defun posn-object-width-height position
+Return the pixel width and height of the object in @var{position} as a
+cons cell @code{(@var{width} . @var{height})}.  If the @var{position}
+is a buffer position, return the size of the character at that position.
 @end defun
 
 @cindex mouse event, timestamp
--- a/lispref/files.texi	Sat Jan 10 12:56:22 2004 +0000
+++ b/lispref/files.texi	Sat Jan 10 13:27:38 2004 +0000
@@ -404,25 +404,29 @@
 This works just like @code{write-file-functions}, but it is intended for
 hooks that pertain to the contents of the file, as opposed to hooks that
 pertain to where the file came from.  Such hooks are usually set up by
-major modes, as buffer-local bindings for this variable.
+major modes, as buffer-local bindings for this variable.  If any of the
+functions in this hook returns non-@code{nil}, @code{write-file-functions}
+is not run.
 
 This variable automatically becomes buffer-local whenever it is set;
-switching to a new major mode always resets this variable.
+switching to a new major mode always resets this variable, but
+calling @code{set-visited-file-name} does not.
 @end defvar
 
-@defvar before-save-hook
-This normal hook runs before a buffer has been saved in its visited
-file.  One use of this hook is for the Copyright package; it uses this
-hook to make sure the file has the current year in the copyright
-header.
-@end defvar
+@defopt before-save-hook
+This normal hook runs before a buffer is saved in its visited file,
+regardless of whether that is done normally or by one of the hooks
+described above.  One use of this hook is for the Copyright package;
+it uses this hook to make sure the file has the current year in the
+copyright header.
+@end defopt
 
 @c Emacs 19 feature
-@defvar after-save-hook
+@defopt after-save-hook
 This normal hook runs after a buffer has been saved in its visited file.
 One use of this hook is in Fast Lock mode; it uses this hook to save the
 highlighting information in a cache file.
-@end defvar
+@end defopt
 
 @defvar file-precious-flag
 If this variable is non-@code{nil}, then @code{save-buffer} protects
@@ -2456,7 +2460,7 @@
 each have handlers.
 
 @kindex safe-magic (@r{property})
-Handlers that don't really do anything specal for actual access to the
+Handlers that don't really do anything special for actual access to the
 file---such as the ones that implement completion of host names for
 remote file names---should have a non-@code{nil} @code{safe-magic}
 property.  For instance, Emacs normally ``protects'' directory names
--- a/make-dist	Sat Jan 10 12:56:22 2004 +0000
+++ b/make-dist	Sat Jan 10 13:27:38 2004 +0000
@@ -512,7 +512,8 @@
 
 echo "Making links to \`nt/icons'"
 (cd nt/icons
- ln [a-z]*.ico ../../${tempdir}/nt/icons)
+ ln [a-z]*.ico ../../${tempdir}/nt/icons
+ ln [a-z]*.cur ../../${tempdir}/nt/icons)
 
 echo "Making links to \`mac'"
 (cd mac
--- a/src/ChangeLog	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/ChangeLog	Sat Jan 10 13:27:38 2004 +0000
@@ -1,3 +1,57 @@
+2004-01-08  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xmenu.c (Fx_popup_dialog): Add an Ok button if no buttons are
+	specified.
+
+2004-01-08  Kenichi Handa  <handa@m17n.org>
+
+	* editfns.c (Fformat): Fix '&' to '&&'.
+
+2004-01-08  Andreas Schwab  <schwab@suse.de>
+
+	* print.c (print_preprocess) <case Lisp_Vectorlike>: Only mask
+	size if PSEUDOVECTOR_FLAG is set.
+
+2004-01-07  Kenichi Handa  <handa@m17n.org>
+
+	* charset.c (Fdeclare_equiv_charset): Fix docstring.
+
+	* fontset.c (fontset_ref_via_base): Fix previous change.
+
+2004-01-07  Kim F. Storm  <storm@cua.dk>
+
+	* process.c (read_process_output): Only activate adaptive
+	buffering if we read less than 256 bytes at a time.
+
+2004-01-06  Kim F. Storm  <storm@cua.dk>
+
+	* dispnew.c (buffer_posn_from_coords): Return both buffer/string
+	object and image object.  Return glyph width and height.
+	(mode_line_string, marginal_area_string): Ditto.
+
+	* dispextern.h (buffer_posn_from_coords, mode_line_string)
+	(marginal_area_string): Fix prototypes.
+
+	* keyboard.h (POSN_POSN, POSN_SET_POSN): Rename macros from
+	POSN_BUFFER_POSN and POSN_SET_BUFFER_POSN. All uses changed.
+	(POSN_INBUFFER_P, POSN_BUFFER_POSN): New macros.
+
+	* keyboard.c (make_lispy_position): Use modified mode_line_string,
+	buffer_posn_from_coords, and marginal_area_string functions to
+	include both string object and image object in the lispy position.
+	Also add actual glyph width and height to position.
+	(read_key_sequence): Use real buffer position from mouse
+	event to find keymap property even when click is in marginal area.
+
+	* xdisp.c (note_mode_line_or_margin_highlight): Use modified
+	mode_line_string and marginal_area_string functions to handle
+	both string object and image object properties.
+	
+2004-01-06  Andreas Schwab  <schwab@suse.de>
+
+	* syntax.c (skip_chars): Treat '-' at end of string as ordinary
+	character.
+
 2004-01-02  Andreas Schwab  <schwab@suse.de>
 
 	* macterm.c (emacs_options, x_initialized, same_x_server): Remove
--- a/src/charset.c	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/charset.c	Sat Jan 10 13:27:38 2004 +0000
@@ -760,17 +760,20 @@
 
 DEFUN ("declare-equiv-charset", Fdeclare_equiv_charset, Sdeclare_equiv_charset,
        4, 4, 0,
-       doc: /* Declare a charset of DIMENSION, CHARS, FINAL-CHAR is the same as CHARSET.
-CHARSET should be defined by `defined-charset' in advance.  */)
-     (dimension, chars, final_char, charset_symbol)
-     Lisp_Object dimension, chars, final_char, charset_symbol;
+       doc: /* Declare an equivalent charset for ISO-2022 decoding.
+
+On decoding by an ISO-2022 base coding system, when a charset
+specified by DIMENSION, CHARS, and FINAL-CHAR is designated, behave as
+if CHARSET is designated instead.  */)
+     (dimension, chars, final_char, charset)
+     Lisp_Object dimension, chars, final_char, charset;
 {
-  int charset;
+  int charset_id;
 
   CHECK_NUMBER (dimension);
   CHECK_NUMBER (chars);
   CHECK_NUMBER (final_char);
-  CHECK_SYMBOL (charset_symbol);
+  CHECK_SYMBOL (charset);
 
   if (XINT (dimension) != 1 && XINT (dimension) != 2)
     error ("Invalid DIMENSION %d, it should be 1 or 2", XINT (dimension));
@@ -778,10 +781,10 @@
     error ("Invalid CHARS %d, it should be 94 or 96", XINT (chars));
   if (XINT (final_char) < '0' || XFASTINT (final_char) > '~')
     error ("Invalid FINAL-CHAR %c, it should be `0'..`~'", XINT (chars));
-  if ((charset = get_charset_id (charset_symbol)) < 0)
-    error ("Invalid charset %s", SDATA (SYMBOL_NAME (charset_symbol)));
+  if ((charset_id = get_charset_id (charset)) < 0)
+    error ("Invalid charset %s", SDATA (SYMBOL_NAME (charset)));
 
-  ISO_CHARSET_TABLE (dimension, chars, final_char) = charset;
+  ISO_CHARSET_TABLE (dimension, chars, final_char) = charset_id;
   return Qnil;
 }
 
--- a/src/dispextern.h	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/dispextern.h	Sat Jan 10 13:27:38 2004 +0000
@@ -2668,12 +2668,19 @@
 extern int inverse_video;
 extern int required_matrix_width P_ ((struct window *));
 extern int required_matrix_height P_ ((struct window *));
-extern Lisp_Object mode_line_string P_ ((struct window *, int *, int *,
-					 int *, int *,
-					 enum window_part, int *));
-extern Lisp_Object marginal_area_string P_ ((struct window *, int *, int *,
-					     int *, int *,
-					     enum window_part, int *));
+extern Lisp_Object buffer_posn_from_coords P_ ((struct window *,
+						int *, int *,
+						struct display_pos *,
+						Lisp_Object *, 
+						int *, int *, int *, int *));
+extern Lisp_Object mode_line_string P_ ((struct window *, enum window_part,
+					 int *, int *, int *,
+					 Lisp_Object *,
+					 int *, int *, int *, int *));
+extern Lisp_Object marginal_area_string P_ ((struct window *, enum window_part,
+					     int *, int *, int *,
+					     Lisp_Object *,
+					     int *, int *, int *, int *));
 extern void redraw_frame P_ ((struct frame *));
 extern void redraw_garbaged_frames P_ ((void));
 extern void cancel_line P_ ((int, struct frame *));
@@ -2714,9 +2721,6 @@
 int update_frame P_ ((struct frame *, int, int));
 void update_single_window P_ ((struct window *, int));
 int scrolling P_ ((struct frame *));
-void buffer_posn_from_coords P_ ((struct window *, int *, int *,
-				  int *, int *,
-				  Lisp_Object *, struct display_pos *));
 void do_pending_window_change P_ ((int));
 void change_frame_size P_ ((struct frame *, int, int, int, int, int));
 void bitch_at_user P_ ((void));
--- a/src/dispnew.c	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/dispnew.c	Sat Jan 10 13:27:38 2004 +0000
@@ -5697,21 +5697,24 @@
  ***********************************************************************/
 
 /* Determine what's under window-relative pixel position (*X, *Y).
-   Return in *OBJECT the object (string or buffer) that's there.
-   Return in *POS the position in that object. Adjust *X and *Y
-   to character positions.  */
-
-void
-buffer_posn_from_coords (w, x, y, dx, dy, object, pos)
+   Return the object (string or buffer) that's there.
+   Return in *POS the position in that object.
+   Adjust *X and *Y to character positions.  */
+
+Lisp_Object
+buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height)
      struct window *w;
      int *x, *y;
-     int *dx, *dy;
+     struct display_pos *pos;
      Lisp_Object *object;
-     struct display_pos *pos;
+     int *dx, *dy;
+     int *width, *height;
 {
   struct it it;
   struct buffer *old_current_buffer = current_buffer;
   struct text_pos startp;
+  Lisp_Object string;
+  struct glyph_row *row;
   int x0, x1;
 
   current_buffer = XBUFFER (w->buffer);
@@ -5729,7 +5732,10 @@
   *dx = x0 + it.first_visible_x - it.current_x;
   *dy = *y - it.current_y;
 
-  *object =  w->buffer;
+  string =  w->buffer;
+  if (STRINGP (it.string))
+    string = it.string;
+  *pos = it.current;
 
 #ifdef HAVE_WINDOW_SYSTEM
   if (it.what == IT_IMAGE)
@@ -5737,25 +5743,33 @@
       struct image *img;
       if ((img = IMAGE_FROM_ID (it.f, it.image_id)) != NULL
 	  && !NILP (img->spec))
+	*object = img->spec;
+    }
+#endif
+
+  row = MATRIX_ROW (w->current_matrix, it.vpos);
+  if (row->enabled_p)
+    {
+      if (it.hpos < row->used[TEXT_AREA])
 	{
-	  struct glyph_row *row = MATRIX_ROW (w->current_matrix, it.vpos);
-	  struct glyph *glyph;
-
-	  if (it.hpos < row->used[TEXT_AREA]
-	      && (glyph = row->glyphs[TEXT_AREA] + it.hpos,
-		  glyph->type == IMAGE_GLYPH))
-	    {
-	      *dy -= row->ascent - glyph->ascent;
-	      *object = img->spec;
-	    }
+	  struct glyph *glyph = row->glyphs[TEXT_AREA] + it.hpos;
+	  *width = glyph->pixel_width;
+	  *height = glyph->ascent + glyph->descent;
+#ifdef HAVE_WINDOW_SYSTEM
+	  if (glyph->type == IMAGE_GLYPH)
+	    *dy -= row->ascent - glyph->ascent;
+#endif
+	}
+      else
+	{
+	  *width = 0;
+	  *height = row->height;
 	}
     }
   else
-#endif
-    if (STRINGP (it.string))
-      *object = it.string;
-
-  *pos = it.current;
+    {
+      *width = *height = 0;
+    }
 
   /* Add extra (default width) columns if clicked after EOL. */
   x1 = max(0, it.current_x + it.pixel_width - it.first_visible_x);
@@ -5764,21 +5778,24 @@
 
   *x = it.hpos;
   *y = it.vpos;
+
+  return string;
 }
 
 
 /* Value is the string under window-relative coordinates X/Y in the
-   mode or header line of window W, or nil if none.  MODE_LINE_P non-zero
-   means look at the mode line.  *CHARPOS is set to the position in
-   the string returned.  */
+   mode line or header line (PART says which) of window W, or nil if none.
+   *CHARPOS is set to the position in the string returned.  */
 
 Lisp_Object
-mode_line_string (w, x, y, dx, dy, part, charpos)
+mode_line_string (w, part, x, y, charpos, object, dx, dy, width, height)
      struct window *w;
+     enum window_part part;
      int *x, *y;
+     int *charpos;
+     Lisp_Object *object;
      int *dx, *dy;
-     enum window_part part;
-     int *charpos;
+     int *width, *height;
 {
   struct glyph_row *row;
   struct glyph *glyph, *end;
@@ -5805,22 +5822,36 @@
 	{
 	  string = glyph->object;
 	  *charpos = glyph->charpos;
+	  *width = glyph->pixel_width;
+	  *height = glyph->ascent + glyph->descent;
+#ifdef HAVE_WINDOW_SYSTEM
+	  if (glyph->type == IMAGE_GLYPH)
+	    {
+	      struct image *img;
+	      img = IMAGE_FROM_ID (WINDOW_XFRAME (w), glyph->u.img_id);
+	      if (img != NULL)
+		*object = img->spec;
+	      y0 -= row->ascent - glyph->ascent;
+	    }
+#endif
 	}
       else
-	/* Add extra (default width) columns if clicked after EOL. */
-	*x += x0 / WINDOW_FRAME_COLUMN_WIDTH (w);
+	{
+	  /* Add extra (default width) columns if clicked after EOL. */
+	  *x += x0 / WINDOW_FRAME_COLUMN_WIDTH (w);
+	  *width = 0;
+	  *height = row->height;
+	}
     }
   else
     {
       *x = 0;
       x0 = 0;
+      *width = *height = 0;
     }
 
-  if (dx)
-    {
-      *dx = x0;
-      *dy = y0;
-    }
+  *dx = x0;
+  *dy = y0;
 
   return string;
 }
@@ -5831,12 +5862,14 @@
    the string returned.  */
 
 Lisp_Object
-marginal_area_string (w, x, y, dx, dy, part, charpos)
+marginal_area_string (w, part, x, y, charpos, object, dx, dy, width, height)
      struct window *w;
+     enum window_part part;
      int *x, *y;
+     int *charpos;
+     Lisp_Object *object;
      int *dx, *dy;
-     enum window_part part;
-     int *charpos;
+     int *width, *height;
 {
   struct glyph_row *row = w->current_matrix->rows;
   struct glyph *glyph, *end;
@@ -5881,32 +5914,36 @@
 	{
 	  string = glyph->object;
 	  *charpos = glyph->charpos;
+	  *width = glyph->pixel_width;
+	  *height = glyph->ascent + glyph->descent;
 #ifdef HAVE_WINDOW_SYSTEM
 	  if (glyph->type == IMAGE_GLYPH)
 	    {
 	      struct image *img;
 	      img = IMAGE_FROM_ID (WINDOW_XFRAME (w), glyph->u.img_id);
 	      if (img != NULL)
-		string = img->spec;
+		*object = img->spec;
 	      y0 -= row->ascent - glyph->ascent;
 	    }
 #endif
 	}
       else
-	/* Add extra (default width) columns if clicked after EOL. */
-	*x += x0 / WINDOW_FRAME_COLUMN_WIDTH (w);
+	{
+	  /* Add extra (default width) columns if clicked after EOL. */
+	  *x += x0 / WINDOW_FRAME_COLUMN_WIDTH (w);
+	  *width = 0;
+	  *height = row->height;
+	}
     }
   else
     {
       x0 = 0;
       *x = 0;
+      *width = *height = 0;
     }
 
-  if (dx)
-    {
-      *dx = x0;
-      *dy = y0;
-    }
+  *dx = x0;
+  *dy = y0;
 
   return string;
 }
--- a/src/editfns.c	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/editfns.c	Sat Jan 10 13:27:38 2004 +0000
@@ -3447,7 +3447,7 @@
 	    /* Anything but a string, convert to a string using princ.  */
 	    register Lisp_Object tem;
 	    tem = Fprin1_to_string (args[n], Qt);
-	    if (STRING_MULTIBYTE (tem) & ! multibyte)
+	    if (STRING_MULTIBYTE (tem) && ! multibyte)
 	      {
 		multibyte = 1;
 		goto retry;
--- a/src/fontset.c	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/fontset.c	Sat Jan 10 13:27:38 2004 +0000
@@ -306,7 +306,7 @@
     elt = FONTSET_REF (FONTSET_BASE (fontset), *c);
   if (NILP (elt))
     elt = lookup_overriding_fontspec (FONTSET_FRAME (fontset), *c);
-  if (NILP (elt) && ! EQ (FONTSET_BASE (fontset), Vdefault_fontset))
+  if (NILP (elt))
     elt = FONTSET_REF (Vdefault_fontset, *c);
   if (NILP (elt))
     return Qnil;
--- a/src/keyboard.c	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/keyboard.c	Sat Jan 10 13:27:38 2004 +0000
@@ -2939,13 +2939,13 @@
     {
       Lisp_Object posn;
 
-      posn = POSN_BUFFER_POSN (EVENT_START (c));
+      posn = POSN_POSN (EVENT_START (c));
       /* Handle menu-bar events:
 	 insert the dummy prefix event `menu-bar'.  */
       if (EQ (posn, Qmenu_bar) || EQ (posn, Qtool_bar))
 	{
 	  /* Change menu-bar to (menu-bar) as the event "position".  */
-	  POSN_BUFFER_SET_POSN (EVENT_START (c), Fcons (posn, Qnil));
+	  POSN_SET_POSN (EVENT_START (c), Fcons (posn, Qnil));
 
 	  also_record = c;
 	  Vunread_command_events = Fcons (c, Vunread_command_events);
@@ -4979,9 +4979,11 @@
     {
       /* It's a click in window window at frame coordinates (x,y)  */
       struct window *w = XWINDOW (window);
-      Lisp_Object object = Qnil;
+      Lisp_Object string_info = Qnil;
       int textpos = -1, rx = -1, ry = -1;
       int dx = -1, dy = -1;
+      int width = -1, height = -1;
+      Lisp_Object object = Qnil;
 
       /* Set event coordinates to window-relative coordinates
 	 for constructing the Lisp event below.  */
@@ -4997,9 +4999,10 @@
 
 	  posn = part == ON_MODE_LINE ? Qmode_line : Qheader_line;
 	  rx = wx, ry = wy;
-	  string = mode_line_string (w, &rx, &ry, &dx, &dy, part, &charpos);
+	  string = mode_line_string (w, part, &rx, &ry, &charpos,
+				     &object, &dx, &dy, &width, &height);
 	  if (STRINGP (string))
-	    object = Fcons (string, make_number (charpos));
+	    string_info = Fcons (string, make_number (charpos));
 	  if (w == XWINDOW (selected_window))
 	    textpos = PT;
 	  else
@@ -5010,6 +5013,7 @@
 	  posn = Qvertical_line;
 	  wx = -1;
 	  dx = 0;
+	  width = 1;
 	}
       else if (part == ON_LEFT_MARGIN || part == ON_RIGHT_MARGIN)
 	{
@@ -5018,22 +5022,10 @@
 	  
 	  posn = (part == ON_LEFT_MARGIN) ? Qleft_margin : Qright_margin;
 	  rx = wx, ry = wy;
-	  string = marginal_area_string (w, &rx, &ry, &dx, &dy, part, &charpos);
+	  string = marginal_area_string (w, part, &rx, &ry, &charpos,
+					 &object, &dx, &dy, &width, &height);
 	  if (STRINGP (string))
-	    object = Fcons (string, make_number (charpos));
-#ifdef HAVE_WINDOW_SYSTEM
-	  else if (IMAGEP (string))
-	    {
-	      Lisp_Object image_map, hotspot;
-	      object = string;
-	      if ((image_map = Fplist_get (XCDR (object), QCmap),
-		   !NILP (image_map))
-		  && (hotspot = find_hot_spot (image_map, dx, dy),
-		      CONSP (hotspot))
-		  && (hotspot = XCDR (hotspot), CONSP (hotspot)))
-		posn = XCAR (hotspot);
-	    }
-#endif
+	    string_info = Fcons (string, make_number (charpos));
 	}
       else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE)
 	{
@@ -5052,46 +5044,60 @@
 
       if (textpos < 0)
 	{
-	  Lisp_Object string;
+	  Lisp_Object string2, object2 = Qnil;
 	  struct display_pos p;
 	  int dx2, dy2;
+	  int width2, height2;
 	  wx = max (WINDOW_LEFT_MARGIN_WIDTH (w), wx);
-	  buffer_posn_from_coords (w, &wx, &wy, &dx2, &dy2, &string, &p);
+	  string2 = buffer_posn_from_coords (w, &wx, &wy, &p,
+					     &object2, &dx2, &dy2,
+					     &width2, &height2);
 	  textpos = CHARPOS (p.pos);
 	  if (rx < 0) rx = wx;
 	  if (ry < 0) ry = wy;
 	  if (dx < 0) dx = dx2;
 	  if (dy < 0) dy = dy2;
+	  if (width < 0) width = width2;
+	  if (height < 0) height = height2;
 
 	  if (NILP (posn))
 	    {
 	      posn = make_number (textpos);
-	      if (STRINGP (string))
-		object = Fcons (string,
-				make_number (CHARPOS (p.string_pos)));
+	      if (STRINGP (string2))
+		string_info = Fcons (string2,
+				     make_number (CHARPOS (p.string_pos)));
+	    }
+	  if (NILP (object))
+	    object = object2;
+	}
+
 #ifdef HAVE_WINDOW_SYSTEM
-	      else if (IMAGEP (string))
-		{
-		  Lisp_Object image_map, hotspot;
-		  object = string;
-		  if ((image_map = Fplist_get (XCDR (object), QCmap),
-		       !NILP (image_map))
-		      && (hotspot = find_hot_spot (image_map, dx, dy),
-			  CONSP (hotspot))
-		      && (hotspot = XCDR (hotspot), CONSP (hotspot)))
-		    posn = XCAR (hotspot);
-		}
-#endif
-	    }
-	}
-
+      if (IMAGEP (object))
+	{
+	  Lisp_Object image_map, hotspot;
+	  if ((image_map = Fplist_get (XCDR (object), QCmap),
+	       !NILP (image_map))
+	      && (hotspot = find_hot_spot (image_map, dx, dy),
+		  CONSP (hotspot))
+	      && (hotspot = XCDR (hotspot), CONSP (hotspot)))
+	    posn = XCAR (hotspot);
+	}
+#endif
+
+      /* Object info */
       extra_info = Fcons (object,
+			  Fcons (Fcons (make_number (dx),
+					make_number (dy)),
+				 Fcons (Fcons (make_number (width),
+					       make_number (height)),
+					Qnil)));
+
+      /* String info */
+      extra_info = Fcons (string_info,
 			  Fcons (make_number (textpos),
 				 Fcons (Fcons (make_number (rx),
 					       make_number (ry)),
-					Fcons (Fcons (make_number (dx),
-						      make_number (dy)),
-					       Qnil))));
+					extra_info)));
     }
   else if (f != 0)
     {
@@ -8918,7 +8924,7 @@
 	      Lisp_Object window, posn;
 
 	      window = POSN_WINDOW      (EVENT_START (key));
-	      posn   = POSN_BUFFER_POSN (EVENT_START (key));
+	      posn   = POSN_POSN (EVENT_START (key));
 
 	      if (CONSP (posn)
 		  || (!NILP (fake_prefixed_keys)
@@ -8976,7 +8982,7 @@
 		  localized_local_map = 1;
 		  start = EVENT_START (key);
 
-		  if (CONSP (start) && CONSP (XCDR (start)))
+		  if (CONSP (start) && POSN_INBUFFER_P (start))
 		    {
 		      pos = POSN_BUFFER_POSN (start);
 		      if (INTEGERP (pos)
@@ -9086,7 +9092,7 @@
 	    {
 	      Lisp_Object posn;
 
-	      posn = POSN_BUFFER_POSN (EVENT_START (key));
+	      posn = POSN_POSN (EVENT_START (key));
 	      /* Handle menu-bar events:
 		 insert the dummy prefix event `menu-bar'.  */
 	      if (EQ (posn, Qmenu_bar) || EQ (posn, Qtool_bar))
@@ -9098,8 +9104,8 @@
 
 		  /* Zap the position in key, so we know that we've
 		     expanded it, and don't try to do so again.  */
-		  POSN_BUFFER_SET_POSN (EVENT_START (key),
-					Fcons (posn, Qnil));
+		  POSN_SET_POSN (EVENT_START (key),
+				 Fcons (posn, Qnil));
 
 		  mock_input = t + 2;
 		  goto replay_sequence;
--- a/src/keyboard.h	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/keyboard.h	Sat Jan 10 13:27:38 2004 +0000
@@ -254,17 +254,21 @@
 
 /* Extract the fields of a position.  */
 #define POSN_WINDOW(posn) (XCAR (posn))
-#define POSN_BUFFER_POSN(posn) (XCAR (XCDR (posn)))
-#define POSN_BUFFER_SET_POSN(posn,x) (XSETCAR (XCDR (posn), (x)))
+#define POSN_POSN(posn) (XCAR (XCDR (posn)))
+#define POSN_SET_POSN(posn,x) (XSETCAR (XCDR (posn), (x)))
 #define POSN_WINDOW_POSN(posn) (XCAR (XCDR (XCDR (posn))))
-#define POSN_TIMESTAMP(posn) \
-  (XCAR (XCDR (XCDR (XCDR (posn)))))
+#define POSN_TIMESTAMP(posn) (XCAR (XCDR (XCDR (XCDR (posn)))))
 #define POSN_SCROLLBAR_PART(posn)	(Fnth (make_number (4), (posn)))
 
 /* A cons (STRING . STRING-CHARPOS), or nil in mouse-click events.
    It's a cons if the click is over a string in the mode line.  */
 
-#define POSN_STRING(POSN) Fnth (make_number (4), (POSN))
+#define POSN_STRING(posn) (Fnth (make_number (4), (posn)))
+
+/* If POSN_STRING is nil, event refers to buffer location.  */
+
+#define POSN_INBUFFER_P(posn) (NILP (POSN_STRING (posn)))
+#define POSN_BUFFER_POSN(posn) (Fnth (make_number (5), (posn)))
 
 /* Some of the event heads.  */
 extern Lisp_Object Qswitch_frame;
--- a/src/print.c	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/print.c	Sat Jan 10 13:27:38 2004 +0000
@@ -1342,7 +1342,9 @@
 	  goto loop;
 
 	case Lisp_Vectorlike:
-	  size = XVECTOR (obj)->size & PSEUDOVECTOR_SIZE_MASK;
+	  size = XVECTOR (obj)->size;
+	  if (size & PSEUDOVECTOR_FLAG)
+	    size &= PSEUDOVECTOR_SIZE_MASK;
 	  for (i = 0; i < size; i++)
 	    print_preprocess (XVECTOR (obj)->contents[i]);
 	  break;
--- a/src/process.c	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/process.c	Sat Jan 10 13:27:38 2004 +0000
@@ -4771,7 +4771,7 @@
       if (!NILP (p->adaptive_read_buffering))
 	{
 	  int delay = XINT (p->read_output_delay);
-	  if (nbytes < readmax - carryover)
+	  if (nbytes < 256)
 	    {
 	      if (delay < READ_OUTPUT_DELAY_MAX_MAX)
 		{
@@ -4780,7 +4780,7 @@
 		  delay += READ_OUTPUT_DELAY_INCREMENT * 2;
 		}
 	    }
-	  else if (delay > 0)
+	  else if (delay > 0 && (nbytes == readmax - carryover))
 	    {
 	      delay -= READ_OUTPUT_DELAY_INCREMENT;
 	      if (delay == 0)
--- a/src/syntax.c	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/syntax.c	Sat Jan 10 13:27:38 2004 +0000
@@ -1,5 +1,5 @@
 /* GNU Emacs routines to deal with syntax tables; also word and list parsing.
-   Copyright (C) 1985, 87, 93, 94, 95, 97, 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1985, 87, 93, 94, 95, 97, 1998, 1999, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -1442,10 +1442,13 @@
 	      if (i_byte == size_byte)
 		break;
 
-	      c = STRING_CHAR_AND_LENGTH (str+i_byte, size_byte-i_byte, len);
+	      c = STRING_CHAR_AND_LENGTH (str + i_byte,
+					  size_byte - i_byte, len);
 	      i_byte += len;
 	    }
-	  if (i_byte < size_byte
+	  /* Treat `-' as range character only if another character
+	     follows.  */
+	  if (i_byte + 1 < size_byte
 	      && str[i_byte] == '-')
 	    {
 	      unsigned int c2;
@@ -1453,11 +1456,9 @@
 	      /* Skip over the dash.  */
 	      i_byte++;
 
-	      if (i_byte == size_byte)
-		break;
-
 	      /* Get the end of the range.  */
-	      c2 =STRING_CHAR_AND_LENGTH (str+i_byte, size_byte-i_byte, len);
+	      c2 = STRING_CHAR_AND_LENGTH (str + i_byte,
+					   size_byte - i_byte, len);
 	      i_byte += len;
 
 	      if (SINGLE_BYTE_CHAR_P (c))
--- a/src/xdisp.c	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/xdisp.c	Sat Jan 10 13:27:38 2004 +0000
@@ -20178,20 +20178,57 @@
   Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
   Cursor cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
   Lisp_Object pointer = Qnil;
-  int charpos, dx, dy;
-  Lisp_Object string;
+  int charpos, dx, dy, width, height;
+  Lisp_Object string, object = Qnil;
   Lisp_Object pos, help, image;
 
   if (area == ON_MODE_LINE || area == ON_HEADER_LINE)
-    string = mode_line_string (w, &x, &y, 0, 0, area, &charpos);
+    string = mode_line_string (w, area, &x, &y, &charpos,
+			       &object, &dx, &dy, &width, &height);
   else
     {
       x -= WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w);
-      string = marginal_area_string (w, &x, &y, &dx, &dy, area, &charpos);
+      string = marginal_area_string (w, area, &x, &y, &charpos,
+				     &object, &dx, &dy, &width, &height);
     }
 
   help = Qnil;
 
+  if (IMAGEP (object))
+    {
+      Lisp_Object image_map, hotspot;
+      if ((image_map = Fplist_get (XCDR (object), QCmap),
+	   !NILP (image_map))
+	  && (hotspot = find_hot_spot (image_map, dx, dy),
+	      CONSP (hotspot))
+	  && (hotspot = XCDR (hotspot), CONSP (hotspot)))
+	{
+	  Lisp_Object area_id, plist;
+
+	  area_id = XCAR (hotspot);
+	  /* Could check AREA_ID to see if we enter/leave this hot-spot.
+	     If so, we could look for mouse-enter, mouse-leave
+	     properties in PLIST (and do something...).  */
+	  if ((plist = XCDR (hotspot), CONSP (plist)))
+	    {
+	      pointer = Fplist_get (plist, Qpointer);
+	      if (NILP (pointer))
+		pointer = Qhand;
+	      help = Fplist_get (plist, Qhelp_echo);
+	      if (!NILP (help))
+		{
+		  help_echo_string = help;
+		  /* Is this correct?  ++kfs */
+		  XSETWINDOW (help_echo_window, w);
+		  help_echo_object = w->buffer;
+		  help_echo_pos = charpos;
+		}
+	    }
+	  if (NILP (pointer))
+	    pointer = Fplist_get (XCDR (object), QCpointer);
+	}
+    }
+
   if (STRINGP (string))
     {
       pos = make_number (charpos);
@@ -20221,40 +20258,6 @@
 	    cursor = dpyinfo->vertical_scroll_bar_cursor;
 	}
     }
-  else if (IMAGEP (string))
-    {
-      Lisp_Object image_map, hotspot;
-      if ((image_map = Fplist_get (XCDR (string), QCmap),
-	   !NILP (image_map))
-	  && (hotspot = find_hot_spot (image_map, dx, dy),
-	      CONSP (hotspot))
-	  && (hotspot = XCDR (hotspot), CONSP (hotspot)))
-	{
-	  Lisp_Object area_id, plist;
-
-	  area_id = XCAR (hotspot);
-	  /* Could check AREA_ID to see if we enter/leave this hot-spot.
-	     If so, we could look for mouse-enter, mouse-leave
-	     properties in PLIST (and do something...).  */
-	  if ((plist = XCDR (hotspot), CONSP (plist)))
-	    {
-	      pointer = Fplist_get (plist, Qpointer);
-	      if (NILP (pointer))
-		pointer = Qhand;
-	      help = Fplist_get (plist, Qhelp_echo);
-	      if (!NILP (help))
-		{
-		  help_echo_string = help;
-		  /* Is this correct?  ++kfs */
-		  XSETWINDOW (help_echo_window, w);
-		  help_echo_object = w->buffer;
-		  help_echo_pos = charpos;
-		}
-	    }
-	  if (NILP (pointer))
-	    pointer = Fplist_get (XCDR (string), QCpointer);
-	}
-    }
 
   define_frame_cursor1 (f, cursor, pointer);
 }
--- a/src/xmenu.c	Sat Jan 10 12:56:22 2004 +0000
+++ b/src/xmenu.c	Sat Jan 10 13:27:38 2004 +0000
@@ -1092,6 +1092,12 @@
     CHECK_STRING (title);
     record_unwind_protect (unuse_menu_items, Qnil);
 
+    if (NILP (Fcar (Fcdr (contents))))
+      /* No buttons specified, add an "Ok" button so users can pop down
+         the dialog.  Also, the lesstif/motif version crashes if there are
+         no buttons.  */
+      contents = Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil));
+    
     list_of_panes (Fcons (contents, Qnil));
 
     /* Display them in a dialog box.  */