changeset 83626:7489e9d44b85

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 762-764) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 22-23) - Update from CVS Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-15
author Miles Bader <miles@gnu.org>
date Thu, 24 May 2007 02:14:22 +0000
parents 188795a4ee84 (current diff) afdc130c86d2 (diff)
children 422451dd396a
files configure lisp/files.el src/image.c
diffstat 12 files changed, 165 insertions(+), 85 deletions(-) [+]
line wrap: on
line diff
--- a/admin/FOR-RELEASE	Mon May 21 12:16:07 2007 +0000
+++ b/admin/FOR-RELEASE	Thu May 24 02:14:22 2007 +0000
@@ -38,22 +38,26 @@
 ** henman@it.to-be.co.jp 09 Aug 2006: ispell.el problem on Cygwin.
   (Did we decide that is unreproducible?)
 
+** eliz@gnu.org, May 20: EOL conversion of files in .tar archives
+
 * BUGS
 
-See the copy of this file on the EMACS_22_BASE branch.
-
-** rcyeske@gmail.com, April 22: Failure to build on OpenBSD macppc.
-OpenBSD compilation works on i386.
-http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg00932.html
-
-** Spurious redisplay bug not fixed.
-http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg00443.html
-http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg00732.html
+NB the definitive copy of this file for Emacs 22 is on the
+EMACS_22_BASE branch.  Any entries below are automatically copied from
+that branch.  Do not make manual changes to this file on the trunk.
 
 ** michael.ewe@arcor.de, Apr 24: 22.0.98  not starting on Solaris 10/I386
 http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01113.html
 
-** coldwell@redhat.com, May 18: 22.0.99 emacs dumper (?) problem
+* FIXES FOR EMACS 22.2
+
+Here we list small fixes that arrived too late for Emacs 22.1, but
+that should be installed on the release branch after 22.1 is released.
+
+** Changes to six pbm icons in etc/images.
+Sync change from trunk 2007-05-19.
+
+** viper and tramp should not load cl at run time.
 
 * DOCUMENTATION
 
--- a/configure	Mon May 21 12:16:07 2007 +0000
+++ b/configure	Thu May 24 02:14:22 2007 +0000
@@ -412,10 +412,10 @@
 fi
 
 test \$exitcode = 0") || {
-  echo No shell found that supports shell functions.
-  echo Please tell autoconf@gnu.org about your system,
-  echo including any error possibly output before this
-  echo message
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
 }
 
 
--- a/etc/PROBLEMS	Mon May 21 12:16:07 2007 +0000
+++ b/etc/PROBLEMS	Thu May 24 02:14:22 2007 +0000
@@ -144,6 +144,21 @@
 	 }
 	 return ret;
 
+** Emacs crashes on startup after a glibc upgrade.
+
+This is caused by a binary incompatible change to the malloc
+implementation in glibc 2.5.90-22.  As a result, Emacs binaries built
+using prior versions of glibc crash when run under 2.5.90-22.
+
+This problem was first seen in pre-release versions of Fedora 7, and
+may be fixed in the final Fedora 7 release.  To stop the crash from
+happening, first try upgrading to the newest version of glibc; if this
+does not work, rebuild Emacs with the same version of glibc that you
+will run it under.  For details, see
+
+https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=239344
+
+
 * Crash bugs
 
 ** Emacs crashes in x-popup-dialog.
--- a/lisp/ChangeLog	Mon May 21 12:16:07 2007 +0000
+++ b/lisp/ChangeLog	Thu May 24 02:14:22 2007 +0000
@@ -1,3 +1,26 @@
+2007-05-22  Katsumi Yamaoka  <yamaoka@jpl.org>  (tiny change)
+
+	* mail/mail-extr.el (mail-extract-address-components): Recognize
+	non-ASCII characters except for NBSP as words.
+
+2007-05-21  Trent Buck  <trentbuck@gmail.com>  (tiny change)
+
+	* net/rcirc.el (rcirc-fill-column): Allow `window-width'.
+	(rcirc-print): Handle `window-width'.
+	(rcirc-buffer-maximum-lines): Doc fix.
+
+2007-05-21  Chong Yidong  <cyd@stupidchicken.com>
+
+	* image-mode.el (image-toggle-display): Don't clear image cache.
+	Only use filename in image spec if the file is readable.  Call
+	image-refresh.
+
+	* image.el (image-type-from-file-name, image-type): Simplify.
+	(image-type-auto-detected-p): Don't scan auto-mode-alist.
+
+	* files.el (magic-mode-alist): Remove image-type-auto-detected-p.
+	(magic-fallback-mode-alist): Add image-type-auto-detected-p.
+
 2007-05-20  Nick Roberts  <nickrob@snap.net.nz>
 
 	* t-mouse.el (t-mouse-mode): Reset t-mouse-mode to nil if there
