diff options
| author | Stephen Leake | 2018-12-13 14:39:02 -0800 |
|---|---|---|
| committer | Stephen Leake | 2018-12-13 14:39:02 -0800 |
| commit | 87bef630bf0f45e8da74e43ba614aa2292b296ef (patch) | |
| tree | efdead3c0d7dd227bacbd4dfc5c1ff9b4d5c13c3 /src | |
| parent | 4d3f7b77cc7dea072d2ecb9f137c2e497bc52da1 (diff) | |
| parent | d08b75abe0f0cf9ade812b189c374809a2c7836e (diff) | |
| download | emacs-87bef630bf0f45e8da74e43ba614aa2292b296ef.tar.gz emacs-87bef630bf0f45e8da74e43ba614aa2292b296ef.zip | |
Merge commit 'd08b75abe0f0cf9ade812b189c374809a2c7836e'
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 28 | ||||
| -rw-r--r-- | src/textprop.c | 87 | ||||
| -rw-r--r-- | src/xdisp.c | 2 |
3 files changed, 54 insertions, 63 deletions
diff --git a/src/fileio.c b/src/fileio.c index d9795715f9e..687f6ec7452 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1692,6 +1692,34 @@ get_homedir (void) | |||
| 1692 | if (!home) | 1692 | if (!home) |
| 1693 | return ""; | 1693 | return ""; |
| 1694 | } | 1694 | } |
| 1695 | #ifdef DOS_NT | ||
| 1696 | /* If home is a drive-relative directory, expand it. */ | ||
| 1697 | if (IS_DRIVE (*home) | ||
| 1698 | && IS_DEVICE_SEP (home[1]) | ||
| 1699 | && !IS_DIRECTORY_SEP (home[2])) | ||
| 1700 | { | ||
| 1701 | # ifdef WINDOWSNT | ||
| 1702 | static char hdir[MAX_UTF8_PATH]; | ||
| 1703 | # else | ||
| 1704 | static char hdir[MAXPATHLEN]; | ||
| 1705 | # endif | ||
| 1706 | if (!getdefdir (c_toupper (*home) - 'A' + 1, hdir)) | ||
| 1707 | { | ||
| 1708 | hdir[0] = c_toupper (*home); | ||
| 1709 | hdir[1] = ':'; | ||
| 1710 | hdir[2] = '/'; | ||
| 1711 | hdir[3] = '\0'; | ||
| 1712 | } | ||
| 1713 | if (home[2]) | ||
| 1714 | { | ||
| 1715 | size_t homelen = strlen (hdir); | ||
| 1716 | if (!IS_DIRECTORY_SEP (hdir[homelen - 1])) | ||
| 1717 | strcat (hdir, "/"); | ||
| 1718 | strcat (hdir, home + 2); | ||
| 1719 | } | ||
| 1720 | home = hdir; | ||
| 1721 | } | ||
| 1722 | #endif | ||
| 1695 | if (IS_ABSOLUTE_FILE_NAME (home)) | 1723 | if (IS_ABSOLUTE_FILE_NAME (home)) |
| 1696 | return home; | 1724 | return home; |
| 1697 | if (!emacs_wd) | 1725 | if (!emacs_wd) |
diff --git a/src/textprop.c b/src/textprop.c index 8e8baf43d9f..8a06f0ffad1 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -111,9 +111,6 @@ CHECK_STRING_OR_BUFFER (Lisp_Object x) | |||
| 111 | to by BEGIN and END may be integers or markers; if the latter, they | 111 | to by BEGIN and END may be integers or markers; if the latter, they |
| 112 | are coerced to integers. | 112 | are coerced to integers. |
| 113 | 113 | ||
| 114 | When OBJECT is a string, we increment *BEGIN and *END | ||
| 115 | to make them origin-one. | ||
| 116 | |||
| 117 | Note that buffer points don't correspond to interval indices. | 114 | Note that buffer points don't correspond to interval indices. |
| 118 | For example, point-max is 1 greater than the index of the last | 115 | For example, point-max is 1 greater than the index of the last |
| 119 | character. This difference is handled in the caller, which uses | 116 | character. This difference is handled in the caller, which uses |
| @@ -175,9 +172,6 @@ validate_interval_range (Lisp_Object object, Lisp_Object *begin, | |||
| 175 | if (! (0 <= XFIXNUM (*begin) && XFIXNUM (*begin) <= XFIXNUM (*end) | 172 | if (! (0 <= XFIXNUM (*begin) && XFIXNUM (*begin) <= XFIXNUM (*end) |
| 176 | && XFIXNUM (*end) <= len)) | 173 | && XFIXNUM (*end) <= len)) |
| 177 | args_out_of_range (*begin, *end); | 174 | args_out_of_range (*begin, *end); |
| 178 | XSETFASTINT (*begin, XFIXNAT (*begin)); | ||
| 179 | if (begin != end) | ||
| 180 | XSETFASTINT (*end, XFIXNAT (*end)); | ||
| 181 | i = string_intervals (object); | 175 | i = string_intervals (object); |
| 182 | 176 | ||
| 183 | if (len == 0) | 177 | if (len == 0) |
| @@ -1348,13 +1342,9 @@ Lisp_Object | |||
| 1348 | set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, | 1342 | set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, |
| 1349 | Lisp_Object object, Lisp_Object coherent_change_p) | 1343 | Lisp_Object object, Lisp_Object coherent_change_p) |
| 1350 | { | 1344 | { |
| 1351 | register INTERVAL i; | 1345 | INTERVAL i; |
| 1352 | Lisp_Object ostart, oend; | ||
| 1353 | bool first_time = true; | 1346 | bool first_time = true; |
| 1354 | 1347 | ||
| 1355 | ostart = start; | ||
| 1356 | oend = end; | ||
| 1357 | |||
| 1358 | properties = validate_plist (properties); | 1348 | properties = validate_plist (properties); |
| 1359 | 1349 | ||
| 1360 | if (NILP (object)) | 1350 | if (NILP (object)) |
| @@ -1382,11 +1372,6 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, | |||
| 1382 | if (NILP (properties)) | 1372 | if (NILP (properties)) |
| 1383 | return Qnil; | 1373 | return Qnil; |
| 1384 | 1374 | ||
| 1385 | /* Restore the original START and END values | ||
| 1386 | because validate_interval_range increments them for strings. */ | ||
| 1387 | start = ostart; | ||
| 1388 | end = oend; | ||
| 1389 | |||
| 1390 | i = validate_interval_range (object, &start, &end, hard); | 1375 | i = validate_interval_range (object, &start, &end, hard); |
| 1391 | /* This can return if start == end. */ | 1376 | /* This can return if start == end. */ |
| 1392 | if (!i) | 1377 | if (!i) |
| @@ -1421,34 +1406,25 @@ set_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object properties, | |||
| 1421 | /* Replace properties of text from START to END with new list of | 1406 | /* Replace properties of text from START to END with new list of |
| 1422 | properties PROPERTIES. OBJECT is the buffer or string containing | 1407 | properties PROPERTIES. OBJECT is the buffer or string containing |
| 1423 | the text. This does not obey any hooks. | 1408 | the text. This does not obey any hooks. |
| 1424 | You should provide the interval that START is located in as I. | 1409 | I is the interval that START is located in. */ |
| 1425 | START and END can be in any order. */ | ||
| 1426 | 1410 | ||
| 1427 | void | 1411 | void |
| 1428 | set_text_properties_1 (Lisp_Object start, Lisp_Object end, Lisp_Object properties, Lisp_Object object, INTERVAL i) | 1412 | set_text_properties_1 (Lisp_Object start, Lisp_Object end, |
| 1413 | Lisp_Object properties, Lisp_Object object, INTERVAL i) | ||
| 1429 | { | 1414 | { |
| 1430 | register INTERVAL prev_changed = NULL; | 1415 | INTERVAL prev_changed = NULL; |
| 1431 | register ptrdiff_t s, len; | 1416 | ptrdiff_t s = XFIXNUM (start); |
| 1432 | INTERVAL unchanged; | 1417 | ptrdiff_t len = XFIXNUM (end) - s; |
| 1433 | 1418 | ||
| 1434 | if (XFIXNUM (start) < XFIXNUM (end)) | 1419 | if (len == 0) |
| 1435 | { | ||
| 1436 | s = XFIXNUM (start); | ||
| 1437 | len = XFIXNUM (end) - s; | ||
| 1438 | } | ||
| 1439 | else if (XFIXNUM (end) < XFIXNUM (start)) | ||
| 1440 | { | ||
| 1441 | s = XFIXNUM (end); | ||
| 1442 | len = XFIXNUM (start) - s; | ||
| 1443 | } | ||
| 1444 | else | ||
| 1445 | return; | 1420 | return; |
| 1421 | eassert (0 < len); | ||
| 1446 | 1422 | ||
| 1447 | eassert (i); | 1423 | eassert (i); |
| 1448 | 1424 | ||
| 1449 | if (i->position != s) | 1425 | if (i->position != s) |
| 1450 | { | 1426 | { |
| 1451 | unchanged = i; | 1427 | INTERVAL unchanged = i; |
| 1452 | i = split_interval_right (unchanged, s - unchanged->position); | 1428 | i = split_interval_right (unchanged, s - unchanged->position); |
| 1453 | 1429 | ||
| 1454 | if (LENGTH (i) > len) | 1430 | if (LENGTH (i) > len) |
| @@ -1896,45 +1872,30 @@ Lisp_Object | |||
| 1896 | copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, | 1872 | copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, |
| 1897 | Lisp_Object pos, Lisp_Object dest, Lisp_Object prop) | 1873 | Lisp_Object pos, Lisp_Object dest, Lisp_Object prop) |
| 1898 | { | 1874 | { |
| 1899 | INTERVAL i; | 1875 | INTERVAL i = validate_interval_range (src, &start, &end, soft); |
| 1900 | Lisp_Object res; | ||
| 1901 | Lisp_Object stuff; | ||
| 1902 | Lisp_Object plist; | ||
| 1903 | ptrdiff_t s, e, e2, p, len; | ||
| 1904 | bool modified = false; | ||
| 1905 | |||
| 1906 | i = validate_interval_range (src, &start, &end, soft); | ||
| 1907 | if (!i) | 1876 | if (!i) |
| 1908 | return Qnil; | 1877 | return Qnil; |
| 1909 | 1878 | ||
| 1910 | CHECK_FIXNUM_COERCE_MARKER (pos); | 1879 | CHECK_FIXNUM_COERCE_MARKER (pos); |
| 1911 | { | ||
| 1912 | Lisp_Object dest_start, dest_end; | ||
| 1913 | |||
| 1914 | e = XFIXNUM (pos) + (XFIXNUM (end) - XFIXNUM (start)); | ||
| 1915 | if (MOST_POSITIVE_FIXNUM < e) | ||
| 1916 | args_out_of_range (pos, end); | ||
| 1917 | dest_start = pos; | ||
| 1918 | XSETFASTINT (dest_end, e); | ||
| 1919 | /* Apply this to a copy of pos; it will try to increment its arguments, | ||
| 1920 | which we don't want. */ | ||
| 1921 | validate_interval_range (dest, &dest_start, &dest_end, soft); | ||
| 1922 | } | ||
| 1923 | 1880 | ||
| 1924 | s = XFIXNUM (start); | 1881 | EMACS_INT dest_e = XFIXNUM (pos) + (XFIXNUM (end) - XFIXNUM (start)); |
| 1925 | e = XFIXNUM (end); | 1882 | if (MOST_POSITIVE_FIXNUM < dest_e) |
| 1926 | p = XFIXNUM (pos); | 1883 | args_out_of_range (pos, end); |
| 1884 | Lisp_Object dest_end = make_fixnum (dest_e); | ||
| 1885 | validate_interval_range (dest, &pos, &dest_end, soft); | ||
| 1886 | |||
| 1887 | ptrdiff_t s = XFIXNUM (start), e = XFIXNUM (end), p = XFIXNUM (pos); | ||
| 1927 | 1888 | ||
| 1928 | stuff = Qnil; | 1889 | Lisp_Object stuff = Qnil; |
| 1929 | 1890 | ||
| 1930 | while (s < e) | 1891 | while (s < e) |
| 1931 | { | 1892 | { |
| 1932 | e2 = i->position + LENGTH (i); | 1893 | ptrdiff_t e2 = i->position + LENGTH (i); |
| 1933 | if (e2 > e) | 1894 | if (e2 > e) |
| 1934 | e2 = e; | 1895 | e2 = e; |
| 1935 | len = e2 - s; | 1896 | ptrdiff_t len = e2 - s; |
| 1936 | 1897 | ||
| 1937 | plist = i->plist; | 1898 | Lisp_Object plist = i->plist; |
| 1938 | if (! NILP (prop)) | 1899 | if (! NILP (prop)) |
| 1939 | while (! NILP (plist)) | 1900 | while (! NILP (plist)) |
| 1940 | { | 1901 | { |
| @@ -1959,9 +1920,11 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, | |||
| 1959 | s = i->position; | 1920 | s = i->position; |
| 1960 | } | 1921 | } |
| 1961 | 1922 | ||
| 1923 | bool modified = false; | ||
| 1924 | |||
| 1962 | while (! NILP (stuff)) | 1925 | while (! NILP (stuff)) |
| 1963 | { | 1926 | { |
| 1964 | res = Fcar (stuff); | 1927 | Lisp_Object res = Fcar (stuff); |
| 1965 | res = Fadd_text_properties (Fcar (res), Fcar (Fcdr (res)), | 1928 | res = Fadd_text_properties (Fcar (res), Fcar (Fcdr (res)), |
| 1966 | Fcar (Fcdr (Fcdr (res))), dest); | 1929 | Fcar (Fcdr (Fcdr (res))), dest); |
| 1967 | if (! NILP (res)) | 1930 | if (! NILP (res)) |
diff --git a/src/xdisp.c b/src/xdisp.c index 4d9990cf46c..cb21397e7b9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -23041,7 +23041,7 @@ Emacs UBA implementation, in particular with the test suite. */) | |||
| 23041 | } | 23041 | } |
| 23042 | else | 23042 | else |
| 23043 | { | 23043 | { |
| 23044 | CHECK_FIXNUM_COERCE_MARKER (vpos); | 23044 | CHECK_FIXNUM (vpos); |
| 23045 | nrow = XFIXNUM (vpos); | 23045 | nrow = XFIXNUM (vpos); |
| 23046 | } | 23046 | } |
| 23047 | 23047 | ||