changeset 83260:25f02aeb20f4

Merged from miles@gnu.org--gnu-2005 (patch 27, 120-125) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-120 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-121 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-122 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-123 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-125 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-27 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-300
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 23 Feb 2005 11:26:15 +0000
parents cf4b5d1da82f (current diff) 317ca910958b (diff)
children 7d309d464f83
files admin/FOR-RELEASE lisp/ChangeLog lispref/ChangeLog src/buffer.c src/minibuf.c src/window.c src/xdisp.c
diffstat 21 files changed, 318 insertions(+), 154 deletions(-) [+]
line wrap: on
line diff
--- a/admin/FOR-RELEASE	Wed Feb 23 11:24:05 2005 +0000
+++ b/admin/FOR-RELEASE	Wed Feb 23 11:26:15 2005 +0000
@@ -13,6 +13,9 @@
 
 ** Update Speedbar.
 
+** Enhance scroll-bar to handle tall line (similar to line-move).
+
+
 * FATAL ERRORS
 
 ** Investigate face cache related crash.
@@ -187,7 +190,7 @@
 man/cmdargs.texi    Chong Yidong
 man/commands.texi   "Luc Teirlinck"
 man/custom.texi     Chong Yidong
-man/dired.texi      Chong Yidong     joakim@verona.se 
+man/dired.texi      Chong Yidong     joakim@verona.se
 man/display.texi    "Luc Teirlinck"  Chong Yidong
 man/emacs.texi      "Luc Teirlinck"
 man/entering.texi   "Luc Teirlinck"  Chong Yidong
--- a/etc/NEWS	Wed Feb 23 11:24:05 2005 +0000
+++ b/etc/NEWS	Wed Feb 23 11:26:15 2005 +0000
@@ -3317,7 +3317,8 @@
 ** The functions all-completions and try-completion now accept lists
 of strings as well as hash-tables additionally to alists, obarrays
 and functions.  Furthermore, the function `test-completion' is now
-exported to Lisp.
+exported to Lisp.  The keys in alists and hash tables may be either
+strings or symbols, which are automatically converted with to strings.
 
 ---
 ** When pure storage overflows while dumping, Emacs now prints how
--- a/lisp/ChangeLog	Wed Feb 23 11:24:05 2005 +0000
+++ b/lisp/ChangeLog	Wed Feb 23 11:26:15 2005 +0000
@@ -1,3 +1,39 @@
+2005-02-22  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* cus-edit.el: Comment change.
+
+2005-02-22  Kim F. Storm  <storm@cua.dk>
+
+	* progmodes/hideif.el (hide-ifdef-use-define-alist): Use
+	completing-read.  Suggested by Juan-Leon Lahoz Garcia.
+
+2005-02-22  Simon Josefsson  <jas@extundo.com>
+
+	* net/browse-url.el (browse-url-netscape-new-window-is-tab): New
+	variable.
+	(browse-url-netscape): Use it.  Suggested by "Johann 'Myrkraverk'
+	Oskarsson" <myrkraverk@users.sourceforget.net>.
+
+2005-02-22  Kim F. Storm  <storm@cua.dk>
+
+	* mouse.el (mouse-on-link-p): If arg POS is a mouse event,
+	check that window of that event is the selected window.
+	(mouse-drag-region-1): Compare mouse event window to selected
+	window before setting point.
+
+	* tooltip.el (tooltip-show-help-function): Pass event to
+	mouse-on-link-p so it can check selected window.
+
+2005-02-22  Kenichi Handa  <handa@m17n.org>
+
+	* ps-mule.el (ps-mule-header-string-charsets): Delete it.
+	(ps-mule-show-warning): New function.
+	(ps-mule-begin-job): Use ps-mule-show-warning if unprintable
+	characters are found.
+
+	* ps-print.el (ps-header-footer-string): Return a list of header
+	and footer strings.
+
 2005-02-21  Wolfgang Jenkner  <wjenkner@inode.at>  (tiny change)
 
 	* pcvs.el (cvs-retrieve-revision): Fix thinko.
--- a/lisp/cus-edit.el	Wed Feb 23 11:24:05 2005 +0000
+++ b/lisp/cus-edit.el	Wed Feb 23 11:26:15 2005 +0000
@@ -35,7 +35,7 @@
 ;; that the user will run with M-x, and `Custom-' for interactive commands.
 
 ;; The identity of a customize option is represented by a Lisp symbol.
-;; There is the following values associated with an option.  
+;; The following values are associated with an option.
 
 ;; 0. The current value.
 
@@ -48,42 +48,42 @@
 
 ;; 1. The widget value.
 
