diff options
| author | Richard M. Stallman | 1993-08-11 19:29:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-08-11 19:29:19 +0000 |
| commit | f16a1ed371acd6ad5052ab2b615289702ba514c4 (patch) | |
| tree | cc181d19d0469eb87bc9db8b20959b8a79b087d2 /src | |
| parent | 0d94f5ca296f68fe52c4a9cafc7400fa9ef27fc7 (diff) | |
| download | emacs-f16a1ed371acd6ad5052ab2b615289702ba514c4.tar.gz emacs-f16a1ed371acd6ad5052ab2b615289702ba514c4.zip | |
(Frecenter): Preserve point in the buffer we change it in.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c index c02611b84f8..25ee043abab 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1310,13 +1310,19 @@ If FRAME is a frame, search only that frame.\n") | |||
| 1310 | DEFUN ("delete-other-windows", Fdelete_other_windows, Sdelete_other_windows, | 1310 | DEFUN ("delete-other-windows", Fdelete_other_windows, Sdelete_other_windows, |
| 1311 | 0, 1, "", | 1311 | 0, 1, "", |
| 1312 | "Make WINDOW (or the selected window) fill its frame.\n\ | 1312 | "Make WINDOW (or the selected window) fill its frame.\n\ |
| 1313 | Only the frame WINDOW is on is affected.") | 1313 | Only the frame WINDOW is on is affected.\n\ |
| 1314 | This function tries to reduce display jumps\n\ | ||
| 1315 | by keeping the text previously visible in WINDOW\n\ | ||
| 1316 | in the same place on the frame. Doing this depends on\n\ | ||
| 1317 | the value of (window-start WINDOW), so if calling this function\n\ | ||
| 1318 | in a program gives strange scrolling, make sure the window-start\n\ | ||
| 1319 | value is reasonable when this function is called.") | ||
| 1314 | (window) | 1320 | (window) |
| 1315 | Lisp_Object window; | 1321 | Lisp_Object window; |
| 1316 | { | 1322 | { |
| 1317 | struct window *w; | 1323 | struct window *w; |
| 1318 | int opoint = point; | ||
| 1319 | struct buffer *obuf = current_buffer; | 1324 | struct buffer *obuf = current_buffer; |
| 1325 | int opoint; | ||
| 1320 | int top; | 1326 | int top; |
| 1321 | 1327 | ||
| 1322 | if (NILP (window)) | 1328 | if (NILP (window)) |
| @@ -1330,11 +1336,12 @@ Only the frame WINDOW is on is affected.") | |||
| 1330 | window_loop (DELETE_OTHER_WINDOWS, window, 0, WINDOW_FRAME (w)); | 1336 | window_loop (DELETE_OTHER_WINDOWS, window, 0, WINDOW_FRAME (w)); |
| 1331 | 1337 | ||
| 1332 | Fset_buffer (w->buffer); | 1338 | Fset_buffer (w->buffer); |
| 1339 | opoint = point; | ||
| 1333 | SET_PT (marker_position (w->start)); | 1340 | SET_PT (marker_position (w->start)); |
| 1334 | Frecenter (make_number (top - FRAME_MENU_BAR_LINES (XFRAME (WINDOW_FRAME (w))))); | 1341 | Frecenter (make_number (top - FRAME_MENU_BAR_LINES (XFRAME (WINDOW_FRAME (w))))); |
| 1335 | 1342 | ||
| 1336 | set_buffer_internal (obuf); | ||
| 1337 | SET_PT (opoint); | 1343 | SET_PT (opoint); |
| 1344 | set_buffer_internal (obuf); | ||
| 1338 | return Qnil; | 1345 | return Qnil; |
| 1339 | } | 1346 | } |
| 1340 | 1347 | ||