comparison src/keyboard.c @ 93884:b4877813e2df

(Qdeactivate_mark): New var. (command_loop_1): Use it to call `deactivate-mark'. (syms_of_keyboard): Initialize it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 09 Apr 2008 03:29:46 +0000
parents b05c7196d0b6
children 3c7025ac9e2c
comparison
equal deleted inserted replaced
93883:722fdbc7a012 93884:b4877813e2df
395 this holds the echo area message that was just erased. */ 395 this holds the echo area message that was just erased. */
396 Lisp_Object Vinput_method_previous_message; 396 Lisp_Object Vinput_method_previous_message;
397 397
398 /* Non-nil means deactivate the mark at end of this command. */ 398 /* Non-nil means deactivate the mark at end of this command. */
399 Lisp_Object Vdeactivate_mark; 399 Lisp_Object Vdeactivate_mark;
400 Lisp_Object Qdeactivate_mark;
400 401
401 /* Menu bar specified in Lucid Emacs fashion. */ 402 /* Menu bar specified in Lucid Emacs fashion. */
402 403
403 Lisp_Object Vlucid_menu_bar_dirty_flag; 404 Lisp_Object Vlucid_menu_bar_dirty_flag;
404 Lisp_Object Qrecompute_lucid_menubar, Qactivate_menubar_hook; 405 Lisp_Object Qrecompute_lucid_menubar, Qactivate_menubar_hook;
1975 if (EQ (Vtransient_mark_mode, Qidentity)) 1976 if (EQ (Vtransient_mark_mode, Qidentity))
1976 Vtransient_mark_mode = Qnil; 1977 Vtransient_mark_mode = Qnil;
1977 else if (EQ (Vtransient_mark_mode, Qonly)) 1978 else if (EQ (Vtransient_mark_mode, Qonly))
1978 Vtransient_mark_mode = Qidentity; 1979 Vtransient_mark_mode = Qidentity;
1979 1980
1980 if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode)) 1981 if (!NILP (Vdeactivate_mark))
1981 { 1982 call0 (Qdeactivate_mark);
1982 /* We could also call `deactivate'mark'. */
1983 if (EQ (Vtransient_mark_mode, Qlambda))
1984 Vtransient_mark_mode = Qnil;
1985 else
1986 {
1987 current_buffer->mark_active = Qnil;
1988 call1 (Vrun_hooks, intern ("deactivate-mark-hook"));
1989 }
1990 }
1991 else if (current_buffer != prev_buffer || MODIFF != prev_modiff) 1983 else if (current_buffer != prev_buffer || MODIFF != prev_modiff)
1992 call1 (Vrun_hooks, intern ("activate-mark-hook")); 1984 call1 (Vrun_hooks, intern ("activate-mark-hook"));
1993 } 1985 }
1994 1986
1995 finalize: 1987 finalize:
2037 2029
2038 /* FIXME: cycling is probably not necessary because these properties 2030 /* FIXME: cycling is probably not necessary because these properties
2039 can't be usefully combined anyway. */ 2031 can't be usefully combined anyway. */
2040 while (check_composition || check_display || check_invisible) 2032 while (check_composition || check_display || check_invisible)
2041 { 2033 {
2034 /* FIXME: check `intangible'. */
2042 if (check_composition 2035 if (check_composition
2043 && PT > BEGV && PT < ZV 2036 && PT > BEGV && PT < ZV
2044 && get_property_and_range (PT, Qcomposition, &val, &beg, &end, Qnil) 2037 && get_property_and_range (PT, Qcomposition, &val, &beg, &end, Qnil)
2045 && COMPOSITION_VALID_P (beg, end, val) 2038 && COMPOSITION_VALID_P (beg, end, val)
2046 && beg < PT /* && end > PT <- It's always the case. */ 2039 && beg < PT /* && end > PT <- It's always the case. */
12281 doc: /* If an editing command sets this to t, deactivate the mark afterward. 12274 doc: /* If an editing command sets this to t, deactivate the mark afterward.
12282 The command loop sets this to nil before each command, 12275 The command loop sets this to nil before each command,
12283 and tests the value when the command returns. 12276 and tests the value when the command returns.
12284 Buffer modification stores t in this variable. */); 12277 Buffer modification stores t in this variable. */);
12285 Vdeactivate_mark = Qnil; 12278 Vdeactivate_mark = Qnil;
12279 Qdeactivate_mark = intern ("deactivate-mark");
12280 staticpro (&Qdeactivate_mark);
12286 12281
12287 DEFVAR_LISP ("command-hook-internal", &Vcommand_hook_internal, 12282 DEFVAR_LISP ("command-hook-internal", &Vcommand_hook_internal,
12288 doc: /* Temporary storage of pre-command-hook or post-command-hook. */); 12283 doc: /* Temporary storage of pre-command-hook or post-command-hook. */);
12289 Vcommand_hook_internal = Qnil; 12284 Vcommand_hook_internal = Qnil;
12290 12285