aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2020-05-23 07:50:30 -0700
committerGlenn Morris2020-05-23 07:50:30 -0700
commitd436e4840a2a99e9717497a7d7dc7a36dbd0ecc9 (patch)
treefe07bdba2e6249b757d4140d737e204a372a0125
parent294495de8e93c094aa25df55905dac61975643b9 (diff)
parentd6a0b66a0cf44389c7474a60dd23cbf666e78537 (diff)
downloademacs-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.texi2
-rw-r--r--doc/emacs/mule.texi84
-rw-r--r--doc/lispref/display.texi6
-rw-r--r--etc/TODO33
-rw-r--r--lisp/subr.el6
-rw-r--r--src/w32.c12
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,
727and for changing text into or out of such formats. 727and 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
731corner and point at the opposite corner. The rectangle thus specified 733corner and point at the opposite corner. The rectangle thus specified
732is called the @dfn{region-rectangle}. If point and the mark are in 734is 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
1326system, fontsets are defined within Emacs itself. Once you have 1326system, fontsets are defined within Emacs itself. Once you have
1327defined a fontset, you can use it within Emacs by specifying its name, 1327defined a fontset, you can use it within Emacs by specifying its name,
1328anywhere that you could use a single font. Of course, Emacs fontsets 1328anywhere that you could use a single font. Of course, Emacs fontsets
1329can use only the fonts that the system supports. If some characters 1329can use only the fonts that your system supports. If some characters
1330appear on the screen as empty boxes or hex codes, this means that the 1330appear on the screen as empty boxes or hex codes, this means that the
1331fontset in use for them has no font for those characters. In this 1331fontset in use for them has no font for those characters. In this
1332case, or if the characters are shown, but not as well as you would 1332case, or if the characters are shown, but not as well as you would
1333like, you may need to install extra fonts. Your operating system may 1333like, you may need to install extra fonts or modify the fontset to use
1334have optional fonts that you can install; or you can install the GNU 1334specific fonts already installed on your system (see below). Your
1335Intlfonts package, which includes fonts for most supported 1335operating system may have optional fonts that you can install; or you
1336scripts.@footnote{If you run Emacs on X, you may need to inform the X 1336can install the GNU Intlfonts package, which includes fonts for most
1337server about the location of the newly installed fonts with commands 1337supported scripts.@footnote{If you run Emacs on X, you may need to
1338such as: 1338inform the X server about the location of the newly installed fonts
1339with 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
1377name, defaulting to the one used by the current frame, and then 1378name, defaulting to the one used by the current frame, and then
1378displays all the subranges of characters and the fonts assigned to 1379displays all the subranges of characters and the fonts assigned to
1379them in that fontset. 1380them in that fontset. To see which fonts Emacs is using in a session
1381started without a specific fontset (which is what happens normally),
1382type @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
1382code. If a fontset specifies no font for a certain character, or if 1386code. If a fontset specifies no font for a certain character, or if
1383it specifies a font that does not exist on your system, then it cannot 1387it specifies a font that does not exist on your system, then it cannot
1384display that character properly. It will display that character as a 1388display that character properly. It will display that character as a
1385hex code or thin space or an empty box instead. (@xref{Text Display, , 1389hex code or thin space or an empty box instead. (@xref{Text Display,
1386glyphless characters}, for details.) 1390, glyphless characters}, for details.) Or a fontset might specify a
1391font for some range of characters, but you may not like their visual
1392appearance. 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
1544minor changes are required it may be easier to modify an existing 1551minor changes are required it may be easier to modify an existing
1545fontset. Modifying @samp{fontset-default} will also affect other 1552fontset, usually @samp{fontset-default}. Modifying
1546fontsets 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
1547fixing problems with the fonts that Emacs chooses for a particular 1554a fallback, so can be an effective way of fixing problems with the
1548script. 1555fonts that Emacs chooses for a particular script.
1549 1556
1550Fontsets can be modified using the function @code{set-fontset-font}, 1557Fontsets can be modified using the function @code{set-fontset-font},
1551specifying a character, a charset, a script, or a range of characters 1558specifying 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
1553used. Some examples are: 1560used. 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") 1584details about using the @code{set-fontset-font} function.
1585
1586@cindex script of a character
1587@cindex codepoint of a character
1588If you don't know the character's codepoint or the script to which it
1589belongs, you can ask Emacs. With point at the character, type
1590@w{@kbd{C-u C-x =}} (@code{what-cursor-position}), and this
1591information, together with much more, will be displayed in the
1592@file{*Help*} buffer that Emacs pops up. @xref{Position Info}. For
1593example, Japanese characters belong to the @samp{kana} script, but
1594Japanese text also mixes them with Chinese characters so the following
1595uses the @samp{han} script to set up Emacs to use the @samp{Kochi
1596Gothic} 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
1605all of the Chinese, Japanese, and Korean, a.k.a.@: @acronym{CJK},
1606characters, not just Chinese characters.)
1607
1608@vindex script-representative-chars
1609For the list of known scripts, see the variable
1610@code{script-representative-chars}.
1611
1612Fontset settings like those above only affect characters that the
1613default font doesn't support, so if the @samp{Kochi Gothic} font
1614covers Latin characters, it will not be used for displaying Latin
1615scripts, since the default font used by Emacs usually covers Basic
1616Latin.
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
3598case, use @var{font-spec} for all the characters in the charset. 3598case, 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,
3601In that case, use @var{font-spec} for all the characters belonging to 3601char-script-table}). In that case, use @var{font-spec} for all the
3602the script. 3602characters 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}
3605for any character which no font-spec is specified. 3605for any character which no font-spec is specified.
diff --git a/etc/TODO b/etc/TODO
index f983fa27d33..0f908def768 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -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
223For the list of typographical ligatures, see 223For 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
228larger, and there's no way, in principle, to specify the superset of
229all the ligatures that could exist. Each font can support different
230ligatures. The reliable way of supporting any and all ligatures is to
231hand all text to be displayed to the shaping engine and get back the
232font glyphs to display that text. However, doing this is impossible
233with the current design of the Emacs display engine, since it examines
234buffer text one character at a time, and implements character
235composition by calls to Lisp, which makes doing this for every
236character impractically slow. Therefore, the rest of this item
237describes a limited form of ligature support which is compatible with
238the current display engine design and uses automatic compositions.)
239
227For Text and derived modes, the job is to figure out which ligatures 240For Text and derived modes, the job is to figure out which ligatures
228we want to support, how to let the user customize that, and probably 241we want to support, how to let the user customize that, and probably
229define a minor mode for automatic ligation (as some contexts might not 242define 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
237needed for each programming language, and provide user options to turn 250needed for each programming language, and provide user options to turn
238this on and off. 251this on and off.
239 252
240The implementation should use the infrastructure for character 253The implementation should use the infrastructure for automatic
241compositions, i.e., we should define appropriate regexp-based rules 254character compositions, i.e., we should define appropriate
242for character sequences that need to be composed into ligatures, and 255regexp-based rules for character sequences that need to be composed
243populate composition-function-table with those rules. See 256into ligatures, and populate composition-function-table with those
244composite.el for examples of this, and also grep lisp/language/*.el 257rules. See composite.el for examples of this, and also grep
245for references to composition-function-table. 258lisp/language/*.el for references to composition-function-table.
246 259
247One problem with character compositions that will need to be solved is 260One problem with character compositions that will need to be solved is
248that composition-function-table, the char-table which holds the 261that composition-function-table, the char-table which holds the
@@ -259,7 +272,11 @@ way of preventing the ligation from happening. One possibility is to
259have a ZWNJ character separate these ASCII characters; another 272have a ZWNJ character separate these ASCII characters; another
260possibility is to introduce a special text property that prevents 273possibility is to introduce a special text property that prevents
261character composition, and place that property on the relevant parts 274character composition, and place that property on the relevant parts
262of the mode line. 275of the mode line. Yet another possibility would be to write a
276specialized composition function, which would detect that it is called
277on mode-line strings, and return nil to signal that composition is not
278possible in this case; then use that function in the rules for
279ligatures stored in composition-function-table.
263 280
264The prettify-symbols-mode should be deprecated once ligature support 281The prettify-symbols-mode should be deprecated once ligature support
265is in place. 282is 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.
4115The value returned is the value of the last form in BODY." 4115The value returned is the value of the last form in BODY.
4116NOTE: The convention in Elisp is that any function, except for a few
4117exceptions like car/assoc/+/goto-char, can clobber the match data,
4118so `save-match-data' should normally be used to save *your* match data
4119rather 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.
diff --git a/src/w32.c b/src/w32.c
index 0f69e652a57..f391f5e26eb 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -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 }