diff options
| author | Glenn Morris | 2020-05-23 07:50:30 -0700 |
|---|---|---|
| committer | Glenn Morris | 2020-05-23 07:50:30 -0700 |
| commit | d436e4840a2a99e9717497a7d7dc7a36dbd0ecc9 (patch) | |
| tree | fe07bdba2e6249b757d4140d737e204a372a0125 | |
| parent | 294495de8e93c094aa25df55905dac61975643b9 (diff) | |
| parent | d6a0b66a0cf44389c7474a60dd23cbf666e78537 (diff) | |
| download | emacs-d436e4840a2a99e9717497a7d7dc7a36dbd0ecc9.tar.gz emacs-d436e4840a2a99e9717497a7d7dc7a36dbd0ecc9.zip | |
Merge from origin/emacs-27
d6a0b66a0c (origin/emacs-27) * lisp/subr.el (save-match-data): Clarif...
1a6d59eeba Improve the documentation of setting up fontsets
c7737d40f2 ; * etc/TODO (Ligatures): Update the entry based on recent...
fb2e34cd21 ; * etc/TODO (Ligatures): Update the entry based on recent...
13b6dfd4f7 * doc/emacs/killing.texi (Rectangles): Improve indexing.
a10254dd46 Fix accessing files on networked drives on MS-Windows
| -rw-r--r-- | doc/emacs/killing.texi | 2 | ||||
| -rw-r--r-- | doc/emacs/mule.texi | 84 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 6 | ||||
| -rw-r--r-- | etc/TODO | 33 | ||||
| -rw-r--r-- | lisp/subr.el | 6 | ||||
| -rw-r--r-- | src/w32.c | 12 |
6 files changed, 109 insertions, 34 deletions
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index 834a5c6159d..6b1f35e6158 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi | |||
| @@ -727,6 +727,8 @@ them. Rectangle commands are useful with text in multicolumn formats, | |||
| 727 | and for changing text into or out of such formats. | 727 | and for changing text into or out of such formats. |
| 728 | 728 | ||
| 729 | @cindex mark rectangle | 729 | @cindex mark rectangle |
| 730 | @cindex region-rectangle | ||
| 731 | @cindex rectangular region | ||
| 730 | To specify a rectangle for a command to work on, set the mark at one | 732 | To specify a rectangle for a command to work on, set the mark at one |
| 731 | corner and point at the opposite corner. The rectangle thus specified | 733 | corner and point at the opposite corner. The rectangle thus specified |
| 732 | is called the @dfn{region-rectangle}. If point and the mark are in | 734 | is called the @dfn{region-rectangle}. If point and the mark are in |
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index e3fe20c76f8..373c7b55817 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi | |||
| @@ -1326,16 +1326,17 @@ stored in the system and the available font names are defined by the | |||
| 1326 | system, fontsets are defined within Emacs itself. Once you have | 1326 | system, fontsets are defined within Emacs itself. Once you have |
| 1327 | defined a fontset, you can use it within Emacs by specifying its name, | 1327 | defined a fontset, you can use it within Emacs by specifying its name, |
| 1328 | anywhere that you could use a single font. Of course, Emacs fontsets | 1328 | anywhere that you could use a single font. Of course, Emacs fontsets |
| 1329 | can use only the fonts that the system supports. If some characters | 1329 | can use only the fonts that your system supports. If some characters |
| 1330 | appear on the screen as empty boxes or hex codes, this means that the | 1330 | appear on the screen as empty boxes or hex codes, this means that the |
| 1331 | fontset in use for them has no font for those characters. In this | 1331 | fontset in use for them has no font for those characters. In this |
| 1332 | case, or if the characters are shown, but not as well as you would | 1332 | case, or if the characters are shown, but not as well as you would |
| 1333 | like, you may need to install extra fonts. Your operating system may | 1333 | like, you may need to install extra fonts or modify the fontset to use |
| 1334 | have optional fonts that you can install; or you can install the GNU | 1334 | specific fonts already installed on your system (see below). Your |
| 1335 | Intlfonts package, which includes fonts for most supported | 1335 | operating system may have optional fonts that you can install; or you |
| 1336 | scripts.@footnote{If you run Emacs on X, you may need to inform the X | 1336 | can install the GNU Intlfonts package, which includes fonts for most |
| 1337 | server about the location of the newly installed fonts with commands | 1337 | supported scripts.@footnote{If you run Emacs on X, you may need to |
| 1338 | such as: | 1338 | inform the X server about the location of the newly installed fonts |
| 1339 | with commands such as: | ||
| 1339 | @c FIXME? I feel like this may be out of date. | 1340 | @c FIXME? I feel like this may be out of date. |
| 1340 | @c E.g., the intlfonts tarfile is ~ 10 years old. | 1341 | @c E.g., the intlfonts tarfile is ~ 10 years old. |
| 1341 | 1342 | ||
| @@ -1376,14 +1377,20 @@ explicitly requested, despite its name. | |||
| 1376 | @w{@kbd{M-x describe-fontset}} command. It prompts for a fontset | 1377 | @w{@kbd{M-x describe-fontset}} command. It prompts for a fontset |
| 1377 | name, defaulting to the one used by the current frame, and then | 1378 | name, defaulting to the one used by the current frame, and then |
| 1378 | displays all the subranges of characters and the fonts assigned to | 1379 | displays all the subranges of characters and the fonts assigned to |
| 1379 | them in that fontset. | 1380 | them in that fontset. To see which fonts Emacs is using in a session |
| 1381 | started without a specific fontset (which is what happens normally), | ||
| 1382 | type @kbd{fontset-default @key{RET}} at the prompt, or just | ||
| 1383 | @kbd{@key{RET}} to describe the fontset used by the current frame. | ||
| 1380 | 1384 | ||
| 1381 | A fontset does not necessarily specify a font for every character | 1385 | A fontset does not necessarily specify a font for every character |
| 1382 | code. If a fontset specifies no font for a certain character, or if | 1386 | code. If a fontset specifies no font for a certain character, or if |
| 1383 | it specifies a font that does not exist on your system, then it cannot | 1387 | it specifies a font that does not exist on your system, then it cannot |
| 1384 | display that character properly. It will display that character as a | 1388 | display that character properly. It will display that character as a |
| 1385 | hex code or thin space or an empty box instead. (@xref{Text Display, , | 1389 | hex code or thin space or an empty box instead. (@xref{Text Display, |
| 1386 | glyphless characters}, for details.) | 1390 | , glyphless characters}, for details.) Or a fontset might specify a |
| 1391 | font for some range of characters, but you may not like their visual | ||
| 1392 | appearance. If this happens, you may wish to modify your fontset; see | ||
| 1393 | @ref{Modifying Fontsets}, for how to do that. | ||
| 1387 | 1394 | ||
| 1388 | @node Defining Fontsets | 1395 | @node Defining Fontsets |
| 1389 | @section Defining Fontsets | 1396 | @section Defining Fontsets |
| @@ -1542,10 +1549,10 @@ call this function explicitly to create a fontset. | |||
| 1542 | 1549 | ||
| 1543 | Fontsets do not always have to be created from scratch. If only | 1550 | Fontsets do not always have to be created from scratch. If only |
| 1544 | minor changes are required it may be easier to modify an existing | 1551 | minor changes are required it may be easier to modify an existing |
| 1545 | fontset. Modifying @samp{fontset-default} will also affect other | 1552 | fontset, usually @samp{fontset-default}. Modifying |
| 1546 | fontsets that use it as a fallback, so can be an effective way of | 1553 | @samp{fontset-default} will also affect other fontsets that use it as |
| 1547 | fixing problems with the fonts that Emacs chooses for a particular | 1554 | a fallback, so can be an effective way of fixing problems with the |
| 1548 | script. | 1555 | fonts that Emacs chooses for a particular script. |
| 1549 | 1556 | ||
| 1550 | Fontsets can be modified using the function @code{set-fontset-font}, | 1557 | Fontsets can be modified using the function @code{set-fontset-font}, |
| 1551 | specifying a character, a charset, a script, or a range of characters | 1558 | specifying a character, a charset, a script, or a range of characters |
| @@ -1553,26 +1560,61 @@ to modify the font for, and a font specification for the font to be | |||
| 1553 | used. Some examples are: | 1560 | used. Some examples are: |
| 1554 | 1561 | ||
| 1555 | @example | 1562 | @example |
| 1556 | ;; Use Liberation Mono for latin-3 charset. | ||
| 1557 | (set-fontset-font "fontset-default" 'iso-8859-3 | ||
| 1558 | "Liberation Mono") | ||
| 1559 | |||
| 1560 | ;; Prefer a big5 font for han characters. | 1563 | ;; Prefer a big5 font for han characters. |
| 1561 | (set-fontset-font "fontset-default" | 1564 | (set-fontset-font "fontset-default" |
| 1562 | 'han (font-spec :registry "big5") | 1565 | 'han (font-spec :registry "big5") |
| 1563 | nil 'prepend) | 1566 | nil 'prepend) |
| 1564 | 1567 | ||
| 1568 | ;; Use MyPrivateFont for the Unicode private use area. | ||
| 1569 | (set-fontset-font "fontset-default" '(#xe000 . #xf8ff) | ||
| 1570 | "MyPrivateFont") | ||
| 1571 | |||
| 1572 | ;; Use Liberation Mono for latin-3 charset. | ||
| 1573 | (set-fontset-font "fontset-default" 'iso-8859-3 | ||
| 1574 | "Liberation Mono") | ||
| 1575 | |||
| 1565 | ;; Use DejaVu Sans Mono as a fallback in fontset-startup | 1576 | ;; Use DejaVu Sans Mono as a fallback in fontset-startup |
| 1566 | ;; before resorting to fontset-default. | 1577 | ;; before resorting to fontset-default. |
| 1567 | (set-fontset-font "fontset-startup" nil "DejaVu Sans Mono" | 1578 | (set-fontset-font "fontset-startup" nil "DejaVu Sans Mono" |
| 1568 | nil 'append) | 1579 | nil 'append) |
| 1580 | @end example | ||
| 1569 | 1581 | ||
| 1570 | ;; Use MyPrivateFont for the Unicode private use area. | 1582 | @noindent |
| 1571 | (set-fontset-font "fontset-default" '(#xe000 . #xf8ff) | 1583 | @xref{Fontsets, , , elisp, GNU Emacs Lisp Reference Manual}, for more |
| 1572 | "MyPrivateFont") | 1584 | details about using the @code{set-fontset-font} function. |
| 1585 | |||
| 1586 | @cindex script of a character | ||
| 1587 | @cindex codepoint of a character | ||
| 1588 | If you don't know the character's codepoint or the script to which it | ||
| 1589 | belongs, you can ask Emacs. With point at the character, type | ||
| 1590 | @w{@kbd{C-u C-x =}} (@code{what-cursor-position}), and this | ||
| 1591 | information, together with much more, will be displayed in the | ||
| 1592 | @file{*Help*} buffer that Emacs pops up. @xref{Position Info}. For | ||
| 1593 | example, Japanese characters belong to the @samp{kana} script, but | ||
| 1594 | Japanese text also mixes them with Chinese characters so the following | ||
| 1595 | uses the @samp{han} script to set up Emacs to use the @samp{Kochi | ||
| 1596 | Gothic} font for Japanese text: | ||
| 1573 | 1597 | ||
| 1598 | @example | ||
| 1599 | (set-fontset-font "fontset-default" 'han "Kochi Gothic") | ||
| 1574 | @end example | 1600 | @end example |
| 1575 | 1601 | ||
| 1602 | @noindent | ||
| 1603 | @cindex CKJ characters | ||
| 1604 | (For convenience, the @samp{han} script in Emacs is set up to support | ||
| 1605 | all of the Chinese, Japanese, and Korean, a.k.a.@: @acronym{CJK}, | ||
| 1606 | characters, not just Chinese characters.) | ||
| 1607 | |||
| 1608 | @vindex script-representative-chars | ||
| 1609 | For the list of known scripts, see the variable | ||
| 1610 | @code{script-representative-chars}. | ||
| 1611 | |||
| 1612 | Fontset settings like those above only affect characters that the | ||
| 1613 | default font doesn't support, so if the @samp{Kochi Gothic} font | ||
| 1614 | covers Latin characters, it will not be used for displaying Latin | ||
| 1615 | scripts, since the default font used by Emacs usually covers Basic | ||
| 1616 | Latin. | ||
| 1617 | |||
| 1576 | @cindex ignore font | 1618 | @cindex ignore font |
| 1577 | @cindex fonts, how to ignore | 1619 | @cindex fonts, how to ignore |
| 1578 | @vindex face-ignored-fonts | 1620 | @vindex face-ignored-fonts |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index e53f0e9f60c..3d738b9965f 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -3597,9 +3597,9 @@ characters in the range @var{from} and @var{to} (inclusive). | |||
| 3597 | @var{character} may be a charset (@pxref{Character Sets}). In that | 3597 | @var{character} may be a charset (@pxref{Character Sets}). In that |
| 3598 | case, use @var{font-spec} for all the characters in the charset. | 3598 | case, use @var{font-spec} for all the characters in the charset. |
| 3599 | 3599 | ||
| 3600 | @var{character} may be a script name (@pxref{Character Properties}). | 3600 | @var{character} may be a script name (@pxref{Character Properties, |
| 3601 | In that case, use @var{font-spec} for all the characters belonging to | 3601 | char-script-table}). In that case, use @var{font-spec} for all the |
| 3602 | the script. | 3602 | characters belonging to the script. |
| 3603 | 3603 | ||
| 3604 | @var{character} may be @code{nil}, which means to use @var{font-spec} | 3604 | @var{character} may be @code{nil}, which means to use @var{font-spec} |
| 3605 | for any character which no font-spec is specified. | 3605 | for any character which no font-spec is specified. |
| @@ -220,10 +220,23 @@ https://lists.gnu.org/r/emacs-devel/2013-11/msg00515.html | |||
| 220 | width fonts. However, more features are still needed to achieve this. | 220 | width fonts. However, more features are still needed to achieve this. |
| 221 | 221 | ||
| 222 | ** Support ligatures out of the box | 222 | ** Support ligatures out of the box |
| 223 | For the list of typographical ligatures, see | 223 | For the list of frequently-used typographical ligatures, see |
| 224 | 224 | ||
| 225 | https://en.wikipedia.org/wiki/Orthographic_ligature#Ligatures_in_Unicode_(Latin_alphabets) | 225 | https://en.wikipedia.org/wiki/Orthographic_ligature#Ligatures_in_Unicode_(Latin_alphabets) |
| 226 | 226 | ||
| 227 | (Note that in general, the number of possible ligatures can be much | ||
| 228 | larger, and there's no way, in principle, to specify the superset of | ||
| 229 | all the ligatures that could exist. Each font can support different | ||
| 230 | ligatures. The reliable way of supporting any and all ligatures is to | ||
| 231 | hand all text to be displayed to the shaping engine and get back the | ||
| 232 | font glyphs to display that text. However, doing this is impossible | ||
| 233 | with the current design of the Emacs display engine, since it examines | ||
| 234 | buffer text one character at a time, and implements character | ||
| 235 | composition by calls to Lisp, which makes doing this for every | ||
| 236 | character impractically slow. Therefore, the rest of this item | ||
| 237 | describes a limited form of ligature support which is compatible with | ||
| 238 | the current display engine design and uses automatic compositions.) | ||
| 239 | |||
| 227 | For Text and derived modes, the job is to figure out which ligatures | 240 | For Text and derived modes, the job is to figure out which ligatures |
| 228 | we want to support, how to let the user customize that, and probably | 241 | we want to support, how to let the user customize that, and probably |
| 229 | define a minor mode for automatic ligation (as some contexts might not | 242 | define a minor mode for automatic ligation (as some contexts might not |
| @@ -237,12 +250,12 @@ prettify-symbols-mode. We need to figure out which ligatures are | |||
| 237 | needed for each programming language, and provide user options to turn | 250 | needed for each programming language, and provide user options to turn |
| 238 | this on and off. | 251 | this on and off. |
| 239 | 252 | ||
| 240 | The implementation should use the infrastructure for character | 253 | The implementation should use the infrastructure for automatic |
| 241 | compositions, i.e., we should define appropriate regexp-based rules | 254 | character compositions, i.e., we should define appropriate |
| 242 | for character sequences that need to be composed into ligatures, and | 255 | regexp-based rules for character sequences that need to be composed |
| 243 | populate composition-function-table with those rules. See | 256 | into ligatures, and populate composition-function-table with those |
| 244 | composite.el for examples of this, and also grep lisp/language/*.el | 257 | rules. See composite.el for examples of this, and also grep |
| 245 | for references to composition-function-table. | 258 | lisp/language/*.el for references to composition-function-table. |
| 246 | 259 | ||
| 247 | One problem with character compositions that will need to be solved is | 260 | One problem with character compositions that will need to be solved is |
| 248 | that composition-function-table, the char-table which holds the | 261 | that composition-function-table, the char-table which holds the |
| @@ -259,7 +272,11 @@ way of preventing the ligation from happening. One possibility is to | |||
| 259 | have a ZWNJ character separate these ASCII characters; another | 272 | have a ZWNJ character separate these ASCII characters; another |
| 260 | possibility is to introduce a special text property that prevents | 273 | possibility is to introduce a special text property that prevents |
| 261 | character composition, and place that property on the relevant parts | 274 | character composition, and place that property on the relevant parts |
| 262 | of the mode line. | 275 | of the mode line. Yet another possibility would be to write a |
| 276 | specialized composition function, which would detect that it is called | ||
| 277 | on mode-line strings, and return nil to signal that composition is not | ||
| 278 | possible in this case; then use that function in the rules for | ||
| 279 | ligatures stored in composition-function-table. | ||
| 263 | 280 | ||
| 264 | The prettify-symbols-mode should be deprecated once ligature support | 281 | The prettify-symbols-mode should be deprecated once ligature support |
| 265 | is in place. | 282 | is in place. |
diff --git a/lisp/subr.el b/lisp/subr.el index 324c59f13f7..10c37e94134 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -4112,7 +4112,11 @@ MODES is as for `set-default-file-modes'." | |||
| 4112 | ;; now, but it generates slower code. | 4112 | ;; now, but it generates slower code. |
| 4113 | (defmacro save-match-data (&rest body) | 4113 | (defmacro save-match-data (&rest body) |
| 4114 | "Execute the BODY forms, restoring the global value of the match data. | 4114 | "Execute the BODY forms, restoring the global value of the match data. |
| 4115 | The value returned is the value of the last form in BODY." | 4115 | The value returned is the value of the last form in BODY. |
| 4116 | NOTE: The convention in Elisp is that any function, except for a few | ||
| 4117 | exceptions like car/assoc/+/goto-char, can clobber the match data, | ||
| 4118 | so `save-match-data' should normally be used to save *your* match data | ||
| 4119 | rather than your caller's match data." | ||
| 4116 | ;; It is better not to use backquote here, | 4120 | ;; It is better not to use backquote here, |
| 4117 | ;; because that makes a bootstrapping problem | 4121 | ;; because that makes a bootstrapping problem |
| 4118 | ;; if you need to recompile all the Lisp files using interpreted code. | 4122 | ;; if you need to recompile all the Lisp files using interpreted code. |
| @@ -6519,7 +6519,15 @@ acl_get_file (const char *fname, acl_type_t type) | |||
| 6519 | if (!get_file_security (fname, si, psd, sd_len, &sd_len)) | 6519 | if (!get_file_security (fname, si, psd, sd_len, &sd_len)) |
| 6520 | { | 6520 | { |
| 6521 | xfree (psd); | 6521 | xfree (psd); |
| 6522 | errno = EIO; | 6522 | err = GetLastError (); |
| 6523 | if (err == ERROR_NOT_SUPPORTED) | ||
| 6524 | errno = ENOTSUP; | ||
| 6525 | else if (err == ERROR_FILE_NOT_FOUND | ||
| 6526 | || err == ERROR_PATH_NOT_FOUND | ||
| 6527 | || err == ERROR_INVALID_NAME) | ||
| 6528 | errno = ENOENT; | ||
| 6529 | else | ||
| 6530 | errno = EIO; | ||
| 6523 | psd = NULL; | 6531 | psd = NULL; |
| 6524 | } | 6532 | } |
| 6525 | } | 6533 | } |
| @@ -6530,6 +6538,8 @@ acl_get_file (const char *fname, acl_type_t type) | |||
| 6530 | be encoded in the current ANSI codepage. */ | 6538 | be encoded in the current ANSI codepage. */ |
| 6531 | || err == ERROR_INVALID_NAME) | 6539 | || err == ERROR_INVALID_NAME) |
| 6532 | errno = ENOENT; | 6540 | errno = ENOENT; |
| 6541 | else if (err == ERROR_NOT_SUPPORTED) | ||
| 6542 | errno = ENOTSUP; | ||
| 6533 | else | 6543 | else |
| 6534 | errno = EIO; | 6544 | errno = EIO; |
| 6535 | } | 6545 | } |