diff options
| author | Paul Eggert | 2017-03-19 12:24:51 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-03-19 12:24:51 -0700 |
| commit | 468259c26e79113b6208324305ffc22ad74a041e (patch) | |
| tree | 926ec10d0fd0da8ece39fe8899751839d983aceb | |
| parent | bb9924128397d072c6997de1f0b77ee8ae671e0e (diff) | |
| parent | 0e35405a92be502ab3851890fc4eb660842fd3a9 (diff) | |
| download | emacs-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.texi | 5 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 26 | ||||
| -rw-r--r-- | doc/lispref/nonascii.texi | 65 | ||||
| -rw-r--r-- | lisp/faces.el | 9 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 4 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 3 | ||||
| -rw-r--r-- | lisp/select.el | 2 |
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}). | |||
| 66 | first visit a file or create a buffer (@pxref{Choosing Modes}). You | 66 | first visit a file or create a buffer (@pxref{Choosing Modes}). You |
| 67 | can explicitly select a new major mode by using an @kbd{M-x} command. | 67 | can explicitly select a new major mode by using an @kbd{M-x} command. |
| 68 | Take the name of the mode and add @code{-mode} to get the name of the | 68 | Take the name of the mode and add @code{-mode} to get the name of the |
| 69 | command to select that mode (e.g., @kbd{M-x lisp-mode} enters Lisp mode). | 69 | command to select that mode (e.g., @kbd{M-x lisp-mode} enters Lisp |
| 70 | mode). Since every buffer has exactly one major mode, there is no way | ||
| 71 | to ``turn off'' a major mode; instead you must switch to a different | ||
| 72 | one. | ||
| 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 |
| 11 | turned on and off while you edit. There are two varieties of modes: | 11 | in useful ways. There are two varieties of modes: @dfn{minor modes}, |
| 12 | @dfn{major modes}, which are mutually exclusive and used for editing | 12 | which provide features that users can turn on and off while editing; |
| 13 | particular kinds of text, and @dfn{minor modes}, which provide features | 13 | and @dfn{major modes}, which are used for editing or interacting with |
| 14 | that users can enable individually. | 14 | a particular kind of text. Each buffer has exactly one @dfn{major |
| 15 | mode} 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 |
| 17 | indicate them in the mode line, and how they run hooks supplied by the | 18 | indicate 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 |
| 200 | Each buffer has one major mode at a time. Every major mode is | 201 | particular kinds of text. Each buffer has exactly one major mode at a |
| 201 | associated with a @dfn{major mode command}, whose name should end in | 202 | time. 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 | 203 | whose name should end in @samp{-mode}. This command takes care of |
| 203 | current buffer, by setting various buffer-local variables such as a | 204 | switching to that mode in the current buffer, by setting various |
| 204 | local keymap. @xref{Major Mode Conventions}. | 205 | buffer-local variables such as a local keymap. @xref{Major Mode |
| 206 | Conventions}. Note that unlike minor modes there is no way to ``turn | ||
| 207 | off'' a major mode, instead the buffer must be switched to a different | ||
| 208 | one. | ||
| 205 | 209 | ||
| 206 | The least specialized major mode is called @dfn{Fundamental mode}, | 210 | The least specialized major mode is called @dfn{Fundamental mode}, |
| 207 | which has no mode-specific definitions or variable settings. | 211 | which 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 | |||
| 1017 | three coding systems for the Cyrillic (Russian) alphabet: ISO, | 1017 | three coding systems for the Cyrillic (Russian) alphabet: ISO, |
| 1018 | Alternativnyj, and KOI8. | 1018 | Alternativnyj, 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 |
| 1021 | conversions, but the coding system @code{undecided} is special: it | 1023 | conversions, but the coding system @code{undecided} is special: it |
| 1022 | leaves the choice unspecified, to be chosen heuristically for each | 1024 | leaves the choice unspecified, to be chosen heuristically for each |
| 1023 | file, based on the file's data. | 1025 | file, based on the file's data. The coding system @code{prefer-utf-8} |
| 1026 | is like @code{undecided}, but it prefers to choose @code{utf-8} when | ||
| 1027 | possible. | ||
| 1024 | 1028 | ||
| 1025 | In general, a coding system doesn't guarantee roundtrip identity: | 1029 | In general, a coding system doesn't guarantee roundtrip identity: |
| 1026 | decoding a byte sequence using coding system, then encoding the | 1030 | decoding 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 |
| 1125 | mechanism (@pxref{Default Coding Systems}). But these methods may not | 1129 | mechanism (@pxref{Default Coding Systems}). But these methods may not |
| 1126 | completely specify what to do. For example, they may choose a coding | 1130 | completely specify what to do. For example, they may choose a coding |
| 1127 | system such as @code{undefined} which leaves the character code | 1131 | system such as @code{undecided} which leaves the character code |
| 1128 | conversion to be determined from the data. In these cases, the I/O | 1132 | conversion to be determined from the data. In these cases, the I/O |
| 1129 | operation finishes the job of choosing a coding system. Very often | 1133 | operation finishes the job of choosing a coding system. Very often |
| 1130 | you will want to find out afterwards which coding system was chosen. | 1134 | you 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 | |||
| 1426 | which can encode all the text, and returns the user's choice. | 1430 | which 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 |
| 1429 | t 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 |
| 1430 | system in the list can handle the text, @code{select-safe-coding-system} | 1434 | system in the list can handle the text, @code{select-safe-coding-system} |
| 1431 | queries the user immediately, without trying any of the three | 1435 | queries the user immediately, without trying any of the three |
| 1432 | alternatives described above. | 1436 | alternatives described above. This is handy for checking only the |
| 1433 | 1437 | coding systems in the list. | |
| 1434 | The optional argument @var{accept-default-p}, if non-@code{nil}, | 1438 | |
| 1435 | should be a function to determine whether a coding system selected | 1439 | The optional argument @var{accept-default-p} determines whether a |
| 1436 | without user interaction is acceptable. @code{select-safe-coding-system} | 1440 | coding system selected without user interaction is acceptable. If |
| 1437 | calls this function with one argument, the base coding system of the | 1441 | it's omitted or @code{nil}, such a silent selection is always |
| 1438 | selected coding system. If @var{accept-default-p} returns @code{nil}, | 1442 | acceptable. 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 |
| 1440 | system, and asks the user to select a coding system from a list of | 1444 | argument, the base coding system of the selected coding system. If |
| 1441 | possible candidates. | 1445 | the function returns @code{nil}, @code{select-safe-coding-system} |
| 1446 | rejects the silently selected coding system, and asks the user to | ||
| 1447 | select 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 |
| 1444 | If the variable @code{select-safe-coding-system-accept-default-p} is | 1450 | If the variable @code{select-safe-coding-system-accept-default-p} is |
| @@ -1459,6 +1465,18 @@ similar functions). If it detects an apparent inconsistency, | |||
| 1459 | coding system. | 1465 | coding system. |
| 1460 | @end defun | 1466 | @end defun |
| 1461 | 1467 | ||
| 1468 | @defvar select-safe-coding-system-function | ||
| 1469 | This variable names the function to be called to request the user to | ||
| 1470 | select a proper coding system for encoding text when the default | ||
| 1471 | coding system for an output operation cannot safely encode that text. | ||
| 1472 | The default value of this variable is @code{select-safe-coding-system}. | ||
| 1473 | Emacs 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, | ||
| 1476 | unless @code{coding-system-for-write} is bound to a non-@code{nil} | ||
| 1477 | value (@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 |
| 1463 | system, with completion. @xref{Completion}. | 1481 | system, 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 |
| 1720 | This works much like @code{coding-system-for-read}, except that it | 1738 | This works much like @code{coding-system-for-read}, except that it |
| 1721 | applies to output rather than input. It affects writing to files, | 1739 | applies to output rather than input. It affects writing to files, |
| 1722 | as well as sending output to subprocesses and net connections. | 1740 | as well as sending output to subprocesses and net connections. It |
| 1741 | also applies to encoding command-line arguments with which Emacs | ||
| 1742 | invokes subprocesses. | ||
| 1723 | 1743 | ||
| 1724 | When a single operation does both input and output, as do | 1744 | When 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 | |||
| 1727 | affect it. | 1747 | affect it. |
| 1728 | @end defvar | 1748 | @end defvar |
| 1729 | 1749 | ||
| 1750 | @defvar coding-system-require-warning | ||
| 1751 | Binding @code{coding-system-for-write} to a non-@code{nil} value | ||
| 1752 | prevents output primitives from calling the function specified by | ||
| 1753 | @code{select-safe-coding-system-function} (@pxref{User-Chosen Coding | ||
| 1754 | Systems}). 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. | ||
| 1757 | If a Lisp program binds @code{coding-system-for-write} to a value that | ||
| 1758 | might 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 | ||
| 1760 | will force the output primitives to check the encoding by calling the | ||
| 1761 | value 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 | ||
| 1764 | encoding. | ||
| 1765 | @end defvar | ||
| 1766 | |||
| 1730 | @defopt inhibit-eol-conversion | 1767 | @defopt inhibit-eol-conversion |
| 1731 | When this variable is non-@code{nil}, no end-of-line conversion is done, | 1768 | When this variable is non-@code{nil}, no end-of-line conversion is done, |
| 1732 | no matter which coding system is specified. This applies to all the | 1769 | no 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 | |||
| 699 | It'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. | |||
| 103 | E.g. it doesn't exist under MS-Windows." | 103 | E.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 | ||