aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Rudalics2011-06-06 08:57:59 +0200
committerMartin Rudalics2011-06-06 08:57:59 +0200
commit1d00388aae9e39ceb8e520b5f227c21fdd219a20 (patch)
tree0fae32c463f63162d608b9038dd63fe73b9dfb59 /src
parent348f5121cd84ade8ce29d557e7f1215694027b05 (diff)
parent4d09bcf621ec32e17fdb8dd2ea08344486f7aeef (diff)
downloademacs-old-branches/window-pub.tar.gz
emacs-old-branches/window-pub.zip
Merge from trunkold-branches/window-pub
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog27
-rw-r--r--src/alloc.c15
-rw-r--r--src/editfns.c5
-rw-r--r--src/gtkutil.c19
-rw-r--r--src/gtkutil.h1
-rw-r--r--src/xfns.c8
6 files changed, 66 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0cc2af13e6a..1932453bb79 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,30 @@
12011-06-06 Paul Eggert <eggert@cs.ucla.edu>
2
3 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
4 Do not assume that spare memory exists; that assumption is valid
5 only if SYSTEM_MALLOC.
6 (LARGE_REQUEST): New macro, so that the issue of large requests
7 is separated from the issue of spare memory.
8
92011-06-05 Andreas Schwab <schwab@linux-m68k.org>
10
11 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12 format. (Bug#8806)
13
14 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15
16 * xfns.c (x_set_scroll_bar_default_width): Move declarations
17 before statements.
18
192011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20
21 * gtkutil.c (xg_get_default_scrollbar_width): New function.
22
23 * gtkutil.h: Declare xg_get_default_scrollbar_width.
24
25 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
26 min width by calling x_set_scroll_bar_default_width (Bug#8505).
27
12011-06-05 Juanma Barranquero <lekktu@gmail.com> 282011-06-05 Juanma Barranquero <lekktu@gmail.com>
2 29
3 * xdisp.c (single_display_spec_intangible_p): Remove declaration. 30 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
diff --git a/src/alloc.c b/src/alloc.c
index 0c18fca1755..8d0fdd125dc 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -196,6 +196,12 @@ static char *spare_memory[7];
196#define SPARE_MEMORY (1 << 14) 196#define SPARE_MEMORY (1 << 14)
197#endif 197#endif
198 198
199#ifdef SYSTEM_MALLOC
200# define LARGE_REQUEST (1 << 14)
201#else
202# define LARGE_REQUEST SPARE_MEMORY
203#endif
204
199/* Number of extra blocks malloc should get when it needs more core. */ 205/* Number of extra blocks malloc should get when it needs more core. */
200 206
201static int malloc_hysteresis; 207static int malloc_hysteresis;
@@ -3283,15 +3289,12 @@ memory_full (size_t nbytes)
3283{ 3289{
3284 /* Do not go into hysterics merely because a large request failed. */ 3290 /* Do not go into hysterics merely because a large request failed. */
3285 int enough_free_memory = 0; 3291 int enough_free_memory = 0;
3286 if (SPARE_MEMORY < nbytes) 3292 if (LARGE_REQUEST < nbytes)
3287 { 3293 {
3288 void *p = malloc (SPARE_MEMORY); 3294 void *p = malloc (LARGE_REQUEST);
3289 if (p) 3295 if (p)
3290 { 3296 {
3291 if (spare_memory[0]) 3297 free (p);
3292 free (p);
3293 else
3294 spare_memory[0] = p;
3295 enough_free_memory = 1; 3298 enough_free_memory = 1;
3296 } 3299 }
3297 } 3300 }
diff --git a/src/editfns.c b/src/editfns.c
index 0e40fde9ca4..b961e602e4c 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -4083,7 +4083,10 @@ usage: (format STRING &rest OBJECTS) */)
4083 int exponent_bytes = 0; 4083 int exponent_bytes = 0;
4084 int signedp = src0 == '-' || src0 == '+' || src0 == ' '; 4084 int signedp = src0 == '-' || src0 == '+' || src0 == ' ';
4085 int significand_bytes; 4085 int significand_bytes;
4086 if (zero_flag && '0' <= src[signedp] && src[signedp] <= '9') 4086 if (zero_flag
4087 && ((src[signedp] >= '0' && src[signedp] <= '9')
4088 || (src[signedp] >= 'a' && src[signedp] <= 'f')
4089 || (src[signedp] >= 'A' && src[signedp] <= 'F')))
4087 { 4090 {
4088 leading_zeros += padding; 4091 leading_zeros += padding;
4089 padding = 0; 4092 padding = 0;
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 6e54006d913..dedb39a7a40 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3326,6 +3326,25 @@ xg_get_widget_from_map (int idx)
3326 return 0; 3326 return 0;
3327} 3327}
3328 3328
3329int
3330xg_get_default_scrollbar_width (FRAME_PTR f)
3331{
3332#ifdef HAVE_GTK3
3333 GtkAdjustment *vadj;
3334#else
3335 GtkObject *vadj;
3336#endif
3337 GtkWidget *wscroll;
3338 int w = 0, b = 0;
3339 vadj = gtk_adjustment_new (XG_SB_MIN, XG_SB_MIN, XG_SB_MAX, 0.1, 0.1, 0.1);
3340 wscroll = gtk_vscrollbar_new (GTK_ADJUSTMENT (vadj));
3341 gtk_widget_style_get (wscroll, "slider-width", &w, "trough-border", &b, NULL);
3342 gtk_widget_destroy (wscroll);
3343 w += 2*b;
3344 if (w < 16) w = 16;
3345 return w;
3346}
3347
3329/* Return the scrollbar id for X Window WID on display DPY. 3348/* Return the scrollbar id for X Window WID on display DPY.
3330 Return -1 if WID not in id_to_widget. */ 3349 Return -1 if WID not in id_to_widget. */
3331 3350
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 3dc0a1dd150..cf58d03b0ce 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -135,6 +135,7 @@ extern void xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
135 int position, 135 int position,
136 int whole); 136 int whole);
137extern int xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event); 137extern int xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event);
138extern int xg_get_default_scrollbar_width (FRAME_PTR f);
138 139
139extern void update_frame_tool_bar (FRAME_PTR f); 140extern void update_frame_tool_bar (FRAME_PTR f);
140extern void free_frame_tool_bar (FRAME_PTR f); 141extern void free_frame_tool_bar (FRAME_PTR f);
diff --git a/src/xfns.c b/src/xfns.c
index ab66ddf1845..3507a13d517 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1699,10 +1699,14 @@ void
1699x_set_scroll_bar_default_width (struct frame *f) 1699x_set_scroll_bar_default_width (struct frame *f)
1700{ 1700{
1701 int wid = FRAME_COLUMN_WIDTH (f); 1701 int wid = FRAME_COLUMN_WIDTH (f);
1702 1702 int minw = 16;
1703 int width;
1703#ifdef USE_TOOLKIT_SCROLL_BARS 1704#ifdef USE_TOOLKIT_SCROLL_BARS
1705#ifdef USE_GTK
1706 minw = xg_get_default_scrollbar_width (f);
1707#endif
1704 /* A minimum width of 14 doesn't look good for toolkit scroll bars. */ 1708 /* A minimum width of 14 doesn't look good for toolkit scroll bars. */
1705 int width = 16 + 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM; 1709 width = minw + 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM;
1706 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (width + wid - 1) / wid; 1710 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (width + wid - 1) / wid;
1707 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = width; 1711 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = width;
1708#else 1712#else