changeset 80941:cf532dffa6ef

Merge from emacs--rel--22 Patches applied: * emacs--rel--22 (patch 18) - Update from CVS 2007-05-16 Richard Stallman <rms@gnu.org> * lisp/buff-menu.el (Buffer-menu-sort-column): Doc fix. 2007-05-16 Stefan Monnier <monnier@iro.umontreal.ca> * lisp/files.el (magic-mode-alist, magic-fallback-mode-alist): Move the *ml, Postscript, and XmCD entries to the fallback part. * lisp/files.el (magic-fallback-mode-alist): Rename from file-start-mode-alist. 2007-05-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> * src/macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert dead key repeat and up events. Revision: emacs@sv.gnu.org/emacs--devo--0--patch-753
author Miles Bader <miles@gnu.org>
date Thu, 17 May 2007 01:12:58 +0000
parents a624fe7396ce (current diff) 9844e2d783f6 (diff)
children af3248515da1
files admin/FOR-RELEASE etc/NEWS lisp/ChangeLog lisp/dired.el src/ChangeLog
diffstat 9 files changed, 62 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/admin/FOR-RELEASE	Wed May 16 15:46:07 2007 +0000
+++ b/admin/FOR-RELEASE	Thu May 17 01:12:58 2007 +0000
@@ -58,7 +58,9 @@
 
 ** Install vc-hooks.el patch from trunk.
 
-** Move some items from magic-mode-alist to file-start-mode-alist.
+** Move some items from magic-mode-alist to magic-fallback-mode-alist.
+
+** cloos@jhcloos.com, May 11: A redisplay bug in 22.0.99
 
 * DOCUMENTATION
 
--- a/etc/NEWS	Wed May 16 15:46:07 2007 +0000
+++ b/etc/NEWS	Thu May 17 01:12:58 2007 +0000
@@ -5013,7 +5013,7 @@
 *** New variable `magic-mode-alist' determines major mode for a file by
 looking at the file contents.  It takes precedence over `auto-mode-alist'.
 
-*** New variable `file-start-mode-alist' determines major mode for a file by
+*** New variable `magic-fallback-mode-alist' determines major mode for a file by
 looking at the file contents.  It is handled after `auto-mode-alist',
 only if `auto-mode-alist' (and `magic-mode-alist') says nothing about the file.
 
--- a/lisp/ChangeLog	Wed May 16 15:46:07 2007 +0000
+++ b/lisp/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -1,3 +1,15 @@
+2007-05-16  Richard Stallman  <rms@gnu.org>
+
+	* buff-menu.el (Buffer-menu-sort-column): Doc fix.
+
+2007-05-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* files.el (magic-mode-alist, magic-fallback-mode-alist):
+	Move the *ml, Postscript, and XmCD entries to the fallback part.
+
+	* files.el (magic-fallback-mode-alist):
+	Rename from file-start-mode-alist.
+
 2007-05-16  Nikolaj Schumacher  <n_schumacher@web.de>  (tiny change)
 
 	* progmodes/compile.el (compilation-handle-exit): Quote first
--- a/lisp/buff-menu.el	Wed May 16 15:46:07 2007 +0000
+++ b/lisp/buff-menu.el	Thu May 17 01:12:58 2007 +0000
@@ -102,8 +102,9 @@
 
 ;; This should get updated & resorted when you click on a column heading
 (defvar Buffer-menu-sort-column nil
-  "2 for sorting by buffer names, 5 for sorting by file names,
-or nil for default sorting by visited order.")
+  "Which column to sort the menu on.
+Use 2 to sort by buffer names, or 5 to sort by file names.
+nil means sort by visited order (the default).")
 
 (defconst Buffer-menu-buffer-column 4)
 
--- a/lisp/dired.el	Wed May 16 15:46:07 2007 +0000
+++ b/lisp/dired.el	Thu May 17 01:12:58 2007 +0000
@@ -1360,10 +1360,10 @@
     (define-key map
       [menu-bar regexp image-dired-mark-tagged-files]
       '(menu-item "Mark From Image Tag..." image-dired-mark-tagged-files
-                  :help "Mark files whose image tags matches regexp"))    
-    
+                  :help "Mark files whose image tags matches regexp"))
+
     (define-key map [menu-bar regexp dashes-1]
-      '("--"))    
+      '("--"))
 
     (define-key map [menu-bar regexp downcase]
       '(menu-item "Downcase" dired-downcase
@@ -1471,9 +1471,9 @@
       [menu-bar operate image-dired-display-thumbs]
       '(menu-item "Display Image-Dired" image-dired-display-thumbs
                   :help "Display image-dired for current or marked image files"))
