Commit 68380acf authored by Miles Bader's avatar Miles Bader
Browse files

Merge from emacs--rel--22

Patches applied:

 * emacs--rel--22  (patch 13)

   - Update from CVS

2007-05-10  Richard M. Stallman  <rms@gnu.org>

   * lisp/international/iso-cvt.el (iso-cvt-read-only): Ignore arguments.
   (iso-cvt-write-only): Likewise.

   * lisp/emacs-lisp/easy-mmode.el (define-minor-mode):
   Fix generated doc string.

   * lisp/startup.el (fancy-splash-text): Add URL of guided tour.
   Adjust horizontal and vertical whitespace.

   * lisp/progmodes/compile.el (compilation-handle-exit):
   Use run-hook-with-args to run compilation-finish-functions.

   * lisp/files.el (file-start-mode-alist): New variable.
   (magic-mode-regexp-match-limit): Doc fix.
   (set-auto-mode): Handle file-start-mode-alist.
   A little cleanup of structure.

2007-05-10  Richard M. Stallman  <rms@gnu.org>

   * lispref/keymaps.texi (Scanning Keymaps): Update where-is-internal example.

   * lispref/help.texi (Keys in Documentation): Add reference to
   Documentation Tips.

   * lispref/files.texi (Format Conversion): TO-FN gets three arguments.

   * lispref/modes.texi (Auto Major Mode): Document file-start-mode-alist.

