diff options
| author | Miles Bader | 2007-05-17 01:12:58 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-05-17 01:12:58 +0000 |
| commit | 97b362e7ac1a1bdd3ca1a22cd7328634f88e6247 (patch) | |
| tree | 27954e985aa0a39ad7b2f4ca949879f056d920e4 | |
| parent | 7883a44f5a0cb5967837e8843c2f048d9d4d0300 (diff) | |
| parent | 84bbd894e3366bec7efa97f7b78d1dcdfef46ad7 (diff) | |
| download | emacs-97b362e7ac1a1bdd3ca1a22cd7328634f88e6247.tar.gz emacs-97b362e7ac1a1bdd3ca1a22cd7328634f88e6247.zip | |
Merge from emacs--rel--22
Patches applied:
* emacs--rel--22 (patch 18)
- Update from CVS
2007-05-16 Richard M. 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
| -rw-r--r-- | admin/FOR-RELEASE | 4 | ||||
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | lisp/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/buff-menu.el | 5 | ||||
| -rw-r--r-- | lisp/dired.el | 12 | ||||
| -rw-r--r-- | lisp/files.el | 37 | ||||
| -rw-r--r-- | lispref/modes.texi | 2 | ||||
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/macterm.c | 17 |
9 files changed, 62 insertions, 34 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index d6584f61a9e..1ba475eccfe 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE | |||
| @@ -58,7 +58,9 @@ http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01113.html | |||
| 58 | 58 | ||
| 59 | ** Install vc-hooks.el patch from trunk. | 59 | ** Install vc-hooks.el patch from trunk. |
| 60 | 60 | ||
| 61 | ** Move some items from magic-mode-alist to file-start-mode-alist. | 61 | ** Move some items from magic-mode-alist to magic-fallback-mode-alist. |
| 62 | |||
| 63 | ** cloos@jhcloos.com, May 11: A redisplay bug in 22.0.99 | ||
| 62 | 64 | ||
| 63 | * DOCUMENTATION | 65 | * DOCUMENTATION |
| 64 | 66 | ||
| @@ -5013,7 +5013,7 @@ of multiline constructs so that such constructs get properly recognized. | |||
| 5013 | *** New variable `magic-mode-alist' determines major mode for a file by | 5013 | *** New variable `magic-mode-alist' determines major mode for a file by |
| 5014 | looking at the file contents. It takes precedence over `auto-mode-alist'. | 5014 | looking at the file contents. It takes precedence over `auto-mode-alist'. |
| 5015 | 5015 | ||
| 5016 | *** New variable `file-start-mode-alist' determines major mode for a file by | 5016 | *** New variable `magic-fallback-mode-alist' determines major mode for a file by |
| 5017 | looking at the file contents. It is handled after `auto-mode-alist', | 5017 | looking at the file contents. It is handled after `auto-mode-alist', |
| 5018 | only if `auto-mode-alist' (and `magic-mode-alist') says nothing about the file. | 5018 | only if `auto-mode-alist' (and `magic-mode-alist') says nothing about the file. |
| 5019 | 5019 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5d1f57ed14e..679659bbe35 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2007-05-16 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * buff-menu.el (Buffer-menu-sort-column): Doc fix. | ||
| 4 | |||
| 5 | 2007-05-16 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 6 | |||
| 7 | * files.el (magic-mode-alist, magic-fallback-mode-alist): | ||
| 8 | Move the *ml, Postscript, and XmCD entries to the fallback part. | ||
| 9 | |||
| 10 | * files.el (magic-fallback-mode-alist): | ||
| 11 | Rename from file-start-mode-alist. | ||
| 12 | |||
| 1 | 2007-05-16 Nikolaj Schumacher <n_schumacher@web.de> (tiny change) | 13 | 2007-05-16 Nikolaj Schumacher <n_schumacher@web.de> (tiny change) |
| 2 | 14 | ||
| 3 | * progmodes/compile.el (compilation-handle-exit): Quote first | 15 | * progmodes/compile.el (compilation-handle-exit): Quote first |
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index f3deec529e5..a6e24b5343e 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el | |||
| @@ -102,8 +102,9 @@ as it is by default." | |||
| 102 | 102 | ||
| 103 | ;; This should get updated & resorted when you click on a column heading | 103 | ;; This should get updated & resorted when you click on a column heading |
| 104 | (defvar Buffer-menu-sort-column nil | 104 | (defvar Buffer-menu-sort-column nil |
| 105 | "2 for sorting by buffer names, 5 for sorting by file names, | 105 | "Which column to sort the menu on. |
| 106 | or nil for default sorting by visited order.") | 106 | Use 2 to sort by buffer names, or 5 to sort by file names. |
| 107 | nil means sort by visited order (the default).") | ||
| 107 | 108 | ||
| 108 | (defconst Buffer-menu-buffer-column 4) | 109 | (defconst Buffer-menu-buffer-column 4) |
| 109 | 110 | ||
diff --git a/lisp/dired.el b/lisp/dired.el index b2026d19c15..4244954d467 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -1360,10 +1360,10 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." | |||
| 1360 | (define-key map | 1360 | (define-key map |
| 1361 | [menu-bar regexp image-dired-mark-tagged-files] | 1361 | [menu-bar regexp image-dired-mark-tagged-files] |
| 1362 | '(menu-item "Mark From Image Tag..." image-dired-mark-tagged-files | 1362 | '(menu-item "Mark From Image Tag..." image-dired-mark-tagged-files |
| 1363 | :help "Mark files whose image tags matches regexp")) | 1363 | :help "Mark files whose image tags matches regexp")) |
| 1364 | 1364 | ||
| 1365 | (define-key map [menu-bar regexp dashes-1] | 1365 | (define-key map [menu-bar regexp dashes-1] |
| 1366 | '("--")) | 1366 | '("--")) |
| 1367 | 1367 | ||
| 1368 | (define-key map [menu-bar regexp downcase] | 1368 | (define-key map [menu-bar regexp downcase] |
| 1369 | '(menu-item "Downcase" dired-downcase | 1369 | '(menu-item "Downcase" dired-downcase |
| @@ -1471,9 +1471,9 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." | |||
| 1471 | [menu-bar operate image-dired-display-thumbs] | 1471 | [menu-bar operate image-dired-display-thumbs] |
| 1472 | '(menu-item "Display Image-Dired" image-dired-display-thumbs | 1472 | '(menu-item "Display Image-Dired" image-dired-display-thumbs |
| 1473 | :help "Display image-dired for current or marked image files")) | 1473 | :help "Display image-dired for current or marked image files")) |
| 1474 | 1474 | ||
| 1475 | (define-key map [menu-bar operate dashes-3] | 1475 | (define-key map [menu-bar operate dashes-3] |
| 1476 | '("--")) | 1476 | '("--")) |
| 1477 | 1477 | ||
| 1478 | (define-key map [menu-bar operate query-replace] | 1478 | (define-key map [menu-bar operate query-replace] |
| 1479 | '(menu-item "Query Replace in Files..." dired-do-query-replace-regexp | 1479 | '(menu-item "Query Replace in Files..." dired-do-query-replace-regexp |
| @@ -3101,7 +3101,7 @@ The idea is to set this buffer-locally in special dired buffers.") | |||
| 3101 | (when (eq major-mode 'dired-mode) | 3101 | (when (eq major-mode 'dired-mode) |
| 3102 | (setq mode-name | 3102 | (setq mode-name |
| 3103 | (let (case-fold-search) | 3103 | (let (case-fold-search) |
| 3104 | (cond ((string-match | 3104 | (cond ((string-match |
| 3105 | dired-sort-by-name-regexp dired-actual-switches) | 3105 | dired-sort-by-name-regexp dired-actual-switches) |
| 3106 | "Dired by name") | 3106 | "Dired by name") |
| 3107 | ((string-match | 3107 | ((string-match |
diff --git a/lisp/files.el b/lisp/files.el index a2d9192246a..322b28f293e 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2120,8 +2120,20 @@ of the regular expression. The mode is then determined as the mode | |||
| 2120 | associated with that interpreter in `interpreter-mode-alist'.") | 2120 | associated with that interpreter in `interpreter-mode-alist'.") |
| 2121 | 2121 | ||
| 2122 | (defvar magic-mode-alist | 2122 | (defvar magic-mode-alist |
| 2123 | `((image-type-auto-detected-p . image-mode) | 2123 | `((image-type-auto-detected-p . image-mode)) |
| 2124 | ;; The < comes before the groups (but the first) to reduce backtracking. | 2124 | "Alist of buffer beginnings vs. corresponding major mode functions. |
| 2125 | Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). | ||
| 2126 | After visiting a file, if REGEXP matches the text at the beginning of the | ||
| 2127 | buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will | ||
| 2128 | call FUNCTION rather than allowing `auto-mode-alist' to decide the buffer's | ||
| 2129 | major mode. | ||
| 2130 | |||
| 2131 | If FUNCTION is nil, then it is not called. (That is a way of saying | ||
| 2132 | \"allow `auto-mode-alist' to decide for these files.\")") | ||
| 2133 | (put 'magic-mode-alist 'risky-local-variable t) | ||
| 2134 | |||
| 2135 | (defvar magic-fallback-mode-alist | ||
| 2136 | `(;; The < comes before the groups (but the first) to reduce backtracking. | ||
| 2125 | ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff. | 2137 | ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff. |
| 2126 | ;; We use [ \t\r\n] instead of `\\s ' to make regex overflow less likely. | 2138 | ;; We use [ \t\r\n] instead of `\\s ' to make regex overflow less likely. |
| 2127 | (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") | 2139 | (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") |
| @@ -2140,19 +2152,6 @@ associated with that interpreter in `interpreter-mode-alist'.") | |||
| 2140 | . sgml-mode) | 2152 | . sgml-mode) |
| 2141 | ("%!PS" . ps-mode) | 2153 | ("%!PS" . ps-mode) |
| 2142 | ("# xmcd " . conf-unix-mode)) | 2154 | ("# xmcd " . conf-unix-mode)) |
| 2143 | "Alist of buffer beginnings vs. corresponding major mode functions. | ||
| 2144 | Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). | ||
| 2145 | After visiting a file, if REGEXP matches the text at the beginning of the | ||
| 2146 | buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will | ||
| 2147 | call FUNCTION rather than allowing `auto-mode-alist' to decide the buffer's | ||
| 2148 | major mode. | ||
| 2149 | |||
| 2150 | If FUNCTION is nil, then it is not called. (That is a way of saying | ||
| 2151 | \"allow `auto-mode-alist' to decide for these files.\")") | ||
| 2152 | (put 'magic-mode-alist 'risky-local-variable t) | ||
| 2153 | |||
| 2154 | (defvar file-start-mode-alist | ||
| 2155 | nil | ||
| 2156 | "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'. | 2155 | "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'. |
| 2157 | Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). | 2156 | Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). |
| 2158 | After visiting a file, if REGEXP matches the text at the beginning of the | 2157 | After visiting a file, if REGEXP matches the text at the beginning of the |
| @@ -2161,11 +2160,11 @@ call FUNCTION, provided that `magic-mode-alist' and `auto-mode-alist' | |||
| 2161 | have not specified a mode for this file. | 2160 | have not specified a mode for this file. |
| 2162 | 2161 | ||
| 2163 | If FUNCTION is nil, then it is not called.") | 2162 | If FUNCTION is nil, then it is not called.") |
| 2164 | (put 'file-start-mode-alist 'risky-local-variable t) | 2163 | (put 'magic-fallback-mode-alist 'risky-local-variable t) |
| 2165 | 2164 | ||
| 2166 | (defvar magic-mode-regexp-match-limit 4000 | 2165 | (defvar magic-mode-regexp-match-limit 4000 |
| 2167 | "Upper limit on `magic-mode-alist' regexp matches. | 2166 | "Upper limit on `magic-mode-alist' regexp matches. |
| 2168 | Also applies to `file-start-mode-alist'.") | 2167 | Also applies to `magic-fallback-mode-alist'.") |
| 2169 | 2168 | ||
| 2170 | (defun set-auto-mode (&optional keep-mode-if-same) | 2169 | (defun set-auto-mode (&optional keep-mode-if-same) |
| 2171 | "Select major mode appropriate for current buffer. | 2170 | "Select major mode appropriate for current buffer. |
| @@ -2284,7 +2283,7 @@ only set the major mode, if that would change it." | |||
| 2284 | (when mode | 2283 | (when mode |
| 2285 | (set-auto-mode-0 mode keep-mode-if-same) | 2284 | (set-auto-mode-0 mode keep-mode-if-same) |
| 2286 | (setq done t)))))) | 2285 | (setq done t)))))) |
| 2287 | ;; Next try matching the buffer beginning against file-start-mode-alist. | 2286 | ;; Next try matching the buffer beginning against magic-fallback-mode-alist. |
| 2288 | (unless done | 2287 | (unless done |
| 2289 | (if (setq done (save-excursion | 2288 | (if (setq done (save-excursion |
| 2290 | (goto-char (point-min)) | 2289 | (goto-char (point-min)) |
| @@ -2292,7 +2291,7 @@ only set the major mode, if that would change it." | |||
| 2292 | (narrow-to-region (point-min) | 2291 | (narrow-to-region (point-min) |
| 2293 | (min (point-max) | 2292 | (min (point-max) |
| 2294 | (+ (point-min) magic-mode-regexp-match-limit))) | 2293 | (+ (point-min) magic-mode-regexp-match-limit))) |
| 2295 | (assoc-default nil file-start-mode-alist | 2294 | (assoc-default nil magic-fallback-mode-alist |
| 2296 | (lambda (re dummy) | 2295 | (lambda (re dummy) |
| 2297 | (if (functionp re) | 2296 | (if (functionp re) |
| 2298 | (funcall re) | 2297 | (funcall re) |
diff --git a/lispref/modes.texi b/lispref/modes.texi index 6d9aabefbe8..95fbe6a292f 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi | |||
| @@ -616,7 +616,7 @@ the text at the beginning of the buffer matches @var{regexp} and | |||
| 616 | @code{auto-mode-alist} gets to decide the mode. | 616 | @code{auto-mode-alist} gets to decide the mode. |
| 617 | @end defvar | 617 | @end defvar |
| 618 | 618 | ||
| 619 | @defvar file-start-mode-alist | 619 | @defvar magic-fallback-mode-alist |
| 620 | This works like @code{magic-mode-alist}, except that it is handled | 620 | This works like @code{magic-mode-alist}, except that it is handled |
| 621 | only if @code{auto-mode-alist} does not specify a mode for this file. | 621 | only if @code{auto-mode-alist} does not specify a mode for this file. |
| 622 | @end defvar | 622 | @end defvar |
diff --git a/src/ChangeLog b/src/ChangeLog index dc488f6bca7..0be2766fdbe 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-05-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * macterm.c [USE_CARBON_EVENTS] (mac_convert_event_ref): Also convert | ||
| 4 | dead key repeat and up events. | ||
| 5 | |||
| 1 | 2007-05-14 Chong Yidong <cyd@stupidchicken.com> | 6 | 2007-05-14 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 7 | ||
| 3 | * image.c (pbm_load): Check image size for monochrome pbm. | 8 | * image.c (pbm_load): Check image size for monochrome pbm. |
diff --git a/src/macterm.c b/src/macterm.c index bee1af5ab71..1acb521f47b 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -9164,15 +9164,16 @@ mac_get_mouse_btn (EventRef ref) | |||
| 9164 | 9164 | ||
| 9165 | /* Normally, ConvertEventRefToEventRecord will correctly handle all | 9165 | /* Normally, ConvertEventRefToEventRecord will correctly handle all |
| 9166 | events. However the click of the mouse wheel is not converted to a | 9166 | events. However the click of the mouse wheel is not converted to a |
| 9167 | mouseDown or mouseUp event. Likewise for dead key down events. | 9167 | mouseDown or mouseUp event. Likewise for dead key events. This |
| 9168 | This calls ConvertEventRef, but then checks to see if it is a mouse | 9168 | calls ConvertEventRefToEventRecord, but then checks to see if it is |
| 9169 | up/down, or a dead key down carbon event that has not been | 9169 | a mouse up/down, or a dead key Carbon event that has not been |
| 9170 | converted, and if so, converts it by hand (to be picked up in the | 9170 | converted, and if so, converts it by hand (to be picked up in the |
| 9171 | XTread_socket loop). */ | 9171 | XTread_socket loop). */ |
| 9172 | static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) | 9172 | static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) |
| 9173 | { | 9173 | { |
| 9174 | OSStatus err; | 9174 | OSStatus err; |
| 9175 | Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec); | 9175 | Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec); |
| 9176 | EventKind action; | ||
| 9176 | 9177 | ||
| 9177 | if (result) | 9178 | if (result) |
| 9178 | return result; | 9179 | return result; |
| @@ -9201,6 +9202,14 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) | |||
| 9201 | switch (GetEventKind (eventRef)) | 9202 | switch (GetEventKind (eventRef)) |
| 9202 | { | 9203 | { |
| 9203 | case kEventRawKeyDown: | 9204 | case kEventRawKeyDown: |
| 9205 | action = keyDown; | ||
| 9206 | goto keystroke_common; | ||
| 9207 | case kEventRawKeyRepeat: | ||
| 9208 | action = autoKey; | ||
| 9209 | goto keystroke_common; | ||
| 9210 | case kEventRawKeyUp: | ||
| 9211 | action = keyUp; | ||
| 9212 | keystroke_common: | ||
| 9204 | { | 9213 | { |
| 9205 | unsigned char char_codes; | 9214 | unsigned char char_codes; |
| 9206 | UInt32 key_code; | 9215 | UInt32 key_code; |
| @@ -9214,7 +9223,7 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) | |||
| 9214 | NULL, &key_code); | 9223 | NULL, &key_code); |
| 9215 | if (err == noErr) | 9224 | if (err == noErr) |
| 9216 | { | 9225 | { |
| 9217 | eventRec->what = keyDown; | 9226 | eventRec->what = action; |
| 9218 | eventRec->message = char_codes | ((key_code & 0xff) << 8); | 9227 | eventRec->message = char_codes | ((key_code & 0xff) << 8); |
| 9219 | result = 1; | 9228 | result = 1; |
| 9220 | } | 9229 | } |