aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2007-05-11 04:44:30 +0000
committerMiles Bader2007-05-11 04:44:30 +0000
commit68380acf41d91014634d625e5f529cd3f773fbd4 (patch)
tree8285c9f7ccc674484bb1d945192c5e2441ac81d6
parente2e7506851231cb87c2e025dc8ba06ad95053de9 (diff)
parenta484846f80a3adae6f85b6fb897a6ae9887b32fb (diff)
downloademacs-68380acf41d91014634d625e5f529cd3f773fbd4.tar.gz
emacs-68380acf41d91014634d625e5f529cd3f773fbd4.zip
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
-rw-r--r--admin/FOR-RELEASE4
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/ChangeLog19
-rw-r--r--lisp/emacs-lisp/easy-mmode.el2
-rw-r--r--lisp/files.el105
-rw-r--r--lisp/international/iso-cvt.el4
-rw-r--r--lisp/progmodes/compile.el5
-rw-r--r--lisp/startup.el20
-rw-r--r--lispref/ChangeLog11
-rw-r--r--lispref/files.texi7
-rw-r--r--lispref/help.texi4
-rw-r--r--lispref/keymaps.texi3
-rw-r--r--lispref/modes.texi5
13 files changed, 132 insertions, 61 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 8a871c86c69..7f73b904a63 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -56,7 +56,9 @@ http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01113.html
56** Takaaki.Ota@am.sony.com, May 2: table cell menu does not appear at the menubar 56** Takaaki.Ota@am.sony.com, May 2: table cell menu does not appear at the menubar
57 Bug is intermittent. 57 Bug is intermittent.
58 58
59** david.reitter@gmail.com, May 4: Euro sign bound, Pound sign not bound. (Bug?) 59** Install python.el `with' patch from trunk.
60
61** Install vc-hooks.el patch from trunk.
60 62
61* DOCUMENTATION 63* DOCUMENTATION
62 64
diff --git a/etc/NEWS b/etc/NEWS
index 3c73ec6ee58..87c42c01067 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -5013,6 +5013,10 @@ 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
5014looking at the file contents. It takes precedence over `auto-mode-alist'. 5014looking 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
5017looking at the file contents. It is handled after `auto-mode-alist',
5018only if `auto-mode-alist' says nothing about the file.
5019
5016*** XML or SGML major mode is selected when file starts with an `<?xml' 5020*** XML or SGML major mode is selected when file starts with an `<?xml'
5017or `<!DOCTYPE' declaration. 5021or `<!DOCTYPE' declaration.
5018 5022
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e453a3984ae..5129fa474c6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,22 @@
12007-05-10 Richard Stallman <rms@gnu.org>
2
3 * international/iso-cvt.el (iso-cvt-read-only): Ignore arguments.
4 (iso-cvt-write-only): Likewise.
5
6 * emacs-lisp/easy-mmode.el (define-minor-mode):
7 Fix generated doc string.
8
9 * startup.el (fancy-splash-text): Add URL of guided tour.
10 Adjust horizontal and vertical whitespace.
11
12 * progmodes/compile.el (compilation-handle-exit):
13 Use run-hook-with-args to run compilation-finish-functions.
14
15 * files.el (file-start-mode-alist): New variable.
16 (magic-mode-regexp-match-limit): Doc fix.
17 (set-auto-mode): Handle file-start-mode-alist.
18 A little cleanup of structure.
19
12007-05-10 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> 202007-05-10 Micha,Ak(Bl Cadilhac <michael@cadilhac.name>
2 21
3 * man.el (Man-next-section): Don't consider the last line of the page 22 * man.el (Man-next-section): Don't consider the last line of the page
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 2ce4ca8cf38..19ed39a2b42 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -197,7 +197,7 @@ Use the command `%s' to change this variable." pretty-name mode))
197 197
198 (let ((base-doc-string 198 (let ((base-doc-string
199 (concat "Non-nil if %s is enabled. 199 (concat "Non-nil if %s is enabled.
200See the command `%s' for a description of this minor-mode." 200See the command `%s' for a description of this minor mode."
201 (if body " 201 (if body "
202Setting this variable directly does not take effect; 202Setting this variable directly does not take effect;
203either customize it (see the info node `Easy Customization') 203either customize it (see the info node `Easy Customization')
diff --git a/lisp/files.el b/lisp/files.el
index 1b6a94766d3..85478ac40a0 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2151,8 +2151,21 @@ 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.\")") 2151\"allow `auto-mode-alist' to decide for these files.\")")
2152(put 'magic-mode-alist 'risky-local-variable t) 2152(put 'magic-mode-alist 'risky-local-variable t)
2153 2153
2154(defvar file-start-mode-alist
2155 nil
2156 "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'.
2157Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION).
2158After visiting a file, if REGEXP matches the text at the beginning of the
2159buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will
2160call FUNCTION, provided that `magic-mode-alist' and `auto-mode-alist'
2161have not specified a mode for this file.
2162
2163If FUNCTION is nil, then it is not called.")
2164(put 'file-start-mode-alist 'risky-local-variable t)
2165
2154(defvar magic-mode-regexp-match-limit 4000 2166(defvar magic-mode-regexp-match-limit 4000
2155 "Upper limit on `magic-mode-alist' regexp matches.") 2167 "Upper limit on `magic-mode-alist' regexp matches.
2168Also applies to `file-start-mode-alist'.")
2156 2169
2157(defun set-auto-mode (&optional keep-mode-if-same) 2170(defun set-auto-mode (&optional keep-mode-if-same)
2158 "Select major mode appropriate for current buffer. 2171 "Select major mode appropriate for current buffer.
@@ -2207,10 +2220,10 @@ only set the major mode, if that would change it."
2207 (or (set-auto-mode-0 mode keep-mode-if-same) 2220 (or (set-auto-mode-0 mode keep-mode-if-same)
2208 ;; continuing would call minor modes again, toggling them off 2221 ;; continuing would call minor modes again, toggling them off
2209 (throw 'nop nil)))))) 2222 (throw 'nop nil))))))
2223 ;; If we didn't, look for an interpreter specified in the first line.
2224 ;; As a special case, allow for things like "#!/bin/env perl", which
2225 ;; finds the interpreter anywhere in $PATH.
2210 (unless done 2226 (unless done
2211 ;; If we didn't, look for an interpreter specified in the first line.
2212 ;; As a special case, allow for things like "#!/bin/env perl", which
2213 ;; finds the interpreter anywhere in $PATH.
2214 (setq mode (save-excursion 2227 (setq mode (save-excursion
2215 (goto-char (point-min)) 2228 (goto-char (point-min))
2216 (if (looking-at auto-mode-interpreter-regexp) 2229 (if (looking-at auto-mode-interpreter-regexp)
@@ -2223,7 +2236,7 @@ only set the major mode, if that would change it."
2223 ;; If we found an interpreter mode to use, invoke it now. 2236 ;; If we found an interpreter mode to use, invoke it now.
2224 (if done 2237 (if done
2225 (set-auto-mode-0 (cdr done) keep-mode-if-same))) 2238 (set-auto-mode-0 (cdr done) keep-mode-if-same)))
2226 ;; If we didn't, match the buffer beginning against magic-mode-alist. 2239 ;; Next try matching the buffer beginning against magic-mode-alist.
2227 (unless done 2240 (unless done
2228 (if (setq done (save-excursion 2241 (if (setq done (save-excursion
2229 (goto-char (point-min)) 2242 (goto-char (point-min))
@@ -2236,39 +2249,55 @@ only set the major mode, if that would change it."
2236 (if (functionp re) 2249 (if (functionp re)
2237 (funcall re) 2250 (funcall re)
2238 (looking-at re))))))) 2251 (looking-at re)))))))
2239 (set-auto-mode-0 done keep-mode-if-same) 2252 (set-auto-mode-0 done keep-mode-if-same)))
2240 ;; Compare the filename against the entries in auto-mode-alist. 2253 ;; Next compare the filename against the entries in auto-mode-alist.
2241 (if buffer-file-name 2254 (unless done
2242 (let ((name buffer-file-name)) 2255 (if buffer-file-name
2243 ;; Remove backup-suffixes from file name. 2256 (let ((name buffer-file-name))
2244 (setq name (file-name-sans-versions name)) 2257 ;; Remove backup-suffixes from file name.
2245 (while name 2258 (setq name (file-name-sans-versions name))
2246 ;; Find first matching alist entry. 2259 (while name
2247 (setq mode 2260 ;; Find first matching alist entry.
2248 (if (memq system-type '(vax-vms windows-nt cygwin)) 2261 (setq mode
2249 ;; System is case-insensitive. 2262 (if (memq system-type '(vax-vms windows-nt cygwin))
2250 (let ((case-fold-search t)) 2263 ;; System is case-insensitive.
2251 (assoc-default name auto-mode-alist 2264 (let ((case-fold-search t))
2252 'string-match)) 2265 (assoc-default name auto-mode-alist
2253 ;; System is case-sensitive. 2266 'string-match))
2254 (or 2267 ;; System is case-sensitive.
2255 ;; First match case-sensitively. 2268 (or
2256 (let ((case-fold-search nil)) 2269 ;; First match case-sensitively.
2257 (assoc-default name auto-mode-alist 2270 (let ((case-fold-search nil))
2258 'string-match)) 2271 (assoc-default name auto-mode-alist
2259 ;; Fallback to case-insensitive match. 2272 'string-match))
2260 (and auto-mode-case-fold 2273 ;; Fallback to case-insensitive match.
2261 (let ((case-fold-search t)) 2274 (and auto-mode-case-fold
2262 (assoc-default name auto-mode-alist 2275 (let ((case-fold-search t))
2263 'string-match)))))) 2276 (assoc-default name auto-mode-alist
2264 (if (and mode 2277 'string-match))))))
2265 (consp mode) 2278 (if (and mode
2266 (cadr mode)) 2279 (consp mode)
2267 (setq mode (car mode) 2280 (cadr mode))
2268 name (substring name 0 (match-beginning 0))) 2281 (setq mode (car mode)
2269 (setq name)) 2282 name (substring name 0 (match-beginning 0)))
2270 (when mode 2283 (setq name))
2271 (set-auto-mode-0 mode keep-mode-if-same))))))))) 2284 (when mode
2285 (set-auto-mode-0 mode keep-mode-if-same)
2286 (setq done t))))))
2287 ;; Next try matching the buffer beginning against file-start-mode-alist.
2288 (unless done
2289 (if (setq done (save-excursion
2290 (goto-char (point-min))
2291 (save-restriction
2292 (narrow-to-region (point-min)
2293 (min (point-max)
2294 (+ (point-min) magic-mode-regexp-match-limit)))
2295 (assoc-default nil file-start-mode-alist
2296 (lambda (re dummy)
2297 (if (functionp re)
2298 (funcall re)
2299 (looking-at re)))))))
2300 (set-auto-mode-0 done keep-mode-if-same)))))
2272 2301
2273;; When `keep-mode-if-same' is set, we are working on behalf of 2302;; When `keep-mode-if-same' is set, we are working on behalf of
2274;; set-visited-file-name. In that case, if the major mode specified is the 2303;; set-visited-file-name. In that case, if the major mode specified is the
diff --git a/lisp/international/iso-cvt.el b/lisp/international/iso-cvt.el
index eb94794145f..3448da812a2 100644
--- a/lisp/international/iso-cvt.el
+++ b/lisp/international/iso-cvt.el
@@ -823,13 +823,13 @@ Optional arg BUFFER is ignored (for use in `format-alist')."
823 (iso-translate-conventions from to iso-sgml2iso-trans-tab)) 823 (iso-translate-conventions from to iso-sgml2iso-trans-tab))
824 824
825;;;###autoload 825;;;###autoload
826(defun iso-cvt-read-only () 826(defun iso-cvt-read-only (&rest ignore)
827 "Warn that format is read-only." 827 "Warn that format is read-only."
828 (interactive) 828 (interactive)
829 (error "This format is read-only; specify another format for writing")) 829 (error "This format is read-only; specify another format for writing"))
830 830
831;;;###autoload 831;;;###autoload
832(defun iso-cvt-write-only () 832(defun iso-cvt-write-only (&rest ignore)
833 "Warn that format is write-only." 833 "Warn that format is write-only."
834 (interactive) 834 (interactive)
835 (error "This format is write-only")) 835 (error "This format is write-only"))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 9266315d98f..1613fd8f976 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1448,10 +1448,7 @@ Turning the mode on runs the normal hook `compilation-minor-mode-hook'."
1448 (with-no-warnings 1448 (with-no-warnings
1449 (if compilation-finish-function 1449 (if compilation-finish-function
1450 (funcall compilation-finish-function (current-buffer) msg))) 1450 (funcall compilation-finish-function (current-buffer) msg)))
1451 (let ((functions compilation-finish-functions)) 1451 (run-hook-with-args compilation-finish-functions (current-buffer) msg)))
1452 (while functions
1453 (funcall (car functions) (current-buffer) msg)
1454 (setq functions (cdr functions))))))
1455 1452
1456;; Called when compilation process changes state. 1453;; Called when compilation process changes state.
1457(defun compilation-sentinel (proc msg) 1454(defun compilation-sentinel (proc msg)
diff --git a/lisp/startup.el b/lisp/startup.el
index 84dc4dca8d8..f57bf66a3a0 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1149,21 +1149,25 @@ regardless of the value of this variable."
1149 "\n"))) 1149 "\n")))
1150 :face variable-pitch "\ 1150 :face variable-pitch "\
1151Emacs FAQ\t\tFrequently asked questions and answers 1151Emacs FAQ\t\tFrequently asked questions and answers
1152View Emacs Manual\tView the Emacs manual using Info 1152View Emacs Manual\t\tView the Emacs manual using Info
1153Absence of Warranty\tGNU Emacs comes with " 1153Absence of Warranty\tGNU Emacs comes with "
1154 :face (variable-pitch :slant oblique) 1154 :face (variable-pitch :slant oblique)
1155 "ABSOLUTELY NO WARRANTY\n" 1155 "ABSOLUTELY NO WARRANTY\n"
1156 :face variable-pitch 1156 :face variable-pitch
1157 "\ 1157 "\
1158Copying Conditions\tConditions for redistributing and changing Emacs 1158Copying Conditions\t\tConditions for redistributing and changing Emacs
1159Getting New Versions\tHow to obtain the latest version of Emacs 1159Getting New Versions\tHow to obtain the latest version of Emacs
1160More Manuals / Ordering Manuals Buying printed manuals from the FSF\n") 1160More Manuals / Ordering Manuals Buying printed manuals from the FSF\n")
1161 (:face variable-pitch 1161 (:face variable-pitch
1162 "To quit a partially entered command, type " 1162 "\nTo quit a partially entered command, type "
1163 :face default 1163 :face default
1164 "Control-g" 1164 "Control-g"
1165 :face variable-pitch 1165 :face variable-pitch
1166 ".\n" 1166 ".
1167
1168Emacs Guided Tour\t\tSee http://www.gnu.org/software/emacs/tour/
1169
1170"
1167 :face (variable-pitch :weight bold) 1171 :face (variable-pitch :weight bold)
1168 "Useful File menu items:\n" 1172 "Useful File menu items:\n"
1169 :face variable-pitch 1173 :face variable-pitch
@@ -1176,13 +1180,7 @@ More Manuals / Ordering Manuals Buying printed manuals from the FSF\n")
1176 "Control-c" 1180 "Control-c"
1177 :face variable-pitch 1181 :face variable-pitch
1178 ") 1182 ")
1179Recover Crashed Session\tRecover files you were editing before a crash 1183Recover Crashed Session\tRecover files you were editing before a crash\n"
1180
1181
1182
1183
1184
1185"
1186 )) 1184 ))
1187 "A list of texts to show in the middle part of splash screens. 1185 "A list of texts to show in the middle part of splash screens.
1188Each element in the list should be a list of strings or pairs 1186Each element in the list should be a list of strings or pairs
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 5d340be7818..cb824323286 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,14 @@
12007-05-10 Richard Stallman <rms@gnu.org>
2
3 * keymaps.texi (Scanning Keymaps): Update where-is-internal example.
4
5 * help.texi (Keys in Documentation): Add reference to
6 Documentation Tips.
7
8 * files.texi (Format Conversion): TO-FN gets three arguments.
9
10 * modes.texi (Auto Major Mode): Document file-start-mode-alist.
11
12007-05-10 Thien-Thi Nguyen <ttn@gnuvola.org> 122007-05-10 Thien-Thi Nguyen <ttn@gnuvola.org>
2 13
3 * elisp.texi (Top): Remove "Saving Properties" from detailed menu. 14 * elisp.texi (Top): Remove "Saving Properties" from detailed menu.
diff --git a/lispref/files.texi b/lispref/files.texi
index 1df6aead199..19bacb142eb 100644
--- a/lispref/files.texi
+++ b/lispref/files.texi
@@ -2903,9 +2903,10 @@ convert the usual Emacs data representation into this format.
2903If @var{to-fn} is a string, it is a shell command; Emacs runs the 2903If @var{to-fn} is a string, it is a shell command; Emacs runs the
2904command as a filter to perform the conversion. 2904command as a filter to perform the conversion.
2905 2905
2906If @var{to-fn} is a function, it is called with two arguments, @var{begin} 2906If @var{to-fn} is a function, it is called with three arguments:
2907and @var{end}, which specify the part of the buffer it should convert. 2907@var{begin} and @var{end}, which specify the part of the buffer it
2908There are two ways it can do the conversion: 2908should convert, and @var{buffer}, which specifies which buffer. There
2909are two ways it can do the conversion:
2909 2910
2910@itemize @bullet 2911@itemize @bullet
2911@item 2912@item
diff --git a/lispref/help.texi b/lispref/help.texi
index 70c7a48c9c4..dd56aa872b7 100644
--- a/lispref/help.texi
+++ b/lispref/help.texi
@@ -384,6 +384,10 @@ C-g abort-recursive-edit
384@end group 384@end group
385@end smallexample 385@end smallexample
386 386
387 There are other special conventions for the text in documentation
388strings---for instance, you can refer to functions, variables, and
389sections of this manual. @xref{Documentation Tips}, for details.
390
387@node Describing Characters 391@node Describing Characters
388@section Describing Characters for Help Messages 392@section Describing Characters for Help Messages
389@cindex describe characters and events 393@cindex describe characters and events
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index 88b312d227b..400a2c38240 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -1895,7 +1895,8 @@ other command. However, if @var{no-remap} is non-@code{nil}.
1895@smallexample 1895@smallexample
1896@group 1896@group
1897(where-is-internal 'describe-function) 1897(where-is-internal 'describe-function)
1898 @result{} ("\^hf" "\^hd") 1898 @result{} ([8 102] [f1 102] [help 102]
1899 [menu-bar help-menu describe describe-function])
1899@end group 1900@end group
1900@end smallexample 1901@end smallexample
1901@end defun 1902@end defun
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 5d91b238fca..56fb43a0c3b 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -616,6 +616,11 @@ 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
620This works like @code{magic-mode-alist}, except that it is handled
621only if @code{auto-mode-alist} does not specify a mode for this file.
622@end defvar
623
619@defvar auto-mode-alist 624@defvar auto-mode-alist
620This variable contains an association list of file name patterns 625This variable contains an association list of file name patterns
621(regular expressions) and corresponding major mode commands. Usually, 626(regular expressions) and corresponding major mode commands. Usually,