aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2013-10-13 20:55:00 +0900
committerKenichi Handa2013-10-13 20:55:00 +0900
commit70c8ae6ebdad9265f793b91bc056204e0833682b (patch)
tree464b1c03544f36da75b8a42ad8f3c8b1f7cfc9e2 /src
parent85b64f021c189466eec8036df2996af409714666 (diff)
parentfc7f501bc04f23af297fda7b6cb17df493b59397 (diff)
downloademacs-70c8ae6ebdad9265f793b91bc056204e0833682b.tar.gz
emacs-70c8ae6ebdad9265f793b91bc056204e0833682b.zip
merge trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog34
-rw-r--r--src/dispextern.h1
-rw-r--r--src/dispnew.c3
-rw-r--r--src/gnutls.c23
-rw-r--r--src/image.c26
-rw-r--r--src/term.c26
-rw-r--r--src/xdisp.c9
7 files changed, 94 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 74bb2a06cb9..b853f874e24 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,35 @@
12013-10-12 Eli Zaretskii <eliz@gnu.org>
2
3 * image.c (GIFLIB_MAJOR, GIFLIB_MINOR, GIFLIB_RELEASE): Move back
4 after inclusion of gif_lib.h, thus fixing compiler warnings caused
5 by 2013-10-10T19:15:33Z!eggert@cs.ucla.edu.
6
72013-10-11 Eli Zaretskii <eliz@gnu.org>
8
9 * xdisp.c (deep_copy_glyph_row): Handle the case that FROM and TO
10 have different dimensions. (Bug#15575)
11
12 * dispnew.c (fill_up_frame_row_with_spaces): Now has external
13 visibility.
14
15 * dispextern.h (fill_up_frame_row_with_spaces): Add prototype.
16
172013-10-11 Dmitry Antipov <dmantipov@yandex.ru>
18
19 * term.c (tty_menu_show): Never return with unbalanced
20 specpdl. Use eassert for debugging check. Adjust style.
21
222013-10-11 Eli Zaretskii <eliz@gnu.org>
23
24 * term.c (read_menu_input): Make selection of menu items
25 cyclical. Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
26 (tty_menu_activate): Fix off-by-one error when computing max_y.
27
282013-10-11 Teodor Zlatanov <tzz@lifelogs.com>
29
30 * gnutls.c (gnutls_audit_log_function): Add function for GnuTLS
31 audit logging (only used with GnuTLS 3.x) and enable it.
32
12013-10-11 Dmitry Antipov <dmantipov@yandex.ru> 332013-10-11 Dmitry Antipov <dmantipov@yandex.ru>
2 34
3 * dispnew.c (redraw_frame): Remove useless #ifdef because 35 * dispnew.c (redraw_frame): Remove useless #ifdef because
@@ -2333,7 +2365,7 @@
2333 * keyboard.c (Fdiscard_input): Do not increment update_mode_lines. 2365 * keyboard.c (Fdiscard_input): Do not increment update_mode_lines.
2334 * nsfns.m (x_set_cursor_type): 2366 * nsfns.m (x_set_cursor_type):
2335 * w32fns.c (x_set_cursor_type): 2367 * w32fns.c (x_set_cursor_type):
2336 * xfns.m (x_set_cursor_type): Do not set cursor_type_changed here... 2368 * xfns.c (x_set_cursor_type): Do not set cursor_type_changed here...
2337 * xdisp.c (set_frame_cursor_types): ...but in common code. 2369 * xdisp.c (set_frame_cursor_types): ...but in common code.
2338 2370
23392013-08-13 Dmitry Antipov <dmantipov@yandex.ru> 23712013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
diff --git a/src/dispextern.h b/src/dispextern.h
index 10cd3169408..2d09fe7c5fe 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3472,6 +3472,7 @@ void init_display (void);
3472void syms_of_display (void); 3472void syms_of_display (void);
3473extern Lisp_Object Qredisplay_dont_pause; 3473extern Lisp_Object Qredisplay_dont_pause;
3474extern void spec_glyph_lookup_face (struct window *, GLYPH *); 3474extern void spec_glyph_lookup_face (struct window *, GLYPH *);
3475extern void fill_up_frame_row_with_spaces (struct glyph_row *, int);
3475 3476
3476/* Defined in terminal.c */ 3477/* Defined in terminal.c */
3477 3478
diff --git a/src/dispnew.c b/src/dispnew.c
index d01de185332..3c0fda0b745 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -77,7 +77,6 @@ static int required_matrix_height (struct window *);
77static int required_matrix_width (struct window *); 77static int required_matrix_width (struct window *);
78static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool); 78static void change_frame_size_1 (struct frame *, int, int, bool, bool, bool);
79static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t); 79static void increment_row_positions (struct glyph_row *, ptrdiff_t, ptrdiff_t);
80static void fill_up_frame_row_with_spaces (struct glyph_row *, int);
81static void build_frame_matrix_from_window_tree (struct glyph_matrix *, 80static void build_frame_matrix_from_window_tree (struct glyph_matrix *,
82 struct window *); 81 struct window *);
83static void build_frame_matrix_from_leaf_window (struct glyph_matrix *, 82static void build_frame_matrix_from_leaf_window (struct glyph_matrix *,
@@ -2503,7 +2502,7 @@ fill_up_glyph_row_area_with_spaces (struct glyph_row *row, int area)
2503/* Add spaces to the end of ROW in a frame matrix until index UPTO is 2502/* Add spaces to the end of ROW in a frame matrix until index UPTO is
2504 reached. In frame matrices only one area, TEXT_AREA, is used. */ 2503 reached. In frame matrices only one area, TEXT_AREA, is used. */
2505 2504
2506static void 2505void
2507fill_up_frame_row_with_spaces (struct glyph_row *row, int upto) 2506fill_up_frame_row_with_spaces (struct glyph_row *row, int upto)
2508{ 2507{
2509 int i = row->used[TEXT_AREA]; 2508 int i = row->used[TEXT_AREA];
diff --git a/src/gnutls.c b/src/gnutls.c
index db0a6dac01c..2157d555053 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -55,6 +55,7 @@ static Lisp_Object QCgnutls_bootprop_verify_hostname_error;
55static Lisp_Object QCgnutls_bootprop_callbacks_verify; 55static Lisp_Object QCgnutls_bootprop_callbacks_verify;
56 56
57static void gnutls_log_function (int, const char *); 57static void gnutls_log_function (int, const char *);
58static void gnutls_audit_log_function (gnutls_session_t, const char *);
58static void gnutls_log_function2 (int, const char*, const char*); 59static void gnutls_log_function2 (int, const char*, const char*);
59 60
60 61
@@ -108,6 +109,9 @@ DEF_GNUTLS_FN (void, gnutls_dh_set_prime_bits,
108DEF_GNUTLS_FN (int, gnutls_error_is_fatal, (int)); 109DEF_GNUTLS_FN (int, gnutls_error_is_fatal, (int));
109DEF_GNUTLS_FN (int, gnutls_global_init, (void)); 110DEF_GNUTLS_FN (int, gnutls_global_init, (void));
110DEF_GNUTLS_FN (void, gnutls_global_set_log_function, (gnutls_log_func)); 111DEF_GNUTLS_FN (void, gnutls_global_set_log_function, (gnutls_log_func));
112#ifdef HAVE_GNUTLS3
113DEF_GNUTLS_FN (void, gnutls_global_set_audit_log_function, (gnutls_audit_log_func));
114#endif
111DEF_GNUTLS_FN (void, gnutls_global_set_log_level, (int)); 115DEF_GNUTLS_FN (void, gnutls_global_set_log_level, (int));
112DEF_GNUTLS_FN (void, gnutls_global_set_mem_functions, 116DEF_GNUTLS_FN (void, gnutls_global_set_mem_functions,
113 (gnutls_alloc_function, gnutls_alloc_function, 117 (gnutls_alloc_function, gnutls_alloc_function,
@@ -173,6 +177,9 @@ init_gnutls_functions (void)
173 LOAD_GNUTLS_FN (library, gnutls_error_is_fatal); 177 LOAD_GNUTLS_FN (library, gnutls_error_is_fatal);
174 LOAD_GNUTLS_FN (library, gnutls_global_init); 178 LOAD_GNUTLS_FN (library, gnutls_global_init);
175 LOAD_GNUTLS_FN (library, gnutls_global_set_log_function); 179 LOAD_GNUTLS_FN (library, gnutls_global_set_log_function);
180#ifdef HAVE_GNUTLS3
181 LOAD_GNUTLS_FN (library, gnutls_global_set_audit_log_function);
182#endif
176 LOAD_GNUTLS_FN (library, gnutls_global_set_log_level); 183 LOAD_GNUTLS_FN (library, gnutls_global_set_log_level);
177 LOAD_GNUTLS_FN (library, gnutls_global_set_mem_functions); 184 LOAD_GNUTLS_FN (library, gnutls_global_set_mem_functions);
178 LOAD_GNUTLS_FN (library, gnutls_handshake); 185 LOAD_GNUTLS_FN (library, gnutls_handshake);
@@ -230,6 +237,9 @@ init_gnutls_functions (void)
230#define fn_gnutls_error_is_fatal gnutls_error_is_fatal 237#define fn_gnutls_error_is_fatal gnutls_error_is_fatal
231#define fn_gnutls_global_init gnutls_global_init 238#define fn_gnutls_global_init gnutls_global_init
232#define fn_gnutls_global_set_log_function gnutls_global_set_log_function 239#define fn_gnutls_global_set_log_function gnutls_global_set_log_function
240#ifdef HAVE_GNUTLS3
241#define fn_gnutls_global_set_audit_log_function gnutls_global_set_audit_log_function
242#endif
233#define fn_gnutls_global_set_log_level gnutls_global_set_log_level 243#define fn_gnutls_global_set_log_level gnutls_global_set_log_level
234#define fn_gnutls_global_set_mem_functions gnutls_global_set_mem_functions 244#define fn_gnutls_global_set_mem_functions gnutls_global_set_mem_functions
235#define fn_gnutls_handshake gnutls_handshake 245#define fn_gnutls_handshake gnutls_handshake
@@ -249,6 +259,16 @@ init_gnutls_functions (void)
249#endif /* !WINDOWSNT */ 259#endif /* !WINDOWSNT */
250 260
251 261
262/* Function to log a simple audit message. */
263static void
264gnutls_audit_log_function (gnutls_session_t session, const char* string)
265{
266 if (global_gnutls_log_level >= 1)
267 {
268 message ("gnutls.c: [audit] %s", string);
269 }
270}
271
252/* Function to log a simple message. */ 272/* Function to log a simple message. */
253static void 273static void
254gnutls_log_function (int level, const char* string) 274gnutls_log_function (int level, const char* string)
@@ -797,6 +817,9 @@ one trustfile (usually a CA bundle). */)
797 if (TYPE_RANGED_INTEGERP (int, loglevel)) 817 if (TYPE_RANGED_INTEGERP (int, loglevel))
798 { 818 {
799 fn_gnutls_global_set_log_function (gnutls_log_function); 819 fn_gnutls_global_set_log_function (gnutls_log_function);
820#ifdef HAVE_GNUTLS3
821 fn_gnutls_global_set_audit_log_function (gnutls_audit_log_function);
822#endif
800 fn_gnutls_global_set_log_level (XINT (loglevel)); 823 fn_gnutls_global_set_log_level (XINT (loglevel));
801 max_log_level = XINT (loglevel); 824 max_log_level = XINT (loglevel);
802 XPROCESS (proc)->gnutls_log_level = max_log_level; 825 XPROCESS (proc)->gnutls_log_level = max_log_level;
diff --git a/src/image.c b/src/image.c
index ca2ef67c0b9..bb3290a89f6 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7203,21 +7203,8 @@ gif_image_p (Lisp_Object object)
7203 7203
7204#ifdef HAVE_GIF 7204#ifdef HAVE_GIF
7205 7205
7206/* Giflib before 5.0 didn't define these macros. */
7207#ifndef GIFLIB_MAJOR
7208#define GIFLIB_MAJOR 4
7209#endif
7210
7211#if defined (HAVE_NTGUI) 7206#if defined (HAVE_NTGUI)
7212 7207
7213/* Giflib before 5.0 didn't define these macros (used only if HAVE_NTGUI). */
7214#ifndef GIFLIB_MINOR
7215#define GIFLIB_MINOR 0
7216#endif
7217#ifndef GIFLIB_RELEASE
7218#define GIFLIB_RELEASE 0
7219#endif
7220
7221/* winuser.h might define DrawText to DrawTextA or DrawTextW. 7208/* winuser.h might define DrawText to DrawTextA or DrawTextW.
7222 Undefine before redefining to avoid a preprocessor warning. */ 7209 Undefine before redefining to avoid a preprocessor warning. */
7223#ifdef DrawText 7210#ifdef DrawText
@@ -7228,12 +7215,25 @@ gif_image_p (Lisp_Object object)
7228#include <gif_lib.h> 7215#include <gif_lib.h>
7229#undef DrawText 7216#undef DrawText
7230 7217
7218/* Giflib before 5.0 didn't define these macros (used only if HAVE_NTGUI). */
7219#ifndef GIFLIB_MINOR
7220#define GIFLIB_MINOR 0
7221#endif
7222#ifndef GIFLIB_RELEASE
7223#define GIFLIB_RELEASE 0
7224#endif
7225
7231#else /* HAVE_NTGUI */ 7226#else /* HAVE_NTGUI */
7232 7227
7233#include <gif_lib.h> 7228#include <gif_lib.h>
7234 7229
7235#endif /* HAVE_NTGUI */ 7230#endif /* HAVE_NTGUI */
7236 7231
7232/* Giflib before 5.0 didn't define these macros. */
7233#ifndef GIFLIB_MAJOR
7234#define GIFLIB_MAJOR 4
7235#endif
7236
7237#ifdef WINDOWSNT 7237#ifdef WINDOWSNT
7238 7238
7239/* GIF library details. */ 7239/* GIF library details. */
diff --git a/src/term.c b/src/term.c
index 27471775d03..b946480cd0c 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3177,11 +3177,15 @@ read_menu_input (struct frame *sf, int *x, int *y, int min_y, int max_y,
3177 { 3177 {
3178 if (*y < max_y) 3178 if (*y < max_y)
3179 *y += 1; 3179 *y += 1;
3180 else
3181 *y = min_y;
3180 } 3182 }
3181 else if (EQ (cmd, Qtty_menu_prev_item)) 3183 else if (EQ (cmd, Qtty_menu_prev_item))
3182 { 3184 {
3183 if (*y > min_y) 3185 if (*y > min_y)
3184 *y -= 1; 3186 *y -= 1;
3187 else
3188 *y = max_y;
3185 } 3189 }
3186 else if (EQ (cmd, Qtty_menu_select)) 3190 else if (EQ (cmd, Qtty_menu_select))
3187 st = 1; 3191 st = 1;
@@ -3290,7 +3294,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3290 { 3294 {
3291 int input_status; 3295 int input_status;
3292 int min_y = state[0].y; 3296 int min_y = state[0].y;
3293 int max_y = min (min_y + state[0].menu->count, FRAME_LINES (sf)) - 1; 3297 int max_y = min (min_y + state[0].menu->count, FRAME_LINES (sf) - 1) - 1;
3294 3298
3295 input_status = read_menu_input (sf, &x, &y, min_y, max_y, &first_time); 3299 input_status = read_menu_input (sf, &x, &y, min_y, max_y, &first_time);
3296 if (input_status) 3300 if (input_status)
@@ -3557,10 +3561,9 @@ tty_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
3557 int dispwidth, dispheight; 3561 int dispwidth, dispheight;
3558 int i, j, lines, maxlines; 3562 int i, j, lines, maxlines;
3559 int maxwidth; 3563 int maxwidth;
3560 ptrdiff_t specpdl_count = SPECPDL_INDEX (); 3564 ptrdiff_t specpdl_count;
3561 3565
3562 if (! FRAME_TERMCAP_P (f)) 3566 eassert (FRAME_TERMCAP_P (f));
3563 emacs_abort ();
3564 3567
3565 *error_name = 0; 3568 *error_name = 0;
3566 if (menu_items_n_panes == 0) 3569 if (menu_items_n_panes == 0)
@@ -3582,7 +3585,7 @@ tty_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
3582 3585
3583 /* Don't GC while we prepare and show the menu, because we give the 3586 /* Don't GC while we prepare and show the menu, because we give the
3584 menu functions pointers to the contents of strings. */ 3587 menu functions pointers to the contents of strings. */
3585 inhibit_garbage_collection (); 3588 specpdl_count = inhibit_garbage_collection ();
3586 3589
3587 /* Adjust coordinates to be root-window-relative. */ 3590 /* Adjust coordinates to be root-window-relative. */
3588 item_x = x += f->left_pos; 3591 item_x = x += f->left_pos;
@@ -3613,7 +3616,8 @@ tty_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
3613 { 3616 {
3614 tty_menu_destroy (menu); 3617 tty_menu_destroy (menu);
3615 *error_name = "Can't create pane"; 3618 *error_name = "Can't create pane";
3616 return Qnil; 3619 entry = Qnil;
3620 goto tty_menu_end;
3617 } 3621 }
3618 i += MENU_ITEMS_PANE_LENGTH; 3622 i += MENU_ITEMS_PANE_LENGTH;
3619 3623
@@ -3675,7 +3679,8 @@ tty_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
3675 { 3679 {
3676 tty_menu_destroy (menu); 3680 tty_menu_destroy (menu);
3677 *error_name = "Can't add selection to menu"; 3681 *error_name = "Can't add selection to menu";
3678 return Qnil; 3682 entry = Qnil;
3683 goto tty_menu_end;
3679 } 3684 }
3680 i += MENU_ITEMS_ITEM_LENGTH; 3685 i += MENU_ITEMS_ITEM_LENGTH;
3681 lines++; 3686 lines++;
@@ -3692,12 +3697,12 @@ tty_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
3692 x = max (x, 1); 3697 x = max (x, 1);
3693 y = max (y, 1); 3698 y = max (y, 1);
3694 tty_menu_locate (menu, x, y, &ulx, &uly, &width, &height); 3699 tty_menu_locate (menu, x, y, &ulx, &uly, &width, &height);
3695 if (ulx+width > dispwidth) 3700 if (ulx + width > dispwidth)
3696 { 3701 {
3697 x -= (ulx + width) - dispwidth; 3702 x -= (ulx + width) - dispwidth;
3698 ulx = dispwidth - width; 3703 ulx = dispwidth - width;
3699 } 3704 }
3700 if (uly+height > dispheight) 3705 if (uly + height > dispheight)
3701 { 3706 {
3702 y -= (uly + height) - dispheight; 3707 y -= (uly + height) - dispheight;
3703 uly = dispheight - height; 3708 uly = dispheight - height;
@@ -3803,8 +3808,9 @@ tty_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
3803 break; 3808 break;
3804 } 3809 }
3805 3810
3806 unbind_to (specpdl_count, Qnil); 3811 tty_menu_end:
3807 3812
3813 unbind_to (specpdl_count, Qnil);
3808 return entry; 3814 return entry;
3809} 3815}
3810 3816
diff --git a/src/xdisp.c b/src/xdisp.c
index 7cfb0ab51ad..033d3b47147 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20590,10 +20590,10 @@ static void
20590deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from) 20590deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from)
20591{ 20591{
20592 struct glyph *pointers[1 + LAST_AREA]; 20592 struct glyph *pointers[1 + LAST_AREA];
20593 int to_used = to->used[TEXT_AREA];
20593 20594
20594 /* Save glyph pointers of TO. */ 20595 /* Save glyph pointers of TO. */
20595 memcpy (pointers, to->glyphs, sizeof to->glyphs); 20596 memcpy (pointers, to->glyphs, sizeof to->glyphs);
20596 eassert (to->used[TEXT_AREA] == from->used[TEXT_AREA]);
20597 20597
20598 /* Do a structure assignment. */ 20598 /* Do a structure assignment. */
20599 *to = *from; 20599 *to = *from;
@@ -20603,7 +20603,12 @@ deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from)
20603 20603
20604 /* Copy the glyphs. */ 20604 /* Copy the glyphs. */
20605 memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA], 20605 memcpy (to->glyphs[TEXT_AREA], from->glyphs[TEXT_AREA],
20606 from->used[TEXT_AREA] * sizeof (struct glyph)); 20606 min (from->used[TEXT_AREA], to_used) * sizeof (struct glyph));
20607
20608 /* If we filled only part of the TO row, fill the rest with
20609 space_glyph (which will display as empty space). */
20610 if (to_used > from->used[TEXT_AREA])
20611 fill_up_frame_row_with_spaces (to, to_used);
20607} 20612}
20608 20613
20609/* Display one menu item on a TTY, by overwriting the glyphs in the 20614/* Display one menu item on a TTY, by overwriting the glyphs in the