aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYuuki Harano2020-12-21 01:53:07 +0900
committerYuuki Harano2020-12-21 01:53:07 +0900
commit565d8f57d349c19d9bbb5d5d5fdacf3c70b85d42 (patch)
tree5a25406b9f4ff091cb6856e857d2857bb3e631e4 /src
parenta44cd7c88121bb0e04bdf13d73e15f085cf3b085 (diff)
parent87b82a1969edf80d3bd4781454ec9fc968773a6d (diff)
downloademacs-565d8f57d349c19d9bbb5d5d5fdacf3c70b85d42.tar.gz
emacs-565d8f57d349c19d9bbb5d5d5fdacf3c70b85d42.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c2
-rw-r--r--src/callint.c5
-rw-r--r--src/dispextern.h4
-rw-r--r--src/editfns.c9
-rw-r--r--src/fileio.c6
-rw-r--r--src/image.c9
-rw-r--r--src/keyboard.c7
-rw-r--r--src/keymap.c39
-rw-r--r--src/lread.c2
-rw-r--r--src/window.c38
-rw-r--r--src/xdisp.c35
11 files changed, 90 insertions, 66 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 4215acbf1df..dfc34faf6e6 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2814,7 +2814,7 @@ the normal hook `change-major-mode-hook'. */)
2814 2814
2815 /* Force mode-line redisplay. Useful here because all major mode 2815 /* Force mode-line redisplay. Useful here because all major mode
2816 commands call this function. */ 2816 commands call this function. */
2817 update_mode_lines = 12; 2817 bset_update_mode_line (current_buffer);
2818 2818
2819 return Qnil; 2819 return Qnil;
2820} 2820}
diff --git a/src/callint.c b/src/callint.c
index f80436f3d91..d172af9e30b 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -283,6 +283,11 @@ invoke it (via an `interactive' spec that contains, for instance, an
283 Lisp_Object save_real_this_command = Vreal_this_command; 283 Lisp_Object save_real_this_command = Vreal_this_command;
284 Lisp_Object save_last_command = KVAR (current_kboard, Vlast_command); 284 Lisp_Object save_last_command = KVAR (current_kboard, Vlast_command);
285 285
286 /* Bound recursively so that code can check the current command from
287 code running from minibuffer hooks (and the like), without being
288 overwritten by subsequent minibuffer calls. */
289 specbind (Qcurrent_minibuffer_command, Vthis_command);
290
286 if (NILP (keys)) 291 if (NILP (keys))
287 keys = this_command_keys, key_count = this_command_key_count; 292 keys = this_command_keys, key_count = this_command_key_count;
288 else 293 else
diff --git a/src/dispextern.h b/src/dispextern.h
index 126f2cb11e5..df04db45955 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3051,6 +3051,10 @@ struct image
3051# if !defined USE_CAIRO && defined HAVE_XRENDER 3051# if !defined USE_CAIRO && defined HAVE_XRENDER
3052 /* Picture versions of pixmap and mask for compositing. */ 3052 /* Picture versions of pixmap and mask for compositing. */
3053 Picture picture, mask_picture; 3053 Picture picture, mask_picture;
3054
3055 /* We need to store the original image dimensions in case we have to
3056 call XGetImage. */
3057 int original_width, original_height;
3054# endif 3058# endif
3055#endif /* HAVE_X_WINDOWS */ 3059#endif /* HAVE_X_WINDOWS */
3056#ifdef HAVE_NTGUI 3060#ifdef HAVE_NTGUI
diff --git a/src/editfns.c b/src/editfns.c
index 4104edd77fd..e4c4141ef5e 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -188,11 +188,16 @@ DEFUN ("point-marker", Fpoint_marker, Spoint_marker, 0, 0, 0,
188 return build_marker (current_buffer, PT, PT_BYTE); 188 return build_marker (current_buffer, PT, PT_BYTE);
189} 189}
190 190
191DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1, "NGoto char: ", 191DEFUN ("goto-char", Fgoto_char, Sgoto_char, 1, 1,
192 "(goto-char--read-natnum-interactive \"Go to char: \")",
192 doc: /* Set point to POSITION, a number or marker. 193 doc: /* Set point to POSITION, a number or marker.
193Beginning of buffer is position (point-min), end is (point-max). 194Beginning of buffer is position (point-min), end is (point-max).
194 195
195The return value is POSITION. */) 196The return value is POSITION.
197
198If called interactively, a numeric prefix argument specifies
199POSITION; without a numeric prefix argument, read POSITION from the
200minibuffer. The default value is the number at point (if any). */)
196 (register Lisp_Object position) 201 (register Lisp_Object position)
197{ 202{
198 if (MARKERP (position)) 203 if (MARKERP (position))
diff --git a/src/fileio.c b/src/fileio.c
index 702c1438283..c97f4daf20c 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -6259,6 +6259,7 @@ syms_of_fileio (void)
6259 DEFSYM (Qfile_date_error, "file-date-error"); 6259 DEFSYM (Qfile_date_error, "file-date-error");
6260 DEFSYM (Qfile_missing, "file-missing"); 6260 DEFSYM (Qfile_missing, "file-missing");
6261 DEFSYM (Qfile_notify_error, "file-notify-error"); 6261 DEFSYM (Qfile_notify_error, "file-notify-error");
6262 DEFSYM (Qremote_file_error, "remote-file-error");
6262 DEFSYM (Qexcl, "excl"); 6263 DEFSYM (Qexcl, "excl");
6263 6264
6264 DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system, 6265 DEFVAR_LISP ("file-name-coding-system", Vfile_name_coding_system,
@@ -6320,6 +6321,11 @@ behaves as if file names were encoded in `utf-8'. */);
6320 Fput (Qfile_notify_error, Qerror_message, 6321 Fput (Qfile_notify_error, Qerror_message,
6321 build_pure_c_string ("File notification error")); 6322 build_pure_c_string ("File notification error"));
6322 6323
6324 Fput (Qremote_file_error, Qerror_conditions,
6325 Fpurecopy (list3 (Qremote_file_error, Qfile_error, Qerror)));
6326 Fput (Qremote_file_error, Qerror_message,
6327 build_pure_c_string ("Remote file error"));
6328
6323 DEFVAR_LISP ("file-name-handler-alist", Vfile_name_handler_alist, 6329 DEFVAR_LISP ("file-name-handler-alist", Vfile_name_handler_alist,
6324 doc: /* Alist of elements (REGEXP . HANDLER) for file names handled specially. 6330 doc: /* Alist of elements (REGEXP . HANDLER) for file names handled specially.
6325If a file name matches REGEXP, all I/O on that file is done by calling 6331If a file name matches REGEXP, all I/O on that file is done by calling
diff --git a/src/image.c b/src/image.c
index e2a3902b26c..b62e7bcd2ef 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2281,6 +2281,10 @@ image_set_transform (struct frame *f, struct image *img)
2281# if !defined USE_CAIRO && defined HAVE_XRENDER 2281# if !defined USE_CAIRO && defined HAVE_XRENDER
2282 if (!img->picture) 2282 if (!img->picture)
2283 return; 2283 return;
2284
2285 /* Store the original dimensions as we'll overwrite them later. */
2286 img->original_width = img->width;
2287 img->original_height = img->height;
2284# endif 2288# endif
2285 2289
2286 /* Determine size. */ 2290 /* Determine size. */
@@ -3140,6 +3144,11 @@ image_get_x_image (struct frame *f, struct image *img, bool mask_p)
3140 3144
3141 if (ximg_in_img) 3145 if (ximg_in_img)
3142 return ximg_in_img; 3146 return ximg_in_img;
3147#ifdef HAVE_XRENDER
3148 else if (img->picture)
3149 return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask,
3150 0, 0, img->original_width, img->original_height, ~0, ZPixmap);
3151#endif
3143 else 3152 else
3144 return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask, 3153 return XGetImage (FRAME_X_DISPLAY (f), !mask_p ? img->pixmap : img->mask,
3145 0, 0, img->width, img->height, ~0, ZPixmap); 3154 0, 0, img->width, img->height, ~0, ZPixmap);
diff --git a/src/keyboard.c b/src/keyboard.c
index e8d0747210a..7f12449a39c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -11838,6 +11838,13 @@ will be in `last-command' during the following command. */);
11838 doc: /* This is like `this-command', except that commands should never modify it. */); 11838 doc: /* This is like `this-command', except that commands should never modify it. */);
11839 Vreal_this_command = Qnil; 11839 Vreal_this_command = Qnil;
11840 11840
11841 DEFSYM (Qcurrent_minibuffer_command, "current-minibuffer-command");
11842 DEFVAR_LISP ("current-minibuffer-command", Vcurrent_minibuffer_command,
11843 doc: /* This is like `this-command', but bound recursively.
11844Code running from (for instance) a minibuffer hook can check this variable
11845to see what command invoked the current minibuffer. */);
11846 Vcurrent_minibuffer_command = Qnil;
11847
11841 DEFVAR_LISP ("this-command-keys-shift-translated", 11848 DEFVAR_LISP ("this-command-keys-shift-translated",
11842 Vthis_command_keys_shift_translated, 11849 Vthis_command_keys_shift_translated,
11843 doc: /* Non-nil if the key sequence activating this command was shift-translated. 11850 doc: /* Non-nil if the key sequence activating this command was shift-translated.
diff --git a/src/keymap.c b/src/keymap.c
index e22eb411f63..ca2d33dba47 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3243,49 +3243,11 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
3243 } 3243 }
3244} 3244}
3245 3245
3246/* Apropos - finding all symbols whose names match a regexp. */
3247static Lisp_Object apropos_predicate;
3248static Lisp_Object apropos_accumulate;
3249
3250static void
3251apropos_accum (Lisp_Object symbol, Lisp_Object string)
3252{
3253 register Lisp_Object tem;
3254
3255 tem = Fstring_match (string, Fsymbol_name (symbol), Qnil);
3256 if (!NILP (tem) && !NILP (apropos_predicate))
3257 tem = call1 (apropos_predicate, symbol);
3258 if (!NILP (tem))
3259 apropos_accumulate = Fcons (symbol, apropos_accumulate);
3260}
3261
3262DEFUN ("apropos-internal", Fapropos_internal, Sapropos_internal, 1, 2, 0,
3263 doc: /* Show all symbols whose names contain match for REGEXP.
3264If optional 2nd arg PREDICATE is non-nil, (funcall PREDICATE SYMBOL) is done
3265for each symbol and a symbol is mentioned only if that returns non-nil.
3266Return list of symbols found. */)
3267 (Lisp_Object regexp, Lisp_Object predicate)
3268{
3269 Lisp_Object tem;
3270 CHECK_STRING (regexp);
3271 apropos_predicate = predicate;
3272 apropos_accumulate = Qnil;
3273 map_obarray (Vobarray, apropos_accum, regexp);
3274 tem = Fsort (apropos_accumulate, Qstring_lessp);
3275 apropos_accumulate = Qnil;
3276 apropos_predicate = Qnil;
3277 return tem;
3278}
3279
3280void 3246void
3281syms_of_keymap (void) 3247syms_of_keymap (void)
3282{ 3248{
3283 DEFSYM (Qkeymap, "keymap"); 3249 DEFSYM (Qkeymap, "keymap");
3284 DEFSYM (Qdescribe_map_tree, "describe-map-tree"); 3250 DEFSYM (Qdescribe_map_tree, "describe-map-tree");
3285 staticpro (&apropos_predicate);
3286 staticpro (&apropos_accumulate);
3287 apropos_predicate = Qnil;
3288 apropos_accumulate = Qnil;
3289 3251
3290 DEFSYM (Qkeymap_canonicalize, "keymap-canonicalize"); 3252 DEFSYM (Qkeymap_canonicalize, "keymap-canonicalize");
3291 3253
@@ -3429,7 +3391,6 @@ be preferred. */);
3429 defsubr (&Stext_char_description); 3391 defsubr (&Stext_char_description);
3430 defsubr (&Swhere_is_internal); 3392 defsubr (&Swhere_is_internal);
3431 defsubr (&Sdescribe_buffer_bindings); 3393 defsubr (&Sdescribe_buffer_bindings);
3432 defsubr (&Sapropos_internal);
3433} 3394}
3434 3395
3435void 3396void
diff --git a/src/lread.c b/src/lread.c
index a3d5fd7bb81..3ef874039a6 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3438,7 +3438,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
3438 3438
3439 /* Any modifiers remaining are invalid. */ 3439 /* Any modifiers remaining are invalid. */
3440 if (modifiers) 3440 if (modifiers)
3441 error ("Invalid modifier in string"); 3441 invalid_syntax ("Invalid modifier in string");
3442 p += CHAR_STRING (ch, (unsigned char *) p); 3442 p += CHAR_STRING (ch, (unsigned char *) p);
3443 } 3443 }
3444 else 3444 else
diff --git a/src/window.c b/src/window.c
index 8e75e460b2b..bcc989b5a79 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5686,27 +5686,20 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
5686 we would end up at the start of the line ending at ZV. */ 5686 we would end up at the start of the line ending at ZV. */
5687 if (dy <= 0) 5687 if (dy <= 0)
5688 { 5688 {
5689 goal_y = it.current_y - dy; 5689 goal_y = it.current_y + dy;
5690 move_it_vertically_backward (&it, -dy); 5690 move_it_vertically_backward (&it, -dy);
5691 /* Extra precision for people who want us to preserve the 5691 /* move_it_vertically_backward above always overshoots if DY
5692 screen position of the cursor: effectively round DY to the 5692 cannot be reached exactly, i.e. if it falls in the middle
5693 nearest screen line, instead of rounding to zero; the latter 5693 of a screen line. But if that screen line is large
5694 causes point to move by one line after C-v followed by M-v, 5694 (e.g., a tall image), it might make more sense to
5695 if the buffer has lines of different height. */ 5695 undershoot instead. */
5696 if (!NILP (Vscroll_preserve_screen_position) 5696 if (goal_y - it.current_y > 0.5 * flh)
5697 && it.current_y - goal_y > 0.5 * flh)
5698 { 5697 {
5699 it_data = bidi_shelve_cache (); 5698 it_data = bidi_shelve_cache ();
5700 struct it it2 = it; 5699 struct it it1 = it;
5701 5700 if (line_bottom_y (&it1) - goal_y < goal_y - it.current_y)
5702 move_it_by_lines (&it, -1); 5701 move_it_by_lines (&it, 1);
5703 if (it.current_y < goal_y - 0.5 * flh) 5702 bidi_unshelve_cache (it_data, true);
5704 {
5705 it = it2;
5706 bidi_unshelve_cache (it_data, false);
5707 }
5708 else
5709 bidi_unshelve_cache (it_data, true);
5710 } 5703 }
5711 /* Ensure we actually do move, e.g. in case we are currently 5704 /* Ensure we actually do move, e.g. in case we are currently
5712 looking at an image that is taller that the window height. */ 5705 looking at an image that is taller that the window height. */
@@ -5718,8 +5711,11 @@ window_scroll_pixel_based (Lisp_Object window, int n, bool whole, bool noerror)
5718 { 5711 {
5719 goal_y = it.current_y + dy; 5712 goal_y = it.current_y + dy;
5720 move_it_to (&it, ZV, -1, goal_y, -1, MOVE_TO_POS | MOVE_TO_Y); 5713 move_it_to (&it, ZV, -1, goal_y, -1, MOVE_TO_POS | MOVE_TO_Y);
5721 /* See the comment above, for the reasons of this 5714 /* Extra precision for people who want us to preserve the
5722 extra-precision. */ 5715 screen position of the cursor: effectively round DY to the
5716 nearest screen line, instead of rounding to zero; the latter
5717 causes point to move by one line after C-v followed by M-v,
5718 if the buffer has lines of different height. */
5723 if (!NILP (Vscroll_preserve_screen_position) 5719 if (!NILP (Vscroll_preserve_screen_position)
5724 && goal_y - it.current_y > 0.5 * flh) 5720 && goal_y - it.current_y > 0.5 * flh)
5725 { 5721 {
@@ -7826,7 +7822,7 @@ set_window_scroll_bars (struct window *w, Lisp_Object width,
7826 if more than a single window needs to be considered, see 7822 if more than a single window needs to be considered, see
7827 redisplay_internal. */ 7823 redisplay_internal. */
7828 if (changed) 7824 if (changed)
7829 windows_or_buffers_changed = 31; 7825 wset_redisplay (w);
7830 7826
7831 return changed ? w : NULL; 7827 return changed ? w : NULL;
7832 } 7828 }
diff --git a/src/xdisp.c b/src/xdisp.c
index a8c66f017fc..5533c82d143 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9957,7 +9957,27 @@ move_it_to (struct it *it, ptrdiff_t to_charpos, int to_x, int to_y, int to_vpos
9957 { 9957 {
9958 skip = skip2; 9958 skip = skip2;
9959 if (skip == MOVE_POS_MATCH_OR_ZV) 9959 if (skip == MOVE_POS_MATCH_OR_ZV)
9960 reached = 7; 9960 {
9961 reached = 7;
9962 /* If the last move_it_in_display_line_to call
9963 took us away from TO_CHARPOS, back up to the
9964 previous position, as it is a better
9965 approximation of TO_CHARPOS. (Note that we
9966 could have both positions after TO_CHARPOS or
9967 both positions before it, due to bidi
9968 reordering.) */
9969 if (IT_CHARPOS (*it) != to_charpos
9970 && ((IT_CHARPOS (it_backup) > to_charpos)
9971 == (IT_CHARPOS (*it) > to_charpos)))
9972 {
9973 int max_ascent = it->max_ascent;
9974 int max_descent = it->max_descent;
9975
9976 RESTORE_IT (it, &it_backup, backup_data);
9977 it->max_ascent = max_ascent;
9978 it->max_descent = max_descent;
9979 }
9980 }
9961 } 9981 }
9962 } 9982 }
9963 else 9983 else
@@ -10301,11 +10321,22 @@ move_it_vertically_backward (struct it *it, int dy)
10301 move_it_vertically (it, target_y - it->current_y); 10321 move_it_vertically (it, target_y - it->current_y);
10302 else 10322 else
10303 { 10323 {
10324 struct text_pos last_pos;
10325 int last_y, last_vpos;
10304 do 10326 do
10305 { 10327 {
10328 last_pos = it->current.pos;
10329 last_y = it->current_y;
10330 last_vpos = it->vpos;
10306 move_it_by_lines (it, 1); 10331 move_it_by_lines (it, 1);
10307 } 10332 }
10308 while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV); 10333 while (target_y > it->current_y && IT_CHARPOS (*it) < ZV);
10334 if (it->current_y > target_y)
10335 {
10336 reseat (it, last_pos, true);
10337 it->current_y = last_y;
10338 it->vpos = last_vpos;
10339 }
10309 } 10340 }
10310 } 10341 }
10311 } 10342 }