-;;    This is the value shown in the widget in a customize buffer.  
+;;    This is the value shown in the widget in a customize buffer.
 
 ;; 2. The customized value.
 
 ;;    This is the last value given to the option through customize.
 
 ;;    It is stored in the 'customized-value' property of the option, in a
-;;    cons-cell whose car evaluate to the customized value.   
+;;    cons-cell whose car evaluates to the customized value.
 
 ;; 3. The saved value.
 
 ;;    This is last value saved from customize.
 
 ;;    It is stored in the 'saved-value' property of the option, in a
-;;    cons-cell whose car evaluate to the saved value.   
+;;    cons-cell whose car evaluates to the saved value.
 
 ;; 4. The standard value.
 
 ;;    This is the value given in the 'defcustom' declaration.
 
 ;;    It is stored in the 'standard-value' property of the option, in a
-;;    cons-cell whose car evaluate to the standard value.   
+;;    cons-cell whose car evaluates to the standard value.
 
 ;; 5. The "think" value.
-   
-;;    This is what customize think the current value should be.
-   
-;;    This is the customize value, if any such value exists, otherwise
+
+;;    This is what customize thinks the current value should be.
+
+;;    This is the customized value, if any such value exists, otherwise
 ;;    the saved value, if that exists, and as a last resort the standard
-;;    value. 
+;;    value.
 
 ;; The reason for storing values unevaluated: This is so you can have
 ;; values that depend on the environment.  For example, you can have a
-;; valiable that has one value when Emacs is running under a window
+;; variable that has one value when Emacs is running under a window
 ;; system, and another value on a tty.  Since the evaluation is only done
-;; when the variable is firsty initialized, this is only relevant for the
+;; when the variable is first initialized, this is only relevant for the
 ;; saved (and standard) values, but affect others values for
 ;; compatibility.
 
@@ -103,8 +103,8 @@
 ;;    The widget value is different from the current value.
 
 ;; 2. changed
-   
-;;    The current value is different from the "think" value.   
+
+;;    The current value is different from the "think" value.
 
 ;; 3. set
 
@@ -120,7 +120,11 @@
 
 ;; 6. rogue
 
-;;    There are no standard value.
+;;    There is no standard value.  This means that the variable was
+;;    not defined with defcustom.  You can not create a Custom buffer
+;;    for such variables using the normal interactive Custom commands.
+;;    However, such Custom buffers can be created in other ways, for
+;;    instance, by calling `customize-option' non-interactively.
 
 ;; 7. hidden
 
@@ -129,7 +133,7 @@
 ;; 8. mismatch
 
 ;;    The widget value is not valid member of the :type specified for the
-;;    option. 
+;;    option.
 
 ;;; Code:
 
--- a/lisp/gnus/ChangeLog	Wed Feb 23 11:24:05 2005 +0000
+++ b/lisp/gnus/ChangeLog	Wed Feb 23 11:26:15 2005 +0000
@@ -1,3 +1,8 @@
+2005-02-21  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-art.el (gnus-parse-news-url, gnus-button-handle-news):
+	Handle news URL with given port correctly.
+
 2005-02-19  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-msg.el (gnus-copy-article-buffer): Quote decoded words
--- a/lisp/gnus/gnus-art.el	Wed Feb 23 11:24:05 2005 +0000
+++ b/lisp/gnus/gnus-art.el	Wed Feb 23 11:26:15 2005 +0000
@@ -6648,15 +6648,18 @@
 		      (cons fun args)))))))
 
 (defun gnus-parse-news-url (url)
-  (let (scheme server group message-id articles)
+  (let (scheme server port group message-id articles)
     (with-temp-buffer
       (insert url)
       (goto-char (point-min))
       (when (looking-at "\\([A-Za-z]+\\):")
 	(setq scheme (match-string 1))
 	(goto-char (match-end 0)))
-      (when (looking-at "//\\([^/]+\\)/")
+      (when (looking-at "//\\([^:/]+\\)\\(:?\\)\\([0-9]+\\)?/")
 	(setq server (match-string 1))
+	(setq port (if (stringp (match-string 3))
+		       (string-to-number (match-string 3))
+		     (match-string 3)))
 	(goto-char (match-end 0)))
 
       (cond
@@ -6669,18 +6672,19 @@
 	(setq group (match-string 1)))
        (t
 	(error "Unknown news URL syntax"))))
-    (list scheme server group message-id articles)))
+    (list scheme server port group message-id articles)))
 
 (defun gnus-button-handle-news (url)
   "Fetch a news URL."
-  (destructuring-bind (scheme server group message-id articles)
+  (destructuring-bind (scheme server port group message-id articles)
       (gnus-parse-news-url url)
     (cond
      (message-id
       (save-excursion
 	(set-buffer gnus-summary-buffer)
 	(if server
-	    (let ((gnus-refer-article-method (list (list 'nntp server))))
+	    (let ((gnus-refer-article-method (list (list 'nntp server)))
+		  (nntp-port-number (or port "nntp")))
 	      (gnus-summary-refer-article message-id))
 	  (gnus-summary-refer-article message-id))))
      (group
--- a/lisp/mouse.el	Wed Feb 23 11:24:05 2005 +0000
+++ b/lisp/mouse.el	Wed Feb 23 11:26:15 2005 +0000
@@ -769,6 +769,8 @@
 
 (defun mouse-on-link-p (pos)
   "Return non-nil if POS is on a link in the current buffer.
+POS must be a buffer position in the current buffer or an mouse
+event location in the selected window, see `event-start'.
 
 A clickable link is identified by one of the following methods:
 