-    
+
     (define-key map [menu-bar operate dashes-3]
-      '("--"))    
+      '("--"))
 
     (define-key map [menu-bar operate query-replace]
       '(menu-item "Query Replace in Files..." dired-do-query-replace-regexp
@@ -3101,7 +3101,7 @@
   (when (eq major-mode 'dired-mode)
     (setq mode-name
 	  (let (case-fold-search)
-	    (cond ((string-match 
+	    (cond ((string-match
 		    dired-sort-by-name-regexp dired-actual-switches)
 		   "Dired by name")
 		  ((string-match
--- a/lisp/files.el	Wed May 16 15:46:07 2007 +0000
+++ b/lisp/files.el	Thu May 17 01:12:58 2007 +0000
@@ -2120,8 +2120,20 @@
 associated with that interpreter in `interpreter-mode-alist'.")
 
 (defvar magic-mode-alist
-  `((image-type-auto-detected-p . image-mode)
-    ;; The < comes before the groups (but the first) to reduce backtracking.
+  `((image-type-auto-detected-p . image-mode))
+  "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
+buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will
+call FUNCTION rather than allowing `auto-mode-alist' to decide the buffer's
+major mode.
+
+If FUNCTION is nil, then it is not called.  (That is a way of saying
+\"allow `auto-mode-alist' to decide for these files.\")")
+(put 'magic-mode-alist 'risky-local-variable t)
+
+(defvar magic-fallback-mode-alist
+  `(;; 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 "\\(?:[^-]\\|-[^-]\\)")
@@ -2140,19 +2152,6 @@
      . sgml-mode)
     ("%!PS" . ps-mode)
     ("# xmcd " . conf-unix-mode))
-  "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
-buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will
-call FUNCTION rather than allowing `auto-mode-alist' to decide the buffer's
-major mode.
-
-If FUNCTION is nil, then it is not called.  (That is a way of saying
-\"allow `auto-mode-alist' to decide for these files.\")")
-(put 'magic-mode-alist 'risky-local-variable t)
-
-(defvar file-start-mode-alist
-  nil
   "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'.
 Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION).
 After visiting a file, if REGEXP matches the text at the beginning of the
@@ -2161,11 +2160,11 @@
 have not specified a mode for this file.
 
 If FUNCTION is nil, then it is not called.")
-(put 'file-start-mode-alist 'risky-local-variable t)
+(put 'magic-fallback-mode-alist 'risky-local-variable t)
 
 (defvar magic-mode-regexp-match-limit 4000
   "Upper limit on `magic-mode-alist' regexp matches.
-Also applies to `file-start-mode-alist'.")
+Also applies to `magic-fallback-mode-alist'.")
 
 (defun set-auto-mode (&optional keep-mode-if-same)
   "Select major mode appropriate for current buffer.
@@ -2284,7 +2283,7 @@
 	      (when mode
 		(set-auto-mode-0 mode keep-mode-if-same)
 		(setq done t))))))
-    ;; Next try matching the buffer beginning against file-start-mode-alist.
+    ;; Next try matching the buffer beginning against magic-fallback-mode-alist.
     (unless done
       (if (setq done (save-excursion
 		       (goto-char (point-min))
@@ -2292,7 +2291,7 @@
 			 (narrow-to-region (point-min)
 					   (min (point-max)
 						(+ (point-min) magic-mode-regexp-match-limit)))
-			 (assoc-default nil file-start-mode-alist
+			 (assoc-default nil magic-fallback-mode-alist
 					(lambda (re dummy)
 					  (if (functionp re)
 					      (funcall re)
--- a/lispref/modes.texi	Wed May 16 15:46:07 2007 +0000
+++ b/lispref/modes.texi	Thu May 17 01:12:58 2007 +0000
@@ -616,7 +616,7 @@
 @code{auto-mode-alist} gets to decide the mode.
 @end defvar
 
-@defvar file-start-mode-alist
+@defvar magic-fallback-mode-alist
 This works like @code{magic-mode-alist}, except that it is handled
 only if @code{auto-mode-alist} does not specify a mode for this file.
 @end defvar
--- a/src/ChangeLog	Wed May 16 15:46:07 2007 +0000
+++ b/src/ChangeLog	Thu May 17 01:12:58 2007 +0000
@@ -1,3 +1,8 @@
+2007-05-16  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert
+	dead key repeat and up events.
+
 2007-05-14  Chong Yidong  <cyd@stupidchicken.com>
 
 	* image.c (pbm_load): Check image size for monochrome pbm.
--- a/src/macterm.c	Wed May 16 15:46:07 2007 +0000
+++ b/src/macterm.c	Thu May 17 01:12:58 2007 +0000
@@ -9164,15 +9164,16 @@
 
 /* Normally, ConvertEventRefToEventRecord will correctly handle all
    events.  However the click of the mouse wheel is not converted to a
-   mouseDown or mouseUp event.  Likewise for dead key down events.
-   This calls ConvertEventRef, but then checks to see if it is a mouse
-   up/down, or a dead key down carbon event that has not been
+   mouseDown or mouseUp event.  Likewise for dead key events.  This
+   calls ConvertEventRefToEventRecord, but then checks to see if it is
+   a mouse up/down, or a dead key Carbon event that has not been
    converted, and if so, converts it by hand (to be picked up in the
    XTread_socket loop).  */
 static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
 {
   OSStatus err;
   Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec);
+  EventKind action;
 
   if (result)
     return result;
@@ -9201,6 +9202,14 @@
       switch (GetEventKind (eventRef))
 	{
 	case kEventRawKeyDown:
+	  action = keyDown;
+	  goto keystroke_common;
+	case kEventRawKeyRepeat:
+	  action = autoKey;
+	  goto keystroke_common;
+	case kEventRawKeyUp:
+	  action = keyUp;
+	keystroke_common:
 	  {
 	    unsigned char char_codes;
 	    UInt32 key_code;
@@ -9214,7 +9223,7 @@
 				       NULL, &key_code);
 	    if (err == noErr)
 	      {
-		eventRec->what = keyDown;
+		eventRec->what = action;
 		eventRec->message = char_codes | ((key_code & 0xff) << 8);
 		result = 1;
 	      }