[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem report #61
From: |
Dan Nicolaescu |
Subject: |
Problem report #61 |
Date: |
Tue, 11 Apr 2006 08:48:43 -0700 |
CID: 61
Checker: UNINIT (help)
File: emacs/src/keyboard.c
Function: command_loop_1
Description: Using uninitialized value "already_adjusted"
CID: 61
Checker: UNINIT (help)
File: emacs/src/keyboard.c
Function: command_loop_1
Description: Using uninitialized value "prev_modiff"
Event var_decl: Declared variable "already_adjusted" without initializer
Also see events: [uninit_use]
1426 int already_adjusted;
1427
1428 current_kboard->Vprefix_arg = Qnil;
1429 current_kboard->Vlast_prefix_arg = Qnil;
1430 Vdeactivate_mark = Qnil;
1431 waiting_for_input = 0;
1432 cancel_echoing ();
1433
1434 nonundocount = 0;
1435 this_command_key_count = 0;
1436 this_command_key_count_reset = 0;
1437 this_single_command_key_start = 0;
1438
1439 if (NILP (Vmemory_full))
1440 {
1441 /* Make sure this hook runs after commands that get errors and
1442 throw to top level. */
1443 /* Note that the value cell will never directly contain nil
1444 if the symbol is a local variable. */
1445 if (!NILP (Vpost_command_hook) && !NILP (Vrun_hooks))
1446 safe_run_hooks (Qpost_command_hook);
1447
1448 /* If displaying a message, resize the echo area window to fit
1449 that message's size exactly. */
1450 if (!NILP (echo_area_buffer[0]))
1451 resize_echo_area_exactly ();
1452
At conditional (1): "Vdeferred_action_list != Qnil" taking true path
1453 if (!NILP (Vdeferred_action_list))
1454 safe_run_hooks (Qdeferred_action_function);
1455 }
1456
1457 /* Do this after running Vpost_command_hook, for consistency. */
1458 current_kboard->Vlast_command = Vthis_command;
1459 current_kboard->Vreal_last_command = real_this_command;
1460
At conditional (2): "1" taking true path
1461 while (1)
1462 {
At conditional (3): "(((0), (selected_frame & -8))->output_data).nothing == 0"
taking false path
1463 if (! FRAME_LIVE_P (XFRAME (selected_frame)))
1464 Fkill_emacs (Qnil);
1465
1466 /* Make sure the current window's buffer is selected. */
At conditional (4): "(0), (((0), (selected_window & -8))->buffer & -8 !=
current_buffer)" taking true path
1467 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
1468 set_buffer_internal (XBUFFER (XWINDOW
(selected_window)->buffer));
1469
1470 /* Display any malloc warning that just came out. Use while
because
1471 displaying one warning can cause another. */
1472
At conditional (5): "pending_malloc_warning != 0" taking true path
At conditional (6): "pending_malloc_warning != 0" taking false path
1473 while (pending_malloc_warning)
1474 display_malloc_warning ();
1475
1476 no_direct = 0;
1477
1478 Vdeactivate_mark = Qnil;
1479
1480 /* If minibuffer on and echo area in use,
1481 wait a short time and redraw minibuffer. */
1482
At conditional (7): "minibuf_level != 0" taking true path
At conditional (8): "echo_area_buffer[0] != Qnil" taking true path
At conditional (9): "minibuf_window == echo_area_window" taking true path
At conditional (10): "Vminibuffer_message_timeout & 7 == 0" taking true path
1483 if (minibuf_level
1484 && !NILP (echo_area_buffer[0])
1485 && EQ (minibuf_window, echo_area_window)
1486 && NUMBERP (Vminibuffer_message_timeout))
1487 {
1488 /* Bind inhibit-quit to t so that C-g gets read in
1489 rather than quitting back to the minibuffer. */
1490 int count = SPECPDL_INDEX ();
1491 specbind (Qinhibit_quit, Qt);
1492
1493 Fsit_for (Vminibuffer_message_timeout, Qnil, Qnil);
1494 /* Clear the echo area. */
1495 message2 (0, 0, 0);
1496 safe_run_hooks (Qecho_area_clear_hook);
1497
1498 unbind_to (count, Qnil);
1499
1500 /* If a C-g came in before, treat it as input now. */
At conditional (11): "Vquit_flag != Qnil" taking true path
1501 if (!NILP (Vquit_flag))
1502 {
1503 Vquit_flag = Qnil;
1504 Vunread_command_events = Fcons (make_number (quit_char),
Qnil);
1505 }
1506 }
1507
1508 #ifdef C_ALLOCA
1509 alloca (0); /* Cause a garbage collection now */
1510 /* Since we can free the most stuff
here. */
1511 #endif /* C_ALLOCA */
1512
1513 #if 0
1514 /* Select the frame that the last event came from. Usually,
1515 switch-frame events will take care of this, but if some lisp
1516 code swallows a switch-frame event, we'll fix things up here.
1517 Is this a good idea? */
1518 if (FRAMEP (internal_last_event_frame)
1519 && !EQ (internal_last_event_frame, selected_frame))
1520 Fselect_frame (internal_last_event_frame);
1521 #endif
1522 /* If it has changed current-menubar from previous value,
1523 really recompute the menubar from the value. */
At conditional (12): "Vlucid_menu_bar_dirty_flag != Qnil" taking true path
At conditional (13): "Ffboundp != Qnil" taking true path
1524 if (! NILP (Vlucid_menu_bar_dirty_flag)
1525 && !NILP (Ffboundp (Qrecompute_lucid_menubar)))
1526 call0 (Qrecompute_lucid_menubar);
1527
1528 before_command_key_count = this_command_key_count;
1529 before_command_echo_length = echo_length ();
1530
1531 Vthis_command = Qnil;
1532 real_this_command = Qnil;
1533 Vthis_original_command = Qnil;
1534
1535 /* Read next key sequence; i gets its length. */
1536 i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0],
1537 Qnil, 0, 1, 1);
1538
1539 /* A filter may have run while we were reading the input. */
At conditional (14): "(((0), (selected_frame & -8))->output_data).nothing == 0"
taking false path
1540 if (! FRAME_LIVE_P (XFRAME (selected_frame)))
1541 Fkill_emacs (Qnil);
At conditional (15): "(0), (((0), (selected_window & -8))->buffer & -8 !=
current_buffer)" taking true path
1542 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
1543 set_buffer_internal (XBUFFER (XWINDOW
(selected_window)->buffer));
1544
1545 ++num_input_keys;
1546
1547 /* Now we have read a key sequence of length I,
1548 or else I is 0 and we found end of file. */
1549
At conditional (16): "i == 0" taking false path
1550 if (i == 0) /* End of file -- happens only in */
1551 return Qnil; /* a kbd macro, at the end. */
1552 /* -1 means read_key_sequence got a menu that was rejected.
1553 Just loop around and read another command. */
At conditional (17): "i == -1" taking true path
1554 if (i == -1)
1555 {
1556 cancel_echoing ();
1557 this_command_key_count = 0;
1558 this_command_key_count_reset = 0;
1559 this_single_command_key_start = 0;
1560 goto finalize;
1561 }
1562
1563 last_command_char = keybuf[i - 1];
1564
1565 /* If the previous command tried to force a specific window-start,
1566 forget about that, in case this command moves point far away
1567 from that position. But also throw away beg_unchanged and
1568 end_unchanged information in that case, so that redisplay will
1569 update the whole window properly. */
1570 if (!NILP (XWINDOW (selected_window)->force_start))
1571 {
1572 struct buffer *b;
1573 XWINDOW (selected_window)->force_start = Qnil;
1574 b = XBUFFER (XWINDOW (selected_window)->buffer);
1575 BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0;
1576 }
1577
1578 cmd = read_key_sequence_cmd;
1579 if (!NILP (Vexecuting_kbd_macro))
1580 {
1581 if (!NILP (Vquit_flag))
1582 {
1583 Vexecuting_kbd_macro = Qt;
1584 QUIT; /* Make some noise. */
1585 /* Will return since macro now empty. */
1586 }
1587 }
1588
1589 /* Do redisplay processing after this command except in special
1590 cases identified below. */
1591 prev_buffer = current_buffer;
1592 prev_modiff = MODIFF;
1593 last_point_position = PT;
1594 last_point_position_window = selected_window;
1595 XSETBUFFER (last_point_position_buffer, prev_buffer);
1596
1597 /* By default, we adjust point to a boundary of a region that
1598 has such a property that should be treated intangible
1599 (e.g. composition, display). But, some commands will set
1600 this variable differently. */
1601 Vdisable_point_adjustment = Qnil;
1602
1603 /* Process filters and timers may have messed with
deactivate-mark.
1604 reset it before we execute the command. */
1605 Vdeactivate_mark = Qnil;
1606
1607 /* Remap command through active keymaps */
1608 Vthis_original_command = cmd;
1609 if (SYMBOLP (cmd))
1610 {
1611 Lisp_Object cmd1;
1612 if (cmd1 = Fcommand_remapping (cmd), !NILP (cmd1))
1613 cmd = cmd1;
1614 }
1615
1616 /* Execute the command. */
1617
1618 Vthis_command = cmd;
1619 real_this_command = cmd;
1620 /* Note that the value cell will never directly contain nil
1621 if the symbol is a local variable. */
1622 if (!NILP (Vpre_command_hook) && !NILP (Vrun_hooks))
1623 safe_run_hooks (Qpre_command_hook);
1624
1625 already_adjusted = 0;
1626
1627 if (NILP (Vthis_command))
1628 {
1629 /* nil means key is undefined. */
1630 Lisp_Object keys = Fvector (i, keybuf);
1631 keys = Fkey_description (keys, Qnil);
1632 bitch_at_user ();
1633 message_with_string ("%s is undefined", keys, 0);
1634 current_kboard->defining_kbd_macro = Qnil;
1635 update_mode_lines = 1;
1636 current_kboard->Vprefix_arg = Qnil;
1637 }
1638 else
1639 {
1640 if (NILP (current_kboard->Vprefix_arg) && ! no_direct)
1641 {
1642 /* In case we jump to directly_done. */
1643 Vcurrent_prefix_arg = current_kboard->Vprefix_arg;
1644
1645 /* Recognize some common commands in common situations and
1646 do them directly. */
1647 if (EQ (Vthis_command, Qforward_char) && PT < ZV)
1648 {
1649 struct Lisp_Char_Table *dp
1650 = window_display_table (XWINDOW (selected_window));
1651 lose = FETCH_CHAR (PT_BYTE);
1652 SET_PT (PT + 1);
1653 if (! NILP (Vpost_command_hook))
1654 /* Put this before calling adjust_point_for_property
1655 so it will only get called once in any case. */
1656 goto directly_done;
1657 if (current_buffer == prev_buffer
1658 && last_point_position != PT
1659 && NILP (Vdisable_point_adjustment)
1660 && NILP (Vglobal_disable_point_adjustment))
1661 adjust_point_for_property (last_point_position, 0);
1662 already_adjusted = 1;
1663 if (PT == last_point_position + 1
1664 && (dp
1665 ? (VECTORP (DISP_CHAR_VECTOR (dp, lose))
1666 ? XVECTOR (DISP_CHAR_VECTOR (dp,
lose))->size == 1
1667 : (NILP (DISP_CHAR_VECTOR (dp, lose))
1668 && (lose >= 0x20 && lose < 0x7f)))
1669 : (lose >= 0x20 && lose < 0x7f))
1670 /* To extract the case of continuation on
1671 wide-column characters. */
1672 && (WIDTH_BY_CHAR_HEAD (FETCH_BYTE (PT_BYTE)) ==
1)
1673 && (XFASTINT (XWINDOW
(selected_window)->last_modified)
1674 >= MODIFF)
1675 && (XFASTINT (XWINDOW
(selected_window)->last_overlay_modified)
1676 >= OVERLAY_MODIFF)
1677 && (XFASTINT (XWINDOW
(selected_window)->last_point)
1678 == PT - 1)
1679 && !windows_or_buffers_changed
1680 && EQ (current_buffer->selective_display, Qnil)
1681 && !detect_input_pending ()
1682 && NILP (XWINDOW
(selected_window)->column_number_displayed)
1683 && NILP (Vexecuting_kbd_macro))
1684 direct_output_forward_char (1);
1685 goto directly_done;
1686 }
1687 else if (EQ (Vthis_command, Qbackward_char) && PT > BEGV)
1688 {
1689 struct Lisp_Char_Table *dp
1690 = window_display_table (XWINDOW (selected_window));
1691 SET_PT (PT - 1);
1692 lose = FETCH_CHAR (PT_BYTE);
1693 if (! NILP (Vpost_command_hook))
1694 goto directly_done;
1695 if (current_buffer == prev_buffer
1696 && last_point_position != PT
1697 && NILP (Vdisable_point_adjustment)
1698 && NILP (Vglobal_disable_point_adjustment))
1699 adjust_point_for_property (last_point_position, 0);
1700 already_adjusted = 1;
1701 if (PT == last_point_position - 1
1702 && (dp
1703 ? (VECTORP (DISP_CHAR_VECTOR (dp, lose))
1704 ? XVECTOR (DISP_CHAR_VECTOR (dp,
lose))->size == 1
1705 : (NILP (DISP_CHAR_VECTOR (dp, lose))
1706 && (lose >= 0x20 && lose < 0x7f)))
1707 : (lose >= 0x20 && lose < 0x7f))
1708 && (XFASTINT (XWINDOW
(selected_window)->last_modified)
1709 >= MODIFF)
1710 && (XFASTINT (XWINDOW
(selected_window)->last_overlay_modified)
1711 >= OVERLAY_MODIFF)
1712 && (XFASTINT (XWINDOW
(selected_window)->last_point)
1713 == PT + 1)
1714 && !windows_or_buffers_changed
1715 && EQ (current_buffer->selective_display, Qnil)
1716 && !detect_input_pending ()
1717 && NILP (XWINDOW
(selected_window)->column_number_displayed)
1718 && NILP (Vexecuting_kbd_macro))
1719 direct_output_forward_char (-1);
1720 goto directly_done;
1721 }
1722 else if (EQ (Vthis_command, Qself_insert_command)
1723 /* Try this optimization only on char
keystrokes. */
1724 && NATNUMP (last_command_char)
1725 && CHAR_VALID_P (XFASTINT (last_command_char),
0))
1726 {
1727 unsigned int c
1728 = translate_char (Vtranslation_table_for_input,
1729 XFASTINT (last_command_char), 0,
0, 0);
1730 int value;
1731 if (NILP (Vexecuting_kbd_macro)
1732 && !EQ (minibuf_window, selected_window))
1733 {
1734 if (!nonundocount || nonundocount >= 20)
1735 {
1736 Fundo_boundary ();
1737 nonundocount = 0;
1738 }
1739 nonundocount++;
1740 }
1741
1742 lose = ((XFASTINT (XWINDOW
(selected_window)->last_modified)
1743 < MODIFF)
1744 || (XFASTINT (XWINDOW
(selected_window)->last_overlay_modified)
1745 < OVERLAY_MODIFF)
1746 || (XFASTINT (XWINDOW
(selected_window)->last_point)
1747 != PT)
1748 || MODIFF <= SAVE_MODIFF
1749 || windows_or_buffers_changed
1750 || !EQ (current_buffer->selective_display,
Qnil)
1751 || detect_input_pending ()
1752 || !NILP (XWINDOW
(selected_window)->column_number_displayed)
1753 || !NILP (Vexecuting_kbd_macro));
1754
1755 value = internal_self_insert (c, 0);
1756
1757 if (value == 2)
1758 nonundocount = 0;
1759
1760 if (! NILP (Vpost_command_hook))
1761 /* Put this before calling adjust_point_for_property
1762 so it will only get called once in any case. */
1763 goto directly_done;
1764
1765 /* VALUE == 1 when AFTER-CHANGE functions are
1766 installed which is the case most of the time
1767 because FONT-LOCK installs one. */
1768 if (!lose && !value)
1769 direct_output_for_insert (c);
1770 goto directly_done;
1771 }
1772 }
1773
1774 /* Here for a command that isn't executed directly */
1775
1776 {
1777 #ifdef HAVE_X_WINDOWS
1778 int scount = SPECPDL_INDEX ();
1779
1780 if (display_hourglass_p
1781 && NILP (Vexecuting_kbd_macro))
1782 {
1783 record_unwind_protect (cancel_hourglass_unwind, Qnil);
1784 start_hourglass ();
1785 }
1786 #endif
1787
1788 nonundocount = 0;
1789 if (NILP (current_kboard->Vprefix_arg))
1790 Fundo_boundary ();
1791 Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
1792
1793 #ifdef HAVE_X_WINDOWS
1794 /* Do not check display_hourglass_p here, because
1795 Fcommand_execute could change it, but we should cancel
1796 hourglass cursor anyway.
1797 But don't cancel the hourglass within a macro
1798 just because a command in the macro finishes. */
1799 if (NILP (Vexecuting_kbd_macro))
1800 unbind_to (scount, Qnil);
1801 #endif
1802 }
1803 }
1804 directly_done: ;
1805 current_kboard->Vlast_prefix_arg = Vcurrent_prefix_arg;
1806
1807 /* Note that the value cell will never directly contain nil
1808 if the symbol is a local variable. */
1809 if (!NILP (Vpost_command_hook) && !NILP (Vrun_hooks))
1810 safe_run_hooks (Qpost_command_hook);
1811
1812 /* If displaying a message, resize the echo area window to fit
1813 that message's size exactly. */
1814 if (!NILP (echo_area_buffer[0]))
1815 resize_echo_area_exactly ();
1816
1817 if (!NILP (Vdeferred_action_list))
1818 safe_run_hooks (Qdeferred_action_function);
1819
1820 /* If there is a prefix argument,
1821 1) We don't want Vlast_command to be ``universal-argument''
1822 (that would be dumb), so don't set Vlast_command,
1823 2) we want to leave echoing on so that the prefix will be
1824 echoed as part of this key sequence, so don't call
1825 cancel_echoing, and
1826 3) we want to leave this_command_key_count non-zero, so that
1827 read_char will realize that it is re-reading a character, and
1828 not echo it a second time.
1829
1830 If the command didn't actually create a prefix arg,
1831 but is merely a frame event that is transparent to prefix args,
1832 then the above doesn't apply. */
1833 if (NILP (current_kboard->Vprefix_arg) || CONSP
(last_command_char))
1834 {
1835 current_kboard->Vlast_command = Vthis_command;
1836 current_kboard->Vreal_last_command = real_this_command;
1837 cancel_echoing ();
1838 this_command_key_count = 0;
1839 this_command_key_count_reset = 0;
1840 this_single_command_key_start = 0;
1841 }
1842
1843 if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks))
1844 {
1845 /* Setting transient-mark-mode to `only' is a way of
1846 turning it on for just one command. */
1847
1848 if (EQ (Vtransient_mark_mode, Qidentity))
1849 Vtransient_mark_mode = Qnil;
1850 if (EQ (Vtransient_mark_mode, Qonly))
1851 Vtransient_mark_mode = Qidentity;
1852
1853 if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode))
1854 {
1855 /* We could also call `deactivate'mark'. */
1856 if (EQ (Vtransient_mark_mode, Qlambda))
1857 Vtransient_mark_mode = Qnil;
1858 else
1859 {
1860 current_buffer->mark_active = Qnil;
1861 call1 (Vrun_hooks, intern ("deactivate-mark-hook"));
1862 }
1863 }
1864 else if (current_buffer != prev_buffer || MODIFF !=
prev_modiff)
1865 call1 (Vrun_hooks, intern ("activate-mark-hook"));
1866 }
1867
1868 finalize:
1869
Event uninit_use: Using uninitialized value "already_adjusted"
Also see events: [var_decl]
At conditional (18): "current_buffer == prev_buffer" taking true path
At conditional (19): "last_point_position != ((current_buffer)->pt + 0)" taking
true path
At conditional (20): "Vdisable_point_adjustment == Qnil" taking true path
At conditional (21): "Vglobal_disable_point_adjustment == Qnil" taking true path
1870 if (current_buffer == prev_buffer
1871 && last_point_position != PT
1872 && NILP (Vdisable_point_adjustment)
1873 && NILP (Vglobal_disable_point_adjustment)
1874 && !already_adjusted)
1875 adjust_point_for_property (last_point_position, MODIFF !=
prev_modiff);
1876
1877 /* Install chars successfully executed in kbd macro. */
1878
1879 if (!NILP (current_kboard->defining_kbd_macro)
1880 && NILP (current_kboard->Vprefix_arg))
1881 finalize_kbd_macro_chars ();
1882
Event var_decl: Declared variable "prev_modiff" without initializer
Also see events: [uninit_use]
1421 int prev_modiff;
1422 struct buffer *prev_buffer = NULL;
1423 #ifdef MULTI_KBOARD
1424 int was_locked = single_kboard;
1425 #endif
1426 int already_adjusted;
1427
1428 current_kboard->Vprefix_arg = Qnil;
1429 current_kboard->Vlast_prefix_arg = Qnil;
1430 Vdeactivate_mark = Qnil;
1431 waiting_for_input = 0;
1432 cancel_echoing ();
1433
1434 nonundocount = 0;
1435 this_command_key_count = 0;
1436 this_command_key_count_reset = 0;
1437 this_single_command_key_start = 0;
1438
1439 if (NILP (Vmemory_full))
1440 {
1441 /* Make sure this hook runs after commands that get errors and
1442 throw to top level. */
1443 /* Note that the value cell will never directly contain nil
1444 if the symbol is a local variable. */
1445 if (!NILP (Vpost_command_hook) && !NILP (Vrun_hooks))
1446 safe_run_hooks (Qpost_command_hook);
1447
1448 /* If displaying a message, resize the echo area window to fit
1449 that message's size exactly. */
1450 if (!NILP (echo_area_buffer[0]))
1451 resize_echo_area_exactly ();
1452
1453 if (!NILP (Vdeferred_action_list))
1454 safe_run_hooks (Qdeferred_action_function);
1455 }
1456
1457 /* Do this after running Vpost_command_hook, for consistency. */
1458 current_kboard->Vlast_command = Vthis_command;
1459 current_kboard->Vreal_last_command = real_this_command;
1460
At conditional (1): "1" taking true path
1461 while (1)
1462 {
At conditional (2): "(((0), (selected_frame & -8))->output_data).nothing == 0"
taking false path
1463 if (! FRAME_LIVE_P (XFRAME (selected_frame)))
1464 Fkill_emacs (Qnil);
1465
1466 /* Make sure the current window's buffer is selected. */
At conditional (3): "(0), (((0), (selected_window & -8))->buffer & -8 !=
current_buffer)" taking true path
1467 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
1468 set_buffer_internal (XBUFFER (XWINDOW
(selected_window)->buffer));
1469
1470 /* Display any malloc warning that just came out. Use while
because
1471 displaying one warning can cause another. */
1472
At conditional (4): "pending_malloc_warning != 0" taking true path
At conditional (5): "pending_malloc_warning != 0" taking false path
1473 while (pending_malloc_warning)
1474 display_malloc_warning ();
1475
1476 no_direct = 0;
1477
1478 Vdeactivate_mark = Qnil;
1479
1480 /* If minibuffer on and echo area in use,
1481 wait a short time and redraw minibuffer. */
1482
At conditional (6): "minibuf_level != 0" taking true path
At conditional (7): "echo_area_buffer[0] != Qnil" taking true path
At conditional (8): "minibuf_window == echo_area_window" taking true path
At conditional (9): "Vminibuffer_message_timeout & 7 == 0" taking true path
1483 if (minibuf_level
1484 && !NILP (echo_area_buffer[0])
1485 && EQ (minibuf_window, echo_area_window)
1486 && NUMBERP (Vminibuffer_message_timeout))
1487 {
1488 /* Bind inhibit-quit to t so that C-g gets read in
1489 rather than quitting back to the minibuffer. */
1490 int count = SPECPDL_INDEX ();
1491 specbind (Qinhibit_quit, Qt);
1492
1493 Fsit_for (Vminibuffer_message_timeout, Qnil, Qnil);
1494 /* Clear the echo area. */
1495 message2 (0, 0, 0);
1496 safe_run_hooks (Qecho_area_clear_hook);
1497
1498 unbind_to (count, Qnil);
1499
1500 /* If a C-g came in before, treat it as input now. */
At conditional (10): "Vquit_flag != Qnil" taking true path
1501 if (!NILP (Vquit_flag))
1502 {
1503 Vquit_flag = Qnil;
1504 Vunread_command_events = Fcons (make_number (quit_char),
Qnil);
1505 }
1506 }
1507
1508 #ifdef C_ALLOCA
1509 alloca (0); /* Cause a garbage collection now */
1510 /* Since we can free the most stuff
here. */
1511 #endif /* C_ALLOCA */
1512
1513 #if 0
1514 /* Select the frame that the last event came from. Usually,
1515 switch-frame events will take care of this, but if some lisp
1516 code swallows a switch-frame event, we'll fix things up here.
1517 Is this a good idea? */
1518 if (FRAMEP (internal_last_event_frame)
1519 && !EQ (internal_last_event_frame, selected_frame))
1520 Fselect_frame (internal_last_event_frame);
1521 #endif
1522 /* If it has changed current-menubar from previous value,
1523 really recompute the menubar from the value. */
At conditional (11): "Vlucid_menu_bar_dirty_flag != Qnil" taking true path
At conditional (12): "Ffboundp != Qnil" taking true path
1524 if (! NILP (Vlucid_menu_bar_dirty_flag)
1525 && !NILP (Ffboundp (Qrecompute_lucid_menubar)))
1526 call0 (Qrecompute_lucid_menubar);
1527
1528 before_command_key_count = this_command_key_count;
1529 before_command_echo_length = echo_length ();
1530
1531 Vthis_command = Qnil;
1532 real_this_command = Qnil;
1533 Vthis_original_command = Qnil;
1534
1535 /* Read next key sequence; i gets its length. */
1536 i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0],
1537 Qnil, 0, 1, 1);
1538
1539 /* A filter may have run while we were reading the input. */
At conditional (13): "(((0), (selected_frame & -8))->output_data).nothing == 0"
taking false path
1540 if (! FRAME_LIVE_P (XFRAME (selected_frame)))
1541 Fkill_emacs (Qnil);
At conditional (14): "(0), (((0), (selected_window & -8))->buffer & -8 !=
current_buffer)" taking true path
1542 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
1543 set_buffer_internal (XBUFFER (XWINDOW
(selected_window)->buffer));
1544
1545 ++num_input_keys;
1546
1547 /* Now we have read a key sequence of length I,
1548 or else I is 0 and we found end of file. */
1549
At conditional (15): "i == 0" taking false path
1550 if (i == 0) /* End of file -- happens only in */
1551 return Qnil; /* a kbd macro, at the end. */
1552 /* -1 means read_key_sequence got a menu that was rejected.
1553 Just loop around and read another command. */
At conditional (16): "i == -1" taking true path
1554 if (i == -1)
1555 {
1556 cancel_echoing ();
1557 this_command_key_count = 0;
1558 this_command_key_count_reset = 0;
1559 this_single_command_key_start = 0;
1560 goto finalize;
1561 }
1562
1563 last_command_char = keybuf[i - 1];
1564
1565 /* If the previous command tried to force a specific window-start,
1566 forget about that, in case this command moves point far away
1567 from that position. But also throw away beg_unchanged and
1568 end_unchanged information in that case, so that redisplay will
1569 update the whole window properly. */
1570 if (!NILP (XWINDOW (selected_window)->force_start))
1571 {
1572 struct buffer *b;
1573 XWINDOW (selected_window)->force_start = Qnil;
1574 b = XBUFFER (XWINDOW (selected_window)->buffer);
1575 BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0;
1576 }
1577
1578 cmd = read_key_sequence_cmd;
1579 if (!NILP (Vexecuting_kbd_macro))
1580 {
1581 if (!NILP (Vquit_flag))
1582 {
1583 Vexecuting_kbd_macro = Qt;
1584 QUIT; /* Make some noise. */
1585 /* Will return since macro now empty. */
1586 }
1587 }
1588
1589 /* Do redisplay processing after this command except in special
1590 cases identified below. */
1591 prev_buffer = current_buffer;
1592 prev_modiff = MODIFF;
1593 last_point_position = PT;
1594 last_point_position_window = selected_window;
1595 XSETBUFFER (last_point_position_buffer, prev_buffer);
1596
1597 /* By default, we adjust point to a boundary of a region that
1598 has such a property that should be treated intangible
1599 (e.g. composition, display). But, some commands will set
1600 this variable differently. */
1601 Vdisable_point_adjustment = Qnil;
1602
1603 /* Process filters and timers may have messed with
deactivate-mark.
1604 reset it before we execute the command. */
1605 Vdeactivate_mark = Qnil;
1606
1607 /* Remap command through active keymaps */
1608 Vthis_original_command = cmd;
1609 if (SYMBOLP (cmd))
1610 {
1611 Lisp_Object cmd1;
1612 if (cmd1 = Fcommand_remapping (cmd), !NILP (cmd1))
1613 cmd = cmd1;
1614 }
1615
1616 /* Execute the command. */
1617
1618 Vthis_command = cmd;
1619 real_this_command = cmd;
1620 /* Note that the value cell will never directly contain nil
1621 if the symbol is a local variable. */
1622 if (!NILP (Vpre_command_hook) && !NILP (Vrun_hooks))
1623 safe_run_hooks (Qpre_command_hook);
1624
1625 already_adjusted = 0;
1626
1627 if (NILP (Vthis_command))
1628 {
1629 /* nil means key is undefined. */
1630 Lisp_Object keys = Fvector (i, keybuf);
1631 keys = Fkey_description (keys, Qnil);
1632 bitch_at_user ();
1633 message_with_string ("%s is undefined", keys, 0);
1634 current_kboard->defining_kbd_macro = Qnil;
1635 update_mode_lines = 1;
1636 current_kboard->Vprefix_arg = Qnil;
1637 }
1638 else
1639 {
1640 if (NILP (current_kboard->Vprefix_arg) && ! no_direct)
1641 {
1642 /* In case we jump to directly_done. */
1643 Vcurrent_prefix_arg = current_kboard->Vprefix_arg;
1644
1645 /* Recognize some common commands in common situations and
1646 do them directly. */
1647 if (EQ (Vthis_command, Qforward_char) && PT < ZV)
1648 {
1649 struct Lisp_Char_Table *dp
1650 = window_display_table (XWINDOW (selected_window));
1651 lose = FETCH_CHAR (PT_BYTE);
1652 SET_PT (PT + 1);
1653 if (! NILP (Vpost_command_hook))
1654 /* Put this before calling adjust_point_for_property
1655 so it will only get called once in any case. */
1656 goto directly_done;
1657 if (current_buffer == prev_buffer
1658 && last_point_position != PT
1659 && NILP (Vdisable_point_adjustment)
1660 && NILP (Vglobal_disable_point_adjustment))
1661 adjust_point_for_property (last_point_position, 0);
1662 already_adjusted = 1;
1663 if (PT == last_point_position + 1
1664 && (dp
1665 ? (VECTORP (DISP_CHAR_VECTOR (dp, lose))
1666 ? XVECTOR (DISP_CHAR_VECTOR (dp,
lose))->size == 1
1667 : (NILP (DISP_CHAR_VECTOR (dp, lose))
1668 && (lose >= 0x20 && lose < 0x7f)))
1669 : (lose >= 0x20 && lose < 0x7f))
1670 /* To extract the case of continuation on
1671 wide-column characters. */
1672 && (WIDTH_BY_CHAR_HEAD (FETCH_BYTE (PT_BYTE)) ==
1)
1673 && (XFASTINT (XWINDOW
(selected_window)->last_modified)
1674 >= MODIFF)
1675 && (XFASTINT (XWINDOW
(selected_window)->last_overlay_modified)
1676 >= OVERLAY_MODIFF)
1677 && (XFASTINT (XWINDOW
(selected_window)->last_point)
1678 == PT - 1)
1679 && !windows_or_buffers_changed
1680 && EQ (current_buffer->selective_display, Qnil)
1681 && !detect_input_pending ()
1682 && NILP (XWINDOW
(selected_window)->column_number_displayed)
1683 && NILP (Vexecuting_kbd_macro))
1684 direct_output_forward_char (1);
1685 goto directly_done;
1686 }
1687 else if (EQ (Vthis_command, Qbackward_char) && PT > BEGV)
1688 {
1689 struct Lisp_Char_Table *dp
1690 = window_display_table (XWINDOW (selected_window));
1691 SET_PT (PT - 1);
1692 lose = FETCH_CHAR (PT_BYTE);
1693 if (! NILP (Vpost_command_hook))
1694 goto directly_done;
1695 if (current_buffer == prev_buffer
1696 && last_point_position != PT
1697 && NILP (Vdisable_point_adjustment)
1698 && NILP (Vglobal_disable_point_adjustment))
1699 adjust_point_for_property (last_point_position, 0);
1700 already_adjusted = 1;
1701 if (PT == last_point_position - 1
1702 && (dp
1703 ? (VECTORP (DISP_CHAR_VECTOR (dp, lose))
1704 ? XVECTOR (DISP_CHAR_VECTOR (dp,
lose))->size == 1
1705 : (NILP (DISP_CHAR_VECTOR (dp, lose))
1706 && (lose >= 0x20 && lose < 0x7f)))
1707 : (lose >= 0x20 && lose < 0x7f))
1708 && (XFASTINT (XWINDOW
(selected_window)->last_modified)
1709 >= MODIFF)
1710 && (XFASTINT (XWINDOW
(selected_window)->last_overlay_modified)
1711 >= OVERLAY_MODIFF)
1712 && (XFASTINT (XWINDOW
(selected_window)->last_point)
1713 == PT + 1)
1714 && !windows_or_buffers_changed
1715 && EQ (current_buffer->selective_display, Qnil)
1716 && !detect_input_pending ()
1717 && NILP (XWINDOW
(selected_window)->column_number_displayed)
1718 && NILP (Vexecuting_kbd_macro))
1719 direct_output_forward_char (-1);
1720 goto directly_done;
1721 }
1722 else if (EQ (Vthis_command, Qself_insert_command)
1723 /* Try this optimization only on char
keystrokes. */
1724 && NATNUMP (last_command_char)
1725 && CHAR_VALID_P (XFASTINT (last_command_char),
0))
1726 {
1727 unsigned int c
1728 = translate_char (Vtranslation_table_for_input,
1729 XFASTINT (last_command_char), 0,
0, 0);
1730 int value;
1731 if (NILP (Vexecuting_kbd_macro)
1732 && !EQ (minibuf_window, selected_window))
1733 {
1734 if (!nonundocount || nonundocount >= 20)
1735 {
1736 Fundo_boundary ();
1737 nonundocount = 0;
1738 }
1739 nonundocount++;
1740 }
1741
1742 lose = ((XFASTINT (XWINDOW
(selected_window)->last_modified)
1743 < MODIFF)
1744 || (XFASTINT (XWINDOW
(selected_window)->last_overlay_modified)
1745 < OVERLAY_MODIFF)
1746 || (XFASTINT (XWINDOW
(selected_window)->last_point)
1747 != PT)
1748 || MODIFF <= SAVE_MODIFF
1749 || windows_or_buffers_changed
1750 || !EQ (current_buffer->selective_display,
Qnil)
1751 || detect_input_pending ()
1752 || !NILP (XWINDOW
(selected_window)->column_number_displayed)
1753 || !NILP (Vexecuting_kbd_macro));
1754
1755 value = internal_self_insert (c, 0);
1756
1757 if (value == 2)
1758 nonundocount = 0;
1759
1760 if (! NILP (Vpost_command_hook))
1761 /* Put this before calling adjust_point_for_property
1762 so it will only get called once in any case. */
1763 goto directly_done;
1764
1765 /* VALUE == 1 when AFTER-CHANGE functions are
1766 installed which is the case most of the time
1767 because FONT-LOCK installs one. */
1768 if (!lose && !value)
1769 direct_output_for_insert (c);
1770 goto directly_done;
1771 }
1772 }
1773
1774 /* Here for a command that isn't executed directly */
1775
1776 {
1777 #ifdef HAVE_X_WINDOWS
1778 int scount = SPECPDL_INDEX ();
1779
1780 if (display_hourglass_p
1781 && NILP (Vexecuting_kbd_macro))
1782 {
1783 record_unwind_protect (cancel_hourglass_unwind, Qnil);
1784 start_hourglass ();
1785 }
1786 #endif
1787
1788 nonundocount = 0;
1789 if (NILP (current_kboard->Vprefix_arg))
1790 Fundo_boundary ();
1791 Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
1792
1793 #ifdef HAVE_X_WINDOWS
1794 /* Do not check display_hourglass_p here, because
1795 Fcommand_execute could change it, but we should cancel
1796 hourglass cursor anyway.
1797 But don't cancel the hourglass within a macro
1798 just because a command in the macro finishes. */
1799 if (NILP (Vexecuting_kbd_macro))
1800 unbind_to (scount, Qnil);
1801 #endif
1802 }
1803 }
1804 directly_done: ;
1805 current_kboard->Vlast_prefix_arg = Vcurrent_prefix_arg;
1806
1807 /* Note that the value cell will never directly contain nil
1808 if the symbol is a local variable. */
1809 if (!NILP (Vpost_command_hook) && !NILP (Vrun_hooks))
1810 safe_run_hooks (Qpost_command_hook);
1811
1812 /* If displaying a message, resize the echo area window to fit
1813 that message's size exactly. */
1814 if (!NILP (echo_area_buffer[0]))
1815 resize_echo_area_exactly ();
1816
1817 if (!NILP (Vdeferred_action_list))
1818 safe_run_hooks (Qdeferred_action_function);
1819
1820 /* If there is a prefix argument,
1821 1) We don't want Vlast_command to be ``universal-argument''
1822 (that would be dumb), so don't set Vlast_command,
1823 2) we want to leave echoing on so that the prefix will be
1824 echoed as part of this key sequence, so don't call
1825 cancel_echoing, and
1826 3) we want to leave this_command_key_count non-zero, so that
1827 read_char will realize that it is re-reading a character, and
1828 not echo it a second time.
1829
1830 If the command didn't actually create a prefix arg,
1831 but is merely a frame event that is transparent to prefix args,
1832 then the above doesn't apply. */
1833 if (NILP (current_kboard->Vprefix_arg) || CONSP
(last_command_char))
1834 {
1835 current_kboard->Vlast_command = Vthis_command;
1836 current_kboard->Vreal_last_command = real_this_command;
1837 cancel_echoing ();
1838 this_command_key_count = 0;
1839 this_command_key_count_reset = 0;
1840 this_single_command_key_start = 0;
1841 }
1842
1843 if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks))
1844 {
1845 /* Setting transient-mark-mode to `only' is a way of
1846 turning it on for just one command. */
1847
1848 if (EQ (Vtransient_mark_mode, Qidentity))
1849 Vtransient_mark_mode = Qnil;
1850 if (EQ (Vtransient_mark_mode, Qonly))
1851 Vtransient_mark_mode = Qidentity;
1852
1853 if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode))
1854 {
1855 /* We could also call `deactivate'mark'. */
1856 if (EQ (Vtransient_mark_mode, Qlambda))
1857 Vtransient_mark_mode = Qnil;
1858 else
1859 {
1860 current_buffer->mark_active = Qnil;
1861 call1 (Vrun_hooks, intern ("deactivate-mark-hook"));
1862 }
1863 }
1864 else if (current_buffer != prev_buffer || MODIFF !=
prev_modiff)
1865 call1 (Vrun_hooks, intern ("activate-mark-hook"));
1866 }
1867
1868 finalize:
1869
At conditional (17): "current_buffer == prev_buffer" taking true path
At conditional (18): "last_point_position != ((current_buffer)->pt + 0)" taking
true path
At conditional (19): "Vdisable_point_adjustment == Qnil" taking true path
At conditional (20): "Vglobal_disable_point_adjustment == Qnil" taking true path
At conditional (21): "already_adjusted == 0" taking true path
1870 if (current_buffer == prev_buffer
1871 && last_point_position != PT
1872 && NILP (Vdisable_point_adjustment)
1873 && NILP (Vglobal_disable_point_adjustment)
1874 && !already_adjusted)
Event uninit_use: Using uninitialized value "prev_modiff"
Also see events: [var_decl]
1875 adjust_point_for_property (last_point_position, MODIFF !=
prev_modiff);
1876
- Problem report #61,
Dan Nicolaescu <=