diff options
| author | Joakim Verona | 2011-07-26 09:47:27 +0200 |
|---|---|---|
| committer | Joakim Verona | 2011-07-26 09:47:27 +0200 |
| commit | 460c547e0d83da81e503fe475f168c168850f49b (patch) | |
| tree | 7a1f2c55f4d4d21c0713ddee277758c29e0b0a4e /src | |
| parent | 716c24d8844d8ef23c93185ad7fd362c78668b6a (diff) | |
| parent | d6f0886cf1d99d80c45a8a57a7bcce42dc623c3c (diff) | |
| download | emacs-460c547e0d83da81e503fe475f168c168850f49b.tar.gz emacs-460c547e0d83da81e503fe475f168c168850f49b.zip | |
merge upstream
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 16 | ||||
| -rw-r--r-- | src/bidi.c | 2 | ||||
| -rw-r--r-- | src/nsmenu.m | 10 | ||||
| -rw-r--r-- | src/xdisp.c | 12 |
4 files changed, 34 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e537848ea41..dd25d155c66 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2011-07-25 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons | ||
| 4 | are specified (Bug#9168). | ||
| 5 | |||
| 6 | 2011-07-25 Paul Eggert <eggert@cs.ucla.edu> | ||
| 7 | |||
| 8 | * bidi.c (bidi_dump_cached_states): Fix printf format mismatch. | ||
| 9 | Found by GCC static checking and --with-wide-int on a 32-bit host. | ||
| 10 | |||
| 11 | 2011-07-25 Eli Zaretskii <eliz@gnu.org> | ||
| 12 | |||
| 13 | * xdisp.c (compute_display_string_pos): Fix logic of caching | ||
| 14 | previous display string position. Initialize cached_prev_pos to | ||
| 15 | -1. Fixes slow-down at the beginning of a buffer. | ||
| 16 | |||
| 1 | 2011-07-24 Eli Zaretskii <eliz@gnu.org> | 17 | 2011-07-24 Eli Zaretskii <eliz@gnu.org> |
| 2 | 18 | ||
| 3 | * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil' | 19 | * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil' |
diff --git a/src/bidi.c b/src/bidi.c index c83ee549923..412dc94cb86 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -2308,7 +2308,7 @@ bidi_dump_cached_states (void) | |||
| 2308 | fprintf (stderr, "The cache is empty.\n"); | 2308 | fprintf (stderr, "The cache is empty.\n"); |
| 2309 | return; | 2309 | return; |
| 2310 | } | 2310 | } |
| 2311 | fprintf (stderr, "Total of %"pD"d state%s in cache:\n", | 2311 | fprintf (stderr, "Total of %"pI"d state%s in cache:\n", |
| 2312 | bidi_cache_idx, bidi_cache_idx == 1 ? "" : "s"); | 2312 | bidi_cache_idx, bidi_cache_idx == 1 ? "" : "s"); |
| 2313 | 2313 | ||
| 2314 | for (i = bidi_cache[bidi_cache_idx - 1].charpos; i > 0; i /= 10) | 2314 | for (i = bidi_cache[bidi_cache_idx - 1].charpos; i > 0; i /= 10) |
diff --git a/src/nsmenu.m b/src/nsmenu.m index 6a9ee7dd4f5..6931b7a3c01 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -1340,7 +1340,7 @@ Lisp_Object | |||
| 1340 | ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) | 1340 | ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) |
| 1341 | { | 1341 | { |
| 1342 | id dialog; | 1342 | id dialog; |
| 1343 | Lisp_Object window, tem; | 1343 | Lisp_Object window, tem, title; |
| 1344 | struct frame *f; | 1344 | struct frame *f; |
| 1345 | NSPoint p; | 1345 | NSPoint p; |
| 1346 | BOOL isQ; | 1346 | BOOL isQ; |
| @@ -1389,6 +1389,14 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) | |||
| 1389 | p.x = (int)f->left_pos + ((int)FRAME_COLUMN_WIDTH (f) * f->text_cols)/2; | 1389 | p.x = (int)f->left_pos + ((int)FRAME_COLUMN_WIDTH (f) * f->text_cols)/2; |
| 1390 | p.y = (int)f->top_pos + (FRAME_LINE_HEIGHT (f) * f->text_lines)/2; | 1390 | p.y = (int)f->top_pos + (FRAME_LINE_HEIGHT (f) * f->text_lines)/2; |
| 1391 | 1391 | ||
| 1392 | title = Fcar (contents); | ||
| 1393 | CHECK_STRING (title); | ||
| 1394 | |||
| 1395 | if (NILP (Fcar (Fcdr (contents)))) | ||
| 1396 | /* No buttons specified, add an "Ok" button so users can pop down | ||
| 1397 | the dialog. */ | ||
| 1398 | contents = Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil)); | ||
| 1399 | |||
| 1392 | BLOCK_INPUT; | 1400 | BLOCK_INPUT; |
| 1393 | dialog = [[EmacsDialogPanel alloc] initFromContents: contents | 1401 | dialog = [[EmacsDialogPanel alloc] initFromContents: contents |
| 1394 | isQuestion: isQ]; | 1402 | isQuestion: isQ]; |
diff --git a/src/xdisp.c b/src/xdisp.c index a8d62e32ed0..1aef5c7caa8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3139,7 +3139,7 @@ next_overlay_change (EMACS_INT pos) | |||
| 3139 | /* Record one cached display string position found recently by | 3139 | /* Record one cached display string position found recently by |
| 3140 | compute_display_string_pos. */ | 3140 | compute_display_string_pos. */ |
| 3141 | static EMACS_INT cached_disp_pos; | 3141 | static EMACS_INT cached_disp_pos; |
| 3142 | static EMACS_INT cached_prev_pos; | 3142 | static EMACS_INT cached_prev_pos = -1; |
| 3143 | static struct buffer *cached_disp_buffer; | 3143 | static struct buffer *cached_disp_buffer; |
| 3144 | static int cached_disp_modiff; | 3144 | static int cached_disp_modiff; |
| 3145 | static int cached_disp_overlay_modiff; | 3145 | static int cached_disp_overlay_modiff; |
| @@ -3186,18 +3186,22 @@ compute_display_string_pos (struct text_pos *position, | |||
| 3186 | && BUF_MODIFF (b) == cached_disp_modiff | 3186 | && BUF_MODIFF (b) == cached_disp_modiff |
| 3187 | && BUF_OVERLAY_MODIFF (b) == cached_disp_overlay_modiff) | 3187 | && BUF_OVERLAY_MODIFF (b) == cached_disp_overlay_modiff) |
| 3188 | { | 3188 | { |
| 3189 | if (cached_prev_pos | 3189 | if (cached_prev_pos >= 0 |
| 3190 | && cached_prev_pos < charpos && charpos <= cached_disp_pos) | 3190 | && cached_prev_pos < charpos && charpos <= cached_disp_pos) |
| 3191 | return cached_disp_pos; | 3191 | return cached_disp_pos; |
| 3192 | /* Handle overstepping either end of the known interval. */ | 3192 | /* Handle overstepping either end of the known interval. */ |
| 3193 | if (charpos > cached_disp_pos) | 3193 | if (charpos > cached_disp_pos) |
| 3194 | cached_prev_pos = cached_disp_pos; | 3194 | cached_prev_pos = cached_disp_pos; |
| 3195 | else /* charpos <= cached_prev_pos */ | 3195 | else /* charpos <= cached_prev_pos */ |
| 3196 | cached_prev_pos = max (charpos - 1, BEGV); | 3196 | cached_prev_pos = max (charpos - 1, 0); |
| 3197 | } | 3197 | } |
| 3198 | 3198 | ||
| 3199 | /* Record new values in the cache. */ | 3199 | /* Record new values in the cache. */ |
| 3200 | cached_disp_buffer = b; | 3200 | if (b != cached_disp_buffer) |
| 3201 | { | ||
| 3202 | cached_disp_buffer = b; | ||
| 3203 | cached_prev_pos = max (charpos - 1, 0); | ||
| 3204 | } | ||
| 3201 | cached_disp_modiff = BUF_MODIFF (b); | 3205 | cached_disp_modiff = BUF_MODIFF (b); |
| 3202 | cached_disp_overlay_modiff = BUF_OVERLAY_MODIFF (b); | 3206 | cached_disp_overlay_modiff = BUF_OVERLAY_MODIFF (b); |
| 3203 | } | 3207 | } |