Lisp_Object Qselect_window;
Lisp_Object Qhelp_echo;
+extern Lisp_Object Qremap;
+
#if defined (HAVE_MOUSE) || defined (HAVE_GPM)
Lisp_Object Qmouse_fixup_help_message;
#endif
/* Find boundaries `beg' and `end' of the invisible area, if any. */
while (end < ZV
+ /* Stop if we find a spot between two runs of
+ `invisible' where inserted text would be visible.
+ This is important when we have two invisible
+ boundaries that enclose an area: if the area is
+ empty, we need this test in order to make it
+ possible to place point in the middle rather than
+ skip both boundaries.
+ Note that this will stop anywhere in a non-sticky
+ text-property, but I don't think there's much we
+ can do about that. */
+ && (val = get_pos_property (make_number (end),
+ Qinvisible, Qnil),
+ TEXT_PROP_MEANS_INVISIBLE (val))
+ /* FIXME: write and then use get_pos_property_and_overlay. */
&& !NILP (val = get_char_property_and_overlay
(make_number (end), Qinvisible, Qnil, &overlay))
&& (inv = TEXT_PROP_MEANS_INVISIBLE (val)))
end = NATNUMP (tmp) ? XFASTINT (tmp) : ZV;
}
while (beg > BEGV
+ && (val = get_pos_property (make_number (beg),
+ Qinvisible, Qnil),
+ TEXT_PROP_MEANS_INVISIBLE (val))
&& !NILP (val = get_char_property_and_overlay
(make_number (beg - 1), Qinvisible, Qnil, &overlay))
&& (inv = TEXT_PROP_MEANS_INVISIBLE (val)))
#ifdef POLL_FOR_INPUT
-/* Poll for input, so what we catch a C-g if it comes in. This
+/* Poll for input, so that we catch a C-g if it comes in. This
function is called from x_make_frame_visible, see comment
there. */
void
poll_for_input_1 ()
{
+/* Tell ns_read_socket() it is being called asynchronously so it can avoid
+ doing anything dangerous. */
+#ifdef HAVE_NS
+ ++handling_signal;
+#endif
if (interrupt_input_blocked == 0
&& !waiting_for_input)
read_avail_input (0);
+#ifdef HAVE_NS
+ --handling_signal;
+#endif
}
/* Timer callback function for poll_timer. TIMER is equal to
else
obj = Fcons (intern ("ns-unput-working-text"), Qnil);
kbd_fetch_ptr = event + 1;
+ *used_mouse_menu = 1;
}
#endif
|| event->kind == TOOL_BAR_EVENT))
*used_mouse_menu = 1;
#endif
+#ifdef HAVE_NS
+ /* certain system events are non-key events */
+ if (event->kind == NS_NONKEY_EVENT)
+ *used_mouse_menu = 1;
+#endif
/* Wipe out this event, to catch bugs. */
clear_event (event);
DEFUN ("current-idle-time", Fcurrent_idle_time, Scurrent_idle_time, 0, 0, 0,
doc: /* Return the current length of Emacs idleness, or nil.
-The value when Emacs is idle is a list of three integers. The first has the
-most significant 16 bits of the seconds, while the second has the
-least significant 16 bits. The third integer gives the microsecond
-count.
+The value when Emacs is idle is a list of three integers. The first has
+the most significant 16 bits of the seconds, while the second has the least
+significant 16 bits. The third integer gives the microsecond count.
The value when Emacs is not idle is nil.
return lispy_c;
}
+#ifdef HAVE_NS
+ /* NS_NONKEY_EVENTs are just like NON_ASCII_KEYSTROKE_EVENTs,
+ except that they are non-key events (last-nonmenu-event is nil). */
+ case NS_NONKEY_EVENT:
+#endif
+
/* A function key. The symbol may need to have modifier prefixes
tacked onto it. */
case NON_ASCII_KEYSTROKE_EVENT:
{
Gpm_Event event;
struct input_event hold_quit;
- int gpm;
+ int gpm, fd = gpm_fd;
EVENT_INIT (hold_quit);
hold_quit.kind = NO_EVENT;
+ /* gpm==1 if event received.
+ gpm==0 if the GPM daemon has closed the connection, in which case
+ Gpm_GetEvent closes gpm_fd and clears it to -1, which is why
+ we save it in `fd' so close_gpm can remove it from the
+ select masks.
+ gpm==-1 if a protocol error or EWOULDBLOCK; the latter is normal. */
while (gpm = Gpm_GetEvent (&event), gpm == 1) {
nread += handle_one_term_event (tty, &event, &hold_quit);
}
- if (gpm < 0)
+ if (gpm == 0)
/* Presumably the GPM daemon has closed the connection. */
- close_gpm ();
+ close_gpm (fd);
if (hold_quit.kind != NO_EVENT)
kbd_buffer_store_event (&hold_quit);
if (nread)
#ifdef SYNC_INPUT
pending_signals = pending_atimers;
#endif
-
+/* Tell ns_read_socket() it is being called asynchronously so it can avoid
+ doing anything dangerous. */
+#ifdef HAVE_NS
+ ++handling_signal;
+#endif
while (1)
{
int nread;
if (nread <= 0)
break;
}
+#ifdef HAVE_NS
+ --handling_signal;
+#endif
}
void
&& ! NILP (Fget (def, Qmenu_alias)))
def = XSYMBOL (def)->function;
tem = Fwhere_is_internal (def, Qnil, Qt, Qnil, Qt);
+
+ /* Don't display remap bindings.*/
+ if (VECTORP (tem) && ASIZE (tem) > 0 && EQ (AREF (tem, 0), Qremap))
+ tem = Qnil;
+
XSETCAR (cachelist, tem);
if (NILP (tem))
{
staticpro (&Qdeactivate_mark);
DEFVAR_LISP ("command-hook-internal", &Vcommand_hook_internal,
- doc: /* Temporary storage of pre-command-hook or post-command-hook. */);
+ doc: /* Temporary storage of `pre-command-hook' or `post-command-hook'. */);
Vcommand_hook_internal = Qnil;
DEFVAR_LISP ("pre-command-hook", &Vpre_command_hook,
to be reconsidered, separately, by the input method,
it can add them to the beginning of `unread-command-events'.
-The input method function can find in `input-method-previous-method'
+The input method function can find in `input-method-previous-message'
the previous echo area message.
The input method function should refer to the variables