aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-01-25 12:42:44 -0500
committerEli Zaretskii2010-01-25 12:42:44 -0500
commit639dd35751e5d43072ef14bc679286136a4feae9 (patch)
tree93a8f5700a211c913d4628607ee6a10f79ad6790 /src
parentb7faba0c9c3d8cb994720e2cccc92a538196d56d (diff)
parente2396d80cbf7e9d20c05eff44c1c8f04ecb9341c (diff)
downloademacs-639dd35751e5d43072ef14bc679286136a4feae9.tar.gz
emacs-639dd35751e5d43072ef14bc679286136a4feae9.zip
Merge from mainline.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog24
-rw-r--r--src/filelock.c2
-rw-r--r--src/image.c14
-rw-r--r--src/keymap.c43
-rw-r--r--src/xfns.c26
5 files changed, 77 insertions, 32 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 62337d8db63..96dc0066fd9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,27 @@
12010-01-25 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xfns.c (Fx_create_frame): If frame height is too big, try
4 sizes 24 and 10. Bug #3643.
5
62010-01-24 Stefan Monnier <monnier@iro.umontreal.ca>
7
8 Try and fix bug#788, hopefully for real this time.
9 * keymap.c (shadow_lookup): Add `remap' arg.
10 (describe_map, describe_vector): Update calls to shadow_lookup.
11 (Fwhere_is_internal): Fix up handling of `remapped_sequences' and
12 `remapped' so this flag is applicable to `sequence'. Be careful to
13 perform remapping during shadow_lookup check of remapped_sequences.
14
152010-01-24 Eric Bélanger <snowmaniscool@gmail.com> (tiny change)
16
17 * image.c (png_load): Use png_sig_cmp instead of the obsolete
18 png_check_sig, which has been removed in libpng 1.4.
19
202010-01-23 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change)
21
22 * filelock.c: Include utmp.h only when HAVE_UTMP_H (FreeBSD 9.x
23 lacks this header file).
24
12010-01-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 252010-01-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 26
3 * xdisp.c (draw_glyphs): Update `start' for left_overwritten case 27 * xdisp.c (draw_glyphs): Update `start' for left_overwritten case
diff --git a/src/filelock.c b/src/filelock.c
index 3c92d495060..7c69ea954fc 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -63,7 +63,9 @@ Lisp_Object Vtemporary_file_directory;
63 63
64#ifdef CLASH_DETECTION 64#ifdef CLASH_DETECTION
65 65
66#ifdef HAVE_UTMP_H
66#include <utmp.h> 67#include <utmp.h>
68#endif
67 69
68#if !defined (S_ISLNK) && defined (S_IFLNK) 70#if !defined (S_ISLNK) && defined (S_IFLNK)
69#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) 71#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
diff --git a/src/image.c b/src/image.c
index 9c11f466807..1265b900c6c 100644
--- a/src/image.c
+++ b/src/image.c
@@ -33,7 +33,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
33#else 33#else
34# include <png.h> 34# include <png.h>
35#endif 35#endif
36#endif 36#endif
37 37
38#include <setjmp.h> 38#include <setjmp.h>
39 39
@@ -3051,7 +3051,7 @@ xbm_load (f, img)
3051 int nbytes, i; 3051 int nbytes, i;
3052 /* Windows mono bitmaps are reversed compared with X. */ 3052 /* Windows mono bitmaps are reversed compared with X. */
3053 invertedBits = bits; 3053 invertedBits = bits;
3054 nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR 3054 nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR
3055 * img->height; 3055 * img->height;
3056 bits = (char *) alloca(nbytes); 3056 bits = (char *) alloca(nbytes);
3057 for (i = 0; i < nbytes; i++) 3057 for (i = 0; i < nbytes; i++)
@@ -5559,7 +5559,7 @@ png_image_p (object)
5559/* PNG library details. */ 5559/* PNG library details. */
5560 5560
5561DEF_IMGLIB_FN (png_get_io_ptr); 5561DEF_IMGLIB_FN (png_get_io_ptr);
5562DEF_IMGLIB_FN (png_check_sig); 5562DEF_IMGLIB_FN (png_sig_cmp);
5563DEF_IMGLIB_FN (png_create_read_struct); 5563DEF_IMGLIB_FN (png_create_read_struct);
5564DEF_IMGLIB_FN (png_create_info_struct); 5564DEF_IMGLIB_FN (png_create_info_struct);
5565DEF_IMGLIB_FN (png_destroy_read_struct); 5565DEF_IMGLIB_FN (png_destroy_read_struct);
@@ -5590,7 +5590,7 @@ init_png_functions (Lisp_Object libraries)
5590 return 0; 5590 return 0;
5591 5591
5592 LOAD_IMGLIB_FN (library, png_get_io_ptr); 5592 LOAD_IMGLIB_FN (library, png_get_io_ptr);
5593 LOAD_IMGLIB_FN (library, png_check_sig); 5593 LOAD_IMGLIB_FN (library, png_sig_cmp);
5594 LOAD_IMGLIB_FN (library, png_create_read_struct); 5594 LOAD_IMGLIB_FN (library, png_create_read_struct);
5595 LOAD_IMGLIB_FN (library, png_create_info_struct); 5595 LOAD_IMGLIB_FN (library, png_create_info_struct);
5596 LOAD_IMGLIB_FN (library, png_destroy_read_struct); 5596 LOAD_IMGLIB_FN (library, png_destroy_read_struct);
@@ -5615,7 +5615,7 @@ init_png_functions (Lisp_Object libraries)
5615#else 5615#else
5616 5616
5617#define fn_png_get_io_ptr png_get_io_ptr 5617#define fn_png_get_io_ptr png_get_io_ptr
5618#define fn_png_check_sig png_check_sig 5618#define fn_png_sig_cmp png_sig_cmp
5619#define fn_png_create_read_struct png_create_read_struct 5619#define fn_png_create_read_struct png_create_read_struct
5620#define fn_png_create_info_struct png_create_info_struct 5620#define fn_png_create_info_struct png_create_info_struct
5621#define fn_png_destroy_read_struct png_destroy_read_struct 5621#define fn_png_destroy_read_struct png_destroy_read_struct
@@ -5762,7 +5762,7 @@ png_load (f, img)
5762 5762
5763 /* Check PNG signature. */ 5763 /* Check PNG signature. */
5764 if (fread (sig, 1, sizeof sig, fp) != sizeof sig 5764 if (fread (sig, 1, sizeof sig, fp) != sizeof sig
5765 || !fn_png_check_sig (sig, sizeof sig)) 5765 || fn_png_sig_cmp (sig, 0, sizeof sig))
5766 { 5766 {
5767 image_error ("Not a PNG file: `%s'", file, Qnil); 5767 image_error ("Not a PNG file: `%s'", file, Qnil);
5768 UNGCPRO; 5768 UNGCPRO;
@@ -5779,7 +5779,7 @@ png_load (f, img)
5779 5779
5780 /* Check PNG signature. */ 5780 /* Check PNG signature. */
5781 if (tbr.len < sizeof sig 5781 if (tbr.len < sizeof sig
5782 || !fn_png_check_sig (tbr.bytes, sizeof sig)) 5782 || fn_png_sig_cmp (tbr.bytes, 0, sizeof sig))
5783 { 5783 {
5784 image_error ("Not a PNG image: `%s'", img->spec, Qnil); 5784 image_error ("Not a PNG image: `%s'", img->spec, Qnil);
5785 UNGCPRO; 5785 UNGCPRO;
diff --git a/src/keymap.c b/src/keymap.c
index 17666c7efcc..98774d5d685 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2650,11 +2650,13 @@ static void where_is_internal_1 P_ ((Lisp_Object key, Lisp_Object binding,
2650 Lisp_Object args, void *data)); 2650 Lisp_Object args, void *data));
2651 2651
2652/* Like Flookup_key, but uses a list of keymaps SHADOW instead of a single map. 2652/* Like Flookup_key, but uses a list of keymaps SHADOW instead of a single map.
2653 Returns the first non-nil binding found in any of those maps. */ 2653 Returns the first non-nil binding found in any of those maps.
2654 If REMAP is true, pass the result of the lookup through command
2655 remapping before returning it. */
2654 2656
2655static Lisp_Object 2657static Lisp_Object
2656shadow_lookup (shadow, key, flag) 2658shadow_lookup (Lisp_Object shadow, Lisp_Object key, Lisp_Object flag,
2657 Lisp_Object shadow, key, flag; 2659 int remap)
2658{ 2660{
2659 Lisp_Object tail, value; 2661 Lisp_Object tail, value;
2660 2662
@@ -2669,7 +2671,15 @@ shadow_lookup (shadow, key, flag)
2669 return Qnil; 2671 return Qnil;
2670 } 2672 }
2671 else if (!NILP (value)) 2673 else if (!NILP (value))
2672 return value; 2674 {
2675 Lisp_Object remapping;
2676 if (remap && SYMBOLP (value)
2677 && (remapping = Fcommand_remapping (value, Qnil, shadow),
2678 !NILP (remapping)))
2679 return remapping;
2680 else
2681 return value;
2682 }
2673 } 2683 }
2674 return Qnil; 2684 return Qnil;
2675} 2685}
@@ -2860,30 +2870,30 @@ remapped command in the returned list. */)
2860 { 2870 {
2861 /* We have a list of advertized bindings. */ 2871 /* We have a list of advertized bindings. */
2862 while (CONSP (tem)) 2872 while (CONSP (tem))
2863 if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil), definition)) 2873 if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil, 0), definition))
2864 return XCAR (tem); 2874 return XCAR (tem);
2865 else 2875 else
2866 tem = XCDR (tem); 2876 tem = XCDR (tem);
2867 if (EQ (shadow_lookup (keymaps, tem, Qnil), definition)) 2877 if (EQ (shadow_lookup (keymaps, tem, Qnil, 0), definition))
2868 return tem; 2878 return tem;
2869 } 2879 }
2870 2880
2871 sequences = Freverse (where_is_internal (definition, keymaps, 2881 sequences = Freverse (where_is_internal (definition, keymaps,
2872 !NILP (noindirect), nomenus)); 2882 !NILP (noindirect), nomenus));
2873 2883
2874 while (CONSP (sequences)) 2884 while (CONSP (sequences)
2885 /* If we're at the end of the `sequences' list and we haven't
2886 considered remapped sequences yet, copy them over and
2887 process them. */
2888 || (!remapped && (sequences = remapped_sequences,
2889 remapped = 1),
2890 CONSP (sequences)))
2875 { 2891 {
2876 Lisp_Object sequence, function; 2892 Lisp_Object sequence, function;
2877 2893
2878 sequence = XCAR (sequences); 2894 sequence = XCAR (sequences);
2879 sequences = XCDR (sequences); 2895 sequences = XCDR (sequences);
2880 2896
2881 if (NILP (sequences) && !remapped)
2882 {
2883 sequences = remapped_sequences;
2884 remapped = 1;
2885 }
2886
2887 /* Verify that this key binding is not shadowed by another 2897 /* Verify that this key binding is not shadowed by another
2888 binding for the same key, before we say it exists. 2898 binding for the same key, before we say it exists.
2889 2899
@@ -2893,7 +2903,8 @@ remapped command in the returned list. */)
2893 2903
2894 Either nil or number as value from Flookup_key 2904 Either nil or number as value from Flookup_key
2895 means undefined. */ 2905 means undefined. */
2896 if (!EQ (shadow_lookup (keymaps, sequence, Qnil), definition)) 2906 if (!EQ (shadow_lookup (keymaps, sequence, Qnil, remapped),
2907 definition))
2897 continue; 2908 continue;
2898 2909
2899 /* If the current sequence is a command remapping with 2910 /* If the current sequence is a command remapping with
@@ -3506,7 +3517,7 @@ describe_map (map, prefix, elt_describer, partial, shadow,
3506 ASET (kludge, 0, event); 3517 ASET (kludge, 0, event);
3507 if (!NILP (shadow)) 3518 if (!NILP (shadow))
3508 { 3519 {
3509 tem = shadow_lookup (shadow, kludge, Qt); 3520 tem = shadow_lookup (shadow, kludge, Qt, 0);
3510 if (!NILP (tem)) 3521 if (!NILP (tem))
3511 { 3522 {
3512 /* If both bindings are keymaps, this key is a prefix key, 3523 /* If both bindings are keymaps, this key is a prefix key,
@@ -3776,7 +3787,7 @@ describe_vector (vector, prefix, args, elt_describer,
3776 { 3787 {
3777 Lisp_Object tem; 3788 Lisp_Object tem;
3778 3789
3779 tem = shadow_lookup (shadow, kludge, Qt); 3790 tem = shadow_lookup (shadow, kludge, Qt, 0);
3780 3791
3781 if (!NILP (tem)) 3792 if (!NILP (tem))
3782 { 3793 {
diff --git a/src/xfns.c b/src/xfns.c
index 6f18e4e813a..905ed9c576a 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3518,27 +3518,35 @@ This function is an internal primitive--use `make-frame' instead. */)
3518 window_prompting = x_figure_window_size (f, parms, 1); 3518 window_prompting = x_figure_window_size (f, parms, 1);
3519 3519
3520 /* Don't make height higher than display height unless the user asked 3520 /* Don't make height higher than display height unless the user asked
3521 for it. */ 3521 for it. Try sizes 24 and 10 if current is too large. */
3522 height = FRAME_LINES (f); 3522 height = FRAME_LINES (f);
3523 tem = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER); 3523 tem = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
3524 if (EQ (tem, Qunbound)) 3524 if (EQ (tem, Qunbound))
3525 { 3525 {
3526 int ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f)); 3526 int h = FRAME_LINES (f) + FRAME_TOOL_BAR_LINES (f)
3527 + FRAME_MENU_BAR_LINES (f) + 2;
3528 int ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, h);
3527 int dph = DisplayHeight (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f)); 3529 int dph = DisplayHeight (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f));
3530 static int tryheight[] = { 24, 10, 0 } ;
3531 int i;
3532
3533 ph += (FRAME_EXTERNAL_TOOL_BAR (f) ? 32 : 0) /* Gtk toolbar size */
3534 + (FRAME_EXTERNAL_MENU_BAR (f) ? 24 : 0); /* Arbitrary */
3535
3528 /* Some desktops have fixed menus above and/or panels below. Try to 3536 /* Some desktops have fixed menus above and/or panels below. Try to
3529 figure out the usable size we have for emacs. */ 3537 figure out the usable size we have for emacs. */
3530 current_desktop = x_get_current_desktop (f); 3538 current_desktop = x_get_current_desktop (f);
3531 x_get_desktop_workarea (f, current_desktop, &deskw, &deskh); 3539 x_get_desktop_workarea (f, current_desktop, &deskw, &deskh);
3532 if (deskh > 0 && deskh < dph) dph = deskh; 3540 if (deskh > 0 && deskh < dph) dph = deskh;
3533 3541
3534 if (ph > dph) 3542 /* Allow 40 pixels for manager decorations. */
3543 for (i = 0; ph+40 > dph && tryheight[i] != 0; ++i)
3535 { 3544 {
3536 height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, dph) - 3545 height = tryheight[i];
3537 FRAME_TOOL_BAR_LINES (f) - FRAME_MENU_BAR_LINES (f); 3546 h = height + FRAME_TOOL_BAR_LINES (f) + FRAME_MENU_BAR_LINES (f) + 2;
3538 if (FRAME_EXTERNAL_TOOL_BAR (f)) 3547 ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, h)
3539 height -= 2; /* We can't know how big it will be. */ 3548 + (FRAME_EXTERNAL_TOOL_BAR (f) ? 32 : 0)
3540 if (FRAME_EXTERNAL_MENU_BAR (f)) 3549 + (FRAME_EXTERNAL_MENU_BAR (f) ? 24 : 0);
3541 height -= 2; /* We can't know how big it will be. */
3542 } 3550 }
3543 } 3551 }
3544 3552