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
This commit is contained in:
Miles Bader 2007-05-17 01:12:58 +00:00
commit 97b362e7ac
9 changed files with 62 additions and 34 deletions

View file

@ -58,7 +58,9 @@ http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01113.html
** 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

View file

@ -5013,7 +5013,7 @@ of multiline constructs so that such constructs get properly recognized.
*** 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.

View file

@ -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

View file

@ -102,8 +102,9 @@ as it is by default."
;; 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)

View file

@ -1360,10 +1360,10 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
(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 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
[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 @@ The idea is to set this buffer-locally in special dired buffers.")
(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

View file

@ -2120,8 +2120,20 @@ 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)
;; 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 @@ associated with that interpreter in `interpreter-mode-alist'.")
. 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 @@ call FUNCTION, provided that `magic-mode-alist' and `auto-mode-alist'
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 @@ only set the major mode, if that would change it."
(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 @@ only set the major mode, if that would change it."
(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)

View file

@ -616,7 +616,7 @@ the text at the beginning of the buffer matches @var{regexp} and
@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

View file

@ -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.

View file

@ -9164,15 +9164,16 @@ mac_get_mouse_btn (EventRef ref)
/* 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 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
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 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
NULL, &key_code);
if (err == noErr)
{
eventRec->what = keyDown;
eventRec->what = action;
eventRec->message = char_codes | ((key_code & 0xff) << 8);
result = 1;
}