@@ -183,6 +206,9 @@
 	(set-auto-mode): Handle file-start-mode-alist.
 	A little cleanup of structure.
 
+	* dabbrev.el (dabbrev-eliminate-newlines):
+	Renamed from dabbrev--eliminate-newlines.  All uses changed.
+
 2007-05-10  Micha,Ak(Bl Cadilhac  <michael@cadilhac.name>
 
 	* man.el (Man-next-section): Don't consider the last line of the page
--- a/lisp/files.el	Mon May 21 12:16:07 2007 +0000
+++ b/lisp/files.el	Thu May 24 02:14:22 2007 +0000
@@ -2119,8 +2119,7 @@
 of the regular expression.  The mode is then determined as the mode
 associated with that interpreter in `interpreter-mode-alist'.")
 
-(defvar magic-mode-alist
-  `((image-type-auto-detected-p . image-mode))
+(defvar magic-mode-alist nil
   "Alist of buffer beginnings vs. corresponding major mode functions.
 Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION).
 After visiting a file, if REGEXP matches the text at the beginning of the
@@ -2133,7 +2132,8 @@
 (put 'magic-mode-alist 'risky-local-variable t)
 
 (defvar magic-fallback-mode-alist
-  `(;; The < comes before the groups (but the first) to reduce backtracking.
+  `((image-type-auto-detected-p . image-mode)
+    ;; The < comes before the groups (but the first) to reduce backtracking.
     ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff.
     ;; We use [ \t\r\n] instead of `\\s ' to make regex overflow less likely.
     (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
--- a/lisp/image-mode.el	Mon May 21 12:16:07 2007 +0000
+++ b/lisp/image-mode.el	Thu May 24 02:14:22 2007 +0000
@@ -144,16 +144,17 @@
 	    (message "Repeat this command to go back to displaying the image")))
     ;; Turn the image data into a real image, but only if the whole file
     ;; was inserted
-    (let* ((image
-	    (if (and (buffer-file-name)
-		     (not (file-remote-p (buffer-file-name)))
+    (let* ((filename (buffer-file-name))
+	   (image
+	    (if (and filename
+		     (file-readable-p filename)
+		     (not (file-remote-p filename))
 		     (not (buffer-modified-p))
 		     (not (and (boundp 'archive-superior-buffer)
 			       archive-superior-buffer))
 		     (not (and (boundp 'tar-superior-buffer)
 			       tar-superior-buffer)))
-		(progn (clear-image-cache)
-		       (create-image (buffer-file-name)))
+		(create-image filename)
 	      (create-image
 	       (string-make-unibyte
 		(buffer-substring-no-properties (point-min) (point-max)))
@@ -169,6 +170,7 @@
 	   (inhibit-read-only t)
 	   (buffer-undo-list t)
 	   (modified (buffer-modified-p)))
+      (image-refresh image)
       (add-text-properties (point-min) (point-max) props)
       (set-buffer-modified-p modified)
       ;; Inhibit the cursor when the buffer contains only an image,
--- a/lisp/image.el	Mon May 21 12:16:07 2007 +0000
+++ b/lisp/image.el	Thu May 24 02:14:22 2007 +0000
@@ -292,43 +292,28 @@
   "Determine the type of image file FILE from its name.
 Value is a symbol specifying the image type, or nil if type cannot
 be determined."
-  (let ((types image-type-file-name-regexps)
-	type)
-    (while types
-      (if (string-match (car (car types)) file)
-	  (setq type (cdr (car types))
-		types nil)
-	(setq types (cdr types))))
-    type))
+  (assoc-default file image-type-file-name-regexps 'string-match))
 
 
 ;;;###autoload
-(defun image-type (file-or-data &optional type data-p)
+(defun image-type (source &optional type data-p)
   "Determine and return image type.
-FILE-OR-DATA is an image file name or image data.
+SOURCE is an image file name or image data.
 Optional TYPE is a symbol describing the image type.  If TYPE is omitted
 or nil, try to determine the image type from its first few bytes
-of image data.  If that doesn't work, and FILE-OR-DATA is a file name,
+of image data.  If that doesn't work, and SOURCE is a file name,
 use its file extension as image type.
-Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data."
-  (when (and (not data-p) (not (stringp file-or-data)))
-    (error "Invalid image file name `%s'" file-or-data))
-  (cond ((null data-p)
-	 ;; FILE-OR-DATA is a file name.
-	 (unless (or type
-		     (setq type (image-type-from-file-header file-or-data)))
-	   (let ((extension (file-name-extension file-or-data)))
-	     (unless extension
-	       (error "Cannot determine image type"))
-	     (setq type (intern extension)))))
-	(t
-	 ;; FILE-OR-DATA contains image data.
-	 (unless type
-	   (setq type (image-type-from-data file-or-data)))))
+Optional DATA-P non-nil means SOURCE is a string containing image data."
+  (when (and (not data-p) (not (stringp source)))
+    (error "Invalid image file name `%s'" source))
   (unless type
-    (error "Cannot determine image type"))
-  (unless (symbolp type)
-    (error "Invalid image type `%s'" type))
+    (setq type (if data-p
+		   (image-type-from-data source)
+		 (or (image-type-from-file-header source)
+		     (image-type-from-file-name source))))
+    (or type (error "Cannot determine image type")))
+  (or (memq type image-types)
+      (error "Invalid image type `%s'" type))
   type)
 
 
@@ -343,30 +328,15 @@
 ;;;###autoload
 (defun image-type-auto-detected-p ()
   "Return t iff the current buffer contains an auto-detectable image.
-This function is intended to be used from `magic-mode-alist' (which see).
+This function is intended to be used from `magic-fallback-mode-alist'.
 
-First, compare the beginning of the buffer with `image-type-header-regexps'.
-If an appropriate image type is found, check if that image type can be
-autodetected using the variable `image-type-auto-detectable'.  Finally,
-if `buffer-file-name' is non-nil, check if it matches another major mode
-in `auto-mode-alist' apart from `image-mode'; if there is another match,
-the autodetection is considered to have failed.  Return t if all the above
-steps succeed."
+The buffer is considered to contain an auto-detectable image if
+its beginning matches an image type in `image-type-header-regexps',
+and that image type is present in `image-type-auto-detectable'."
   (let* ((type (image-type-from-buffer))
 	 (auto (and type (cdr (assq type image-type-auto-detectable)))))
-    (and auto
-	 (or (eq auto t) (image-type-available-p type))
-	 (or (null buffer-file-name)
-	     (not (assoc-default
-		   buffer-file-name
-		   (delq nil (mapcar 
-			      (lambda (elt)
-				(unless (memq (or (car-safe (cdr elt))
-						  (cdr elt))
-					      '(image-mode image-mode-maybe))
-				  elt))
-			      auto-mode-alist))
-		   'string-match))))))
+    (and type
+	 (or (eq auto t) (image-type-available-p type)))))
 
 
 ;;;###autoload
--- a/lisp/mail/mail-extr.el	Mon May 21 12:16:07 2007 +0000
+++ b/lisp/mail/mail-extr.el	Thu May 24 02:14:22 2007 +0000
@@ -873,7 +873,17 @@
 	      (mail-extr-nuke-char-at (point))
 	      (forward-char 1))
 	     (t
-	      (forward-word 1)))
+	      ;; Do `(forward-word 1)', recognizing non-ASCII characters
+	      ;; except Latin-1 nbsp as words.
+	      (while (progn
+		       (skip-chars-forward "^\000-\177 ")
+		       (and (not (eobp))
+			    (eq ?w (char-syntax (char-after)))
+			    (progn
+			      (forward-word 1)
+			      (and (not (eobp))
+				   (> (char-after) ?\177)
+				   (not (eq (char-after) ? )))))))))
 	    (or (eq char ?\()
 		;; At the end of first address of a multiple address header.
 		(and (eq char ?,)
--- a/lisp/net/rcirc.el	Mon May 21 12:16:07 2007 +0000
+++ b/lisp/net/rcirc.el	Thu May 24 02:14:22 2007 +0000
@@ -95,9 +95,11 @@
 
 (defcustom rcirc-fill-column nil
   "*Column beyond which automatic line-wrapping should happen.
-If nil, use value of `fill-column'.  If 'frame-width, use the
-maximum frame width."
+If nil, use value of `fill-column'.
+If `window-width', use the window's width as maximum.
+If `frame-width', use the frame's width as maximum."
   :type '(choice (const :tag "Value of `fill-column'")
+		 (const :tag "Full window width" window-width)
 		 (const :tag "Full frame width" frame-width)
 		 (integer :tag "Number of columns"))
   :group 'rcirc)
@@ -143,8 +145,7 @@
   :group 'rcirc)
 
 (defcustom rcirc-scroll-show-maximum-output t
-  "*If non-nil, scroll buffer to keep the point at the bottom of
-the window."
+  "*If non-nil, scroll buffer to keep the point at the bottom of the window."
   :type 'boolean
   :group 'rcirc)
 
@@ -1245,6 +1246,8 @@
 			   (make-string (- text-start fill-start) ?\s)))
 		      (fill-column (cond ((eq rcirc-fill-column 'frame-width)
 					  (1- (frame-width)))
+					 ((eq rcirc-fill-column 'window-width)
+					  (1- (window-width)))
 					 (rcirc-fill-column
 					  rcirc-fill-column)
 					 (t fill-column))))
--- a/lisp/paren.el	Mon May 21 12:16:07 2007 +0000
+++ b/lisp/paren.el	Thu May 24 02:14:22 2007 +0000
@@ -143,7 +143,6 @@
       (let ((oldpos (point))
 	    (dir (cond ((eq (syntax-class (syntax-after (1- (point)))) 5) -1)
                        ((eq (syntax-class (syntax-after (point)))      4) 1)))
-	    (window-start (window-start))
 	    pos mismatch face)
 	;;
 	;; Find the other end of the sexp.
@@ -248,13 +247,7 @@
 	  ;;
 	  ;; Always set the overlay face, since it varies.
 	  (overlay-put show-paren-overlay 'priority show-paren-priority)
-	  (overlay-put show-paren-overlay 'face face))
-	;; If there are continued lines, the above operations can
-	;; force redisplay to recenter the window (since there is no
-	;; way for it to know that the overlay changes to the buffer
-	;; are harmless).  So reset the window-start.
-	(unless (window-minibuffer-p)
-	  (set-window-start (selected-window) window-start)))
+	  (overlay-put show-paren-overlay 'face face)))
     ;; show-paren-mode is nil in this buffer.
     (and show-paren-overlay
 	 (delete-overlay show-paren-overlay))
--- a/src/ChangeLog	Mon May 21 12:16:07 2007 +0000
+++ b/src/ChangeLog	Thu May 24 02:14:22 2007 +0000
@@ -1,3 +1,8 @@
+2007-05-21  Chong Yidong  <cyd@stupidchicken.com>
+
+	* image.c (uncache_image): New function.
+	(Fimage_refresh): New function.
+
 2007-05-20  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* Makefile.in: Move GPM check outside HAVE_X_WINDOWS.
--- a/src/image.c	Mon May 21 12:16:07 2007 +0000
+++ b/src/image.c	Thu May 24 02:14:22 2007 +0000
@@ -1631,6 +1631,27 @@
 }
 
 
+/* Search frame F for an images with spec SPEC, and free it.  */
+
+static void
+uncache_image (f, spec)
+     struct frame *f;
+     Lisp_Object spec;
+{
+  struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
+  struct image *img = IMAGE_FROM_ID (f, lookup_image (f, spec));
+  unsigned hash = sxhash (spec, 0);
+  int i = hash % IMAGE_CACHE_BUCKETS_SIZE;
+
+  for (img = c->buckets[i]; img; img = img->next)
+    if (img->hash == hash && !NILP (Fequal (img->spec, spec)))
+      {
+	free_image (f, img);
+	break;
+      }
+}
+
+
 /* Free image cache of frame F.  Be aware that X frames share images
    caches.  */
 
@@ -1741,6 +1762,36 @@
 }
 
 
+DEFUN ("image-refresh", Fimage_refresh, Simage_refresh,
+       1, 2, 0,
+       doc: /* Refresh the image with specification SPEC on frame FRAME.
+If SPEC specifies an image file, the displayed image is updated with
+the current contents of that file.
+FRAME nil or omitted means use the selected frame.
+FRAME t means refresh the image on all frames.  */)
+     (spec, frame)
+     Lisp_Object spec, frame;
+{
+  if (!valid_image_p (spec))
+    error ("Invalid image specification");
+
+  if (EQ (frame, Qt))
+    {
+      Lisp_Object tail;
+      FOR_EACH_FRAME (tail, frame)
+	{
+	  struct frame *f = XFRAME (frame);
+	  if (FRAME_WINDOW_P (f))
+	    uncache_image (f, spec);
+	}
+    }
+  else
+    uncache_image (check_x_frame (frame), spec);
+
+  return Qnil;
+}
+
+
 /* Compute masks and transform image IMG on frame F, as specified
    by the image's specification,  */
 
@@ -8662,6 +8713,7 @@
 
   defsubr (&Sinit_image_library);
   defsubr (&Sclear_image_cache);
+  defsubr (&Simage_refresh);
   defsubr (&Simage_size);
   defsubr (&Simage_mask_p);
   defsubr (&Simage_extension_data);