mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-01 11:14:55 +00:00
Make use of NILP where possible
* src/w32menu.c (menubar_selection_callback, w32_menu_show): Use NILP where possible. * src/w32fns.c (w32_set_mouse_color): Likewise. * src/w16select.c (Fw16_selection_exists_p): Likewise. * src/process.c (Fnetwork_lookup_address_info): Likewise. * src/cygw32.c (Fcygwin_convert_file_name_to_windows) (Fcygwin_convert_file_name_from_windows): Likewise.
This commit is contained in:
parent
a2eb83d037
commit
1200e55b6f
@ -115,7 +115,7 @@ For the reverse operation, see `cygwin-convert-file-name-from-windows'. */)
|
||||
(Lisp_Object file, Lisp_Object absolute_p)
|
||||
{
|
||||
return from_unicode (
|
||||
conv_filename_to_w32_unicode (file, EQ (absolute_p, Qnil) ? 0 : 1));
|
||||
conv_filename_to_w32_unicode (file, NILP (absolute_p) ? 0 : 1));
|
||||
}
|
||||
|
||||
DEFUN ("cygwin-convert-file-name-from-windows",
|
||||
@ -128,7 +128,7 @@ For the reverse operation, see `cygwin-convert-file-name-to-windows'. */)
|
||||
(Lisp_Object file, Lisp_Object absolute_p)
|
||||
{
|
||||
return conv_filename_from_w32_unicode (to_unicode (file, &file),
|
||||
EQ (absolute_p, Qnil) ? 0 : 1);
|
||||
NILP (absolute_p) ? 0 : 1);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -4644,7 +4644,7 @@ error displays the error message. */)
|
||||
struct addrinfo hints;
|
||||
|
||||
memset (&hints, 0, sizeof hints);
|
||||
if (EQ (family, Qnil))
|
||||
if (NILP (family))
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
else if (EQ (family, Qipv4))
|
||||
hints.ai_family = AF_INET;
|
||||
|
@ -651,7 +651,7 @@ frame's display, or the first available X display. */)
|
||||
by the X interface code. (On MSDOS, killed text is only put
|
||||
into the clipboard if we run under Windows, so we cannot check
|
||||
the clipboard alone.) */
|
||||
if ((EQ (selection, Qnil) || EQ (selection, QPRIMARY))
|
||||
if ((NILP (selection) || EQ (selection, QPRIMARY))
|
||||
&& ! NILP (Fsymbol_value (Fintern_soft (build_string ("kill-ring"),
|
||||
Qnil))))
|
||||
return Qt;
|
||||
|
12
src/w32fns.c
12
src/w32fns.c
@ -1217,7 +1217,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
|
||||
#endif
|
||||
int mask_color;
|
||||
|
||||
if (!EQ (Qnil, arg))
|
||||
if (!NILP (arg))
|
||||
f->output_data.w32->mouse_pixel
|
||||
= w32_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
|
||||
mask_color = FRAME_BACKGROUND_PIXEL (f);
|
||||
@ -1233,7 +1233,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
|
||||
/* It's not okay to crash if the user selects a screwy cursor. */
|
||||
count = x_catch_errors (FRAME_W32_DISPLAY (f));
|
||||
|
||||
if (!EQ (Qnil, Vx_pointer_shape))
|
||||
if (!NILP (Vx_pointer_shape))
|
||||
{
|
||||
CHECK_FIXNUM (Vx_pointer_shape);
|
||||
cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XFIXNUM (Vx_pointer_shape));
|
||||
@ -1242,7 +1242,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
|
||||
cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm);
|
||||
x_check_errors (FRAME_W32_DISPLAY (f), "bad text pointer cursor: %s");
|
||||
|
||||
if (!EQ (Qnil, Vx_nontext_pointer_shape))
|
||||
if (!NILP (Vx_nontext_pointer_shape))
|
||||
{
|
||||
CHECK_FIXNUM (Vx_nontext_pointer_shape);
|
||||
nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
|
||||
@ -1252,7 +1252,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
|
||||
nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_left_ptr);
|
||||
x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
|
||||
|
||||
if (!EQ (Qnil, Vx_hourglass_pointer_shape))
|
||||
if (!NILP (Vx_hourglass_pointer_shape))
|
||||
{
|
||||
CHECK_FIXNUM (Vx_hourglass_pointer_shape);
|
||||
hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
|
||||
@ -1263,7 +1263,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
|
||||
x_check_errors (FRAME_W32_DISPLAY (f), "bad busy pointer cursor: %s");
|
||||
|
||||
x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
|
||||
if (!EQ (Qnil, Vx_mode_pointer_shape))
|
||||
if (!NILP (Vx_mode_pointer_shape))
|
||||
{
|
||||
CHECK_FIXNUM (Vx_mode_pointer_shape);
|
||||
mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
|
||||
@ -1273,7 +1273,7 @@ w32_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
|
||||
mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm);
|
||||
x_check_errors (FRAME_W32_DISPLAY (f), "bad modeline pointer cursor: %s");
|
||||
|
||||
if (!EQ (Qnil, Vx_sensitive_text_pointer_shape))
|
||||
if (!NILP (Vx_sensitive_text_pointer_shape))
|
||||
{
|
||||
CHECK_FIXNUM (Vx_sensitive_text_pointer_shape);
|
||||
hand_cursor
|
||||
|
@ -188,7 +188,7 @@ menubar_selection_callback (struct frame *f, void * client_data)
|
||||
i = 0;
|
||||
while (i < f->menu_bar_items_used)
|
||||
{
|
||||
if (EQ (AREF (vector, i), Qnil))
|
||||
if (NILP (AREF (vector, i)))
|
||||
{
|
||||
subprefix_stack[submenu_depth++] = prefix;
|
||||
prefix = entry;
|
||||
@ -587,7 +587,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags,
|
||||
i = 0;
|
||||
while (i < menu_items_used)
|
||||
{
|
||||
if (EQ (AREF (menu_items, i), Qnil))
|
||||
if (NILP (AREF (menu_items, i)))
|
||||
{
|
||||
submenu_stack[submenu_depth++] = save_wv;
|
||||
save_wv = prev_wv;
|
||||
@ -779,7 +779,7 @@ w32_menu_show (struct frame *f, int x, int y, int menuflags,
|
||||
i = 0;
|
||||
while (i < menu_items_used)
|
||||
{
|
||||
if (EQ (AREF (menu_items, i), Qnil))
|
||||
if (NILP (AREF (menu_items, i)))
|
||||
{
|
||||
subprefix_stack[submenu_depth++] = prefix;
|
||||
prefix = entry;
|
||||
|
Loading…
Reference in New Issue
Block a user