aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2004-08-03 12:45:59 +0000
committerKaroly Lorentey2004-08-03 12:45:59 +0000
commit4fce8dfae60dce6a19bef88ce893bcc019576c66 (patch)
tree41dcfb7ebfda8af1faba9e2833283f3dd1fba472 /src
parentd0e37e4839b378aa90ba6686013f9563cc3c0821 (diff)
parented5c373cab5483317a8b6fca3d8d4d52432934fc (diff)
downloademacs-4fce8dfae60dce6a19bef88ce893bcc019576c66.tar.gz
emacs-4fce8dfae60dce6a19bef88ce893bcc019576c66.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-473 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-474 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-475 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-476 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-477 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-478 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-225
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog39
-rw-r--r--src/abbrev.c4
-rw-r--r--src/callint.c3
-rw-r--r--src/data.c4
-rw-r--r--src/editfns.c5
-rw-r--r--src/indent.c79
-rw-r--r--src/keyboard.c4
-rw-r--r--src/keymap.c5
-rw-r--r--src/process.c12
-rw-r--r--src/window.c2
10 files changed, 117 insertions, 40 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 282d422beb1..0194c4b8c6f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,42 @@
12004-08-03 Kim F. Storm <storm@cua.dk>
2
3 * indent.c (compute_motion): Fix check for full width window
4 in non-window case. Do not count left truncation glyph on
5 window systems.
6
72004-08-02 Luc Teirlinck <teirllm@auburn.edu>
8
9 * data.c (Finteractive_form): Doc fix.
10
112004-08-02 Kim F. Storm <storm@cua.dk>
12
13 * indent.c (compute_motion): Use actual window width if WIDTH is -1,
14 properly accounting for continuation glyph on non-window systems.
15 (Fcompute_motion): Use actual window width if WIDTH is nil, and
16 actual window width/height if TOPOS is nil, properly accounting for
17 continuation glyphs on non-window systems, and optional header lines.
18 (vmotion): Let compute_motion calculate actual window width.
19
20 * window.c (window_scroll_line_based): Let compute_motion
21 calculate actual window width.
22
232004-08-02 Kim F. Storm <storm@cua.dk>
24
25 * process.c (read_process_output): Use whole read buffer.
26 Don't trigger adaptive read buffering on errors.
27
282004-07-31 Luc Teirlinck <teirllm@auburn.edu>
29
30 * keymap.c (Fset_keymap_parent, Fdefine_prefix_command): Doc fixes.
31
32 * keyboard.c (syms_of_keyboard) <disable-point-adjustment>: Doc fix.
33
34 * callint.c (Fcall_interactively): Doc fix.
35
362004-07-30 Kim F. Storm <storm@cua.dk>
37
38 * editfns.c (Fformat): Allocate extra (dummy) element in info.
39
12004-07-28 Luc Teirlinck <teirllm@auburn.edu> 402004-07-28 Luc Teirlinck <teirllm@auburn.edu>
2 41
3 * eval.c (Fdefvar, Fdefconst): Doc fixes. 42 * eval.c (Fdefvar, Fdefconst): Doc fixes.
diff --git a/src/abbrev.c b/src/abbrev.c
index 37ab640ee43..ac132f20023 100644
--- a/src/abbrev.c
+++ b/src/abbrev.c
@@ -248,6 +248,8 @@ Returns the abbrev symbol, if expansion took place. */)
248 248
249 value = Qnil; 249 value = Qnil;
250 250
251 Frun_hooks (1, &Qpre_abbrev_expand_hook);
252
251 wordstart = 0; 253 wordstart = 0;
252 if (!(BUFFERP (Vabbrev_start_location_buffer) 254 if (!(BUFFERP (Vabbrev_start_location_buffer)
253 && XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) 255 && XBUFFER (Vabbrev_start_location_buffer) == current_buffer))
@@ -324,8 +326,6 @@ Returns the abbrev symbol, if expansion took place. */)
324 if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) 326 if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym)))
325 return value; 327 return value;
326 328
327 Frun_hooks (1, &Qpre_abbrev_expand_hook);
328
329 if (INTERACTIVE && !EQ (minibuf_window, selected_window)) 329 if (INTERACTIVE && !EQ (minibuf_window, selected_window))
330 { 330 {
331 /* Add an undo boundary, in case we are doing this for 331 /* Add an undo boundary, in case we are doing this for
diff --git a/src/callint.c b/src/callint.c
index a3e4984fd16..8b8cb032095 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -256,7 +256,8 @@ Optional second arg RECORD-FLAG non-nil
256means unconditionally put this command in the command-history. 256means unconditionally put this command in the command-history.
257Otherwise, this is done only if an arg is read using the minibuffer. 257Otherwise, this is done only if an arg is read using the minibuffer.
258Optional third arg KEYS, if given, specifies the sequence of events to 258Optional third arg KEYS, if given, specifies the sequence of events to
259supply if the command inquires which events were used to invoke it. */) 259supply if the command inquires which events were used to invoke it.
260If KEYS is omitted or nil, the return value of `this-command-keys' is used. */)
260 (function, record_flag, keys) 261 (function, record_flag, keys)
261 Lisp_Object function, record_flag, keys; 262 Lisp_Object function, record_flag, keys;
262{ 263{
diff --git a/src/data.c b/src/data.c
index 1259c5891a1..616e91c2d62 100644
--- a/src/data.c
+++ b/src/data.c
@@ -776,8 +776,8 @@ SUBR must be a built-in function. */)
776 776
777DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0, 777DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0,
778 doc: /* Return the interactive form of CMD or nil if none. 778 doc: /* Return the interactive form of CMD or nil if none.
779CMD must be a command. Value, if non-nil, is a list 779If CMD is not a command, the return value is nil.
780\(interactive SPEC). */) 780Value, if non-nil, is a list \(interactive SPEC). */)
781 (cmd) 781 (cmd)
782 Lisp_Object cmd; 782 Lisp_Object cmd;
783{ 783{
diff --git a/src/editfns.c b/src/editfns.c
index a506c5f4fc8..88a0e63118f 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3254,6 +3254,7 @@ usage: (format STRING &rest OBJECTS) */)
3254 /* Piggyback on this loop to initialize precision[N]. */ 3254 /* Piggyback on this loop to initialize precision[N]. */
3255 precision[n] = -1; 3255 precision[n] = -1;
3256 } 3256 }
3257 precision[nargs] = -1;
3257 3258
3258 CHECK_STRING (args[0]); 3259 CHECK_STRING (args[0]);
3259 /* We may have to change "%S" to "%s". */ 3260 /* We may have to change "%S" to "%s". */
@@ -3277,11 +3278,11 @@ usage: (format STRING &rest OBJECTS) */)
3277 3278
3278 /* Allocate the info and discarded tables. */ 3279 /* Allocate the info and discarded tables. */
3279 { 3280 {
3280 int nbytes = nargs * sizeof *info; 3281 int nbytes = (nargs+1) * sizeof *info;
3281 int i; 3282 int i;
3282 info = (struct info *) alloca (nbytes); 3283 info = (struct info *) alloca (nbytes);
3283 bzero (info, nbytes); 3284 bzero (info, nbytes);
3284 for (i = 0; i < nargs; i++) 3285 for (i = 0; i <= nargs; i++)
3285 info[i].start = -1; 3286 info[i].start = -1;
3286 discarded = (char *) alloca (SBYTES (args[0])); 3287 discarded = (char *) alloca (SBYTES (args[0]));
3287 bzero (discarded, SBYTES (args[0])); 3288 bzero (discarded, SBYTES (args[0]));
diff --git a/src/indent.c b/src/indent.c
index 1dc5c91fbad..d6fea34f5f5 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1133,6 +1133,9 @@ struct position val_compute_motion;
1133 1133
1134 WIDTH is the number of columns available to display text; 1134 WIDTH is the number of columns available to display text;
1135 compute_motion uses this to handle continuation lines and such. 1135 compute_motion uses this to handle continuation lines and such.
1136 If WIDTH is -1, use width of window's text area adjusted for
1137 continuation glyph when needed.
1138
1136 HSCROLL is the number of columns not being displayed at the left 1139 HSCROLL is the number of columns not being displayed at the left
1137 margin; this is usually taken from a window's hscroll member. 1140 margin; this is usually taken from a window's hscroll member.
1138 TAB_OFFSET is the number of columns of the first tab that aren't 1141 TAB_OFFSET is the number of columns of the first tab that aren't
@@ -1230,6 +1233,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
1230 int prev_vpos = 0; 1233 int prev_vpos = 0;
1231 int contin_hpos; /* HPOS of last column of continued line. */ 1234 int contin_hpos; /* HPOS of last column of continued line. */
1232 int prev_tab_offset; /* Previous tab offset. */ 1235 int prev_tab_offset; /* Previous tab offset. */
1236 int continuation_glyph_width;
1233 1237
1234 XSETBUFFER (buffer, current_buffer); 1238 XSETBUFFER (buffer, current_buffer);
1235 XSETWINDOW (window, win); 1239 XSETWINDOW (window, win);
@@ -1247,6 +1251,23 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
1247 if (tab_width <= 0 || tab_width > 1000) 1251 if (tab_width <= 0 || tab_width > 1000)
1248 tab_width = 8; 1252 tab_width = 8;
1249 1253
1254 /* Negative width means use all available text columns. */
1255 if (width < 0)
1256 {
1257 width = window_box_text_cols (win);
1258 /* We must make room for continuation marks if we don't have fringes. */
1259#ifdef HAVE_WINDOW_SYSTEM
1260 if (!FRAME_WINDOW_P (XFRAME (win->frame)))
1261#endif
1262 width -= 1;
1263 }
1264
1265 continuation_glyph_width = 0;
1266#ifdef HAVE_WINDOW_SYSTEM
1267 if (!FRAME_WINDOW_P (XFRAME (win->frame)))
1268 continuation_glyph_width = 1;
1269#endif
1270
1250 immediate_quit = 1; 1271 immediate_quit = 1;
1251 QUIT; 1272 QUIT;
1252 1273
@@ -1370,7 +1391,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
1370 { 1391 {
1371 if (hscroll 1392 if (hscroll
1372 || (truncate_partial_width_windows 1393 || (truncate_partial_width_windows
1373 && width + 1 < FRAME_COLS (XFRAME (WINDOW_FRAME (win)))) 1394 && ((width + continuation_glyph_width)
1395 < FRAME_COLS (XFRAME (WINDOW_FRAME (win)))))
1374 || !NILP (current_buffer->truncate_lines)) 1396 || !NILP (current_buffer->truncate_lines))
1375 { 1397 {
1376 /* Truncating: skip to newline, unless we are already past 1398 /* Truncating: skip to newline, unless we are already past
@@ -1654,7 +1676,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width,
1654 hpos -= hscroll; 1676 hpos -= hscroll;
1655 /* Count the truncation glyph on column 0 */ 1677 /* Count the truncation glyph on column 0 */
1656 if (hscroll > 0) 1678 if (hscroll > 0)
1657 hpos++; 1679 hpos += continuation_glyph_width;
1658 tab_offset = 0; 1680 tab_offset = 0;
1659 } 1681 }
1660 contin_hpos = 0; 1682 contin_hpos = 0;
@@ -1739,12 +1761,14 @@ assuming it is at position FROMPOS--a cons of the form (HPOS . VPOS)--
1739to position TO or position TOPOS--another cons of the form (HPOS . VPOS)-- 1761to position TO or position TOPOS--another cons of the form (HPOS . VPOS)--
1740and return the ending buffer position and screen location. 1762and return the ending buffer position and screen location.
1741 1763
1764If TOPOS is nil, the actual width and height of the window's
1765text area are used.
1766
1742There are three additional arguments: 1767There are three additional arguments:
1743 1768
1744WIDTH is the number of columns available to display text; 1769WIDTH is the number of columns available to display text;
1745this affects handling of continuation lines. 1770this affects handling of continuation lines. A value of nil
1746This is usually the value returned by `window-width', less one (to allow 1771corresponds to the actual number of available text columns.
1747for the continuation glyph).
1748 1772
1749OFFSETS is either nil or a cons cell (HSCROLL . TAB-OFFSET). 1773OFFSETS is either nil or a cons cell (HSCROLL . TAB-OFFSET).
1750HSCROLL is the number of columns not being displayed at the left 1774HSCROLL is the number of columns not being displayed at the left
@@ -1776,6 +1800,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */)
1776 Lisp_Object from, frompos, to, topos; 1800 Lisp_Object from, frompos, to, topos;
1777 Lisp_Object width, offsets, window; 1801 Lisp_Object width, offsets, window;
1778{ 1802{
1803 struct window *w;
1779 Lisp_Object bufpos, hpos, vpos, prevhpos; 1804 Lisp_Object bufpos, hpos, vpos, prevhpos;
1780 struct position *pos; 1805 struct position *pos;
1781 int hscroll, tab_offset; 1806 int hscroll, tab_offset;
@@ -1785,10 +1810,15 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */)
1785 CHECK_NUMBER_CAR (frompos); 1810 CHECK_NUMBER_CAR (frompos);
1786 CHECK_NUMBER_CDR (frompos); 1811 CHECK_NUMBER_CDR (frompos);
1787 CHECK_NUMBER_COERCE_MARKER (to); 1812 CHECK_NUMBER_COERCE_MARKER (to);
1788 CHECK_CONS (topos); 1813 if (!NILP (topos))
1789 CHECK_NUMBER_CAR (topos); 1814 {
1790 CHECK_NUMBER_CDR (topos); 1815 CHECK_CONS (topos);
1791 CHECK_NUMBER (width); 1816 CHECK_NUMBER_CAR (topos);
1817 CHECK_NUMBER_CDR (topos);
1818 }
1819 if (!NILP (width))
1820 CHECK_NUMBER (width);
1821
1792 if (!NILP (offsets)) 1822 if (!NILP (offsets))
1793 { 1823 {
1794 CHECK_CONS (offsets); 1824 CHECK_CONS (offsets);
@@ -1804,6 +1834,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */)
1804 window = Fselected_window (); 1834 window = Fselected_window ();
1805 else 1835 else
1806 CHECK_LIVE_WINDOW (window); 1836 CHECK_LIVE_WINDOW (window);
1837 w = XWINDOW (window);
1807 1838
1808 if (XINT (from) < BEGV || XINT (from) > ZV) 1839 if (XINT (from) < BEGV || XINT (from) > ZV)
1809 args_out_of_range_3 (from, make_number (BEGV), make_number (ZV)); 1840 args_out_of_range_3 (from, make_number (BEGV), make_number (ZV));
@@ -1812,9 +1843,20 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */)
1812 1843
1813 pos = compute_motion (XINT (from), XINT (XCDR (frompos)), 1844 pos = compute_motion (XINT (from), XINT (XCDR (frompos)),
1814 XINT (XCAR (frompos)), 0, 1845 XINT (XCAR (frompos)), 0,
1815 XINT (to), XINT (XCDR (topos)), 1846 XINT (to),
1816 XINT (XCAR (topos)), 1847 (NILP (topos)
1817 XINT (width), hscroll, tab_offset, 1848 ? window_internal_height (w)
1849 : XINT (XCDR (topos))),
1850 (NILP (topos)
1851 ? (window_box_text_cols (w)
1852 - (
1853#ifdef HAVE_WINDOW_SYSTEM
1854 FRAME_WINDOW_P (XFRAME (w->frame)) ? 0 :
1855#endif
1856 1))
1857 : XINT (XCAR (topos))),
1858 (NILP (width) ? -1 : XINT (width)),
1859 hscroll, tab_offset,
1818 XWINDOW (window)); 1860 XWINDOW (window));
1819 1861
1820 XSETFASTINT (bufpos, pos->bufpos); 1862 XSETFASTINT (bufpos, pos->bufpos);
@@ -1839,7 +1881,6 @@ vmotion (from, vtarget, w)
1839 register int from, vtarget; 1881 register int from, vtarget;
1840 struct window *w; 1882 struct window *w;
1841{ 1883{
1842 int width = window_box_text_cols (w);
1843 int hscroll = XINT (w->hscroll); 1884 int hscroll = XINT (w->hscroll);
1844 struct position pos; 1885 struct position pos;
1845 /* vpos is cumulative vertical position, changed as from is changed */ 1886 /* vpos is cumulative vertical position, changed as from is changed */
@@ -1860,12 +1901,6 @@ vmotion (from, vtarget, w)
1860 1901
1861 XSETWINDOW (window, w); 1902 XSETWINDOW (window, w);
1862 1903
1863 /* We must make room for continuation marks if we don't have fringes. */
1864#ifdef HAVE_WINDOW_SYSTEM
1865 if (!FRAME_WINDOW_P (XFRAME (w->frame)))
1866#endif
1867 width -= 1;
1868
1869 /* If the window contains this buffer, use it for getting text properties. 1904 /* If the window contains this buffer, use it for getting text properties.
1870 Otherwise use the current buffer as arg for doing that. */ 1905 Otherwise use the current buffer as arg for doing that. */
1871 if (EQ (w->buffer, Fcurrent_buffer ())) 1906 if (EQ (w->buffer, Fcurrent_buffer ()))
@@ -1907,7 +1942,7 @@ vmotion (from, vtarget, w)
1907 1 << (BITS_PER_SHORT - 1), 1942 1 << (BITS_PER_SHORT - 1),
1908 /* ... nor HPOS. */ 1943 /* ... nor HPOS. */
1909 1 << (BITS_PER_SHORT - 1), 1944 1 << (BITS_PER_SHORT - 1),
1910 width, hscroll, 1945 -1, hscroll,
1911 /* This compensates for start_hpos 1946 /* This compensates for start_hpos
1912 so that a tab as first character 1947 so that a tab as first character
1913 still occupies 8 columns. */ 1948 still occupies 8 columns. */
@@ -1966,7 +2001,7 @@ vmotion (from, vtarget, w)
1966 1 << (BITS_PER_SHORT - 1), 2001 1 << (BITS_PER_SHORT - 1),
1967 /* ... nor HPOS. */ 2002 /* ... nor HPOS. */
1968 1 << (BITS_PER_SHORT - 1), 2003 1 << (BITS_PER_SHORT - 1),
1969 width, hscroll, 2004 -1, hscroll,
1970 (XFASTINT (prevline) == BEG ? -start_hpos : 0), 2005 (XFASTINT (prevline) == BEG ? -start_hpos : 0),
1971 w); 2006 w);
1972 did_motion = 1; 2007 did_motion = 1;
@@ -1980,7 +2015,7 @@ vmotion (from, vtarget, w)
1980 } 2015 }
1981 return compute_motion (from, vpos, pos.hpos, did_motion, 2016 return compute_motion (from, vpos, pos.hpos, did_motion,
1982 ZV, vtarget, - (1 << (BITS_PER_SHORT - 1)), 2017 ZV, vtarget, - (1 << (BITS_PER_SHORT - 1)),
1983 width, hscroll, 2018 -1, hscroll,
1984 pos.tab_offset - (from == BEG ? start_hpos : 0), 2019 pos.tab_offset - (from == BEG ? start_hpos : 0),
1985 w); 2020 w);
1986} 2021}
diff --git a/src/keyboard.c b/src/keyboard.c
index 4d18435e17d..c84e5d7bedc 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11505,8 +11505,8 @@ It's called with one argument, the help string to display. */);
11505 11505
11506After a command is executed, if point is moved into a region that has 11506After a command is executed, if point is moved into a region that has
11507special properties (e.g. composition, display), we adjust point to 11507special properties (e.g. composition, display), we adjust point to
11508the boundary of the region. But, several special commands sets this 11508the boundary of the region. But, when a command sets this variable to
11509variable to non-nil, then we suppress the point adjustment. 11509non-nil, we suppress the point adjustment.
11510 11510
11511This variable is set to nil before reading a command, and is checked 11511This variable is set to nil before reading a command, and is checked
11512just after executing the command. */); 11512just after executing the command. */);
diff --git a/src/keymap.c b/src/keymap.c
index 42bbeb92a18..ee4f41de6b8 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -343,7 +343,7 @@ keymap_memberp (map, maps)
343 343
344DEFUN ("set-keymap-parent", Fset_keymap_parent, Sset_keymap_parent, 2, 2, 0, 344DEFUN ("set-keymap-parent", Fset_keymap_parent, Sset_keymap_parent, 2, 2, 0,
345 doc: /* Modify KEYMAP to set its parent map to PARENT. 345 doc: /* Modify KEYMAP to set its parent map to PARENT.
346PARENT should be nil or another keymap. */) 346Return PARENT. PARENT should be nil or another keymap. */)
347 (keymap, parent) 347 (keymap, parent)
348 Lisp_Object keymap, parent; 348 Lisp_Object keymap, parent;
349{ 349{
@@ -1687,7 +1687,8 @@ If a second optional argument MAPVAR is given, the map is stored as
1687its value instead of as COMMAND's value; but COMMAND is still defined 1687its value instead of as COMMAND's value; but COMMAND is still defined
1688as a function. 1688as a function.
1689The third optional argument NAME, if given, supplies a menu name 1689The third optional argument NAME, if given, supplies a menu name
1690string for the map. This is required to use the keymap as a menu. */) 1690string for the map. This is required to use the keymap as a menu.
1691This function returns COMMAND. */)
1691 (command, mapvar, name) 1692 (command, mapvar, name)
1692 Lisp_Object command, mapvar, name; 1693 Lisp_Object command, mapvar, name;
1693{ 1694{
diff --git a/src/process.c b/src/process.c
index 9e77123bee7..ff3f79158ca 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4195,7 +4195,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
4195 present (for reading) at stdin, even when none is. This 4195 present (for reading) at stdin, even when none is. This
4196 causes the call to SELECT below to return 1 and 4196 causes the call to SELECT below to return 1 and
4197 status_notify not to be called. As a result output of 4197 status_notify not to be called. As a result output of
4198 subprocesses are incorrectly discarded. 4198 subprocesses are incorrectly discarded.
4199 */ 4199 */
4200 FD_CLR (0, &Atemp); 4200 FD_CLR (0, &Atemp);
4201#endif 4201#endif
@@ -4762,16 +4762,16 @@ read_process_output (proc, channel)
4762 if (DATAGRAM_CHAN_P (channel)) 4762 if (DATAGRAM_CHAN_P (channel))
4763 { 4763 {
4764 int len = datagram_address[channel].len; 4764 int len = datagram_address[channel].len;
4765 nbytes = recvfrom (channel, chars + carryover, readmax - carryover, 4765 nbytes = recvfrom (channel, chars + carryover, readmax,
4766 0, datagram_address[channel].sa, &len); 4766 0, datagram_address[channel].sa, &len);
4767 } 4767 }
4768 else 4768 else
4769#endif 4769#endif
4770 if (proc_buffered_char[channel] < 0) 4770 if (proc_buffered_char[channel] < 0)
4771 { 4771 {
4772 nbytes = emacs_read (channel, chars + carryover, readmax - carryover); 4772 nbytes = emacs_read (channel, chars + carryover, readmax);
4773#ifdef ADAPTIVE_READ_BUFFERING 4773#ifdef ADAPTIVE_READ_BUFFERING
4774 if (!NILP (p->adaptive_read_buffering)) 4774 if (nbytes > 0 && !NILP (p->adaptive_read_buffering))
4775 { 4775 {
4776 int delay = XINT (p->read_output_delay); 4776 int delay = XINT (p->read_output_delay);
4777 if (nbytes < 256) 4777 if (nbytes < 256)
@@ -4783,7 +4783,7 @@ read_process_output (proc, channel)
4783 delay += READ_OUTPUT_DELAY_INCREMENT * 2; 4783 delay += READ_OUTPUT_DELAY_INCREMENT * 2;
4784 } 4784 }
4785 } 4785 }
4786 else if (delay > 0 && (nbytes == readmax - carryover)) 4786 else if (delay > 0 && (nbytes == readmax))
4787 { 4787 {
4788 delay -= READ_OUTPUT_DELAY_INCREMENT; 4788 delay -= READ_OUTPUT_DELAY_INCREMENT;
4789 if (delay == 0) 4789 if (delay == 0)
@@ -4802,7 +4802,7 @@ read_process_output (proc, channel)
4802 { 4802 {
4803 chars[carryover] = proc_buffered_char[channel]; 4803 chars[carryover] = proc_buffered_char[channel];
4804 proc_buffered_char[channel] = -1; 4804 proc_buffered_char[channel] = -1;
4805 nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1 - carryover); 4805 nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1);
4806 if (nbytes < 0) 4806 if (nbytes < 0)
4807 nbytes = 1; 4807 nbytes = 1;
4808 else 4808 else
diff --git a/src/window.c b/src/window.c
index 5edabc510be..4baf9d371bc 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4709,7 +4709,7 @@ window_scroll_line_based (window, n, whole, noerror)
4709 4709
4710 posit = *compute_motion (startpos, 0, 0, 0, 4710 posit = *compute_motion (startpos, 0, 0, 0,
4711 PT, ht, 0, 4711 PT, ht, 0,
4712 window_box_text_cols (w), XINT (w->hscroll), 4712 -1, XINT (w->hscroll),
4713 0, w); 4713 0, w);
4714 original_vpos = posit.vpos; 4714 original_vpos = posit.vpos;
4715 4715