aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2017-03-19 12:24:51 -0700
committerPaul Eggert2017-03-19 12:24:51 -0700
commit468259c26e79113b6208324305ffc22ad74a041e (patch)
tree926ec10d0fd0da8ece39fe8899751839d983aceb
parentbb9924128397d072c6997de1f0b77ee8ae671e0e (diff)
parent0e35405a92be502ab3851890fc4eb660842fd3a9 (diff)
downloademacs-468259c26e79113b6208324305ffc22ad74a041e.tar.gz
emacs-468259c26e79113b6208324305ffc22ad74a041e.zip
Merge from origin/emacs-25
0e35405 Improve documentation of coding-systems c2fd04c Improve definition of 'variable-pitch' face on MS-Windows 16fb50d Fix an error message in python.el a2a2073 Clarify major mode switching fc38671 Add helpful comment to compile-command's docstring ee65d85 Fix ':version' of 'select-enable-primary'
-rw-r--r--doc/emacs/modes.texi5
-rw-r--r--doc/lispref/modes.texi26
-rw-r--r--doc/lispref/nonascii.texi65
-rw-r--r--lisp/faces.el9
-rw-r--r--lisp/progmodes/compile.el4
-rw-r--r--lisp/progmodes/python.el3
-rw-r--r--lisp/select.el2
7 files changed, 81 insertions, 33 deletions
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi
index 0acb82dc914..be893403012 100644
--- a/doc/emacs/modes.texi
+++ b/doc/emacs/modes.texi
@@ -66,7 +66,10 @@ process (@pxref{Interactive Shell}).
66first visit a file or create a buffer (@pxref{Choosing Modes}). You 66first visit a file or create a buffer (@pxref{Choosing Modes}). You
67can explicitly select a new major mode by using an @kbd{M-x} command. 67can explicitly select a new major mode by using an @kbd{M-x} command.
68Take the name of the mode and add @code{-mode} to get the name of the 68Take the name of the mode and add @code{-mode} to get the name of the
69command to select that mode (e.g., @kbd{M-x lisp-mode} enters Lisp mode). 69command to select that mode (e.g., @kbd{M-x lisp-mode} enters Lisp
70mode). Since every buffer has exactly one major mode, there is no way
71to ``turn off'' a major mode; instead you must switch to a different
72one.
70 73
71@vindex major-mode 74@vindex major-mode
72 The value of the buffer-local variable @code{major-mode} is a symbol 75 The value of the buffer-local variable @code{major-mode} is a symbol
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 0913d7491f3..88e8e811a65 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -7,11 +7,12 @@
7@chapter Major and Minor Modes 7@chapter Major and Minor Modes
8@cindex mode 8@cindex mode
9 9
10 A @dfn{mode} is a set of definitions that customize Emacs and can be 10 A @dfn{mode} is a set of definitions that customize Emacs behavior
11turned on and off while you edit. There are two varieties of modes: 11in useful ways. There are two varieties of modes: @dfn{minor modes},
12@dfn{major modes}, which are mutually exclusive and used for editing 12which provide features that users can turn on and off while editing;
13particular kinds of text, and @dfn{minor modes}, which provide features 13and @dfn{major modes}, which are used for editing or interacting with
14that users can enable individually. 14a particular kind of text. Each buffer has exactly one @dfn{major
15mode} at a time.
15 16
16 This chapter describes how to write both major and minor modes, how to 17 This chapter describes how to write both major and minor modes, how to
17indicate them in the mode line, and how they run hooks supplied by the 18indicate them in the mode line, and how they run hooks supplied by the
@@ -196,12 +197,15 @@ from the buffer-local hook list instead of from the global hook list.
196@cindex major mode 197@cindex major mode
197 198
198@cindex major mode command 199@cindex major mode command
199 Major modes specialize Emacs for editing particular kinds of text. 200 Major modes specialize Emacs for editing or interacting with
200Each buffer has one major mode at a time. Every major mode is 201particular kinds of text. Each buffer has exactly one major mode at a
201associated with a @dfn{major mode command}, whose name should end in 202time. Every major mode is associated with a @dfn{major mode command},
202@samp{-mode}. This command takes care of switching to that mode in the 203whose name should end in @samp{-mode}. This command takes care of
203current buffer, by setting various buffer-local variables such as a 204switching to that mode in the current buffer, by setting various
204local keymap. @xref{Major Mode Conventions}. 205buffer-local variables such as a local keymap. @xref{Major Mode
206Conventions}. Note that unlike minor modes there is no way to ``turn
207off'' a major mode, instead the buffer must be switched to a different
208one.
205 209
206 The least specialized major mode is called @dfn{Fundamental mode}, 210 The least specialized major mode is called @dfn{Fundamental mode},
207which has no mode-specific definitions or variable settings. 211which has no mode-specific definitions or variable settings.
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 29930c5312d..ee4bef6e498 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -1017,10 +1017,14 @@ alternative encodings for the same characters; for example, there are
1017three coding systems for the Cyrillic (Russian) alphabet: ISO, 1017three coding systems for the Cyrillic (Russian) alphabet: ISO,
1018Alternativnyj, and KOI8. 1018Alternativnyj, and KOI8.
1019 1019
1020@vindex undecided@r{ coding system}
1021@vindex prefer-utf-8@r{ coding system}
1020 Every coding system specifies a particular set of character code 1022 Every coding system specifies a particular set of character code
1021conversions, but the coding system @code{undecided} is special: it 1023conversions, but the coding system @code{undecided} is special: it
1022leaves the choice unspecified, to be chosen heuristically for each 1024leaves the choice unspecified, to be chosen heuristically for each
1023file, based on the file's data. 1025file, based on the file's data. The coding system @code{prefer-utf-8}
1026is like @code{undecided}, but it prefers to choose @code{utf-8} when
1027possible.
1024 1028
1025 In general, a coding system doesn't guarantee roundtrip identity: 1029 In general, a coding system doesn't guarantee roundtrip identity:
1026decoding a byte sequence using coding system, then encoding the 1030decoding a byte sequence using coding system, then encoding the
@@ -1124,7 +1128,7 @@ encode the buffer contents.
1124(@pxref{Specifying Coding Systems}), or implicitly using a default 1128(@pxref{Specifying Coding Systems}), or implicitly using a default
1125mechanism (@pxref{Default Coding Systems}). But these methods may not 1129mechanism (@pxref{Default Coding Systems}). But these methods may not
1126completely specify what to do. For example, they may choose a coding 1130completely specify what to do. For example, they may choose a coding
1127system such as @code{undefined} which leaves the character code 1131system such as @code{undecided} which leaves the character code
1128conversion to be determined from the data. In these cases, the I/O 1132conversion to be determined from the data. In these cases, the I/O
1129operation finishes the job of choosing a coding system. Very often 1133operation finishes the job of choosing a coding system. Very often
1130you will want to find out afterwards which coding system was chosen. 1134you will want to find out afterwards which coding system was chosen.
@@ -1426,19 +1430,21 @@ Otherwise, it asks the user to choose from a list of coding systems
1426which can encode all the text, and returns the user's choice. 1430which can encode all the text, and returns the user's choice.
1427 1431
1428@var{default-coding-system} can also be a list whose first element is 1432@var{default-coding-system} can also be a list whose first element is
1429t and whose other elements are coding systems. Then, if no coding 1433@code{t} and whose other elements are coding systems. Then, if no coding
1430system in the list can handle the text, @code{select-safe-coding-system} 1434system in the list can handle the text, @code{select-safe-coding-system}
1431queries the user immediately, without trying any of the three 1435queries the user immediately, without trying any of the three
1432alternatives described above. 1436alternatives described above. This is handy for checking only the
1433 1437coding systems in the list.
1434The optional argument @var{accept-default-p}, if non-@code{nil}, 1438
1435should be a function to determine whether a coding system selected 1439The optional argument @var{accept-default-p} determines whether a
1436without user interaction is acceptable. @code{select-safe-coding-system} 1440coding system selected without user interaction is acceptable. If
1437calls this function with one argument, the base coding system of the 1441it's omitted or @code{nil}, such a silent selection is always
1438selected coding system. If @var{accept-default-p} returns @code{nil}, 1442acceptable. If it is non-@code{nil}, it should be a function;
1439@code{select-safe-coding-system} rejects the silently selected coding 1443@code{select-safe-coding-system} calls this function with one
1440system, and asks the user to select a coding system from a list of 1444argument, the base coding system of the selected coding system. If
1441possible candidates. 1445the function returns @code{nil}, @code{select-safe-coding-system}
1446rejects the silently selected coding system, and asks the user to
1447select a coding system from a list of possible candidates.
1442 1448
1443@vindex select-safe-coding-system-accept-default-p 1449@vindex select-safe-coding-system-accept-default-p
1444If the variable @code{select-safe-coding-system-accept-default-p} is 1450If the variable @code{select-safe-coding-system-accept-default-p} is
@@ -1459,6 +1465,18 @@ similar functions). If it detects an apparent inconsistency,
1459coding system. 1465coding system.
1460@end defun 1466@end defun
1461 1467
1468@defvar select-safe-coding-system-function
1469This variable names the function to be called to request the user to
1470select a proper coding system for encoding text when the default
1471coding system for an output operation cannot safely encode that text.
1472The default value of this variable is @code{select-safe-coding-system}.
1473Emacs primitives that write text to files, such as
1474@code{write-region}, or send text to other processes, such as
1475@code{process-send-region}, normally call the value of this variable,
1476unless @code{coding-system-for-write} is bound to a non-@code{nil}
1477value (@pxref{Specifying Coding Systems}).
1478@end defvar
1479
1462 Here are two functions you can use to let the user specify a coding 1480 Here are two functions you can use to let the user specify a coding
1463system, with completion. @xref{Completion}. 1481system, with completion. @xref{Completion}.
1464 1482
@@ -1719,7 +1737,9 @@ including @code{file-coding-system-alist},
1719@defvar coding-system-for-write 1737@defvar coding-system-for-write
1720This works much like @code{coding-system-for-read}, except that it 1738This works much like @code{coding-system-for-read}, except that it
1721applies to output rather than input. It affects writing to files, 1739applies to output rather than input. It affects writing to files,
1722as well as sending output to subprocesses and net connections. 1740as well as sending output to subprocesses and net connections. It
1741also applies to encoding command-line arguments with which Emacs
1742invokes subprocesses.
1723 1743
1724When a single operation does both input and output, as do 1744When a single operation does both input and output, as do
1725@code{call-process-region} and @code{start-process}, both 1745@code{call-process-region} and @code{start-process}, both
@@ -1727,6 +1747,23 @@ When a single operation does both input and output, as do
1727affect it. 1747affect it.
1728@end defvar 1748@end defvar
1729 1749
1750@defvar coding-system-require-warning
1751Binding @code{coding-system-for-write} to a non-@code{nil} value
1752prevents output primitives from calling the function specified by
1753@code{select-safe-coding-system-function} (@pxref{User-Chosen Coding
1754Systems}). This is because @kbd{C-x RET c}
1755(@code{universal-coding-system-argument}) works by binding
1756@code{coding-system-for-write}, and Emacs should obey user selection.
1757If a Lisp program binds @code{coding-system-for-write} to a value that
1758might not be safe for encoding the text to be written, it can also bind
1759@code{coding-system-require-warning} to a non-@code{nil} value, which
1760will force the output primitives to check the encoding by calling the
1761value of @code{select-safe-coding-system-function} even though
1762@code{coding-system-for-write} is non-@code{nil}. Alternatively, call
1763@code{select-safe-coding-system} explicitly before using the specified
1764encoding.
1765@end defvar
1766
1730@defopt inhibit-eol-conversion 1767@defopt inhibit-eol-conversion
1731When this variable is non-@code{nil}, no end-of-line conversion is done, 1768When this variable is non-@code{nil}, no end-of-line conversion is done,
1732no matter which coding system is specified. This applies to all the 1769no matter which coding system is specified. This applies to all the
diff --git a/lisp/faces.el b/lisp/faces.el
index d4f2f08acf5..e62561a63a5 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2349,10 +2349,13 @@ If you set `term-file-prefix' to nil, this function does nothing."
2349 2349
2350(defface variable-pitch 2350(defface variable-pitch
2351 '((((type w32)) 2351 '((((type w32))
2352 ;; This is a kludgy workaround for an issue discussed in 2352 ;; This is a workaround for an issue discussed in
2353 ;; http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00746.html. 2353 ;; http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00746.html.
2354 :font "-outline-Arial-normal-normal-normal-sans-*-*-*-*-p-*-iso8859-1") 2354 ;; We need (a) the splash screen not to pick up bold-italics variant of
2355 (t :family "Sans Serif")) 2355 ;; the font, and (b) still be able to request bold/italic/larger size
2356 ;; variants in the likes of EWW.
2357 :family "Arial" :foundry "outline")
2358 (t :family "Sans Serif"))
2356 "The basic variable-pitch face." 2359 "The basic variable-pitch face."
2357 :group 'basic-faces) 2360 :group 'basic-faces)
2358 2361
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index d35388e98d7..31ec5a67d03 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -694,7 +694,9 @@ You might also use mode hooks to specify it in certain modes, like this:
694 (concat \"make -k \" 694 (concat \"make -k \"
695 (if buffer-file-name 695 (if buffer-file-name
696 (shell-quote-argument 696 (shell-quote-argument
697 (file-name-sans-extension buffer-file-name))))))))" 697 (file-name-sans-extension buffer-file-name))))))))
698
699It's often useful to leave a space at the end of the value."
698 :type 'string 700 :type 'string
699 :group 'compilation) 701 :group 'compilation)
700;;;###autoload(put 'compile-command 'safe-local-variable (lambda (a) (and (stringp a) (or (not (boundp 'compilation-read-command)) compilation-read-command)))) 702;;;###autoload(put 'compile-command 'safe-local-variable (lambda (a) (and (stringp a) (or (not (boundp 'compilation-read-command)) compilation-read-command))))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 90b5e4e0dc6..d4ed1392703 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2850,8 +2850,7 @@ of `error' with a user-friendly message."
2850 (or (python-shell-get-process) 2850 (or (python-shell-get-process)
2851 (if interactivep 2851 (if interactivep
2852 (user-error 2852 (user-error
2853 "Start a Python process first with `%s' or `%s'." 2853 "Start a Python process first with `M-x run-python' or `%s'."
2854 (substitute-command-keys "\\[run-python]")
2855 ;; Get the binding. 2854 ;; Get the binding.
2856 (key-description 2855 (key-description
2857 (where-is-internal 2856 (where-is-internal
diff --git a/lisp/select.el b/lisp/select.el
index a4a79255a98..4849d7d515e 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -103,7 +103,7 @@ The existence of a primary selection depends on the underlying GUI you use.
103E.g. it doesn't exist under MS-Windows." 103E.g. it doesn't exist under MS-Windows."
104 :type 'boolean 104 :type 'boolean
105 :group 'killing 105 :group 'killing
106 :version "24.1") 106 :version "25.1")
107(define-obsolete-variable-alias 'x-select-enable-primary 107(define-obsolete-variable-alias 'x-select-enable-primary
108 'select-enable-primary "25.1") 108 'select-enable-primary "25.1")
109 109