# HG changeset patch # User Miles Bader # Date 1179364378 0 # Node ID cf532dffa6eff8c788d6882386c0ccdde250dbca # Parent a624fe7396ce021cae21abf45b50534bea6f9f7d# Parent 9844e2d783f63b0a74af3eb3e305e22f22f2393b Merge from emacs--rel--22 Patches applied: * emacs--rel--22 (patch 18) - Update from CVS 2007-05-16 Richard Stallman * lisp/buff-menu.el (Buffer-menu-sort-column): Doc fix. 2007-05-16 Stefan Monnier * 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 * 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 diff -r a624fe7396ce -r cf532dffa6ef admin/FOR-RELEASE --- 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 diff -r a624fe7396ce -r cf532dffa6ef etc/NEWS --- 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. diff -r a624fe7396ce -r cf532dffa6ef lisp/ChangeLog --- 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 + + * buff-menu.el (Buffer-menu-sort-column): Doc fix. + +2007-05-16 Stefan Monnier + + * 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 (tiny change) * progmodes/compile.el (compilation-handle-exit): Quote first diff -r a624fe7396ce -r cf532dffa6ef lisp/buff-menu.el --- 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) diff -r a624fe7396ce -r cf532dffa6ef lisp/dired.el --- 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 diff -r a624fe7396ce -r cf532dffa6ef lisp/files.el --- 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 + + * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert + dead key repeat and up events. + 2007-05-14 Chong Yidong * image.c (pbm_load): Check image size for monochrome pbm. diff -r a624fe7396ce -r cf532dffa6ef src/macterm.c --- 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; }