aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2012-11-21 06:53:37 +0100
committerJoakim Verona2012-11-21 06:53:37 +0100
commit01537ffb98320064484ed4898ad66318b18a8e46 (patch)
treeaa948d4220d92d7f26905284b315f7dc2da9edb4 /src
parent0de998c37f8467ef671a9559642a8de7fe17114e (diff)
parenteadf1faa3cb5eea8c25a5166a9a97ebd63525c56 (diff)
downloademacs-01537ffb98320064484ed4898ad66318b18a8e46.tar.gz
emacs-01537ffb98320064484ed4898ad66318b18a8e46.zip
upstream
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog54
-rw-r--r--src/alloc.c4
-rw-r--r--src/bytecode.c4
-rw-r--r--src/cygw32.c20
-rw-r--r--src/data.c21
-rw-r--r--src/eval.c132
-rw-r--r--src/lisp.h2
-rw-r--r--src/lread.c3
-rw-r--r--src/w32fns.c6
-rw-r--r--src/xdisp.c70
10 files changed, 135 insertions, 181 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2a0c0e6822d..332656fcf00 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,45 @@
12012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 Conflate Qnil and Qunbound for `symbol-function'.
4 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
5 * lread.c (init_obarray): Set `function' fields to Qnil.
6 * eval.c (Fcommandp): Ignore Qunbound.
7 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
8 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
9 Test NILP rather than Qunbound.
10 (Ffmakunbound): Set to Qnil.
11 (Fsymbol_function): Never signal an error.
12 (Finteractive_form): Ignore Qunbound.
13
142012-11-20 Paul Eggert <eggert@cs.ucla.edu>
15
16 * eval.c (interactive_p): Remove no-longer-used decl.
17
182012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
19
20 * xdisp.c (buffer_shared): Adjust comment.
21 (buffer_shared_and_changed): New function.
22 (prepare_menu_bars, redisplay_internal): Use it to
23 decide whether all windows or frames should be updated.
24 (window_outdated): New function.
25 (text_outside_line_unchanged_p, redisplay_window): Use it.
26 (redisplay_internal): Likewise. Fix indentation.
27
282012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
29
30 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
31 (syms_of_eval): Remove corresponding defsubr.
32 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
33
342012-11-19 Daniel Colascione <dancol@dancol.org>
35
36 * w32fns.c (Fx_file_dialog):
37 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
38 cygwin_convert_file_name*.
39
40 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
41 Rename cygwin_convert_path* to cygwin_convert_file_name*.
42
12012-11-18 Paul Eggert <eggert@cs.ucla.edu> 432012-11-18 Paul Eggert <eggert@cs.ucla.edu>
2 44
3 * nsterm.m (ns_select): Send SIGIO only to self, not to process group. 45 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
@@ -8,10 +50,10 @@
8 windows.h gets included before w32term.h uses some of its 50 windows.h gets included before w32term.h uses some of its
9 features, see below. 51 features, see below.
10 52
11 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New 53 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
12 typedefs. 54 New typedefs.
13 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New 55 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
14 prototypes. 56 New prototypes.
15 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878) 57 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
16 58
172012-11-18 Jan Djärv <jan.h.d@swipnet.se> 592012-11-18 Jan Djärv <jan.h.d@swipnet.se>
@@ -303,8 +345,8 @@
303 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll 345 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
304 amount when the scroll margins are too large. When scrolling 346 amount when the scroll margins are too large. When scrolling
305 backwards in the buffer, give up if cannot reach point or the 347 backwards in the buffer, give up if cannot reach point or the
306 scroll margin within a reasonable number of screen lines. Fixes 348 scroll margin within a reasonable number of screen lines.
307 point position in window under scroll-up/down-aggressively when 349 Fixes point position in window under scroll-up/down-aggressively when
308 point is positioned many lines beyond the window top/bottom. 350 point is positioned many lines beyond the window top/bottom.
309 (Bug#12811) 351 (Bug#12811)
310 352
diff --git a/src/alloc.c b/src/alloc.c
index a66a752f5dc..22e3db3cc77 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3212,7 +3212,7 @@ static struct Lisp_Symbol *symbol_free_list;
3212 3212
3213DEFUN ("make-symbol", Fmake_symbol, Smake_symbol, 1, 1, 0, 3213DEFUN ("make-symbol", Fmake_symbol, Smake_symbol, 1, 1, 0,
3214 doc: /* Return a newly allocated uninterned symbol whose name is NAME. 3214 doc: /* Return a newly allocated uninterned symbol whose name is NAME.
3215Its value and function definition are void, and its property list is nil. */) 3215Its value is void, and its function definition and property list are nil. */)
3216 (Lisp_Object name) 3216 (Lisp_Object name)
3217{ 3217{
3218 register Lisp_Object val; 3218 register Lisp_Object val;
@@ -3249,7 +3249,7 @@ Its value and function definition are void, and its property list is nil. */)
3249 set_symbol_plist (val, Qnil); 3249 set_symbol_plist (val, Qnil);
3250 p->redirect = SYMBOL_PLAINVAL; 3250 p->redirect = SYMBOL_PLAINVAL;
3251 SET_SYMBOL_VAL (p, Qunbound); 3251 SET_SYMBOL_VAL (p, Qunbound);
3252 set_symbol_function (val, Qunbound); 3252 set_symbol_function (val, Qnil);
3253 set_symbol_next (val, NULL); 3253 set_symbol_next (val, NULL);
3254 p->gcmarkbit = 0; 3254 p->gcmarkbit = 0;
3255 p->interned = SYMBOL_UNINTERNED; 3255 p->interned = SYMBOL_UNINTERNED;
diff --git a/src/bytecode.c b/src/bytecode.c
index 648813aed86..3267c7c8c76 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1579,7 +1579,9 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
1579 NEXT; 1579 NEXT;
1580 1580
1581 CASE (Binteractive_p): /* Obsolete since 24.1. */ 1581 CASE (Binteractive_p): /* Obsolete since 24.1. */
1582 PUSH (Finteractive_p ()); 1582 BEFORE_POTENTIAL_GC ();
1583 PUSH (call0 (intern ("interactive-p")));
1584 AFTER_POTENTIAL_GC ();
1583 NEXT; 1585 NEXT;
1584 1586
1585 CASE (Bforward_char): 1587 CASE (Bforward_char):
diff --git a/src/cygw32.c b/src/cygw32.c
index 54f2076a891..d9777d5e22e 100644
--- a/src/cygw32.c
+++ b/src/cygw32.c
@@ -106,22 +106,24 @@ conv_filename_from_w32_unicode (const wchar_t* in, int absolute_p)
106 return unbind_to (count, DECODE_FILE (converted)); 106 return unbind_to (count, DECODE_FILE (converted));
107} 107}
108 108
109DEFUN ("cygwin-convert-path-to-windows", 109DEFUN ("cygwin-convert-file-name-to-windows",
110 Fcygwin_convert_path_to_windows, Scygwin_convert_path_to_windows, 110 Fcygwin_convert_file_name_to_windows,
111 Scygwin_convert_file_name_to_windows,
111 1, 2, 0, 112 1, 2, 0,
112 doc: /* Convert PATH to a Windows path. If ABSOLUTE-P if 113 doc: /* Convert PATH to a Windows path. If ABSOLUTE-P is
113 non-nil, return an absolute path.*/) 114non-nil, return an absolute path.*/)
114 (Lisp_Object path, Lisp_Object absolute_p) 115 (Lisp_Object path, Lisp_Object absolute_p)
115{ 116{
116 return from_unicode ( 117 return from_unicode (
117 conv_filename_to_w32_unicode (path, EQ (absolute_p, Qnil) ? 0 : 1)); 118 conv_filename_to_w32_unicode (path, EQ (absolute_p, Qnil) ? 0 : 1));
118} 119}
119 120
120DEFUN ("cygwin-convert-path-from-windows", 121DEFUN ("cygwin-convert-file-name-from-windows",
121 Fcygwin_convert_path_from_windows, Scygwin_convert_path_from_windows, 122 Fcygwin_convert_file_name_from_windows,
123 Scygwin_convert_file_name_from_windows,
122 1, 2, 0, 124 1, 2, 0,
123 doc: /* Convert a Windows path to a Cygwin path. If ABSOLUTE-P 125 doc: /* Convert a Windows path to a Cygwin path. If ABSOLUTE-P
124 if non-nil, return an absolute path.*/) 126is non-nil, return an absolute path.*/)
125 (Lisp_Object path, Lisp_Object absolute_p) 127 (Lisp_Object path, Lisp_Object absolute_p)
126{ 128{
127 return conv_filename_from_w32_unicode (to_unicode (path, &path), 129 return conv_filename_from_w32_unicode (to_unicode (path, &path),
@@ -131,6 +133,6 @@ DEFUN ("cygwin-convert-path-from-windows",
131void 133void
132syms_of_cygw32 (void) 134syms_of_cygw32 (void)
133{ 135{
134 defsubr (&Scygwin_convert_path_from_windows); 136 defsubr (&Scygwin_convert_file_name_from_windows);
135 defsubr (&Scygwin_convert_path_to_windows); 137 defsubr (&Scygwin_convert_file_name_to_windows);
136} 138}
diff --git a/src/data.c b/src/data.c
index 09899400b68..5fc6afaaa03 100644
--- a/src/data.c
+++ b/src/data.c
@@ -543,12 +543,13 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
543 return (EQ (valcontents, Qunbound) ? Qnil : Qt); 543 return (EQ (valcontents, Qunbound) ? Qnil : Qt);
544} 544}
545 545
546/* FIXME: Make it an alias for function-symbol! */
546DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0, 547DEFUN ("fboundp", Ffboundp, Sfboundp, 1, 1, 0,
547 doc: /* Return t if SYMBOL's function definition is not void. */) 548 doc: /* Return t if SYMBOL's function definition is not void. */)
548 (register Lisp_Object symbol) 549 (register Lisp_Object symbol)
549{ 550{
550 CHECK_SYMBOL (symbol); 551 CHECK_SYMBOL (symbol);
551 return EQ (XSYMBOL (symbol)->function, Qunbound) ? Qnil : Qt; 552 return NILP (XSYMBOL (symbol)->function) ? Qnil : Qt;
552} 553}
553 554
554DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0, 555DEFUN ("makunbound", Fmakunbound, Smakunbound, 1, 1, 0,
@@ -564,14 +565,14 @@ Return SYMBOL. */)
564} 565}
565 566
566DEFUN ("fmakunbound", Ffmakunbound, Sfmakunbound, 1, 1, 0, 567DEFUN ("fmakunbound", Ffmakunbound, Sfmakunbound, 1, 1, 0,
567 doc: /* Make SYMBOL's function definition be void. 568 doc: /* Make SYMBOL's function definition be nil.
568Return SYMBOL. */) 569Return SYMBOL. */)
569 (register Lisp_Object symbol) 570 (register Lisp_Object symbol)
570{ 571{
571 CHECK_SYMBOL (symbol); 572 CHECK_SYMBOL (symbol);
572 if (NILP (symbol) || EQ (symbol, Qt)) 573 if (NILP (symbol) || EQ (symbol, Qt))
573 xsignal1 (Qsetting_constant, symbol); 574 xsignal1 (Qsetting_constant, symbol);
574 set_symbol_function (symbol, Qunbound); 575 set_symbol_function (symbol, Qnil);
575 return symbol; 576 return symbol;
576} 577}
577 578
@@ -580,9 +581,7 @@ DEFUN ("symbol-function", Fsymbol_function, Ssymbol_function, 1, 1, 0,
580 (register Lisp_Object symbol) 581 (register Lisp_Object symbol)
581{ 582{
582 CHECK_SYMBOL (symbol); 583 CHECK_SYMBOL (symbol);
583 if (!EQ (XSYMBOL (symbol)->function, Qunbound))
584 return XSYMBOL (symbol)->function; 584 return XSYMBOL (symbol)->function;
585 xsignal1 (Qvoid_function, symbol);
586} 585}
587 586
588DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0, 587DEFUN ("symbol-plist", Fsymbol_plist, Ssymbol_plist, 1, 1, 0,
@@ -613,7 +612,7 @@ DEFUN ("fset", Ffset, Sfset, 2, 2, 0,
613 612
614 function = XSYMBOL (symbol)->function; 613 function = XSYMBOL (symbol)->function;
615 614
616 if (!NILP (Vautoload_queue) && !EQ (function, Qunbound)) 615 if (!NILP (Vautoload_queue) && !NILP (function))
617 Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue); 616 Vautoload_queue = Fcons (Fcons (symbol, function), Vautoload_queue);
618 617
619 if (AUTOLOADP (function)) 618 if (AUTOLOADP (function))
@@ -714,7 +713,7 @@ Value, if non-nil, is a list \(interactive SPEC). */)
714{ 713{
715 Lisp_Object fun = indirect_function (cmd); /* Check cycles. */ 714 Lisp_Object fun = indirect_function (cmd); /* Check cycles. */
716 715
717 if (NILP (fun) || EQ (fun, Qunbound)) 716 if (NILP (fun))
718 return Qnil; 717 return Qnil;
719 718
720 /* Use an `interactive-form' property if present, analogous to the 719 /* Use an `interactive-form' property if present, analogous to the
@@ -2008,10 +2007,10 @@ indirect_function (register Lisp_Object object)
2008 2007
2009 for (;;) 2008 for (;;)
2010 { 2009 {
2011 if (!SYMBOLP (hare) || EQ (hare, Qunbound)) 2010 if (!SYMBOLP (hare) || NILP (hare))
2012 break; 2011 break;
2013 hare = XSYMBOL (hare)->function; 2012 hare = XSYMBOL (hare)->function;
2014 if (!SYMBOLP (hare) || EQ (hare, Qunbound)) 2013 if (!SYMBOLP (hare) || NILP (hare))
2015 break; 2014 break;
2016 hare = XSYMBOL (hare)->function; 2015 hare = XSYMBOL (hare)->function;
2017 2016
@@ -2038,10 +2037,10 @@ function chain of symbols. */)
2038 2037
2039 /* Optimize for no indirection. */ 2038 /* Optimize for no indirection. */
2040 result = object; 2039 result = object;
2041 if (SYMBOLP (result) && !EQ (result, Qunbound) 2040 if (SYMBOLP (result) && !NILP (result)
2042 && (result = XSYMBOL (result)->function, SYMBOLP (result))) 2041 && (result = XSYMBOL (result)->function, SYMBOLP (result)))
2043 result = indirect_function (result); 2042 result = indirect_function (result);
2044 if (!EQ (result, Qunbound)) 2043 if (!NILP (result))
2045 return result; 2044 return result;
2046 2045
2047 if (NILP (noerror)) 2046 if (NILP (noerror))
diff --git a/src/eval.c b/src/eval.c
index f8a76646352..34b20f6fc8e 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -114,7 +114,6 @@ Lisp_Object Vsignaling_function;
114Lisp_Object inhibit_lisp_code; 114Lisp_Object inhibit_lisp_code;
115 115
116static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *); 116static Lisp_Object funcall_lambda (Lisp_Object, ptrdiff_t, Lisp_Object *);
117static bool interactive_p (void);
118static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args); 117static Lisp_Object apply_lambda (Lisp_Object fun, Lisp_Object args);
119 118
120/* Functions to set Lisp_Object slots of struct specbinding. */ 119/* Functions to set Lisp_Object slots of struct specbinding. */
@@ -489,102 +488,6 @@ usage: (function ARG) */)
489} 488}
490 489
491 490
492DEFUN ("interactive-p", Finteractive_p, Sinteractive_p, 0, 0, 0,
493 doc: /* Return t if the containing function was run directly by user input.
494This means that the function was called with `call-interactively'
495\(which includes being called as the binding of a key)
496and input is currently coming from the keyboard (not a keyboard macro),
497and Emacs is not running in batch mode (`noninteractive' is nil).
498
499The only known proper use of `interactive-p' is in deciding whether to
500display a helpful message, or how to display it. If you're thinking
501of using it for any other purpose, it is quite likely that you're
502making a mistake. Think: what do you want to do when the command is
503called from a keyboard macro?
504
505To test whether your function was called with `call-interactively',
506either (i) add an extra optional argument and give it an `interactive'
507spec that specifies non-nil unconditionally (such as \"p\"); or (ii)
508use `called-interactively-p'. */)
509 (void)
510{
511 return (INTERACTIVE && interactive_p ()) ? Qt : Qnil;
512}
513
514
515DEFUN ("called-interactively-p", Fcalled_interactively_p, Scalled_interactively_p, 0, 1, 0,
516 doc: /* Return t if the containing function was called by `call-interactively'.
517If KIND is `interactive', then only return t if the call was made
518interactively by the user, i.e. not in `noninteractive' mode nor
519when `executing-kbd-macro'.
520If KIND is `any', on the other hand, it will return t for any kind of
521interactive call, including being called as the binding of a key, or
522from a keyboard macro, or in `noninteractive' mode.
523
524The only known proper use of `interactive' for KIND is in deciding
525whether to display a helpful message, or how to display it. If you're
526thinking of using it for any other purpose, it is quite likely that
527you're making a mistake. Think: what do you want to do when the
528command is called from a keyboard macro?
529
530Instead of using this function, it is sometimes cleaner to give your
531function an extra optional argument whose `interactive' spec specifies
532non-nil unconditionally (\"p\" is a good way to do this), or via
533\(not (or executing-kbd-macro noninteractive)). */)
534 (Lisp_Object kind)
535{
536 return (((INTERACTIVE || !EQ (kind, intern ("interactive")))
537 && interactive_p ())
538 ? Qt : Qnil);
539}
540
541
542/* Return true if function in which this appears was called using
543 call-interactively and is not a built-in. */
544
545static bool
546interactive_p (void)
547{
548 struct backtrace *btp;
549 Lisp_Object fun;
550
551 btp = backtrace_list;
552
553 /* If this isn't a byte-compiled function, there may be a frame at
554 the top for Finteractive_p. If so, skip it. */
555 fun = Findirect_function (btp->function, Qnil);
556 if (SUBRP (fun) && (XSUBR (fun) == &Sinteractive_p
557 || XSUBR (fun) == &Scalled_interactively_p))
558 btp = btp->next;
559
560 /* If we're running an Emacs 18-style byte-compiled function, there
561 may be a frame for Fbytecode at the top level. In any version of
562 Emacs there can be Fbytecode frames for subexpressions evaluated
563 inside catch and condition-case. Skip past them.
564
565 If this isn't a byte-compiled function, then we may now be
566 looking at several frames for special forms. Skip past them. */
567 while (btp
568 && (EQ (btp->function, Qbytecode)
569 || btp->nargs == UNEVALLED))
570 btp = btp->next;
571
572 /* `btp' now points at the frame of the innermost function that isn't
573 a special form, ignoring frames for Finteractive_p and/or
574 Fbytecode at the top. If this frame is for a built-in function
575 (such as load or eval-region) return false. */
576 fun = Findirect_function (btp->function, Qnil);
577 if (SUBRP (fun))
578 return 0;
579
580 /* `btp' points to the frame of a Lisp function that called interactive-p.
581 Return t if that function was called interactively. */
582 if (btp && btp->next && EQ (btp->next->function, Qcall_interactively))
583 return 1;
584 return 0;
585}
586
587
588DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0, 491DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0,
589 doc: /* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE. 492 doc: /* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE.
590Aliased variables always have the same value; setting one sets the other. 493Aliased variables always have the same value; setting one sets the other.
@@ -696,8 +599,9 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
696 if (EQ ((--pdl)->symbol, sym) && !pdl->func 599 if (EQ ((--pdl)->symbol, sym) && !pdl->func
697 && EQ (pdl->old_value, Qunbound)) 600 && EQ (pdl->old_value, Qunbound))
698 { 601 {
699 message_with_string ("Warning: defvar ignored because %s is let-bound", 602 message_with_string
700 SYMBOL_NAME (sym), 1); 603 ("Warning: defvar ignored because %s is let-bound",
604 SYMBOL_NAME (sym), 1);
701 break; 605 break;
702 } 606 }
703 } 607 }
@@ -717,8 +621,8 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
717 /* A simple (defvar foo) with lexical scoping does "nothing" except 621 /* A simple (defvar foo) with lexical scoping does "nothing" except
718 declare that var to be dynamically scoped *locally* (i.e. within 622 declare that var to be dynamically scoped *locally* (i.e. within
719 the current file or let-block). */ 623 the current file or let-block). */
720 Vinternal_interpreter_environment = 624 Vinternal_interpreter_environment
721 Fcons (sym, Vinternal_interpreter_environment); 625 = Fcons (sym, Vinternal_interpreter_environment);
722 else 626 else
723 { 627 {
724 /* Simple (defvar <var>) should not count as a definition at all. 628 /* Simple (defvar <var>) should not count as a definition at all.
@@ -971,7 +875,7 @@ definitions to shadow the loaded ones for use in file byte-compilation. */)
971 if (NILP (tem)) 875 if (NILP (tem))
972 { 876 {
973 def = XSYMBOL (sym)->function; 877 def = XSYMBOL (sym)->function;
974 if (!EQ (def, Qunbound)) 878 if (!NILP (def))
975 continue; 879 continue;
976 } 880 }
977 break; 881 break;
@@ -986,7 +890,7 @@ definitions to shadow the loaded ones for use in file byte-compilation. */)
986 GCPRO1 (form); 890 GCPRO1 (form);
987 def = Fautoload_do_load (def, sym, Qmacro); 891 def = Fautoload_do_load (def, sym, Qmacro);
988 UNGCPRO; 892 UNGCPRO;
989 if (EQ (def, Qunbound) || !CONSP (def)) 893 if (!CONSP (def))
990 /* Not defined or definition not suitable. */ 894 /* Not defined or definition not suitable. */
991 break; 895 break;
992 if (!EQ (XCAR (def), Qmacro)) 896 if (!EQ (XCAR (def), Qmacro))
@@ -1811,12 +1715,12 @@ then strings and vectors are not accepted. */)
1811 1715
1812 fun = function; 1716 fun = function;
1813 1717
1814 fun = indirect_function (fun); /* Check cycles. */ 1718 fun = indirect_function (fun); /* Check cycles. */
1815 if (NILP (fun) || EQ (fun, Qunbound)) 1719 if (NILP (fun))
1816 return Qnil; 1720 return Qnil;
1817 1721
1818 /* Check an `interactive-form' property if present, analogous to the 1722 /* Check an `interactive-form' property if present, analogous to the
1819 function-documentation property. */ 1723 function-documentation property. */
1820 fun = function; 1724 fun = function;
1821 while (SYMBOLP (fun)) 1725 while (SYMBOLP (fun))
1822 { 1726 {
@@ -1876,7 +1780,7 @@ this does nothing and returns nil. */)
1876 CHECK_STRING (file); 1780 CHECK_STRING (file);
1877 1781
1878 /* If function is defined and not as an autoload, don't override. */ 1782 /* If function is defined and not as an autoload, don't override. */
1879 if (!EQ (XSYMBOL (function)->function, Qunbound) 1783 if (!NILP (XSYMBOL (function)->function)
1880 && !AUTOLOADP (XSYMBOL (function)->function)) 1784 && !AUTOLOADP (XSYMBOL (function)->function))
1881 return Qnil; 1785 return Qnil;
1882 1786
@@ -2055,7 +1959,7 @@ eval_sub (Lisp_Object form)
2055 1959
2056 /* Optimize for no indirection. */ 1960 /* Optimize for no indirection. */
2057 fun = original_fun; 1961 fun = original_fun;
2058 if (SYMBOLP (fun) && !EQ (fun, Qunbound) 1962 if (SYMBOLP (fun) && !NILP (fun)
2059 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) 1963 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
2060 fun = indirect_function (fun); 1964 fun = indirect_function (fun);
2061 1965
@@ -2177,7 +2081,7 @@ eval_sub (Lisp_Object form)
2177 val = apply_lambda (fun, original_args); 2081 val = apply_lambda (fun, original_args);
2178 else 2082 else
2179 { 2083 {
2180 if (EQ (fun, Qunbound)) 2084 if (NILP (fun))
2181 xsignal1 (Qvoid_function, original_fun); 2085 xsignal1 (Qvoid_function, original_fun);
2182 if (!CONSP (fun)) 2086 if (!CONSP (fun))
2183 xsignal1 (Qinvalid_function, original_fun); 2087 xsignal1 (Qinvalid_function, original_fun);
@@ -2251,10 +2155,10 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
2251 numargs += nargs - 2; 2155 numargs += nargs - 2;
2252 2156
2253 /* Optimize for no indirection. */ 2157 /* Optimize for no indirection. */
2254 if (SYMBOLP (fun) && !EQ (fun, Qunbound) 2158 if (SYMBOLP (fun) && !NILP (fun)
2255 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) 2159 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
2256 fun = indirect_function (fun); 2160 fun = indirect_function (fun);
2257 if (EQ (fun, Qunbound)) 2161 if (NILP (fun))
2258 { 2162 {
2259 /* Let funcall get the error. */ 2163 /* Let funcall get the error. */
2260 fun = args[0]; 2164 fun = args[0];
@@ -2728,7 +2632,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2728 2632
2729 /* Optimize for no indirection. */ 2633 /* Optimize for no indirection. */
2730 fun = original_fun; 2634 fun = original_fun;
2731 if (SYMBOLP (fun) && !EQ (fun, Qunbound) 2635 if (SYMBOLP (fun) && !NILP (fun)
2732 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun))) 2636 && (fun = XSYMBOL (fun)->function, SYMBOLP (fun)))
2733 fun = indirect_function (fun); 2637 fun = indirect_function (fun);
2734 2638
@@ -2816,7 +2720,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */)
2816 val = funcall_lambda (fun, numargs, args + 1); 2720 val = funcall_lambda (fun, numargs, args + 1);
2817 else 2721 else
2818 { 2722 {
2819 if (EQ (fun, Qunbound)) 2723 if (NILP (fun))
2820 xsignal1 (Qvoid_function, original_fun); 2724 xsignal1 (Qvoid_function, original_fun);
2821 if (!CONSP (fun)) 2725 if (!CONSP (fun))
2822 xsignal1 (Qinvalid_function, original_fun); 2726 xsignal1 (Qinvalid_function, original_fun);
@@ -3551,8 +3455,6 @@ alist of active lexical bindings. */);
3551 defsubr (&Sunwind_protect); 3455 defsubr (&Sunwind_protect);
3552 defsubr (&Scondition_case); 3456 defsubr (&Scondition_case);
3553 defsubr (&Ssignal); 3457 defsubr (&Ssignal);
3554 defsubr (&Sinteractive_p);
3555 defsubr (&Scalled_interactively_p);
3556 defsubr (&Scommandp); 3458 defsubr (&Scommandp);
3557 defsubr (&Sautoload); 3459 defsubr (&Sautoload);
3558 defsubr (&Sautoload_do_load); 3460 defsubr (&Sautoload_do_load);
diff --git a/src/lisp.h b/src/lisp.h
index 4941f649e79..ae532eed5a2 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1109,7 +1109,7 @@ struct Lisp_Symbol
1109 union Lisp_Fwd *fwd; 1109 union Lisp_Fwd *fwd;
1110 } val; 1110 } val;
1111 1111
1112 /* Function value of the symbol or Qunbound if not fboundp. */ 1112 /* Function value of the symbol or Qnil if not fboundp. */
1113 Lisp_Object function; 1113 Lisp_Object function;
1114 1114
1115 /* The symbol's property list. */ 1115 /* The symbol's property list. */
diff --git a/src/lread.c b/src/lread.c
index 5859a2f85a9..6d0ff9f780e 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3957,12 +3957,13 @@ init_obarray (void)
3957 /* Fmake_symbol inits fields of new symbols with Qunbound and Qnil, 3957 /* Fmake_symbol inits fields of new symbols with Qunbound and Qnil,
3958 so those two need to be fixed manually. */ 3958 so those two need to be fixed manually. */
3959 SET_SYMBOL_VAL (XSYMBOL (Qunbound), Qunbound); 3959 SET_SYMBOL_VAL (XSYMBOL (Qunbound), Qunbound);
3960 set_symbol_function (Qunbound, Qunbound); 3960 set_symbol_function (Qunbound, Qnil);
3961 set_symbol_plist (Qunbound, Qnil); 3961 set_symbol_plist (Qunbound, Qnil);
3962 SET_SYMBOL_VAL (XSYMBOL (Qnil), Qnil); 3962 SET_SYMBOL_VAL (XSYMBOL (Qnil), Qnil);
3963 XSYMBOL (Qnil)->constant = 1; 3963 XSYMBOL (Qnil)->constant = 1;
3964 XSYMBOL (Qnil)->declared_special = 1; 3964 XSYMBOL (Qnil)->declared_special = 1;
3965 set_symbol_plist (Qnil, Qnil); 3965 set_symbol_plist (Qnil, Qnil);
3966 set_symbol_function (Qnil, Qnil);
3966 3967
3967 Qt = intern_c_string ("t"); 3968 Qt = intern_c_string ("t");
3968 SET_SYMBOL_VAL (XSYMBOL (Qt), Qt); 3969 SET_SYMBOL_VAL (XSYMBOL (Qt), Qt);
diff --git a/src/w32fns.c b/src/w32fns.c
index ed5625e802c..90f5b1695ea 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -6167,9 +6167,9 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
6167 filename = empty_unibyte_string; 6167 filename = empty_unibyte_string;
6168 6168
6169#ifdef CYGWIN 6169#ifdef CYGWIN
6170 dir = Fcygwin_convert_path_to_windows (dir, Qt); 6170 dir = Fcygwin_convert_file_name_to_windows (dir, Qt);
6171 if (SCHARS (filename) > 0) 6171 if (SCHARS (filename) > 0)
6172 filename = Fcygwin_convert_path_to_windows (filename, Qnil); 6172 filename = Fcygwin_convert_file_name_to_windows (filename, Qnil);
6173#endif 6173#endif
6174 6174
6175 CHECK_STRING (dir); 6175 CHECK_STRING (dir);
@@ -6270,7 +6270,7 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
6270#endif /* NTGUI_UNICODE */ 6270#endif /* NTGUI_UNICODE */
6271 6271
6272#ifdef CYGWIN 6272#ifdef CYGWIN
6273 filename = Fcygwin_convert_path_from_windows (filename, Qt); 6273 filename = Fcygwin_convert_file_name_from_windows (filename, Qt);
6274#endif /* CYGWIN */ 6274#endif /* CYGWIN */
6275 6275
6276 /* Strip the dummy filename off the end of the string if we 6276 /* Strip the dummy filename off the end of the string if we
diff --git a/src/xdisp.c b/src/xdisp.c
index 5e53168cf0e..a14c54dfc23 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -517,9 +517,8 @@ Lisp_Object Qmenu_bar_update_hook;
517 517
518static int overlay_arrow_seen; 518static int overlay_arrow_seen;
519 519
520/* Number of windows showing the buffer of the selected window (or 520/* Number of windows showing the buffer of the selected
521 another buffer with the same base buffer). keyboard.c refers to 521 window (or another buffer with the same base buffer). */
522 this. */
523 522
524int buffer_shared; 523int buffer_shared;
525 524
@@ -10943,8 +10942,26 @@ echo_area_display (int update_frame_p)
10943 return window_height_changed_p; 10942 return window_height_changed_p;
10944} 10943}
10945 10944
10945/* Nonzero if the current buffer is shown in more than
10946 one window and was modified since last display. */
10947
10948static int
10949buffer_shared_and_changed (void)
10950{
10951 return (buffer_shared > 1 && UNCHANGED_MODIFIED < MODIFF);
10952}
10953
10954/* Nonzero if W doesn't reflect the actual state of
10955 current buffer due to its text or overlays change. */
10956
10957static int
10958window_outdated (struct window *w)
10959{
10960 eassert (XBUFFER (w->buffer) == current_buffer);
10961 return (w->last_modified < MODIFF
10962 || w->last_overlay_modified < OVERLAY_MODIFF);
10963}
10946 10964
10947
10948/*********************************************************************** 10965/***********************************************************************
10949 Mode Lines and Frame Titles 10966 Mode Lines and Frame Titles
10950 ***********************************************************************/ 10967 ***********************************************************************/
@@ -11250,7 +11267,7 @@ prepare_menu_bars (void)
11250 /* Update the menu bar item lists, if appropriate. This has to be 11267 /* Update the menu bar item lists, if appropriate. This has to be
11251 done before any actual redisplay or generation of display lines. */ 11268 done before any actual redisplay or generation of display lines. */
11252 all_windows = (update_mode_lines 11269 all_windows = (update_mode_lines
11253 || buffer_shared > 1 11270 || buffer_shared_and_changed ()
11254 || windows_or_buffers_changed); 11271 || windows_or_buffers_changed);
11255 if (all_windows) 11272 if (all_windows)
11256 { 11273 {
@@ -12670,8 +12687,7 @@ text_outside_line_unchanged_p (struct window *w,
12670 int unchanged_p = 1; 12687 int unchanged_p = 1;
12671 12688
12672 /* If text or overlays have changed, see where. */ 12689 /* If text or overlays have changed, see where. */
12673 if (w->last_modified < MODIFF 12690 if (window_outdated (w))
12674 || w->last_overlay_modified < OVERLAY_MODIFF)
12675 { 12691 {
12676 /* Gap in the line? */ 12692 /* Gap in the line? */
12677 if (GPT < start || Z - GPT < end) 12693 if (GPT < start || Z - GPT < end)
@@ -13170,7 +13186,7 @@ redisplay_internal (void)
13170 if ((SAVE_MODIFF < MODIFF) != w->last_had_star) 13186 if ((SAVE_MODIFF < MODIFF) != w->last_had_star)
13171 { 13187 {
13172 w->update_mode_line = 1; 13188 w->update_mode_line = 1;
13173 if (buffer_shared > 1) 13189 if (buffer_shared_and_changed ())
13174 update_mode_lines++; 13190 update_mode_lines++;
13175 } 13191 }
13176 13192
@@ -13182,9 +13198,7 @@ redisplay_internal (void)
13182 if (!NILP (w->column_number_displayed) 13198 if (!NILP (w->column_number_displayed)
13183 /* This alternative quickly identifies a common case 13199 /* This alternative quickly identifies a common case
13184 where no change is needed. */ 13200 where no change is needed. */
13185 && !(PT == w->last_point 13201 && !(PT == w->last_point && !window_outdated (w))
13186 && w->last_modified >= MODIFF
13187 && w->last_overlay_modified >= OVERLAY_MODIFF)
13188 && (XFASTINT (w->column_number_displayed) != current_column ())) 13202 && (XFASTINT (w->column_number_displayed) != current_column ()))
13189 w->update_mode_line = 1; 13203 w->update_mode_line = 1;
13190 13204
@@ -13195,7 +13209,8 @@ redisplay_internal (void)
13195 /* The variable buffer_shared is set in redisplay_window and 13209 /* The variable buffer_shared is set in redisplay_window and
13196 indicates that we redisplay a buffer in different windows. See 13210 indicates that we redisplay a buffer in different windows. See
13197 there. */ 13211 there. */
13198 consider_all_windows_p = (update_mode_lines || buffer_shared > 1 13212 consider_all_windows_p = (update_mode_lines
13213 || buffer_shared_and_changed ()
13199 || cursor_type_changed); 13214 || cursor_type_changed);
13200 13215
13201 /* If specs for an arrow have changed, do thorough redisplay 13216 /* If specs for an arrow have changed, do thorough redisplay
@@ -13245,18 +13260,16 @@ redisplay_internal (void)
13245 } 13260 }
13246 } 13261 }
13247 else if (EQ (selected_window, minibuf_window) 13262 else if (EQ (selected_window, minibuf_window)
13248 && (current_buffer->clip_changed 13263 && (current_buffer->clip_changed || window_outdated (w))
13249 || w->last_modified < MODIFF
13250 || w->last_overlay_modified < OVERLAY_MODIFF)
13251 && resize_mini_window (w, 0)) 13264 && resize_mini_window (w, 0))
13252 { 13265 {
13253 /* Resized active mini-window to fit the size of what it is 13266 /* Resized active mini-window to fit the size of what it is
13254 showing if its contents might have changed. */ 13267 showing if its contents might have changed. */
13255 must_finish = 1; 13268 must_finish = 1;
13256/* FIXME: this causes all frames to be updated, which seems unnecessary 13269 /* FIXME: this causes all frames to be updated, which seems unnecessary
13257 since only the current frame needs to be considered. This function needs 13270 since only the current frame needs to be considered. This function
13258 to be rewritten with two variables, consider_all_windows and 13271 needs to be rewritten with two variables, consider_all_windows and
13259 consider_all_frames. */ 13272 consider_all_frames. */
13260 consider_all_windows_p = 1; 13273 consider_all_windows_p = 1;
13261 ++windows_or_buffers_changed; 13274 ++windows_or_buffers_changed;
13262 ++update_mode_lines; 13275 ++update_mode_lines;
@@ -13311,9 +13324,7 @@ redisplay_internal (void)
13311 || FETCH_BYTE (BYTEPOS (tlbufpos)) == '\n')) 13324 || FETCH_BYTE (BYTEPOS (tlbufpos)) == '\n'))
13312 /* Former continuation line has disappeared by becoming empty. */ 13325 /* Former continuation line has disappeared by becoming empty. */
13313 goto cancel; 13326 goto cancel;
13314 else if (w->last_modified < MODIFF 13327 else if (window_outdated (w) || MINI_WINDOW_P (w))
13315 || w->last_overlay_modified < OVERLAY_MODIFF
13316 || MINI_WINDOW_P (w))
13317 { 13328 {
13318 /* We have to handle the case of continuation around a 13329 /* We have to handle the case of continuation around a
13319 wide-column character (see the comment in indent.c around 13330 wide-column character (see the comment in indent.c around
@@ -13494,7 +13505,7 @@ redisplay_internal (void)
13494 } 13505 }
13495 13506
13496 CHARPOS (this_line_start_pos) = 0; 13507 CHARPOS (this_line_start_pos) = 0;
13497 consider_all_windows_p |= buffer_shared > 1; 13508 consider_all_windows_p |= buffer_shared_and_changed ();
13498 ++clear_face_cache_count; 13509 ++clear_face_cache_count;
13499#ifdef HAVE_WINDOW_SYSTEM 13510#ifdef HAVE_WINDOW_SYSTEM
13500 ++clear_image_cache_count; 13511 ++clear_image_cache_count;
@@ -15571,8 +15582,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15571 = (!NILP (w->window_end_valid) 15582 = (!NILP (w->window_end_valid)
15572 && !current_buffer->clip_changed 15583 && !current_buffer->clip_changed
15573 && !current_buffer->prevent_redisplay_optimizations_p 15584 && !current_buffer->prevent_redisplay_optimizations_p
15574 && w->last_modified >= MODIFF 15585 && !window_outdated (w));
15575 && w->last_overlay_modified >= OVERLAY_MODIFF);
15576 15586
15577 /* Run the window-bottom-change-functions 15587 /* Run the window-bottom-change-functions
15578 if it is possible that the text on the screen has changed 15588 if it is possible that the text on the screen has changed
@@ -15594,8 +15604,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15594 buffer_unchanged_p 15604 buffer_unchanged_p
15595 = (!NILP (w->window_end_valid) 15605 = (!NILP (w->window_end_valid)
15596 && !current_buffer->clip_changed 15606 && !current_buffer->clip_changed
15597 && w->last_modified >= MODIFF 15607 && !window_outdated (w));
15598 && w->last_overlay_modified >= OVERLAY_MODIFF);
15599 15608
15600 /* When windows_or_buffers_changed is non-zero, we can't rely on 15609 /* When windows_or_buffers_changed is non-zero, we can't rely on
15601 the window end being valid, so set it to nil there. */ 15610 the window end being valid, so set it to nil there. */
@@ -15620,9 +15629,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15620 if (!NILP (w->column_number_displayed) 15629 if (!NILP (w->column_number_displayed)
15621 /* This alternative quickly identifies a common case 15630 /* This alternative quickly identifies a common case
15622 where no change is needed. */ 15631 where no change is needed. */
15623 && !(PT == w->last_point 15632 && !(PT == w->last_point && !window_outdated (w))
15624 && w->last_modified >= MODIFF
15625 && w->last_overlay_modified >= OVERLAY_MODIFF)
15626 && (XFASTINT (w->column_number_displayed) != current_column ())) 15633 && (XFASTINT (w->column_number_displayed) != current_column ()))
15627 update_mode_line = 1; 15634 update_mode_line = 1;
15628 15635
@@ -15864,8 +15871,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
15864 && (CHARPOS (startp) < ZV 15871 && (CHARPOS (startp) < ZV
15865 /* Avoid starting at end of buffer. */ 15872 /* Avoid starting at end of buffer. */
15866 || CHARPOS (startp) == BEGV 15873 || CHARPOS (startp) == BEGV
15867 || (w->last_modified >= MODIFF 15874 || !window_outdated (w)))
15868 && w->last_overlay_modified >= OVERLAY_MODIFF)))
15869 { 15875 {
15870 int d1, d2, d3, d4, d5, d6; 15876 int d1, d2, d3, d4, d5, d6;
15871 15877