@@ -787,7 +789,7 @@
 
 - If the value is a function, FUNC, POS is inside a link if
 the call \(FUNC POS) returns non-nil.  Return the return value
-from that call.
+from that call.  Arg is \(posn-point POS) if POS is a mouse event,
 
 - Otherwise, return the value itself.
 
@@ -803,17 +805,22 @@
 
 - Otherwise, the mouse-1 event is translated into a mouse-2 event
 at the same position."
-  (let ((action
-	 (or (get-char-property pos 'follow-link)
-	     (save-excursion
-	       (goto-char pos)
-	       (key-binding [follow-link] nil t)))))
-    (cond
-     ((eq action 'mouse-face)
-      (and (get-char-property pos 'mouse-face) t))
-     ((functionp action)
-      (funcall action pos))
-     (t action))))
+  (if (consp pos)
+      (setq pos (and (eq (selected-window) (posn-window pos))
+		     (posn-point pos))))
+  (when pos
+    (let ((action
+	   (or (get-char-property pos 'follow-link)
+	       (save-excursion
+		 (goto-char pos)
+		 (key-binding [follow-link] nil t)))))
+      (cond
+       ((eq action 'mouse-face)
+	(and (get-char-property pos 'mouse-face) t))
+       ((functionp action)
+	(funcall action pos))
+       (t action)))))
+
 
 (defun mouse-drag-region-1 (start-event)
   (mouse-minibuffer-check start-event)
@@ -831,7 +838,9 @@
 		     (nth 3 bounds)
 		   ;; Don't count the mode line.
 		   (1- (nth 3 bounds))))
-	 on-link remap-double-click
+	 (on-link (and mouse-1-click-follows-link
+		       (eq start-window (selected-window))))
+	 remap-double-click
 	 (click-count (1- (event-click-count start-event))))
     (setq mouse-selection-click-count click-count)
     (setq mouse-selection-click-count-buffer (current-buffer))
@@ -841,7 +850,7 @@
     (if (< (point) start-point)
 	(goto-char start-point))
     (setq start-point (point))
-    (setq on-link (and mouse-1-click-follows-link
+    (setq on-link (and on-link
 		       (mouse-on-link-p start-point)))
     (setq remap-double-click (and on-link
 				  (eq mouse-1-click-follows-link 'double)
--- a/lisp/net/browse-url.el	Wed Feb 23 11:24:05 2005 +0000
+++ b/lisp/net/browse-url.el	Wed Feb 23 11:26:15 2005 +0000
@@ -1,6 +1,6 @@
 ;;; browse-url.el --- pass a URL to a WWW browser
 
-;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001, 2004
+;; Copyright (C) 1995, 96, 97, 98, 99, 2000, 2001, 2004, 2005
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Denis Howe <dbh@doc.ic.ac.uk>
@@ -387,6 +387,14 @@
   :type 'boolean
   :group 'browse-url)
 
+(defcustom browse-url-netscape-new-window-is-tab nil
+  "*Whether to open up new windows in a tab or a new window.
+If non-nil, then open the URL in a new tab rather than a new
+window if `browse-url-netscape' is asked to open it in a new
+window."
+  :type 'boolean
+  :group 'browse-url)
+
 (defcustom browse-url-new-window-flag nil
   "*If non-nil, always open a new browser window with appropriate browsers.
 Passing an interactive argument to \\[browse-url], or specific browser
@@ -834,6 +842,10 @@
 random existing one.  A non-nil interactive prefix argument reverses
 the effect of `browse-url-new-window-flag'.
 
+If `browse-url-netscape-new-window-is-tab' is non-nil, then
+whenever a document would otherwise be loaded in a new window, it
+is loaded in a new tab in an existing window instead.
+
 When called non-interactively, optional second argument NEW-WINDOW is
 used instead of `browse-url-new-window-flag'."
   (interactive (browse-url-interactive-arg "URL: "))
@@ -843,21 +855,24 @@
     (setq url (replace-match
 	       (format "%%%x" (string-to-char (match-string 0 url))) t t url)))
   (let* ((process-environment (browse-url-process-environment))
-         (process (apply 'start-process
-			 (concat "netscape " url) nil
-			 browse-url-netscape-program
-			 (append
-			  browse-url-netscape-arguments
-			  (if (eq window-system 'w32)
-			      (list url)
-			    (append
-			     (if new-window '("-noraise"))
-			     (list "-remote"
-				   (concat "openURL(" url
-					   (if (browse-url-maybe-new-window
-						new-window)
-					       ",new-window")
-					   ")"))))))))
+	 (process
+	  (apply 'start-process
+		 (concat "netscape " url) nil
+		 browse-url-netscape-program
+		 (append
+		  browse-url-netscape-arguments
+		  (if (eq window-system 'w32)
+		      (list url)
+		    (append
+		     (if new-window '("-noraise"))
+		     (list "-remote"
+			   (concat "openURL(" url
+				   (if (browse-url-maybe-new-window
+					new-window)
+				       (if browse-url-netscape-new-window-is-tab
+					   ",new-tab"
+					 ",new-window"))
+				   ")"))))))))
     (set-process-sentinel process
 			  `(lambda (process change)
 			     (browse-url-netscape-sentinel process ,url)))))
--- a/lisp/progmodes/hideif.el	Wed Feb 23 11:24:05 2005 +0000
+++ b/lisp/progmodes/hideif.el	Wed Feb 23 11:26:15 2005 +0000
@@ -958,7 +958,10 @@
 
 (defun hide-ifdef-use-define-alist (name)
   "Set `hide-ifdef-env' to the define list specified by NAME."
-  (interactive "SUse define list: ")
+  (interactive
+   (list (completing-read "Use define list: "
+			  hide-ifdef-define-alist nil t)))
+  (if (stringp name) (setq name (intern name)))
   (let ((define-list (assoc name hide-ifdef-define-alist)))
     (if define-list
 	(setq hide-ifdef-env
--- a/lisp/ps-mule.el	Wed Feb 23 11:24:05 2005 +0000
+++ b/lisp/ps-mule.el	Wed Feb 23 11:26:15 2005 +0000
@@ -1390,20 +1390,60 @@
 	  (setq string (ps-mule-string-encoding font-spec string nil t))))))
   string)
 
-;;;###autoload
-(defun ps-mule-header-string-charsets ()
-  "Return a list of character sets that appears in header strings."
-  (let* ((str (ps-header-footer-string))
-	 (len (length str))
-	 (i 0)
-	 charset-list)
-    (while (< i len)
-      (let ((charset (char-charset (aref str i))))
-	(setq i (1+ i))
-	(or (eq charset 'ascii)
-	    (memq charset charset-list)
-	    (setq charset-list (cons charset charset-list)))))
-    charset-list))
+(defun ps-mule-show-warning (charsets from to header-footer-list)
+  (let ((table (make-category-table))
+	(buf (current-buffer))
+	char-pos-list)
+    (define-category ?u "Unprintable charset" table)
+    (dolist (cs charsets)
+      (modify-category-entry (make-char cs) ?u table))
+    (with-category-table table
+      (save-excursion
+	(goto-char from)
+	(while (and (< (length char-pos-list) 20)
+		    (re-search-forward "\\cu" to t))
+	  (push (cons (preceding-char) (1- (point))) char-pos-list))
+	(setq char-pos-list (nreverse char-pos-list))))
+    (with-output-to-temp-buffer "*Warning*"
+      (with-current-buffer standard-output
+	(when char-pos-list
+	  (let ((func #'(lambda (buf pos)
+			  (when (buffer-live-p buf)
+			    (pop-to-buffer buf)
+			    (goto-char pos)))))
+	    (insert "These characters in the buffer can't be printed:\n")
+	    (dolist (elt char-pos-list)
+	      (insert " ")
+	      (insert-text-button (string (car elt))
+				  :type 'help-xref
+				  'help-echo
+				  "mouse-2, RET: jump to this character"
+				  'help-function func
+				  'help-args (list buf (cdr elt)))
+	      (insert ","))
+	    ;; Delete the last comma.
+	    (delete-char -1)
+	    (insert "\nClick them to jump to the buffer position,\n"
+		    (substitute-command-keys "\
+or \\[universal-argument] \\[what-cursor-position] will give information about them.\n"))))
+
+	(with-category-table table
+	  (let (string-list idx)
+	    (dolist (elt header-footer-list)
+	      (when (stringp elt)
+		(when (string-match "\\cu+" elt)
+		  (setq elt (copy-sequence elt))
+		  (put-text-property (match-beginning 0) (match-end 0)
+				     'face 'highlight elt)
+		  (while (string-match "\\cu+" elt (match-end 0))
+		    (put-text-property (match-beginning 0) (match-end 0)
+				       'face 'highlight elt))
+		  (push elt string-list))))
+	    (when string-list
+	      (insert
+	       "These highlighted characters in header/footer can't be printed:\n")
+	      (dolist (elt string-list)
+		(insert "  " elt "\n")))))))))
 
 ;;;###autoload
 (defun ps-mule-begin-job (from to)
@@ -1424,58 +1464,55 @@
        enable-multibyte-characters
        ;; Initialize `ps-mule-charset-list'.  If some characters aren't
        ;; printable, warn it.
-       (let ((charsets (find-charset-region from to)))
-	 (setq charsets (delq 'ascii (delq 'unknown (delq nil charsets)))
-	       ps-mule-charset-list charsets)
-	 (save-excursion
-	   (goto-char from)
-	   (and (search-forward "\200" to t)
-		(setq ps-mule-charset-list
-		      (cons 'composition ps-mule-charset-list))))
-	 ;; We also have to check non-ASCII charsets in the header strings.
-	 (let ((tail (ps-mule-header-string-charsets)))
-	   (while tail
-	     (unless (eq (car tail) 'ascii)
-	       (setq ps-mule-header-charsets
-		     (cons (car tail) ps-mule-header-charsets))
-	       (or (memq (car tail) charsets)
-		   (setq charsets (cons (car tail) charsets))))
-	     (setq tail (cdr tail))))
-	 (while charsets
-	   (setq charsets
-		 (cond
-		  ((or (eq (car charsets) 'composition)
-		       (ps-mule-printable-p (car charsets)))
-		   (cdr charsets))
-		  ((y-or-n-p
-		    "Font for some characters not found, continue anyway? ")
-		   nil)
-		  (t
-		   (error "Printing cancelled")))))))
+       (let ((header-footer-list (ps-header-footer-string))
+	     unprintable-charsets)
+	 (setq ps-mule-charset-list
+	       (delq 'ascii (delq 'eight-bit-control
+				  (delq 'eight-bit-graphic 
+					(find-charset-region from to))))
+	       ps-mule-header-charsets
+	       (delq 'ascii (delq 'eight-bit-control
+				  (delq 'eight-bit-graphic 
+					(find-charset-string
+					 (mapconcat
+					  'identity header-footer-list ""))))))
+	 (dolist (cs ps-mule-charset-list)
+	   (or (ps-mule-printable-p cs)
+	       (push cs unprintable-charsets)))
+	 (dolist (cs ps-mule-header-charsets)
+	   (or (ps-mule-printable-p cs)
+	       (memq cs unprintable-charsets)
+	       (push cs unprintable-charsets)))
+	 (when unprintable-charsets
+	   (ps-mule-show-warning unprintable-charsets from to
+				 header-footer-list)
+	   (or
+	    (y-or-n-p "Font for some characters not found, continue anyway? ")
+	    (error "Printing cancelled")))
+
+	 (or ps-mule-composition-prologue-generated
+	     (let ((use-composition (nth 2 (find-composition from to))))
+	       (or use-composition
+		   (let (str)
+		     (while header-footer-list
+		       (setq str (car header-footer-list))
+		       (if (and (stringp str)
+				(nth 2 (find-composition 0 (length str) str)))
+			   (setq use-composition t
+				 header-footer-list nil)
+			 (setq header-footer-list (cdr header-footer-list))))))
+	       (when use-composition
+		 (progn
+		   (ps-mule-prologue-generated)
+		   (ps-output-prologue ps-mule-composition-prologue)
+		   (setq ps-mule-composition-prologue-generated t)))))))
 
   (setq ps-mule-current-charset 'ascii)
 
-  (if (and (nth 2 (find-composition from to))
-	   (not ps-mule-composition-prologue-generated))
-      (progn
-	(ps-mule-prologue-generated)
-	(ps-output-prologue ps-mule-composition-prologue)
-	(setq ps-mule-composition-prologue-generated t)))
-
   (if (or ps-mule-charset-list ps-mule-header-charsets)
-      (let ((the-list (append ps-mule-header-charsets ps-mule-charset-list))
-	    font-spec elt)
+      (dolist (elt (append ps-mule-header-charsets ps-mule-charset-list))
 	(ps-mule-prologue-generated)
-	;; If external functions are necessary, generate prologues for them.
-	(while the-list
-	  (setq elt (car the-list)
-		the-list (cdr the-list))
-	  (cond ((and (eq elt 'composition)
-		      (not ps-mule-composition-prologue-generated))
-		 (ps-output-prologue ps-mule-composition-prologue)
-		 (setq ps-mule-composition-prologue-generated t))
-		((setq font-spec (ps-mule-get-font-spec elt 'normal))
-		 (ps-mule-init-external-library font-spec))))))
+	(ps-mule-init-external-library (ps-mule-get-font-spec elt 'normal))))
 
   ;; If ASCII font is also specified in ps-mule-font-info-database,
   ;; use it instead of what specified in ps-font-info-database.
@@ -1496,7 +1533,8 @@
   ;; If the header contains non-ASCII and non-Latin1 characters, prepare a font
   ;; and glyphs for the first occurrence of such characters.
   (if (and ps-mule-header-charsets
-	   (not (eq (car ps-mule-header-charsets) 'latin-iso8859-1)))
+	   (not (eq (car ps-mule-header-charsets) 'latin-iso8859-1))
+	   (= (charset-dimension (car ps-mule-header-charsets)) 1))
       (let ((font-spec (ps-mule-get-font-spec (car ps-mule-header-charsets)
 					      'normal)))
 	(if font-spec
--- a/lisp/ps-print.el	Wed Feb 23 11:24:05 2005 +0000
+++ b/lisp/ps-print.el	Wed Feb 23 11:26:15 2005 +0000
@@ -4855,9 +4855,7 @@
   (and ps-print-footer
        (setq ps-lf-cache (ps-generate-string-list ps-left-footer)
 	     ps-rf-cache (ps-generate-string-list ps-right-footer)))
-  (mapconcat 'identity
-	     (append ps-lh-cache ps-rh-cache ps-lf-cache ps-rf-cache)
-	     ""))
+  (append ps-lh-cache ps-rh-cache ps-lf-cache ps-rf-cache))
 
 ;; These functions insert the arrays that define the contents of the headers.
 
--- a/lisp/tooltip.el	Wed Feb 23 11:24:05 2005 +0000
+++ b/lisp/tooltip.el	Wed Feb 23 11:26:15 2005 +0000
@@ -488,7 +488,7 @@
 	     (setq pos (posn-at-x-y (car pos) (cdr pos) (car mp)))
 	     (windowp (posn-window pos)))
 	(with-current-buffer (window-buffer (posn-window pos))
-	  (if (mouse-on-link-p (posn-point pos))
+	  (if (mouse-on-link-p pos)
 	      (setq msg (concat
 		    (cond
 		     ((eq mouse-1-click-follows-link 'double) "double-")
--- a/lispref/ChangeLog	Wed Feb 23 11:24:05 2005 +0000
+++ b/lispref/ChangeLog	Wed Feb 23 11:26:15 2005 +0000
@@ -1,3 +1,13 @@
+2005-02-23  Lute Kamstra  <lute@gnu.org>
+
+	* display.texi (Managing Overlays): overlay-buffer returns nil for
+	deleted overlays.
+
+2005-02-22  Kim F. Storm  <storm@cua.dk>
+
+	* minibuf.texi (Basic Completion): Allow symbols in addition to
+	strings in try-completion and all-completions.
+
 2005-02-14  Lute Kamstra  <lute@gnu.org>
 
 	* elisp.texi (Top): Remove reference to deleted node.
--- a/lispref/display.texi	Wed Feb 23 11:24:05 2005 +0000
+++ b/lispref/display.texi	Wed Feb 23 11:26:15 2005 +0000
@@ -1339,7 +1339,8 @@
 @end defun
 
 @defun overlay-buffer overlay
-This function returns the buffer that @var{overlay} belongs to.
+This function returns the buffer that @var{overlay} belongs to.  It
+returns @code{nil}, if @var{overlay} has been deleted.
 @end defun
 
 @defun delete-overlay overlay
--- a/lispref/minibuf.texi	Wed Feb 23 11:24:05 2005 +0000
+++ b/lispref/minibuf.texi	Wed Feb 23 11:26:15 2005 +0000
@@ -595,9 +595,9 @@
 @defun try-completion string collection &optional predicate
 This function returns the longest common substring of all possible
 completions of @var{string} in @var{collection}.  The value of
-@var{collection} must be a list of strings, an alist, an obarray, a
-hash table, or a function that implements a virtual set of strings
-(see below).
+@var{collection} must be a list of strings or symbols, an alist, an
+obarray, a hash table, or a function that implements a virtual set of
+strings (see below).
 
 Completion compares @var{string} against each of the permissible
 completions specified by @var{collection}; if the beginning of the
@@ -610,11 +610,13 @@
 
 If @var{collection} is an alist (@pxref{Association Lists}), the
 permissible completions are the elements of the alist that are either
-strings or conses whose @sc{car} is a string.  Other elements of the
-alist are ignored. (Remember that in Emacs Lisp, the elements of
-alists do not @emph{have} to be conses.)  As all elements of the alist
-can be strings, this case actually includes lists of strings, even
-though we usually do not think of such lists as alists.
+strings, symbols, or conses whose @sc{car} is a string or symbol.
+Symbols are converted to strings using @code{symbol-name}.
+Other elements of the alist are ignored. (Remember that in Emacs Lisp,
+the elements of alists do not @emph{have} to be conses.)  As all
+elements of the alist can be strings, this case actually includes
+lists of strings or symbols, even though we usually do not think of
+such lists as alists.
 
 @cindex obarray in completion
 If @var{collection} is an obarray (@pxref{Creating Symbols}), the names
--- a/lispref/modes.texi	Wed Feb 23 11:24:05 2005 +0000
+++ b/lispref/modes.texi	Wed Feb 23 11:26:15 2005 +0000
@@ -1,7 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2003, 2004
-@c   Free Software Foundation, Inc.
+@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 
+@c   2003, 2004, 2005 Free Software Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @setfilename ../info/modes
 @node Modes, Documentation, Keymaps, Top
@@ -1098,8 +1098,7 @@
 @subsection Defining Minor Modes
 
   The macro @code{define-minor-mode} offers a convenient way of
-implementing a mode in one self-contained definition.  It supports only
-buffer-local minor modes, not global ones.
+implementing a mode in one self-contained definition.
 
 @defmac define-minor-mode mode doc [init-value [lighter [keymap keyword-args... body...]]]
 @tindex define-minor-mode
--- a/src/ChangeLog	Wed Feb 23 11:24:05 2005 +0000
+++ b/src/ChangeLog	Wed Feb 23 11:26:15 2005 +0000
@@ -1,3 +1,19 @@
+2005-02-23  Lute Kamstra  <lute@gnu.org>
+
+	* buffer.c (Foverlay_buffer): Doc fix.
+
+2005-02-22  Kim F. Storm  <storm@cua.dk>
+
+	* minibuf.c (Ftry_completion, Fall_completions): Allow both string
+	and symbol keys in alists and hash tables.
+
+	* xdisp.c (fast_find_position): Fix search for start of overlay.
+
+2005-02-21  Kim F. Storm  <storm@cua.dk>
+
+	* window.c (window_scroll_pixel_based): When scrolling backwards,
+	handle partial visible line at end of window even when we hit PT.
+
 2005-02-21  Stefan  <monnier@iro.umontreal.ca>
 
 	* keymap.h: Declare Fcurrent_active_maps, used in doc.c.
--- a/src/buffer.c	Wed Feb 23 11:24:05 2005 +0000
+++ b/src/buffer.c	Wed Feb 23 11:26:15 2005 +0000
@@ -1,6 +1,6 @@
 /* Buffer manipulation primitives for GNU Emacs.
-   Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999, 2000, 2001, 02, 03, 2004
-	Free Software Foundation, Inc.
+   Copyright (C) 1985, 86, 87, 88, 89, 93, 94, 95, 97, 98, 99, 
+     2000, 01, 02, 03, 04, 2005 Free Software Foundation, Inc. 
 
 This file is part of GNU Emacs.
 
@@ -3830,7 +3830,8 @@
 }
 
 DEFUN ("overlay-buffer", Foverlay_buffer, Soverlay_buffer, 1, 1, 0,
-       doc: /* Return the buffer OVERLAY belongs to.  */)
+       doc: /* Return the buffer OVERLAY belongs to.
+Return nil if OVERLAY has been deleted.  */)
      (overlay)
        Lisp_Object overlay;
 {
--- a/src/minibuf.c	Wed Feb 23 11:24:05 2005 +0000
+++ b/src/minibuf.c	Wed Feb 23 11:26:15 2005 +0000
@@ -1186,13 +1186,16 @@
 DEFUN ("try-completion", Ftry_completion, Stry_completion, 2, 3, 0,
        doc: /* Return common substring of all completions of STRING in ALIST.
 Each car of each element of ALIST (or each element if it is not a cons cell)
-is tested to see if it begins with STRING.
+is tested to see if it begins with STRING.  The possible matches may be
+strings or symbols.  Symbols are converted to strings before testing,
+see `symbol-name'.
 All that match are compared together; the longest initial sequence
 common to all matches is returned as a string.
 If there is no match at all, nil is returned.
 For a unique match which is exact, t is returned.
 
-If ALIST is a hash-table, all the string keys are the possible matches.
+If ALIST is a hash-table, all the string and symbol keys are the
+possible matches.
 If ALIST is an obarray, the names of all symbols in the obarray
 are the possible matches.
 
@@ -1262,7 +1265,7 @@
 	  if (!EQ (bucket, zero))
 	    {
 	      elt = bucket;
-	      eltstring = Fsymbol_name (elt);
+	      eltstring = elt;
 	      if (XSYMBOL (bucket)->next)
 		XSETSYMBOL (bucket, XSYMBOL (bucket)->next);
 	      else
@@ -1289,6 +1292,9 @@
 
       /* Is this element a possible completion? */
 
+      if (SYMBOLP (eltstring))
+	eltstring = Fsymbol_name (eltstring);
+
       if (STRINGP (eltstring)
 	  && SCHARS (string) <= SCHARS (eltstring)
 	  && (tem = Fcompare_strings (eltstring, zero,
@@ -1445,10 +1451,13 @@
 DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 4, 0,
        doc: /* Search for partial matches to STRING in ALIST.
 Each car of each element of ALIST (or each element if it is not a cons cell)
-is tested to see if it begins with STRING.
+is tested to see if it begins with STRING.  The possible matches may be
+strings or symbols.  Symbols are converted to strings before testing,
+see `symbol-name'.
 The value is a list of all the strings from ALIST that match.
 
-If ALIST is a hash-table, all the string keys are the possible matches.
+If ALIST is a hash-table, all the string and symbol keys are the
+possible matches.
 If ALIST is an obarray, the names of all symbols in the obarray
 are the possible matches.
 
@@ -1517,7 +1526,7 @@
 	  if (!EQ (bucket, zero))
 	    {
 	      elt = bucket;
-	      eltstring = Fsymbol_name (elt);
+	      eltstring = elt;
 	      if (XSYMBOL (bucket)->next)
 		XSETSYMBOL (bucket, XSYMBOL (bucket)->next);
 	      else
@@ -1544,6 +1553,9 @@
 
       /* Is this element a possible completion? */
 
+      if (SYMBOLP (eltstring))
+	eltstring = Fsymbol_name (eltstring);
+
       if (STRINGP (eltstring)
 	  && SCHARS (string) <= SCHARS (eltstring)
 	  /* If HIDE_SPACES, reject alternatives that start with space
--- a/src/window.c	Wed Feb 23 11:24:05 2005 +0000
+++ b/src/window.c	Wed Feb 23 11:26:15 2005 +0000
@@ -4765,6 +4765,7 @@
   else if (n < 0)
     {
       int charpos, bytepos;
+      int partial_p;
 
       /* Save our position, for the preserve_y case.  */
       charpos = IT_CHARPOS (it);
@@ -4776,7 +4777,20 @@
 		  it.last_visible_y - this_scroll_margin - 1, -1,
 		  MOVE_TO_POS | MOVE_TO_Y);
 
-      if (IT_CHARPOS (it) == PT)
+      /* Save our position, in case it's correct.  */
+      charpos = IT_CHARPOS (it);
+      bytepos = IT_BYTEPOS (it);
+
+      /* See if point is on a partially visible line at the end.  */
+      if (it.what == IT_EOB)
+	partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y;
+      else
+	{
+	  move_it_by_lines (&it, 1, 1);
+	  partial_p = it.current_y > it.last_visible_y;
+	}
+
+      if (charpos == PT && !partial_p)
 	/* We found PT before we found the display margin, so PT is ok.  */
 	;
       else if (preserve_y >= 0)
@@ -4797,14 +4811,7 @@
 	}
       else
 	{
-	  /* Save our position, in case it's correct.  */
-	  charpos = IT_CHARPOS (it);
-	  bytepos = IT_BYTEPOS (it);
-
-	  /* See if point is on a partially visible line at the end.  */
-	  move_it_by_lines (&it, 1, 1);
-
-	  if (it.current_y > it.last_visible_y)
+	  if (partial_p)
 	    /* The last line was only partially visible, so back up two
 	       lines to make sure we're on a fully visible line.  */
 	    {
--- a/src/xdisp.c	Wed Feb 23 11:24:05 2005 +0000
+++ b/src/xdisp.c	Wed Feb 23 11:26:15 2005 +0000
@@ -20776,7 +20776,7 @@
      have a STOP object and previous row's end glyph came from STOP.  */
   if (!NILP (stop))
     {
-      struct glyph_row *prev = row-1;
+      struct glyph_row *prev;
       while ((prev = row - 1, prev >= first)
 	     && MATRIX_ROW_END_CHARPOS (prev) == charpos
 	     && prev->used[TEXT_AREA] > 0)
@@ -20785,8 +20785,8 @@
 	  glyph = end + prev->used[TEXT_AREA];
 	  while (--glyph >= end
 		 && INTEGERP (glyph->object));
-	  if (glyph >= end
-	      && !EQ (stop, glyph->object))
+	  if (glyph < end
+	      || !EQ (stop, glyph->object))
 	    break;
 	  row = prev;
 	}