/* If the user name claimed in the environment vars differs from
the real uid, use the claimed name to find the full name. */
tem = Fstring_equal (Vuser_name, Vuser_real_name);
- if (NULL (tem))
+ if (NILP (tem))
pw = (struct passwd *) getpwnam (XSTRING (Vuser_name)->data);
p = (unsigned char *) (pw ? USER_FULL_NAME : "unknown");
{
register Lisp_Object m;
m = Fmarker_position (current_buffer->mark);
- if (NULL (m)) error ("There is no region now");
+ if (NILP (m)) error ("There is no region now");
if ((point < XFASTINT (m)) == beginningp)
return (make_number (point));
else
(pos)
Lisp_Object pos;
{
- if (NULL (pos))
+ if (NILP (pos))
{
current_buffer->mark = Qnil;
return Qnil;
}
CHECK_NUMBER_COERCE_MARKER (pos, 0);
- if (NULL (current_buffer->mark))
+ if (NILP (current_buffer->mark))
current_buffer->mark = Fmake_marker ();
Fset_marker (current_buffer->mark, pos, Qnil);
/* Otherwise could get error here while unwinding to top level
and crash */
/* In that case, Fmarker_buffer returns nil now. */
- if (NULL (tem))
+ if (NILP (tem))
return Qnil;
Fset_buffer (tem);
tem = Fcar (info);
Fset_marker (current_buffer->mark, tem, Fcurrent_buffer ());
unchain_marker (tem);
tem = Fcdr (Fcdr (info));
- if (!NULL (tem) && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer))
+ if (!NILP (tem) && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer))
Fswitch_to_buffer (Fcurrent_buffer (), Qnil);
return Qnil;
}
buf = Fget_buffer (buf);
bp = XBUFFER (buf);
- if (NULL (b))
+ if (NILP (b))
beg = BUF_BEGV (bp);
else
{
CHECK_NUMBER_COERCE_MARKER (b, 0);
beg = XINT (b);
}
- if (NULL (e))
+ if (NILP (e))
end = BUF_ZV (bp);
else
{
look = XINT (fromchar);
modify_region (pos, stop);
- if (! NULL (noundo))
+ if (! NILP (noundo))
{
if (MODIFF - 1 == current_buffer->save_modified)
current_buffer->save_modified++;
{
if (FETCH_CHAR (pos) == look)
{
- if (NULL (noundo))
+ if (NILP (noundo))
record_change (pos, 1);
FETCH_CHAR (pos) = XINT (tochar);
- if (NULL (noundo))
+ if (NILP (noundo))
signal_after_change (pos, 1, 1);
}
pos++;
CHECK_NUMBER (c1, 0);
CHECK_NUMBER (c2, 1);
- if (!NULL (current_buffer->case_fold_search)
+ if (!NILP (current_buffer->case_fold_search)
? downcase[0xff & XFASTINT (c1)] == downcase[0xff & XFASTINT (c2)]
: XINT (c1) == XINT (c2))
return Qt;
return Qnil;
}
-#ifndef MAINTAIN_ENVIRONMENT /* it is done in environ.c in that case */
-DEFUN ("getenv", Fgetenv, Sgetenv, 1, 2, 0,
- "Return the value of environment variable VAR, as a string.\n\
-VAR should be a string. Value is nil if VAR is undefined in the environment.")
- (str)
- Lisp_Object str;
-{
- register char *val;
- CHECK_STRING (str, 0);
- val = (char *) egetenv (XSTRING (str)->data);
- if (!val)
- return Qnil;
- return build_string (val);
-}
-#endif /* MAINTAIN_ENVIRONMENT */
\f
void
syms_of_editfns ()
defsubr (&Sunix_sync);
defsubr (&Smessage);
defsubr (&Sformat);
-#ifndef MAINTAIN_ENVIRONMENT /* in environ.c */
- defsubr (&Sgetenv);
-#endif
defsubr (&Sinsert_buffer_substring);
defsubr (&Ssubst_char_in_region);
/* Value of MODIFF when current_column was called */
int last_known_column_modified;
-extern int minibuf_prompt_width;
-
/* Get the display table to use for the current buffer. */
struct Lisp_Vector *
int post_tab;
register int c;
register int tab_width = XINT (current_buffer->tab_width);
- int ctl_arrow = !NULL (current_buffer->ctl_arrow);
+ int ctl_arrow = !NILP (current_buffer->ctl_arrow);
register struct Lisp_Vector *dp = buffer_display_table ();
int stopchar;
register int tab_width = XINT (current_buffer->tab_width);
CHECK_NUMBER (col, 0);
- if (NULL (minimum))
+ if (NILP (minimum))
XFASTINT (minimum) = 0;
CHECK_NUMBER (minimum, 1);
register int goal;
register int end;
register int tab_width = XINT (current_buffer->tab_width);
- register int ctl_arrow = !NULL (current_buffer->ctl_arrow);
+ register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
register struct Lisp_Vector *dp = buffer_display_table ();
Lisp_Object val;
/* If a tab char made us overshoot, change it to spaces
and scan through it again. */
- if (!NULL (force) && col > goal && c == '\t' && prev_col < goal)
+ if (!NILP (force) && col > goal && c == '\t' && prev_col < goal)
{
del_range (point - 1, point);
Findent_to (make_number (col - 1));
}
/* If line ends prematurely, add space to the end. */
- if (col < goal && !NULL (force))
+ if (col < goal && !NILP (force))
Findent_to (make_number (col = goal));
last_known_column = col;
register int pos;
register int c;
register int tab_width = XFASTINT (current_buffer->tab_width);
- register int ctl_arrow = !NULL (current_buffer->ctl_arrow);
+ register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
register struct Lisp_Vector *dp = buffer_display_table ();
int selective
= XTYPE (current_buffer->selective_display) == Lisp_Int
? XINT (current_buffer->selective_display)
- : !NULL (current_buffer->selective_display) ? -1 : 0;
+ : !NILP (current_buffer->selective_display) ? -1 : 0;
int prevpos;
int selective_rlen
= (selective && dp && XTYPE (DISP_INVIS_ROPE (dp)) == Lisp_String
if (hscroll
|| (truncate_partial_width_windows
&& width + 1 < SCREEN_WIDTH (selected_screen))
- || !NULL (current_buffer->truncate_lines))
+ || !NILP (current_buffer->truncate_lines))
{
while (pos < to && FETCH_CHAR(pos) != '\n') pos++;
pos--;
int selective
= XTYPE (current_buffer->selective_display) == Lisp_Int
? XINT (current_buffer->selective_display)
- : !NULL (current_buffer->selective_display) ? -1 : 0;
+ : !NILP (current_buffer->selective_display) ? -1 : 0;
int start_hpos = (EQ (window, minibuf_window) ? minibuf_prompt_width : 0);
retry:
Lisp_Object Quser_variable_p;
-/* Width in columns of current minibuffer prompt. */
-
-extern int minibuf_prompt_width;
-
\f
/* Actual minibuffer invocation. */
Ferase_buffer ();
minibuf_level++;
- if (!NULL (initial))
+ if (!NILP (initial))
{
Finsert (1, &initial);
- if (!NULL (backup_n) && XTYPE (backup_n) == Lisp_Int)
+ if (!NILP (backup_n) && XTYPE (backup_n) == Lisp_Int)
Fforward_char (backup_n);
}
XFASTINT (num) = depth;
tail = Fnthcdr (num, Vminibuffer_list);
- if (NULL (tail))
+ if (NILP (tail))
{
tail = Fcons (Qnil, Qnil);
Vminibuffer_list = nconc2 (Vminibuffer_list, tail);
}
buf = Fcar (tail);
- if (NULL (buf) || NULL (XBUFFER (buf)->name))
+ if (NILP (buf) || NILP (XBUFFER (buf)->name))
{
sprintf (name, " *Minibuf-%d*", depth);
buf = Fget_buffer_create (build_string (name));
int pos = 0;
CHECK_STRING (prompt, 0);
- if (!NULL (initial_input))
+ if (!NILP (initial_input))
{
CHECK_STRING (initial_input, 1);
- if (!NULL (position))
+ if (!NILP (position))
{
CHECK_NUMBER (position, 0);
/* Convert to distance from end of input. */
}
}
- if (NULL (keymap))
+ if (NILP (keymap))
keymap = Vminibuffer_local_map;
else
keymap = get_keymap (keymap,2);
return read_minibuf (keymap, initial_input, prompt,
- pos, !NULL (read));
+ pos, !NILP (read));
}
DEFUN ("read-minibuffer", Fread_minibuffer, Sread_minibuffer, 1, 2, 0,
Lisp_Object prompt, initial_contents;
{
CHECK_STRING (prompt, 0);
- if (!NULL (initial_contents))
+ if (!NILP (initial_contents))
CHECK_STRING (initial_contents, 1)
return read_minibuf (Vminibuffer_local_map, initial_contents, prompt, Qnil, 1);
}
Lisp_Object prompt, init;
{
CHECK_STRING (prompt, 0);
- if (! NULL (init))
+ if (! NILP (init))
CHECK_STRING (init, 1);
return read_minibuf (Vminibuffer_local_ns_map, init, prompt, Qnil, 0);
if (XTYPE (def) == Lisp_Buffer)
def = XBUFFER (def)->name;
- if (!NULL (def))
+ if (!NILP (def))
{
args[0] = build_string ("%s(default %s) ");
args[1] = prompt;
Lisp_Object bestmatch, tail, elt, eltstring;
int bestmatchsize;
int compare, matchsize;
- int list = CONSP (alist) || NULL (alist);
+ int list = CONSP (alist) || NILP (alist);
int index, obsize;
int matchcount = 0;
Lisp_Object bucket, zero, end, tem;
if (list)
{
- if (NULL (tail))
+ if (NILP (tail))
break;
elt = Fcar (tail);
eltstring = Fcar (elt);
/* Ignore this element if there is a predicate
and the predicate doesn't like it. */
- if (!NULL (pred))
+ if (!NILP (pred))
{
if (EQ (pred, Qcommandp))
tem = Fcommandp (elt);
tem = call1 (pred, elt);
UNGCPRO;
}
- if (NULL (tem)) continue;
+ if (NILP (tem)) continue;
}
/* Update computation of how much all possible completions match */
matchcount++;
- if (NULL (bestmatch))
+ if (NILP (bestmatch))
bestmatch = eltstring, bestmatchsize = XSTRING (eltstring)->size;
else
{
}
}
- if (NULL (bestmatch))
+ if (NILP (bestmatch))
return Qnil; /* No completions found */
/* If we are ignoring case, and there is no exact match,
and no additional text was supplied,
{
Lisp_Object tail, elt, eltstring;
Lisp_Object allmatches;
- int list = CONSP (alist) || NULL (alist);
+ int list = CONSP (alist) || NILP (alist);
int index, obsize;
Lisp_Object bucket, tem;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
if (list)
{
- if (NULL (tail))
+ if (NILP (tail))
break;
elt = Fcar (tail);
eltstring = Fcar (elt);
/* Ignore this element if there is a predicate
and the predicate doesn't like it. */
- if (!NULL (pred))
+ if (!NILP (pred))
{
if (EQ (pred, Qcommandp))
tem = Fcommandp (elt);
tem = call1 (pred, elt);
UNGCPRO;
}
- if (NULL (tem)) continue;
+ if (NILP (tem)) continue;
}
/* Ok => put it on the list. */
allmatches = Fcons (eltstring, allmatches);
specbind (Qminibuffer_completion_confirm,
EQ (require_match, Qt) ? Qnil : Qt);
last_exact_completion = Qnil;
- val = read_minibuf (NULL (require_match)
+ val = read_minibuf (NILP (require_match)
? Vminibuffer_local_completion_map
: Vminibuffer_local_must_match_map,
init, prompt, backup_n, 0);
Vinhibit_quit = Qt;
Fsit_for (make_number (2), Qnil, Qnil);
del_range (point, ZV);
- if (!NULL (Vquit_flag))
+ if (!NILP (Vquit_flag))
{
Vquit_flag = Qnil;
unread_command_char = Ctl ('g');
last = last_exact_completion;
last_exact_completion = Qnil;
- if (NULL (completion))
+ if (NILP (completion))
{
bitch_at_user ();
temp_echo_area_glyphs (" [No match]");
/* compiler bug */
tem = Fstring_equal (completion, Fbuffer_string());
- if (completedp = NULL (tem))
+ if (completedp = NILP (tem))
{
Ferase_buffer (); /* Some completion happened */
Finsert (1, &completion);
/* It did find a match. Do we match some possibility exactly now? */
if (CONSP (Vminibuffer_completion_table)
- || NULL (Vminibuffer_completion_table))
+ || NILP (Vminibuffer_completion_table))
tem = assoc_for_completion (Fbuffer_string (),
Vminibuffer_completion_table);
else if (XTYPE (Vminibuffer_completion_table) == Lisp_Vector)
XSTRING (tem)->data, XSTRING (tem)->size);
if (XTYPE (tem) != Lisp_Symbol)
tem = Qnil;
- else if (!NULL (Vminibuffer_completion_predicate))
+ else if (!NILP (Vminibuffer_completion_predicate))
tem = call1 (Vminibuffer_completion_predicate, tem);
else
tem = Qt;
Vminibuffer_completion_predicate,
Qlambda);
- if (NULL (tem))
+ if (NILP (tem))
{ /* not an exact match */
if (completedp)
return 5;
it means we've already given a "Complete but not unique"
message and the user's hit TAB again, so now we give him help. */
last_exact_completion = completion;
- if (!NULL (last))
+ if (!NILP (last))
{
tem = Fbuffer_string ();
- if (!NULL (Fequal (tem, last)))
+ if (!NILP (Fequal (tem, last)))
Fminibuffer_completion_help ();
}
return 3;
if (completion_ignore_case)
key = Fupcase (key);
- for (tail = list; !NULL (tail); tail = Fcdr (tail))
+ for (tail = list; !NILP (tail); tail = Fcdr (tail))
{
register Lisp_Object elt, tem, thiscar;
elt = Fcar (tail);
if (completion_ignore_case)
thiscar = Fupcase (thiscar);
tem = Fequal (thiscar, key);
- if (!NULL (tem)) return elt;
+ if (!NILP (tem)) return elt;
QUIT;
}
return Qnil;
goto exit;
case 4:
- if (!NULL (Vminibuffer_completion_confirm))
+ if (!NILP (Vminibuffer_completion_confirm))
{
temp_echo_area_glyphs (" [Confirm]");
return Qnil;
completion = Ftry_completion (Fbuffer_string (),
Vminibuffer_completion_table,
Vminibuffer_completion_predicate);
- if (NULL (completion))
+ if (NILP (completion))
{
bitch_at_user ();
temp_echo_area_glyphs (" [No match]");
set_buffer_internal (XBUFFER (Vstandard_output));
- if (NULL (completions))
+ if (NILP (completions))
insert_string ("There are no possible completions of what you have typed.");
else
{
insert_string ("Possible completions are:");
- for (tail = completions, i = 0; !NULL (tail); tail = Fcdr (tail), i++)
+ for (tail = completions, i = 0; !NILP (tail); tail = Fcdr (tail), i++)
{
/* this needs fixing for the case of long completions
and/or narrow windows */
Vminibuffer_completion_predicate);
echo_area_glyphs = 0;
- if (NULL (completions))
+ if (NILP (completions))
{
bitch_at_user ();
temp_echo_area_glyphs (" [No completions]");