Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save shuujii/2583619 to your computer and use it in GitHub Desktop.

Select an option

Save shuujii/2583619 to your computer and use it in GitHub Desktop.
Limited fix crash ime inptting in Cocoa Emacs 23.4 on Mac + emacs-inline-patch
--- a/src/nsterm.m 2012-04-22 20:31:20.000000000 +0900
+++ b/src/nsterm.m 2012-05-03 13:57:40.000000000 +0900
@@ -284,6 +284,8 @@
int x_use_underline_position_properties, x_underline_at_descent_line;
/* FIXME: figure out what to do with underline_minimum_offset. */
+EXFUN (Fbuffer_local_value, 2);
+EXFUN (Fcurrent_buffer, 0);
/* ==========================================================================
@@ -4703,6 +4705,7 @@
/* used to position char selection windows, etc. */
- (NSRect)firstRectForCharacterRange: (NSRange)theRange
{
+ Lisp_Object isearch_mode;
NSRect rect;
NSPoint pt;
// struct window *win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
@@ -4710,9 +4713,8 @@
if (NS_KEYLOG)
NSLog (@"firstRectForCharRange request");
- if (NILP (Feval (Fcons (intern ("ns-in-echo-area"), Qnil))))
- win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
- else if (WINDOWP (echo_area_window))
+ isearch_mode = Fbuffer_local_value(intern("isearch-mode"), Fcurrent_buffer());
+ if (!NILP(isearch_mode))
win = XWINDOW (echo_area_window);
else
win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment