changeset 107727:d3652b82ebe3

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Wed, 31 Mar 2010 21:55:47 +0000
parents 618b73d33723 (current diff) 98f7a4103e8e (diff)
children 56e62ae17d17
files
diffstat 11 files changed, 113 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Wed Mar 31 06:53:45 2010 +0000
+++ b/etc/NEWS	Wed Mar 31 21:55:47 2010 +0000
@@ -132,12 +132,14 @@
 ** Image API
 
 *** When the image type is one of listed in `image-animated-types'
-and the number of sub-images in the image is more then one, then the
+and the number of sub-images in the image is more than one, then the
 new function `create-animated-image' creates an animated image where
 sub-images are displayed successively with the duration defined by
 `image-animate-max-time' and the delay between sub-images defined
 by the Graphic Control Extension of the image.
 
+*** `image-extension-data' is renamed to `image-metadata'.
+
 ** Progress reporters can now "spin".
 The MIN-VALUE and MAX-VALUE arguments of `make-progress-reporter' can
 now be nil, or omitted.  This makes a "non-numeric" reporter.  Each
--- a/lisp/ChangeLog	Wed Mar 31 06:53:45 2010 +0000
+++ b/lisp/ChangeLog	Wed Mar 31 21:55:47 2010 +0000
@@ -1,3 +1,21 @@
+2010-03-31  Juri Linkov  <juri@jurta.org>
+
+	* simple.el (next-line, previous-line): Re-throw a signal
+	with `signal' instead of using `ding'.
+	http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01432.html
+
+2010-03-31  Juri Linkov  <juri@jurta.org>
+
+	* simple.el (keyboard-escape-quit): Raise deselecting the active
+	region higher than exiting the minibuffer.
+	http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg00904.html
+
+2010-03-31  Juri Linkov  <juri@jurta.org>
+
+	* image.el (image-animated-p): Use `image-metadata' instead of
+	`image-extension-data'.  Get GIF extenstion data from metadata
+	property `extension-data'.
+
 2010-03-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* simple.el (append-to-buffer): Simplify.
--- a/lisp/image.el	Wed Mar 31 06:53:45 2010 +0000
+++ b/lisp/image.el	Wed Mar 31 21:55:47 2010 +0000
@@ -681,8 +681,9 @@
 shall be displayed."
   (cond
    ((eq (plist-get (cdr image) :type) 'gif)
-    (let* ((extdata (image-extension-data image))
-	   (images (plist-get extdata 'count))
+    (let* ((metadata (image-metadata image))
+	   (images (plist-get metadata 'count))
+	   (extdata (plist-get metadata 'extension-data))
 	   (anim (plist-get extdata #xF9)))
       (and (integerp images) (> images 1)
 	   (stringp anim) (>= (length anim) 4)
--- a/lisp/simple.el	Wed Mar 31 06:53:45 2010 +0000
+++ b/lisp/simple.el	Wed Mar 31 21:55:47 2010 +0000
@@ -4003,9 +4003,10 @@
 	    (insert (if use-hard-newlines hard-newline "\n")))
 	(line-move arg nil nil try-vscroll))
     (if (called-interactively-p 'interactive)
-	(condition-case nil
+	(condition-case err
 	    (line-move arg nil nil try-vscroll)
-	  ((beginning-of-buffer end-of-buffer) (ding)))
+	  ((beginning-of-buffer end-of-buffer)
+	   (signal (car err) (cdr err))))
       (line-move arg nil nil try-vscroll)))
   nil)
 
@@ -4033,9 +4034,10 @@
   (interactive "^p\np")
   (or arg (setq arg 1))
   (if (called-interactively-p 'interactive)
-      (condition-case nil
+      (condition-case err
 	  (line-move (- arg) nil nil try-vscroll)
-	((beginning-of-buffer end-of-buffer) (ding)))
+	((beginning-of-buffer end-of-buffer)
+	 (signal (car err) (cdr err))))
     (line-move (- arg) nil nil try-vscroll))
   nil)
 
@@ -5490,12 +5492,12 @@
 or go back to just one window (by deleting all but the selected window)."
   (interactive)
   (cond ((eq last-command 'mode-exited) nil)
+	((region-active-p)
+	 (deactivate-mark))
 	((> (minibuffer-depth) 0)
 	 (abort-recursive-edit))
 	(current-prefix-arg
 	 nil)
-	((region-active-p)
-	 (deactivate-mark))
 	((> (recursion-depth) 0)
 	 (exit-recursive-edit))
 	(buffer-quit-function
--- a/src/ChangeLog	Wed Mar 31 06:53:45 2010 +0000
+++ b/src/ChangeLog	Wed Mar 31 21:55:47 2010 +0000
@@ -1,3 +1,26 @@
+2010-03-31  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Clean up BSD_SYSTEM use.
+	* xterm.c:
+	* process.c:
+	* emacs.c: Use HAVE_SYS_IOCTL_H instead of BSD_SYSTEM as a guard
+	for including <sys/ioctl.h>.
+	* sysdep.c (wait_without_blocking): Remove BSD_SYSTEM case, this
+	code is only used for MSDOS.
+
+2010-03-31  Juri Linkov  <juri@jurta.org>
+
+	* image.c: Add `Qextension_data'.
+	(syms_of_image): Initialize and staticpro `Qextension_data'.
+	(Fimage_metadata): Rename from `Fimage_extension_data'.
+	(gif_load): Put GIF extension data to the property
+	`Qextension_data'.
+
+2010-03-31  Eli Zaretskii  <eliz@gnu.org>
+
+	* xdisp.c (highlight_trailing_whitespace): Support highlight of
+	trailing whitespace in right-to-left rows.
+
 2010-03-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	Get rid of the direct_output optimizations.
--- a/src/emacs.c	Wed Mar 31 06:53:45 2010 +0000
+++ b/src/emacs.c	Wed Mar 31 21:55:47 2010 +0000
@@ -32,7 +32,7 @@
 #include <unistd.h>
 #endif
 
-#ifdef BSD_SYSTEM
+#ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 #endif
 
--- a/src/image.c	Wed Mar 31 06:53:45 2010 +0000
+++ b/src/image.c	Wed Mar 31 21:55:47 2010 +0000
@@ -604,7 +604,7 @@
 extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile;
 extern Lisp_Object QCdata, QCtype;
 extern Lisp_Object Qcenter;
-Lisp_Object QCascent, QCmargin, QCrelief, Qcount;
+Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data;
 Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
 Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask;
 
@@ -1011,8 +1011,8 @@
   return mask;
 }
 
-DEFUN ("image-extension-data", Fimage_extension_data, Simage_extension_data, 1, 2, 0,
-       doc: /* Return extension data for image SPEC.
+DEFUN ("image-metadata", Fimage_metadata, Simage_metadata, 1, 2, 0,
+       doc: /* Return metadata for image SPEC.
 FRAME is the frame on which the image will be displayed.  FRAME nil
 or omitted means use the selected frame.  */)
      (spec, frame)
@@ -7169,7 +7169,7 @@
      struct frame *f;
      struct image *img;
 {
-  /* IMG->data.ptr_val may contain extension data.  */
+  /* IMG->data.ptr_val may contain metadata with extension data.  */
   img->data.lisp_val = Qnil;
   x_clear_image (f, img);
 }
@@ -7488,8 +7488,8 @@
 	  }
     }
 
-  /* Save GIF image extension data for `image-extension-data'.
-     Format is (count IMAGES FUNCTION "BYTES" ...).  */
+  /* Save GIF image extension data for `image-metadata'.
+     Format is (count IMAGES extension-data (FUNCTION "BYTES" ...)).  */
   img->data.lisp_val = Qnil;
   if (gif->SavedImages[ino].ExtensionBlockCount > 0)
     {
@@ -7499,7 +7499,9 @@
 	img->data.lisp_val = Fcons (make_unibyte_string (ext->Bytes, ext->ByteCount),
 				    Fcons (make_number (ext->Function),
 					   img->data.lisp_val));
-      img->data.lisp_val = Fnreverse (img->data.lisp_val);
+      img->data.lisp_val = Fcons (Qextension_data,
+				  Fcons (Fnreverse (img->data.lisp_val),
+					 Qnil));
     }
   if (gif->ImageCount > 1)
     img->data.lisp_val = Fcons (Qcount,
@@ -8403,6 +8405,8 @@
 
   Qcount = intern_c_string ("count");
   staticpro (&Qcount);
+  Qextension_data = intern_c_string ("extension-data");
+  staticpro (&Qextension_data);
 
   QCascent = intern_c_string (":ascent");
   staticpro (&QCascent);
@@ -8498,7 +8502,7 @@
   defsubr (&Simage_refresh);
   defsubr (&Simage_size);
   defsubr (&Simage_mask_p);
-  defsubr (&Simage_extension_data);
+  defsubr (&Simage_metadata);
 
 #if GLYPH_DEBUG
   defsubr (&Simagep);
--- a/src/process.c	Wed Mar 31 06:53:45 2010 +0000
+++ b/src/process.c	Wed Mar 31 21:55:47 2010 +0000
@@ -69,12 +69,12 @@
 #endif
 #endif /* HAVE_SOCKETS */
 
-#if defined(BSD_SYSTEM)
+#if defined(HAVE_SYS_IOCTL_H)
 #include <sys/ioctl.h>
 #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5)
 #include <fcntl.h>
 #endif /* HAVE_PTYS and no O_NDELAY */
-#endif /* BSD_SYSTEM */
+#endif /* HAVE_SYS_IOCTL_H */
 
 #ifdef NEED_BSDTTY
 #include <bsdtty.h>
--- a/src/sysdep.c	Wed Mar 31 06:53:45 2010 +0000
+++ b/src/sysdep.c	Wed Mar 31 21:55:47 2010 +0000
@@ -384,11 +384,7 @@
 
 wait_without_blocking ()
 {
-#ifdef BSD_SYSTEM
-  wait3 (0, WNOHANG | WUNTRACED, 0);
-#else
   croak ("wait_without_blocking");
-#endif
   synch_process_alive = 0;
 }
 
--- a/src/xdisp.c	Wed Mar 31 06:53:45 2010 +0000
+++ b/src/xdisp.c	Wed Mar 31 21:55:47 2010 +0000
@@ -16868,19 +16868,37 @@
       struct glyph *start = row->glyphs[TEXT_AREA];
       struct glyph *glyph = start + used - 1;
 
+      if (row->reversed_p)
+	{
+	  /* Right-to-left rows need to be processed in the opposite
+	     direction, so swap the edge pointers. */
+	  glyph = start;
+	  start = row->glyphs[TEXT_AREA] + used - 1;
+	}
+
       /* Skip over glyphs inserted to display the cursor at the
 	 end of a line, for extending the face of the last glyph
 	 to the end of the line on terminals, and for truncation
 	 and continuation glyphs.  */
-      while (glyph >= start
-	     && glyph->type == CHAR_GLYPH
-	     && INTEGERP (glyph->object))
-	--glyph;
+      if (!row->reversed_p)
+	{
+	  while (glyph >= start
+		 && glyph->type == CHAR_GLYPH
+		 && INTEGERP (glyph->object))
+	    --glyph;
+	}
+      else
+	{
+	  while (glyph <= start
+		 && glyph->type == CHAR_GLYPH
+		 && INTEGERP (glyph->object))
+	    ++glyph;
+	}
 
       /* If last glyph is a space or stretch, and it's trailing
 	 whitespace, set the face of all trailing whitespace glyphs in
 	 IT->glyph_row to `trailing-whitespace'.  */
-      if (glyph >= start
+      if ((row->reversed_p ? glyph <= start : glyph >= start)
 	  && BUFFERP (glyph->object)
 	  && (glyph->type == STRETCH_GLYPH
 	      || (glyph->type == CHAR_GLYPH
@@ -16891,12 +16909,24 @@
 	  if (face_id < 0)
 	    return;
 
-	  while (glyph >= start
-		 && BUFFERP (glyph->object)
-		 && (glyph->type == STRETCH_GLYPH
-		     || (glyph->type == CHAR_GLYPH
-			 && glyph->u.ch == ' ')))
-	    (glyph--)->face_id = face_id;
+	  if (!row->reversed_p)
+	    {
+	      while (glyph >= start
+		     && BUFFERP (glyph->object)
+		     && (glyph->type == STRETCH_GLYPH
+			 || (glyph->type == CHAR_GLYPH
+			     && glyph->u.ch == ' ')))
+		(glyph--)->face_id = face_id;
+	    }
+	  else
+	    {
+	      while (glyph <= start
+		     && BUFFERP (glyph->object)
+		     && (glyph->type == STRETCH_GLYPH
+			 || (glyph->type == CHAR_GLYPH
+			     && glyph->u.ch == ' ')))
+		(glyph++)->face_id = face_id;
+	    }
 	}
     }
 }
--- a/src/xterm.c	Wed Mar 31 06:53:45 2010 +0000
+++ b/src/xterm.c	Wed Mar 31 21:55:47 2010 +0000
@@ -50,9 +50,9 @@
 #include <sys/types.h>
 #endif /* makedev */
 
-#ifdef BSD_SYSTEM
+#ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
-#endif /* ! defined (BSD_SYSTEM) */
+#endif /* ! defined (HAVE_SYS_IOCTL_H) */
 
 #include "systime.h"