summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog37
-rw-r--r--src/alloc.c10
-rw-r--r--src/filelock.c2
-rw-r--r--src/image.c14
-rw-r--r--src/keymap.c43
-rw-r--r--src/lisp.h2
-rw-r--r--src/lread.c2
-rw-r--r--src/xdisp.c3
8 files changed, 83 insertions, 30 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a09fbac8c35..96dc0066fd9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -3,6 +3,43 @@
* xfns.c (Fx_create_frame): If frame height is too big, try
sizes 24 and 10. Bug #3643.
+2010-01-24 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ Try and fix bug#788, hopefully for real this time.
+ * keymap.c (shadow_lookup): Add `remap' arg.
+ (describe_map, describe_vector): Update calls to shadow_lookup.
+ (Fwhere_is_internal): Fix up handling of `remapped_sequences' and
+ `remapped' so this flag is applicable to `sequence'. Be careful to
+ perform remapping during shadow_lookup check of remapped_sequences.
+
+2010-01-24 Eric BĂ©langer <snowmaniscool@gmail.com> (tiny change)
+
+ * image.c (png_load): Use png_sig_cmp instead of the obsolete
+ png_check_sig, which has been removed in libpng 1.4.
+
+2010-01-23 Giorgos Keramidas <keramida@ceid.upatras.gr> (tiny change)
+
+ * filelock.c: Include utmp.h only when HAVE_UTMP_H (FreeBSD 9.x
+ lacks this header file).
+
+2010-01-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * xdisp.c (draw_glyphs): Update `start' for left_overwritten case
+ as in Emacs 22.
+
+2010-01-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * lisp.h (make_pure_string): String pointer arg now points to const.
+
+ * alloc.c (find_string_data_in_pure, make_pure_string): String pointer
+ args now point to const.
+
+2010-01-22 Eli Zaretskii <eliz@gnu.org>
+
+ * lread.c (Fload): Don't treat files without .elc extension as
+ byte-compiled if they are ``magic'', i.e. `openp' returned -2 for
+ them. (bug#5303)
+
2010-01-20 Kenichi Handa <handa@m17n.org>
* coding.c (consume_chars): If ! multibyte and the encoder is ccl,
diff --git a/src/alloc.c b/src/alloc.c
index 3c48f8762f8..9a935cc8952 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4725,11 +4725,11 @@ check_pure_size ()
static char *
find_string_data_in_pure (data, nbytes)
- char *data;
+ const char *data;
int nbytes;
{
int i, skip, bm_skip[256], last_char_skip, infinity, start, start_max;
- unsigned char *p;
+ const unsigned char *p;
char *non_lisp_beg;
if (pure_bytes_used_non_lisp < nbytes + 1)
@@ -4740,7 +4740,7 @@ find_string_data_in_pure (data, nbytes)
for (i = 0; i < 256; i++)
bm_skip[i] = skip;
- p = (unsigned char *) data;
+ p = (const unsigned char *) data;
while (--skip > 0)
bm_skip[*p++] = skip;
@@ -4754,7 +4754,7 @@ find_string_data_in_pure (data, nbytes)
infinity = pure_bytes_used_non_lisp + 1;
bm_skip['\0'] = infinity;
- p = (unsigned char *) non_lisp_beg + nbytes;
+ p = (const unsigned char *) non_lisp_beg + nbytes;
start = 0;
do
{
@@ -4796,7 +4796,7 @@ find_string_data_in_pure (data, nbytes)
Lisp_Object
make_pure_string (data, nchars, nbytes, multibyte)
- char *data;
+ const char *data;
int nchars, nbytes;
int multibyte;
{
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;
#ifdef CLASH_DETECTION
+#ifdef HAVE_UTMP_H
#include <utmp.h>
+#endif
#if !defined (S_ISLNK) && defined (S_IFLNK)
#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/>. */
#else
# include <png.h>
#endif
-#endif
+#endif
#include <setjmp.h>
@@ -3051,7 +3051,7 @@ xbm_load (f, img)
int nbytes, i;
/* Windows mono bitmaps are reversed compared with X. */
invertedBits = bits;
- nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR
+ nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR
* img->height;
bits = (char *) alloca(nbytes);
for (i = 0; i < nbytes; i++)
@@ -5559,7 +5559,7 @@ png_image_p (object)
/* PNG library details. */
DEF_IMGLIB_FN (png_get_io_ptr);
-DEF_IMGLIB_FN (png_check_sig);
+DEF_IMGLIB_FN (png_sig_cmp);
DEF_IMGLIB_FN (png_create_read_struct);
DEF_IMGLIB_FN (png_create_info_struct);
DEF_IMGLIB_FN (png_destroy_read_struct);
@@ -5590,7 +5590,7 @@ init_png_functions (Lisp_Object libraries)
return 0;
LOAD_IMGLIB_FN (library, png_get_io_ptr);
- LOAD_IMGLIB_FN (library, png_check_sig);
+ LOAD_IMGLIB_FN (library, png_sig_cmp);
LOAD_IMGLIB_FN (library, png_create_read_struct);
LOAD_IMGLIB_FN (library, png_create_info_struct);
LOAD_IMGLIB_FN (library, png_destroy_read_struct);
@@ -5615,7 +5615,7 @@ init_png_functions (Lisp_Object libraries)
#else
#define fn_png_get_io_ptr png_get_io_ptr
-#define fn_png_check_sig png_check_sig
+#define fn_png_sig_cmp png_sig_cmp
#define fn_png_create_read_struct png_create_read_struct
#define fn_png_create_info_struct png_create_info_struct
#define fn_png_destroy_read_struct png_destroy_read_struct
@@ -5762,7 +5762,7 @@ png_load (f, img)
/* Check PNG signature. */
if (fread (sig, 1, sizeof sig, fp) != sizeof sig
- || !fn_png_check_sig (sig, sizeof sig))
+ || fn_png_sig_cmp (sig, 0, sizeof sig))
{
image_error ("Not a PNG file: `%s'", file, Qnil);
UNGCPRO;
@@ -5779,7 +5779,7 @@ png_load (f, img)
/* Check PNG signature. */
if (tbr.len < sizeof sig
- || !fn_png_check_sig (tbr.bytes, sizeof sig))
+ || fn_png_sig_cmp (tbr.bytes, 0, sizeof sig))
{
image_error ("Not a PNG image: `%s'", img->spec, Qnil);
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,
Lisp_Object args, void *data));
/* Like Flookup_key, but uses a list of keymaps SHADOW instead of a single map.
- Returns the first non-nil binding found in any of those maps. */
+ Returns the first non-nil binding found in any of those maps.
+ If REMAP is true, pass the result of the lookup through command
+ remapping before returning it. */
static Lisp_Object
-shadow_lookup (shadow, key, flag)
- Lisp_Object shadow, key, flag;
+shadow_lookup (Lisp_Object shadow, Lisp_Object key, Lisp_Object flag,
+ int remap)
{
Lisp_Object tail, value;
@@ -2669,7 +2671,15 @@ shadow_lookup (shadow, key, flag)
return Qnil;
}
else if (!NILP (value))
- return value;
+ {
+ Lisp_Object remapping;
+ if (remap && SYMBOLP (value)
+ && (remapping = Fcommand_remapping (value, Qnil, shadow),
+ !NILP (remapping)))
+ return remapping;
+ else
+ return value;
+ }
}
return Qnil;
}
@@ -2860,30 +2870,30 @@ remapped command in the returned list. */)
{
/* We have a list of advertized bindings. */
while (CONSP (tem))
- if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil), definition))
+ if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil, 0), definition))
return XCAR (tem);
else
tem = XCDR (tem);
- if (EQ (shadow_lookup (keymaps, tem, Qnil), definition))
+ if (EQ (shadow_lookup (keymaps, tem, Qnil, 0), definition))
return tem;
}
sequences = Freverse (where_is_internal (definition, keymaps,
!NILP (noindirect), nomenus));
- while (CONSP (sequences))
+ while (CONSP (sequences)
+ /* If we're at the end of the `sequences' list and we haven't
+ considered remapped sequences yet, copy them over and
+ process them. */
+ || (!remapped && (sequences = remapped_sequences,
+ remapped = 1),
+ CONSP (sequences)))
{
Lisp_Object sequence, function;
sequence = XCAR (sequences);
sequences = XCDR (sequences);
- if (NILP (sequences) && !remapped)
- {
- sequences = remapped_sequences;
- remapped = 1;
- }
-
/* Verify that this key binding is not shadowed by another
binding for the same key, before we say it exists.
@@ -2893,7 +2903,8 @@ remapped command in the returned list. */)
Either nil or number as value from Flookup_key
means undefined. */
- if (!EQ (shadow_lookup (keymaps, sequence, Qnil), definition))
+ if (!EQ (shadow_lookup (keymaps, sequence, Qnil, remapped),
+ definition))
continue;
/* If the current sequence is a command remapping with
@@ -3506,7 +3517,7 @@ describe_map (map, prefix, elt_describer, partial, shadow,
ASET (kludge, 0, event);
if (!NILP (shadow))
{
- tem = shadow_lookup (shadow, kludge, Qt);
+ tem = shadow_lookup (shadow, kludge, Qt, 0);
if (!NILP (tem))
{
/* If both bindings are keymaps, this key is a prefix key,
@@ -3776,7 +3787,7 @@ describe_vector (vector, prefix, args, elt_describer,
{
Lisp_Object tem;
- tem = shadow_lookup (shadow, kludge, Qt);
+ tem = shadow_lookup (shadow, kludge, Qt, 0);
if (!NILP (tem))
{
diff --git a/src/lisp.h b/src/lisp.h
index 5ea0303976d..7032a3f48f4 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2686,7 +2686,7 @@ extern Lisp_Object make_uninit_multibyte_string P_ ((int, int));
extern Lisp_Object make_string_from_bytes P_ ((const char *, int, int));
extern Lisp_Object make_specified_string P_ ((const char *, int, int, int));
EXFUN (Fpurecopy, 1);
-extern Lisp_Object make_pure_string P_ ((char *, int, int, int));
+extern Lisp_Object make_pure_string P_ ((const char *, int, int, int));
extern Lisp_Object make_pure_c_string (const char *data);
extern Lisp_Object pure_cons P_ ((Lisp_Object, Lisp_Object));
extern Lisp_Object make_pure_vector P_ ((EMACS_INT));
diff --git a/src/lread.c b/src/lread.c
index db425b82299..ba9d5378104 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1155,7 +1155,7 @@ Return t if the file exists and loads successfully. */)
if (!bcmp (SDATA (found) + SBYTES (found) - 4,
".elc", 4)
- || (version = safe_to_load_p (fd)) > 0)
+ || (fd >= 0 && (version = safe_to_load_p (fd)) > 0))
/* Load .elc files directly, but not when they are
remote and have no handler! */
{
diff --git a/src/xdisp.c b/src/xdisp.c
index 7d43f2d8bef..8e356224c8a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20401,6 +20401,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps)
j = i;
BUILD_GLYPH_STRINGS (j, start, h, t,
overlap_hl, dummy_x, last_x);
+ start = i;
compute_overhangs_and_x (t, head->x, 1);
prepend_glyph_string_lists (&head, &tail, h, t);
clip_head = head;
@@ -20450,6 +20451,8 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps)
BUILD_GLYPH_STRINGS (end, i, h, t,
overlap_hl, x, last_x);
+ /* Because BUILD_GLYPH_STRINGS updates the first argument,
+ we don't have `end = i;' here. */
compute_overhangs_and_x (h, tail->x + tail->width, 0);
append_glyph_string_lists (&head, &tail, h, t);
clip_tail = tail;