Revision: emacs@sv.gnu.org/emacs--devo--0--patch-743
parents e2e75068 a484846f
......@@ -56,7 +56,9 @@ http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01113.html
** Takaaki.Ota@am.sony.com, May 2: table cell menu does not appear at the menubar
Bug is intermittent.
** david.reitter@gmail.com, May 4: Euro sign bound, Pound sign not bound. (Bug?)
** Install python.el `with' patch from trunk.
** Install vc-hooks.el patch from trunk.
* DOCUMENTATION
......
......@@ -5013,6 +5013,10 @@ 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
looking at the file contents. It is handled after `auto-mode-alist',
only if `auto-mode-alist' says nothing about the file.
*** XML or SGML major mode is selected when file starts with an `<?xml'
or `<!DOCTYPE' declaration.
......
2007-05-10 Richard Stallman <rms@gnu.org>
* international/iso-cvt.el (iso-cvt-read-only): Ignore arguments.
(iso-cvt-write-only): Likewise.
* emacs-lisp/easy-mmode.el (define-minor-mode):
Fix generated doc string.
* startup.el (fancy-splash-text): Add URL of guided tour.
Adjust horizontal and vertical whitespace.
* progmodes/compile.el (compilation-handle-exit):
Use run-hook-with-args to run compilation-finish-functions.
* files.el (file-start-mode-alist): New variable.
(magic-mode-regexp-match-limit): Doc fix.
(set-auto-mode): Handle file-start-mode-alist.
A little cleanup of structure.
2007-05-10 Micha,Ak(Bl Cadilhac <michael@cadilhac.name>
 
* man.el (Man-next-section): Don't consider the last line of the page
......@@ -197,7 +197,7 @@ Use the command `%s' to change this variable." pretty-name mode))
(let ((base-doc-string
(concat "Non-nil if %s is enabled.
See the command `%s' for a description of this minor-mode."
See the command `%s' for a description of this minor mode."
(if body "
Setting this variable directly does not take effect;
either customize it (see the info node `Easy Customization')
......
......@@ -2151,8 +2151,21 @@ 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
buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will
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)
(defvar magic-mode-regexp-match-limit 4000
"Upper limit on `magic-mode-alist' regexp matches.")
"Upper limit on `magic-mode-alist' regexp matches.
Also applies to `file-start-mode-alist'.")
(defun set-auto-mode (&optional keep-mode-if-same)
"Select major mode appropriate for current buffer.
......@@ -2207,10 +2220,10 @@ only set the major mode, if that would change it."
(or (set-auto-mode-0 mode keep-mode-if-same)
;; continuing would call minor modes again, toggling them off
(throw 'nop nil))))))
;; If we didn't, look for an interpreter specified in the first line.
;; As a special case, allow for things like "#!/bin/env perl", which
;; finds the interpreter anywhere in $PATH.
(unless done
;; If we didn't, look for an interpreter specified in the first line.
;; As a special case, allow for things like "#!/bin/env perl", which
;; finds the interpreter anywhere in $PATH.
(setq mode (save-excursion
(goto-char (point-min))
(if (looking-at auto-mode-interpreter-regexp)
......@@ -2223,7 +2236,7 @@ only set the major mode, if that would change it."
;; If we found an interpreter mode to use, invoke it now.
(if done
(set-auto-mode-0 (cdr done) keep-mode-if-same)))
;; If we didn't, match the buffer beginning against magic-mode-alist.
;; Next try matching the buffer beginning against magic-mode-alist.
(unless done
(if (setq done (save-excursion
(goto-char (point-min))
......@@ -2236,39 +2249,55 @@ only set the major mode, if that would change it."
(if (functionp re)
(funcall re)
(looking-at re)))))))
(set-auto-mode-0 done keep-mode-if-same)
;; Compare the filename against the entries in auto-mode-alist.
(if buffer-file-name
(let ((name buffer-file-name))
;; Remove backup-suffixes from file name.
(setq name (file-name-sans-versions name))
(while name
;; Find first matching alist entry.
(setq mode
(if (memq system-type '(vax-vms windows-nt cygwin))
;; System is case-insensitive.
(let ((case-fold-search t))
(assoc-default name auto-mode-alist
'string-match))
;; System is case-sensitive.
(or
;; First match case-sensitively.
(let ((case-fold-search nil))
(assoc-default name auto-mode-alist
'string-match))
;; Fallback to case-insensitive match.
(and auto-mode-case-fold
(let ((case-fold-search t))
(assoc-default name auto-mode-alist
'string-match))))))
(if (and mode
(consp mode)
(cadr mode))
(setq mode (car mode)
name (substring name 0 (match-beginning 0)))
(setq name))
(when mode
(set-auto-mode-0 mode keep-mode-if-same)))))))))
(set-auto-mode-0 done keep-mode-if-same)))
;; Next compare the filename against the entries in auto-mode-alist.
(unless done
(if buffer-file-name
(let ((name buffer-file-name))
;; Remove backup-suffixes from file name.
(setq name (file-name-sans-versions name))
(while name
;; Find first matching alist entry.
(setq mode
(if (memq system-type '(vax-vms windows-nt cygwin))
;; System is case-insensitive.
(let ((case-fold-search t))
(assoc-default name auto-mode-alist
'string-match))
;; System is case-sensitive.
(or
;; First match case-sensitively.
(let ((case-fold-search nil))
(assoc-default name auto-mode-alist
'string-match))
;; Fallback to case-insensitive match.
(and auto-mode-case-fold
(let ((case-fold-search t))
(assoc-default name auto-mode-alist
'string-match))))))
(if (and mode
(consp mode)
(cadr mode))
(setq mode (car mode)
name (substring name 0 (match-beginning 0)))
(setq name))
(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.
(unless done
(if (setq done (save-excursion
(goto-char (point-min))
(save-restriction
(narrow-to-region (point-min)
(min (point-max)
(+ (point-min) magic-mode-regexp-match-limit)))
(assoc-default nil file-start-mode-alist
(lambda (re dummy)
(if (functionp re)
(funcall re)
(looking-at re)))))))
(set-auto-mode-0 done keep-mode-if-same)))))
;; When `keep-mode-if-same' is set, we are working on behalf of
;; set-visited-file-name. In that case, if the major mode specified is the
......
......@@ -823,13 +823,13 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
(iso-translate-conventions from to iso-sgml2iso-trans-tab))
;;;###autoload
(defun iso-cvt-read-only ()
(defun iso-cvt-read-only (&rest ignore)
"Warn that format is read-only."
(interactive)
(error "This format is read-only; specify another format for writing"))
;;;###autoload
(defun iso-cvt-write-only ()
(defun iso-cvt-write-only (&rest ignore)
"Warn that format is write-only."
(interactive)
(error "This format is write-only"))
......
......@@ -1448,10 +1448,7 @@ Turning the mode on runs the normal hook `compilation-minor-mode-hook'."
(with-no-warnings
(if compilation-finish-function
(funcall compilation-finish-function (current-buffer) msg)))
(let ((functions compilation-finish-functions))
(while functions
(funcall (car functions) (current-buffer) msg)
(setq functions (cdr functions))))))
(run-hook-with-args compilation-finish-functions (current-buffer) msg)))
;; Called when compilation process changes state.
(defun compilation-sentinel (proc msg)
......
......@@ -1149,21 +1149,25 @@ regardless of the value of this variable."
"\n")))
:face variable-pitch "\
Emacs FAQ\t\tFrequently asked questions and answers
View Emacs Manual\tView the Emacs manual using Info
View Emacs Manual\t\tView the Emacs manual using Info
Absence of Warranty\tGNU Emacs comes with "
:face (variable-pitch :slant oblique)
"ABSOLUTELY NO WARRANTY\n"
:face variable-pitch
"\
Copying Conditions\tConditions for redistributing and changing Emacs
Copying Conditions\t\tConditions for redistributing and changing Emacs
Getting New Versions\tHow to obtain the latest version of Emacs
More Manuals / Ordering Manuals Buying printed manuals from the FSF\n")
(:face variable-pitch
"To quit a partially entered command, type "
"\nTo quit a partially entered command, type "
:face default
"Control-g"
:face variable-pitch
".\n"
".
Emacs Guided Tour\t\tSee http://www.gnu.org/software/emacs/tour/
"
:face (variable-pitch :weight bold)
"Useful File menu items:\n"
:face variable-pitch
......@@ -1176,13 +1180,7 @@ More Manuals / Ordering Manuals Buying printed manuals from the FSF\n")
"Control-c"
:face variable-pitch
")
Recover Crashed Session\tRecover files you were editing before a crash
"
Recover Crashed Session\tRecover files you were editing before a crash\n"
))
"A list of texts to show in the middle part of splash screens.
Each element in the list should be a list of strings or pairs
......
2007-05-10 Richard Stallman <rms@gnu.org>
* keymaps.texi (Scanning Keymaps): Update where-is-internal example.
* help.texi (Keys in Documentation): Add reference to
Documentation Tips.
* files.texi (Format Conversion): TO-FN gets three arguments.
* modes.texi (Auto Major Mode): Document file-start-mode-alist.
2007-05-10 Thien-Thi Nguyen <ttn@gnuvola.org>
* elisp.texi (Top): Remove "Saving Properties" from detailed menu.
......
......@@ -2903,9 +2903,10 @@ convert the usual Emacs data representation into this format.
If @var{to-fn} is a string, it is a shell command; Emacs runs the
command as a filter to perform the conversion.
If @var{to-fn} is a function, it is called with two arguments, @var{begin}
and @var{end}, which specify the part of the buffer it should convert.
There are two ways it can do the conversion:
If @var{to-fn} is a function, it is called with three arguments:
@var{begin} and @var{end}, which specify the part of the buffer it
should convert, and @var{buffer}, which specifies which buffer. There
are two ways it can do the conversion:
@itemize @bullet
@item
......
......@@ -384,6 +384,10 @@ C-g abort-recursive-edit
@end group
@end smallexample
There are other special conventions for the text in documentation
strings---for instance, you can refer to functions, variables, and
sections of this manual. @xref{Documentation Tips}, for details.
@node Describing Characters
@section Describing Characters for Help Messages
@cindex describe characters and events
......
......@@ -1895,7 +1895,8 @@ other command. However, if @var{no-remap} is non-@code{nil}.
@smallexample
@group
(where-is-internal 'describe-function)
@result{} ("\^hf" "\^hd")
@result{} ([8 102] [f1 102] [help 102]
[menu-bar help-menu describe describe-function])
@end group
@end smallexample
@end defun
......
......@@ -616,6 +616,11 @@ 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
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
@defvar auto-mode-alist
This variable contains an association list of file name patterns
(regular expressions) and corresponding major mode commands. Usually,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment