summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-09-21 11:03:48 +0800
committerChong Yidong <cyd@gnu.org>2012-09-21 11:03:48 +0800
commitacfa068f4a1a4652b784af1d7aaac92929399249 (patch)
tree4d5aef916164ae9862e4c94f50a5e53bbe274e53 /src
parenteb2deaffd17e760b3ec945c58d43080e8a44767a (diff)
parentd3fa327c47570a1767324d23d710504e90b083f9 (diff)
downloademacs-acfa068f4a1a4652b784af1d7aaac92929399249.tar.gz
Merge from emacs-24; up to 2012-05-07T14:57:18Z!michael.albinus@gmx.de
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog27
-rw-r--r--src/eval.c7
-rw-r--r--src/fileio.c7
-rw-r--r--src/unexmacosx.c21
-rw-r--r--src/xdisp.c43
5 files changed, 76 insertions, 29 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c3ce1ee1b0b..f3b8b2108e1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,30 @@
+2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
+
+ * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
+ (print_load_command_name): Add case LC_DATA_IN_CODE.
+ (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
+
+2012-09-21 Glenn Morris <rgm@gnu.org>
+
+ * eval.c (Frun_hook_with_args_until_success)
+ (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
+
+2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
+
+ * fileio.c (Ffile_selinux_context): Only call freecon when
+ lgetfilecon succeeded.
+ (Fset_file_selinux_context): Likewise. (Bug#12444)
+
+2012-09-21 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (try_window_reusing_current_matrix): Under bidi
+ reordering, locate the cursor by calling set_cursor_from_row; if
+ that fails, clear the desired glyph matrix before returning a
+ failure indication to the caller. Fixes leaving garbled display
+ when fast scrolling with a down-key. (Bug#12403)
+ (compute_stop_pos_backwards): Fix a typo that caused crashes while
+ scrolling through multibyte text.
+
2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
* alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
diff --git a/src/eval.c b/src/eval.c
index 1c565e233c6..e47478bb1f1 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2399,6 +2399,7 @@ If it is a list of functions, those functions are called, in order,
with the given arguments ARGS, until one of them
returns a non-nil value. Then we return that value.
However, if they all return nil, we return nil.
+If the value of HOOK is nil, this function returns nil.
Do not use `make-local-variable' to make a hook variable buffer-local.
Instead, use `add-hook' and specify t for the LOCAL argument.
@@ -2420,10 +2421,12 @@ DEFUN ("run-hook-with-args-until-failure", Frun_hook_with_args_until_failure,
HOOK should be a symbol, a hook variable. If HOOK has a non-nil
value, that value may be a function or a list of functions to be
called to run the hook. If the value is a function, it is called with
-the given arguments and its return value is returned.
+the given arguments. Then we return nil if the function returns nil,
+and t if it returns non-nil.
If it is a list of functions, those functions are called, in order,
with the given arguments ARGS, until one of them returns nil.
-Then we return nil. However, if they all return non-nil, we return non-nil.
+Then we return nil. However, if they all return non-nil, we return t.
+If the value of HOOK is nil, this function returns t.
Do not use `make-local-variable' to make a hook variable buffer-local.
Instead, use `add-hook' and specify t for the LOCAL argument.
diff --git a/src/fileio.c b/src/fileio.c
index ca71af7ed95..6c4e34d7312 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2833,9 +2833,8 @@ or if SELinux is disabled, or if Emacs lacks SELinux support. */)
if (context_range_get (context))
values[3] = build_string (context_range_get (context));
context_free (context);
+ freecon (con);
}
- if (con)
- freecon (con);
}
#endif
@@ -2914,12 +2913,10 @@ compiled with SELinux support. */)
report_file_error ("Doing lsetfilecon", Fcons (absname, Qnil));
context_free (parsed_con);
+ freecon (con);
}
else
report_file_error ("Doing lgetfilecon", Fcons (absname, Qnil));
-
- if (con)
- freecon (con);
}
#endif
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 05a16466dfb..d38b91e955a 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -117,6 +117,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <assert.h>
+/* LC_DATA_IN_CODE is not defined in mach-o/loader.h on OS X 10.7.
+ But it is used if we build with "Command Line Tools for Xcode 4.5
+ (OS X Lion) - Septemper 2012". */
+#ifndef LC_DATA_IN_CODE
+#define LC_DATA_IN_CODE 0x29 /* table of non-instructions in __text */
+#endif
+
#ifdef _LP64
#define mach_header mach_header_64
#define segment_command segment_command_64
@@ -612,6 +619,11 @@ print_load_command_name (int lc)
printf ("LC_MAIN ");
break;
#endif
+#ifdef LC_DATA_IN_CODE
+ case LC_DATA_IN_CODE:
+ printf ("LC_DATA_IN_CODE ");
+ break;
+#endif
#ifdef LC_SOURCE_VERSION
case LC_SOURCE_VERSION:
printf ("LC_SOURCE_VERSION");
@@ -1178,9 +1190,9 @@ copy_dyld_info (struct load_command *lc, long delta)
#endif
#ifdef LC_FUNCTION_STARTS
-/* Copy a LC_FUNCTION_STARTS/LC_DYLIB_CODE_SIGN_DRS load command from
- the input file to the output file, adjusting the data offset
- field. */
+/* Copy a LC_FUNCTION_STARTS/LC_DATA_IN_CODE/LC_DYLIB_CODE_SIGN_DRS
+ load command from the input file to the output file, adjusting the
+ data offset field. */
static void
copy_linkedit_data (struct load_command *lc, long delta)
{
@@ -1274,6 +1286,9 @@ dump_it (void)
#endif
#ifdef LC_FUNCTION_STARTS
case LC_FUNCTION_STARTS:
+#ifdef LC_DATA_IN_CODE
+ case LC_DATA_IN_CODE:
+#endif
#ifdef LC_DYLIB_CODE_SIGN_DRS
case LC_DYLIB_CODE_SIGN_DRS:
#endif
diff --git a/src/xdisp.c b/src/xdisp.c
index 5ee5a46601c..f00719be37a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7755,7 +7755,7 @@ compute_stop_pos_backwards (struct it *it)
{
it->end_charpos = min (charpos + 1, ZV);
charpos = max (charpos - SCAN_BACK_LIMIT, BEGV);
- SET_TEXT_POS (pos, charpos, BYTE_TO_CHAR (charpos));
+ SET_TEXT_POS (pos, charpos, CHAR_TO_BYTE (charpos));
reseat_1 (it, pos, 0);
compute_stop_pos (it);
/* We must advance forward, right? */
@@ -16744,28 +16744,33 @@ try_window_reusing_current_matrix (struct window *w)
}
if (row < bottom_row)
{
- struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
- struct glyph *end = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
-
- /* Can't use this optimization with bidi-reordered glyph
- rows, unless cursor is already at point. */
+ /* Can't simply scan the row for point with
+ bidi-reordered glyph rows. Let set_cursor_from_row
+ figure out where to put the cursor, and if it fails,
+ give up. */
if (!NILP (BVAR (XBUFFER (w->buffer), bidi_display_reordering)))
{
- if (!(w->cursor.hpos >= 0
- && w->cursor.hpos < row->used[TEXT_AREA]
- && BUFFERP (glyph->object)
- && glyph->charpos == PT))
- return 0;
+ if (!set_cursor_from_row (w, row, w->current_matrix,
+ 0, 0, 0, 0))
+ {
+ clear_glyph_matrix (w->desired_matrix);
+ return 0;
+ }
}
else
- for (; glyph < end
- && (!BUFFERP (glyph->object)
- || glyph->charpos < PT);
- glyph++)
- {
- w->cursor.hpos++;
- w->cursor.x += glyph->pixel_width;
- }
+ {
+ struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
+ struct glyph *end = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
+
+ for (; glyph < end
+ && (!BUFFERP (glyph->object)
+ || glyph->charpos < PT);
+ glyph++)
+ {
+ w->cursor.hpos++;
+ w->cursor.x += glyph->pixel_width;
+ }
+ }
}
}