aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2018-07-19 22:03:34 -0700
committerPaul Eggert2018-07-19 22:05:27 -0700
commitfb24ce37d1bc258cfc3884d9828aa0602fa06e1d (patch)
tree2c0669e13f1324d78b9a0e2de496fc366016ef12
parent96d77f9eb882b68e994e187ed9c2156a23e3279d (diff)
downloademacs-fb24ce37d1bc258cfc3884d9828aa0602fa06e1d.tar.gz
emacs-fb24ce37d1bc258cfc3884d9828aa0602fa06e1d.zip
Prefer NILP (x) to EQ (x, Qnil)
This simplifies the code a bit, and also simplifies some potential future changes slightly (e.g., altering eq vs eql). * src/alloc.c (mark_object): * src/callint.c (fix_command): * src/chartab.c (Fchar_table_range, Fset_char_table_range): * src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE, xd_signature): * src/dired.c (Fsystem_users): * src/fileio.c (Fdo_auto_save): * src/fns.c (concat): * src/frame.c (get_frame_param, frame_inhibit_resize) (store_in_alist, store_frame_param, x_set_autoraise) (x_set_autolower, x_get_arg): * src/image.c (Fclear_image_cache): * src/intervals.c (intervals_equal): * src/intervals.h (DEFAULT_INTERVAL_P): * src/lread.c (substitute_object_recurse): * src/menu.c (digest_single_submenu) (find_and_call_menu_selection) (find_and_return_menu_selection): * src/nsfns.m (x_set_icon_name, Fx_create_frame): * src/nsmenu.m (ns_menu_show): * src/nsselect.m (ns_string_to_pasteboard_internal) (Fns_selection_exists_p, Fns_selection_owner_p): * src/process.c (Faccept_process_output) (wait_reading_process_output): * src/terminal.c (store_terminal_param): * src/textprop.c (verify_interval_modification): * src/xdisp.c (next_element_from_buffer): * src/xfaces.c (Finternal_set_lisp_face_attribute): * src/xfns.c (x_set_icon_type, Fx_synchronize): * src/xmenu.c (x_menu_show): * src/xselect.c (Fx_selection_owner_p) (Fx_selection_exists_p): * src/xwidget.c (xwidget_view_lookup): Prefer NILP (x) to EQ (x, Qnil).
-rw-r--r--src/alloc.c2
-rw-r--r--src/callint.c2
-rw-r--r--src/chartab.c4
-rw-r--r--src/dbusbind.c4
-rw-r--r--src/dired.c2
-rw-r--r--src/fileio.c2
-rw-r--r--src/fns.c2
-rw-r--r--src/frame.c27
-rw-r--r--src/image.c2
-rw-r--r--src/intervals.c2
-rw-r--r--src/intervals.h2
-rw-r--r--src/lread.c4
-rw-r--r--src/menu.c6
-rw-r--r--src/nsfns.m4
-rw-r--r--src/nsmenu.m2
-rw-r--r--src/nsselect.m6
-rw-r--r--src/process.c4
-rw-r--r--src/terminal.c2
-rw-r--r--src/textprop.c2
-rw-r--r--src/xdisp.c2
-rw-r--r--src/xfaces.c4
-rw-r--r--src/xfns.c4
-rw-r--r--src/xmenu.c4
-rw-r--r--src/xselect.c4
-rw-r--r--src/xwidget.c2
25 files changed, 47 insertions, 54 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 8764591336e..ad716f543c3 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6585,7 +6585,7 @@ mark_object (Lisp_Object arg)
6585 CHECK_ALLOCATED_AND_LIVE (live_cons_p); 6585 CHECK_ALLOCATED_AND_LIVE (live_cons_p);
6586 CONS_MARK (ptr); 6586 CONS_MARK (ptr);
6587 /* If the cdr is nil, avoid recursion for the car. */ 6587 /* If the cdr is nil, avoid recursion for the car. */
6588 if (EQ (ptr->u.s.u.cdr, Qnil)) 6588 if (NILP (ptr->u.s.u.cdr))
6589 { 6589 {
6590 obj = ptr->u.s.car; 6590 obj = ptr->u.s.car;
6591 cdr_count = 0; 6591 cdr_count = 0;
diff --git a/src/callint.c b/src/callint.c
index c6e003ed408..807e1cca9cc 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -200,7 +200,7 @@ fix_command (Lisp_Object input, Lisp_Object values)
200 carelt = XCAR (elt); 200 carelt = XCAR (elt);
201 /* If it is (if X Y), look at Y. */ 201 /* If it is (if X Y), look at Y. */
202 if (EQ (carelt, Qif) 202 if (EQ (carelt, Qif)
203 && EQ (Fnthcdr (make_number (3), elt), Qnil)) 203 && NILP (Fnthcdr (make_number (3), elt)))
204 elt = Fnth (make_number (2), elt); 204 elt = Fnth (make_number (2), elt);
205 /* If it is (when ... Y), look at Y. */ 205 /* If it is (when ... Y), look at Y. */
206 else if (EQ (carelt, Qwhen)) 206 else if (EQ (carelt, Qwhen))
diff --git a/src/chartab.c b/src/chartab.c
index 065ae4f9f20..89983503ac6 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -605,7 +605,7 @@ a cons of character codes (for characters in the range), or a character code. *
605 Lisp_Object val; 605 Lisp_Object val;
606 CHECK_CHAR_TABLE (char_table); 606 CHECK_CHAR_TABLE (char_table);
607 607
608 if (EQ (range, Qnil)) 608 if (NILP (range))
609 val = XCHAR_TABLE (char_table)->defalt; 609 val = XCHAR_TABLE (char_table)->defalt;
610 else if (CHARACTERP (range)) 610 else if (CHARACTERP (range))
611 val = CHAR_TABLE_REF (char_table, XFASTINT (range)); 611 val = CHAR_TABLE_REF (char_table, XFASTINT (range));
@@ -642,7 +642,7 @@ or a character code. Return VALUE. */)
642 for (i = 0; i < chartab_size[0]; i++) 642 for (i = 0; i < chartab_size[0]; i++)
643 set_char_table_contents (char_table, i, value); 643 set_char_table_contents (char_table, i, value);
644 } 644 }
645 else if (EQ (range, Qnil)) 645 else if (NILP (range))
646 set_char_table_defalt (char_table, value); 646 set_char_table_defalt (char_table, value);
647 else if (CHARACTERP (range)) 647 else if (CHARACTERP (range))
648 char_table_set (char_table, XINT (range), value); 648 char_table_set (char_table, XINT (range), value);
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 4ebea5712a8..96429810e22 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -200,7 +200,7 @@ xd_symbol_to_dbus_type (Lisp_Object object)
200 `dbus-send-signal', into corresponding C values appended as 200 `dbus-send-signal', into corresponding C values appended as
201 arguments to a D-Bus message. */ 201 arguments to a D-Bus message. */
202#define XD_OBJECT_TO_DBUS_TYPE(object) \ 202#define XD_OBJECT_TO_DBUS_TYPE(object) \
203 ((EQ (object, Qt) || EQ (object, Qnil)) ? DBUS_TYPE_BOOLEAN \ 203 ((EQ (object, Qt) || NILP (object)) ? DBUS_TYPE_BOOLEAN \
204 : (NATNUMP (object)) ? DBUS_TYPE_UINT32 \ 204 : (NATNUMP (object)) ? DBUS_TYPE_UINT32 \
205 : (INTEGERP (object)) ? DBUS_TYPE_INT32 \ 205 : (INTEGERP (object)) ? DBUS_TYPE_INT32 \
206 : (FLOATP (object)) ? DBUS_TYPE_DOUBLE \ 206 : (FLOATP (object)) ? DBUS_TYPE_DOUBLE \
@@ -360,7 +360,7 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object)
360 break; 360 break;
361 361
362 case DBUS_TYPE_BOOLEAN: 362 case DBUS_TYPE_BOOLEAN:
363 if (!EQ (object, Qt) && !EQ (object, Qnil)) 363 if (!EQ (object, Qt) && !NILP (object))
364 wrong_type_argument (intern ("booleanp"), object); 364 wrong_type_argument (intern ("booleanp"), object);
365 sprintf (signature, "%c", dtype); 365 sprintf (signature, "%c", dtype);
366 break; 366 break;
diff --git a/src/dired.c b/src/dired.c
index 5812c569fa6..472ec113d44 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -1058,7 +1058,7 @@ return a list with one element, taken from `user-real-login-name'. */)
1058 1058
1059 endpwent (); 1059 endpwent ();
1060#endif 1060#endif
1061 if (EQ (users, Qnil)) 1061 if (NILP (users))
1062 /* At least current user is always known. */ 1062 /* At least current user is always known. */
1063 users = list1 (Vuser_real_login_name); 1063 users = list1 (Vuser_real_login_name);
1064 return users; 1064 return users;
diff --git a/src/fileio.c b/src/fileio.c
index 5a1c7ae10e5..39789e55ff5 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5714,7 +5714,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5714 spare the user annoying messages. */ 5714 spare the user annoying messages. */
5715 && XFASTINT (BVAR (b, save_length)) > 5000 5715 && XFASTINT (BVAR (b, save_length)) > 5000
5716 /* These messages are frequent and annoying for `*mail*'. */ 5716 /* These messages are frequent and annoying for `*mail*'. */
5717 && !EQ (BVAR (b, filename), Qnil) 5717 && !NILP (BVAR (b, filename))
5718 && NILP (no_message)) 5718 && NILP (no_message))
5719 { 5719 {
5720 /* It has shrunk too much; turn off auto-saving here. */ 5720 /* It has shrunk too much; turn off auto-saving here. */
diff --git a/src/fns.c b/src/fns.c
index 10997da0d46..7d120a90f78 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -718,7 +718,7 @@ concat (ptrdiff_t nargs, Lisp_Object *args,
718 val = make_uninit_string (result_len); 718 val = make_uninit_string (result_len);
719 719
720 /* In `append', if all but last arg are nil, return last arg. */ 720 /* In `append', if all but last arg are nil, return last arg. */
721 if (target_type == Lisp_Cons && EQ (val, Qnil)) 721 if (target_type == Lisp_Cons && NILP (val))
722 return last_tail; 722 return last_tail;
723 723
724 /* Copy the contents of the args into the result. */ 724 /* Copy the contents of the args into the result. */
diff --git a/src/frame.c b/src/frame.c
index d477c1acc3f..85ec7401d6e 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -139,14 +139,9 @@ check_window_system (struct frame *f)
139/* Return the value of frame parameter PROP in frame FRAME. */ 139/* Return the value of frame parameter PROP in frame FRAME. */
140 140
141Lisp_Object 141Lisp_Object
142get_frame_param (register struct frame *frame, Lisp_Object prop) 142get_frame_param (struct frame *frame, Lisp_Object prop)
143{ 143{
144 register Lisp_Object tem; 144 return Fcdr (Fassq (prop, frame->param_alist));
145
146 tem = Fassq (prop, frame->param_alist);
147 if (EQ (tem, Qnil))
148 return tem;
149 return Fcdr (tem);
150} 145}
151 146
152 147
@@ -189,9 +184,9 @@ frame_inhibit_resize (struct frame *f, bool horizontal, Lisp_Object parameter)
189 || (CONSP (frame_inhibit_implied_resize) 184 || (CONSP (frame_inhibit_implied_resize)
190 && !NILP (Fmemq (parameter, frame_inhibit_implied_resize))) 185 && !NILP (Fmemq (parameter, frame_inhibit_implied_resize)))
191 || (horizontal 186 || (horizontal
192 && !EQ (fullscreen, Qnil) && !EQ (fullscreen, Qfullheight)) 187 && !NILP (fullscreen) && !EQ (fullscreen, Qfullheight))
193 || (!horizontal 188 || (!horizontal
194 && !EQ (fullscreen, Qnil) && !EQ (fullscreen, Qfullwidth)) 189 && !NILP (fullscreen) && !EQ (fullscreen, Qfullwidth))
195 || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) 190 || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
196 : ((horizontal && f->inhibit_horizontal_resize) 191 : ((horizontal && f->inhibit_horizontal_resize)
197 || (!horizontal && f->inhibit_vertical_resize))); 192 || (!horizontal && f->inhibit_vertical_resize)));
@@ -2808,10 +2803,8 @@ frames_discard_buffer (Lisp_Object buffer)
2808void 2803void
2809store_in_alist (Lisp_Object *alistptr, Lisp_Object prop, Lisp_Object val) 2804store_in_alist (Lisp_Object *alistptr, Lisp_Object prop, Lisp_Object val)
2810{ 2805{
2811 register Lisp_Object tem; 2806 Lisp_Object tem = Fassq (prop, *alistptr);
2812 2807 if (NILP (tem))
2813 tem = Fassq (prop, *alistptr);
2814 if (EQ (tem, Qnil))
2815 *alistptr = Fcons (Fcons (prop, val), *alistptr); 2808 *alistptr = Fcons (Fcons (prop, val), *alistptr);
2816 else 2809 else
2817 Fsetcdr (tem, val); 2810 Fsetcdr (tem, val);
@@ -2975,7 +2968,7 @@ store_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
2975 2968
2976 /* Update the frame parameter alist. */ 2969 /* Update the frame parameter alist. */
2977 old_alist_elt = Fassq (prop, f->param_alist); 2970 old_alist_elt = Fassq (prop, f->param_alist);
2978 if (EQ (old_alist_elt, Qnil)) 2971 if (NILP (old_alist_elt))
2979 fset_param_alist (f, Fcons (Fcons (prop, val), f->param_alist)); 2972 fset_param_alist (f, Fcons (Fcons (prop, val), f->param_alist));
2980 else 2973 else
2981 Fsetcdr (old_alist_elt, val); 2974 Fsetcdr (old_alist_elt, val);
@@ -4516,13 +4509,13 @@ x_set_visibility (struct frame *f, Lisp_Object value, Lisp_Object oldval)
4516void 4509void
4517x_set_autoraise (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 4510x_set_autoraise (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
4518{ 4511{
4519 f->auto_raise = !EQ (Qnil, arg); 4512 f->auto_raise = !NILP (arg);
4520} 4513}
4521 4514
4522void 4515void
4523x_set_autolower (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 4516x_set_autolower (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
4524{ 4517{
4525 f->auto_lower = !EQ (Qnil, arg); 4518 f->auto_lower = !NILP (arg);
4526} 4519}
4527 4520
4528void 4521void
@@ -4973,7 +4966,7 @@ x_get_arg (Display_Info *dpyinfo, Lisp_Object alist, Lisp_Object param,
4973 4966
4974 /* If it wasn't specified in ALIST or the Lisp-level defaults, 4967 /* If it wasn't specified in ALIST or the Lisp-level defaults,
4975 look in the X resources. */ 4968 look in the X resources. */
4976 if (EQ (tem, Qnil)) 4969 if (NILP (tem))
4977 { 4970 {
4978 if (attribute && dpyinfo) 4971 if (attribute && dpyinfo)
4979 { 4972 {
diff --git a/src/image.c b/src/image.c
index 992b225d7b7..a83f0641aba 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1610,7 +1610,7 @@ Anything else, means only clear those images which refer to FILTER,
1610which is then usually a filename. */) 1610which is then usually a filename. */)
1611 (Lisp_Object filter) 1611 (Lisp_Object filter)
1612{ 1612{
1613 if (!(EQ (filter, Qnil) || FRAMEP (filter))) 1613 if (! (NILP (filter) || FRAMEP (filter)))
1614 clear_image_caches (filter); 1614 clear_image_caches (filter);
1615 else 1615 else
1616 clear_image_cache (decode_window_system_frame (filter), Qt); 1616 clear_image_cache (decode_window_system_frame (filter), Qt);
diff --git a/src/intervals.c b/src/intervals.c
index 4c624ea79c1..c3e137cc38c 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -197,7 +197,7 @@ intervals_equal (INTERVAL i0, INTERVAL i1)
197 } 197 }
198 198
199 /* i0 has something i1 doesn't. */ 199 /* i0 has something i1 doesn't. */
200 if (EQ (i1_val, Qnil)) 200 if (NILP (i1_val))
201 return false; 201 return false;
202 202
203 /* i0 and i1 both have sym, but it has different values in each. */ 203 /* i0 and i1 both have sym, but it has different values in each. */
diff --git a/src/intervals.h b/src/intervals.h
index 162c4efc62e..f37372a42c8 100644
--- a/src/intervals.h
+++ b/src/intervals.h
@@ -116,7 +116,7 @@ struct interval
116 116
117/* True if this is a default interval, which is the same as being null 117/* True if this is a default interval, which is the same as being null
118 or having no properties. */ 118 or having no properties. */
119#define DEFAULT_INTERVAL_P(i) (!i || EQ ((i)->plist, Qnil)) 119#define DEFAULT_INTERVAL_P(i) (!i || NILP ((i)->plist))
120 120
121/* Test what type of parent we have. Three possibilities: another 121/* Test what type of parent we have. Three possibilities: another
122 interval, a buffer or string object, or NULL. */ 122 interval, a buffer or string object, or NULL. */
diff --git a/src/lread.c b/src/lread.c
index 4ce6a442c36..4eba8635521 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3603,7 +3603,7 @@ substitute_object_recurse (struct subst *subst, Lisp_Object subtree)
3603 return subtree; 3603 return subtree;
3604 3604
3605 /* If we've been to this node before, don't explore it again. */ 3605 /* If we've been to this node before, don't explore it again. */
3606 if (!EQ (Qnil, Fmemq (subtree, subst->seen))) 3606 if (!NILP (Fmemq (subtree, subst->seen)))
3607 return subtree; 3607 return subtree;
3608 3608
3609 /* If this node can be the entry point to a cycle, remember that 3609 /* If this node can be the entry point to a cycle, remember that
@@ -4236,7 +4236,7 @@ usage: (unintern NAME OBARRAY) */)
4236 session if we unintern them, as well as even more ways to use 4236 session if we unintern them, as well as even more ways to use
4237 `setq' or `fset' or whatnot to make the Emacs session 4237 `setq' or `fset' or whatnot to make the Emacs session
4238 unusable. Let's not go down this silly road. --Stef */ 4238 unusable. Let's not go down this silly road. --Stef */
4239 /* if (EQ (tem, Qnil) || EQ (tem, Qt)) 4239 /* if (NILP (tem) || EQ (tem, Qt))
4240 error ("Attempt to unintern t or nil"); */ 4240 error ("Attempt to unintern t or nil"); */
4241 4241
4242 XSYMBOL (tem)->u.s.interned = SYMBOL_UNINTERNED; 4242 XSYMBOL (tem)->u.s.interned = SYMBOL_UNINTERNED;
diff --git a/src/menu.c b/src/menu.c
index e7d4d782fe8..a088083df27 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -647,7 +647,7 @@ digest_single_submenu (int start, int end, bool top_level_items)
647 i = start; 647 i = start;
648 while (i < end) 648 while (i < end)
649 { 649 {
650 if (EQ (AREF (menu_items, i), Qnil)) 650 if (NILP (AREF (menu_items, i)))
651 { 651 {
652 submenu_stack[submenu_depth++] = save_wv; 652 submenu_stack[submenu_depth++] = save_wv;
653 save_wv = prev_wv; 653 save_wv = prev_wv;
@@ -900,7 +900,7 @@ find_and_call_menu_selection (struct frame *f, int menu_bar_items_used,
900 900
901 while (i < menu_bar_items_used) 901 while (i < menu_bar_items_used)
902 { 902 {
903 if (EQ (AREF (vector, i), Qnil)) 903 if (NILP (AREF (vector, i)))
904 { 904 {
905 subprefix_stack[submenu_depth++] = prefix; 905 subprefix_stack[submenu_depth++] = prefix;
906 prefix = entry; 906 prefix = entry;
@@ -985,7 +985,7 @@ find_and_return_menu_selection (struct frame *f, bool keymaps, void *client_data
985 985
986 while (i < menu_items_used) 986 while (i < menu_items_used)
987 { 987 {
988 if (EQ (AREF (menu_items, i), Qnil)) 988 if (NILP (AREF (menu_items, i)))
989 { 989 {
990 subprefix_stack[submenu_depth++] = prefix; 990 subprefix_stack[submenu_depth++] = prefix;
991 prefix = entry; 991 prefix = entry;
diff --git a/src/nsfns.m b/src/nsfns.m
index 9ff7e88a8d4..184657f3b4f 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -363,7 +363,7 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
363 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) 363 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt))
364 return; 364 return;
365 } 365 }
366 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) 366 else if (!STRINGP (oldval) && NILP (oldval) == NILP (arg))
367 return; 367 return;
368 368
369 fset_icon_name (f, arg); 369 fset_icon_name (f, arg);
@@ -1291,7 +1291,7 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
1291 window_prompting = x_figure_window_size (f, parms, true, &x_width, &x_height); 1291 window_prompting = x_figure_window_size (f, parms, true, &x_width, &x_height);
1292 1292
1293 tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); 1293 tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
1294 f->no_split = minibuffer_only || (!EQ (tem, Qunbound) && !EQ (tem, Qnil)); 1294 f->no_split = minibuffer_only || (!EQ (tem, Qunbound) && !NILP (tem));
1295 1295
1296 /* NOTE: on other terms, this is done in set_mouse_color, however this 1296 /* NOTE: on other terms, this is done in set_mouse_color, however this
1297 was not getting called under Nextstep. */ 1297 was not getting called under Nextstep. */
diff --git a/src/nsmenu.m b/src/nsmenu.m
index a438952818a..18c3230a742 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -828,7 +828,7 @@ ns_menu_show (struct frame *f, int x, int y, int menuflags,
828 i = 0; 828 i = 0;
829 while (i < menu_items_used) 829 while (i < menu_items_used)
830 { 830 {
831 if (EQ (AREF (menu_items, i), Qnil)) 831 if (NILP (AREF (menu_items, i)))
832 { 832 {
833 submenu_stack[submenu_depth++] = save_wv; 833 submenu_stack[submenu_depth++] = save_wv;
834 save_wv = prev_wv; 834 save_wv = prev_wv;
diff --git a/src/nsselect.m b/src/nsselect.m
index c72f179ab38..e71a20ed92e 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -164,7 +164,7 @@ ns_get_our_change_count_for (Lisp_Object selection)
164static void 164static void
165ns_string_to_pasteboard_internal (id pb, Lisp_Object str, NSString *gtype) 165ns_string_to_pasteboard_internal (id pb, Lisp_Object str, NSString *gtype)
166{ 166{
167 if (EQ (str, Qnil)) 167 if (NILP (str))
168 { 168 {
169 [pb declareTypes: [NSArray array] owner: nil]; 169 [pb declareTypes: [NSArray array] owner: nil];
170 } 170 }
@@ -399,7 +399,7 @@ these literal upper-case names.) The symbol nil is the same as
399 return Qnil; 399 return Qnil;
400 400
401 CHECK_SYMBOL (selection); 401 CHECK_SYMBOL (selection);
402 if (EQ (selection, Qnil)) selection = QPRIMARY; 402 if (NILP (selection)) selection = QPRIMARY;
403 if (EQ (selection, Qt)) selection = QSECONDARY; 403 if (EQ (selection, Qt)) selection = QSECONDARY;
404 pb = ns_symbol_to_pb (selection); 404 pb = ns_symbol_to_pb (selection);
405 if (pb == nil) return Qnil; 405 if (pb == nil) return Qnil;
@@ -421,7 +421,7 @@ and t is the same as `SECONDARY'. */)
421{ 421{
422 check_window_system (NULL); 422 check_window_system (NULL);
423 CHECK_SYMBOL (selection); 423 CHECK_SYMBOL (selection);
424 if (EQ (selection, Qnil)) selection = QPRIMARY; 424 if (NILP (selection)) selection = QPRIMARY;
425 if (EQ (selection, Qt)) selection = QSECONDARY; 425 if (EQ (selection, Qt)) selection = QSECONDARY;
426 return ns_get_pb_change_count (selection) 426 return ns_get_pb_change_count (selection)
427 == ns_get_our_change_count_for (selection) 427 == ns_get_our_change_count_for (selection)
diff --git a/src/process.c b/src/process.c
index 3fccd962da6..06324641346 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4608,7 +4608,7 @@ is nil, from any process) before the timeout expired. */)
4608 4608
4609 /* Can't wait for a process that is dedicated to a different 4609 /* Can't wait for a process that is dedicated to a different
4610 thread. */ 4610 thread. */
4611 if (!EQ (proc->thread, Qnil) && !EQ (proc->thread, Fcurrent_thread ())) 4611 if (!NILP (proc->thread) && !EQ (proc->thread, Fcurrent_thread ()))
4612 { 4612 {
4613 Lisp_Object proc_thread_name = XTHREAD (proc->thread)->name; 4613 Lisp_Object proc_thread_name = XTHREAD (proc->thread)->name;
4614 4614
@@ -5015,7 +5015,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
5015 struct timespec now = invalid_timespec (); 5015 struct timespec now = invalid_timespec ();
5016 5016
5017 eassert (wait_proc == NULL 5017 eassert (wait_proc == NULL
5018 || EQ (wait_proc->thread, Qnil) 5018 || NILP (wait_proc->thread)
5019 || XTHREAD (wait_proc->thread) == current_thread); 5019 || XTHREAD (wait_proc->thread) == current_thread);
5020 5020
5021 FD_ZERO (&Available); 5021 FD_ZERO (&Available);
diff --git a/src/terminal.c b/src/terminal.c
index 070b8aac1fe..1b3acbe07cf 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -483,7 +483,7 @@ static Lisp_Object
483store_terminal_param (struct terminal *t, Lisp_Object parameter, Lisp_Object value) 483store_terminal_param (struct terminal *t, Lisp_Object parameter, Lisp_Object value)
484{ 484{
485 Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist); 485 Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist);
486 if (EQ (old_alist_elt, Qnil)) 486 if (NILP (old_alist_elt))
487 { 487 {
488 tset_param_alist (t, Fcons (Fcons (parameter, value), t->param_alist)); 488 tset_param_alist (t, Fcons (Fcons (parameter, value), t->param_alist));
489 return Qnil; 489 return Qnil;
diff --git a/src/textprop.c b/src/textprop.c
index f7e69f30ea6..fe5b61e2ddc 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -2269,7 +2269,7 @@ verify_interval_modification (struct buffer *buf,
2269 if (!inhibit_modification_hooks) 2269 if (!inhibit_modification_hooks)
2270 { 2270 {
2271 hooks = Fnreverse (hooks); 2271 hooks = Fnreverse (hooks);
2272 while (! EQ (hooks, Qnil)) 2272 while (! NILP (hooks))
2273 { 2273 {
2274 call_mod_hooks (Fcar (hooks), make_number (start), 2274 call_mod_hooks (Fcar (hooks), make_number (start),
2275 make_number (end)); 2275 make_number (end));
diff --git a/src/xdisp.c b/src/xdisp.c
index 1199e1c1b7d..316c12ee73f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8384,7 +8384,7 @@ next_element_from_buffer (struct it *it)
8384 eassert (IT_CHARPOS (*it) >= BEGV); 8384 eassert (IT_CHARPOS (*it) >= BEGV);
8385 eassert (NILP (it->string) && !it->s); 8385 eassert (NILP (it->string) && !it->s);
8386 eassert (!it->bidi_p 8386 eassert (!it->bidi_p
8387 || (EQ (it->bidi_it.string.lstring, Qnil) 8387 || (NILP (it->bidi_it.string.lstring)
8388 && it->bidi_it.string.s == NULL)); 8388 && it->bidi_it.string.s == NULL));
8389 8389
8390 /* With bidi reordering, the character to display might not be the 8390 /* With bidi reordering, the character to display might not be the
diff --git a/src/xfaces.c b/src/xfaces.c
index eea06724185..0f9a741dfe3 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -2971,7 +2971,7 @@ FRAME 0 means change the face on all frames, and change the default
2971 if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)) 2971 if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
2972 if ((SYMBOLP (value) 2972 if ((SYMBOLP (value)
2973 && !EQ (value, Qt) 2973 && !EQ (value, Qt)
2974 && !EQ (value, Qnil)) 2974 && !NILP (value))
2975 /* Overline color. */ 2975 /* Overline color. */
2976 || (STRINGP (value) 2976 || (STRINGP (value)
2977 && SCHARS (value) == 0)) 2977 && SCHARS (value) == 0))
@@ -2985,7 +2985,7 @@ FRAME 0 means change the face on all frames, and change the default
2985 if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)) 2985 if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value))
2986 if ((SYMBOLP (value) 2986 if ((SYMBOLP (value)
2987 && !EQ (value, Qt) 2987 && !EQ (value, Qt)
2988 && !EQ (value, Qnil)) 2988 && !NILP (value))
2989 /* Strike-through color. */ 2989 /* Strike-through color. */
2990 || (STRINGP (value) 2990 || (STRINGP (value)
2991 && SCHARS (value) == 0)) 2991 && SCHARS (value) == 0))
diff --git a/src/xfns.c b/src/xfns.c
index fe8170cf635..66e49df2985 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1456,7 +1456,7 @@ x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1456 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt)) 1456 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt))
1457 return; 1457 return;
1458 } 1458 }
1459 else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil)) 1459 else if (!STRINGP (oldval) && NILP (oldval) == NILP (arg))
1460 return; 1460 return;
1461 1461
1462 block_input (); 1462 block_input ();
@@ -5722,7 +5722,7 @@ If TERMINAL is omitted or nil, that stands for the selected frame's display. */
5722{ 5722{
5723 struct x_display_info *dpyinfo = check_x_display_info (terminal); 5723 struct x_display_info *dpyinfo = check_x_display_info (terminal);
5724 5724
5725 XSynchronize (dpyinfo->display, !EQ (on, Qnil)); 5725 XSynchronize (dpyinfo->display, !NILP (on));
5726 5726
5727 return Qnil; 5727 return Qnil;
5728} 5728}
diff --git a/src/xmenu.c b/src/xmenu.c
index 58fba8c3225..a99e8ab9f09 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1487,7 +1487,7 @@ x_menu_show (struct frame *f, int x, int y, int menuflags,
1487 i = 0; 1487 i = 0;
1488 while (i < menu_items_used) 1488 while (i < menu_items_used)
1489 { 1489 {
1490 if (EQ (AREF (menu_items, i), Qnil)) 1490 if (NILP (AREF (menu_items, i)))
1491 { 1491 {
1492 submenu_stack[submenu_depth++] = save_wv; 1492 submenu_stack[submenu_depth++] = save_wv;
1493 save_wv = prev_wv; 1493 save_wv = prev_wv;
@@ -1656,7 +1656,7 @@ x_menu_show (struct frame *f, int x, int y, int menuflags,
1656 i = 0; 1656 i = 0;
1657 while (i < menu_items_used) 1657 while (i < menu_items_used)
1658 { 1658 {
1659 if (EQ (AREF (menu_items, i), Qnil)) 1659 if (NILP (AREF (menu_items, i)))
1660 { 1660 {
1661 subprefix_stack[submenu_depth++] = prefix; 1661 subprefix_stack[submenu_depth++] = prefix;
1662 prefix = entry; 1662 prefix = entry;
diff --git a/src/xselect.c b/src/xselect.c
index 1f51be4c522..8448944c00f 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2094,7 +2094,7 @@ On Nextstep, TERMINAL is unused. */)
2094 struct frame *f = frame_for_x_selection (terminal); 2094 struct frame *f = frame_for_x_selection (terminal);
2095 2095
2096 CHECK_SYMBOL (selection); 2096 CHECK_SYMBOL (selection);
2097 if (EQ (selection, Qnil)) selection = QPRIMARY; 2097 if (NILP (selection)) selection = QPRIMARY;
2098 if (EQ (selection, Qt)) selection = QSECONDARY; 2098 if (EQ (selection, Qt)) selection = QSECONDARY;
2099 2099
2100 if (f && !NILP (LOCAL_SELECTION (selection, FRAME_DISPLAY_INFO (f)))) 2100 if (f && !NILP (LOCAL_SELECTION (selection, FRAME_DISPLAY_INFO (f))))
@@ -2124,7 +2124,7 @@ On Nextstep, TERMINAL is unused. */)
2124 struct x_display_info *dpyinfo; 2124 struct x_display_info *dpyinfo;
2125 2125
2126 CHECK_SYMBOL (selection); 2126 CHECK_SYMBOL (selection);
2127 if (EQ (selection, Qnil)) selection = QPRIMARY; 2127 if (NILP (selection)) selection = QPRIMARY;
2128 if (EQ (selection, Qt)) selection = QSECONDARY; 2128 if (EQ (selection, Qt)) selection = QSECONDARY;
2129 2129
2130 if (!f) 2130 if (!f)
diff --git a/src/xwidget.c b/src/xwidget.c
index 2a53966ef43..758e6408781 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -1099,7 +1099,7 @@ xwidget_view_lookup (struct xwidget *xw, struct window *w)
1099 1099
1100 ret = Fxwidget_view_lookup (xwidget, window); 1100 ret = Fxwidget_view_lookup (xwidget, window);
1101 1101
1102 return EQ (ret, Qnil) ? NULL : XXWIDGET_VIEW (ret); 1102 return NILP (ret) ? NULL : XXWIDGET_VIEW (ret);
1103} 1103}
1104 1104
1105struct xwidget * 1105struct xwidget *