aboutsummaryrefslogtreecommitdiffstats
path: root/src/editfns.c
diff options
context:
space:
mode:
authorJim Blandy1992-01-14 02:48:51 +0000
committerJim Blandy1992-01-14 02:48:51 +0000
commit56a98455a6d993518b9b1f1b3cff4e72bdd6275d (patch)
tree9429ed5f68a3cab776b7efa0b6f0ffa00ec74a29 /src/editfns.c
parent0849f191ce56119013c31cba8bc44bb374269f7c (diff)
downloademacs-56a98455a6d993518b9b1f1b3cff4e72bdd6275d.tar.gz
emacs-56a98455a6d993518b9b1f1b3cff4e72bdd6275d.zip
*** empty log message ***
Diffstat (limited to 'src/editfns.c')
-rw-r--r--src/editfns.c42
1 files changed, 12 insertions, 30 deletions
diff --git a/src/editfns.c b/src/editfns.c
index 2ea8471fd50..0f059079f1f 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -92,7 +92,7 @@ init_editfns ()
92 /* If the user name claimed in the environment vars differs from 92 /* If the user name claimed in the environment vars differs from
93 the real uid, use the claimed name to find the full name. */ 93 the real uid, use the claimed name to find the full name. */
94 tem = Fstring_equal (Vuser_name, Vuser_real_name); 94 tem = Fstring_equal (Vuser_name, Vuser_real_name);
95 if (NULL (tem)) 95 if (NILP (tem))
96 pw = (struct passwd *) getpwnam (XSTRING (Vuser_name)->data); 96 pw = (struct passwd *) getpwnam (XSTRING (Vuser_name)->data);
97 97
98 p = (unsigned char *) (pw ? USER_FULL_NAME : "unknown"); 98 p = (unsigned char *) (pw ? USER_FULL_NAME : "unknown");
@@ -202,7 +202,7 @@ region_limit (beginningp)
202{ 202{
203 register Lisp_Object m; 203 register Lisp_Object m;
204 m = Fmarker_position (current_buffer->mark); 204 m = Fmarker_position (current_buffer->mark);
205 if (NULL (m)) error ("There is no region now"); 205 if (NILP (m)) error ("There is no region now");
206 if ((point < XFASTINT (m)) == beginningp) 206 if ((point < XFASTINT (m)) == beginningp)
207 return (make_number (point)); 207 return (make_number (point));
208 else 208 else
@@ -263,14 +263,14 @@ store it in a Lisp variable. Example:\n\
263 (pos) 263 (pos)
264 Lisp_Object pos; 264 Lisp_Object pos;
265{ 265{
266 if (NULL (pos)) 266 if (NILP (pos))
267 { 267 {
268 current_buffer->mark = Qnil; 268 current_buffer->mark = Qnil;
269 return Qnil; 269 return Qnil;
270 } 270 }
271 CHECK_NUMBER_COERCE_MARKER (pos, 0); 271 CHECK_NUMBER_COERCE_MARKER (pos, 0);
272 272
273 if (NULL (current_buffer->mark)) 273 if (NILP (current_buffer->mark))
274 current_buffer->mark = Fmake_marker (); 274 current_buffer->mark = Fmake_marker ();
275 275
276 Fset_marker (current_buffer->mark, pos, Qnil); 276 Fset_marker (current_buffer->mark, pos, Qnil);
@@ -298,7 +298,7 @@ save_excursion_restore (info)
298 /* Otherwise could get error here while unwinding to top level 298 /* Otherwise could get error here while unwinding to top level
299 and crash */ 299 and crash */
300 /* In that case, Fmarker_buffer returns nil now. */ 300 /* In that case, Fmarker_buffer returns nil now. */
301 if (NULL (tem)) 301 if (NILP (tem))
302 return Qnil; 302 return Qnil;
303 Fset_buffer (tem); 303 Fset_buffer (tem);
304 tem = Fcar (info); 304 tem = Fcar (info);
@@ -308,7 +308,7 @@ save_excursion_restore (info)
308 Fset_marker (current_buffer->mark, tem, Fcurrent_buffer ()); 308 Fset_marker (current_buffer->mark, tem, Fcurrent_buffer ());
309 unchain_marker (tem); 309 unchain_marker (tem);
310 tem = Fcdr (Fcdr (info)); 310 tem = Fcdr (Fcdr (info));
311 if (!NULL (tem) && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer)) 311 if (!NILP (tem) && current_buffer != XBUFFER (XWINDOW (selected_window)->buffer))
312 Fswitch_to_buffer (Fcurrent_buffer (), Qnil); 312 Fswitch_to_buffer (Fcurrent_buffer (), Qnil);
313 return Qnil; 313 return Qnil;
314} 314}
@@ -720,14 +720,14 @@ They default to the beginning and the end of BUFFER.")
720 buf = Fget_buffer (buf); 720 buf = Fget_buffer (buf);
721 bp = XBUFFER (buf); 721 bp = XBUFFER (buf);
722 722
723 if (NULL (b)) 723 if (NILP (b))
724 beg = BUF_BEGV (bp); 724 beg = BUF_BEGV (bp);
725 else 725 else
726 { 726 {
727 CHECK_NUMBER_COERCE_MARKER (b, 0); 727 CHECK_NUMBER_COERCE_MARKER (b, 0);
728 beg = XINT (b); 728 beg = XINT (b);
729 } 729 }
730 if (NULL (e)) 730 if (NILP (e))
731 end = BUF_ZV (bp); 731 end = BUF_ZV (bp);
732 else 732 else
733 { 733 {
@@ -782,7 +782,7 @@ and don't mark the buffer as really changed.")
782 look = XINT (fromchar); 782 look = XINT (fromchar);
783 783
784 modify_region (pos, stop); 784 modify_region (pos, stop);
785 if (! NULL (noundo)) 785 if (! NILP (noundo))
786 { 786 {
787 if (MODIFF - 1 == current_buffer->save_modified) 787 if (MODIFF - 1 == current_buffer->save_modified)
788 current_buffer->save_modified++; 788 current_buffer->save_modified++;
@@ -794,10 +794,10 @@ and don't mark the buffer as really changed.")
794 { 794 {
795 if (FETCH_CHAR (pos) == look) 795 if (FETCH_CHAR (pos) == look)
796 { 796 {
797 if (NULL (noundo)) 797 if (NILP (noundo))
798 record_change (pos, 1); 798 record_change (pos, 1);
799 FETCH_CHAR (pos) = XINT (tochar); 799 FETCH_CHAR (pos) = XINT (tochar);
800 if (NULL (noundo)) 800 if (NILP (noundo))
801 signal_after_change (pos, 1, 1); 801 signal_after_change (pos, 1, 1);
802 } 802 }
803 pos++; 803 pos++;
@@ -1183,28 +1183,13 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer.")
1183 CHECK_NUMBER (c1, 0); 1183 CHECK_NUMBER (c1, 0);
1184 CHECK_NUMBER (c2, 1); 1184 CHECK_NUMBER (c2, 1);
1185 1185
1186 if (!NULL (current_buffer->case_fold_search) 1186 if (!NILP (current_buffer->case_fold_search)
1187 ? downcase[0xff & XFASTINT (c1)] == downcase[0xff & XFASTINT (c2)] 1187 ? downcase[0xff & XFASTINT (c1)] == downcase[0xff & XFASTINT (c2)]
1188 : XINT (c1) == XINT (c2)) 1188 : XINT (c1) == XINT (c2))
1189 return Qt; 1189 return Qt;
1190 return Qnil; 1190 return Qnil;
1191} 1191}
1192 1192
1193#ifndef MAINTAIN_ENVIRONMENT /* it is done in environ.c in that case */
1194DEFUN ("getenv", Fgetenv, Sgetenv, 1, 2, 0,
1195 "Return the value of environment variable VAR, as a string.\n\
1196VAR should be a string. Value is nil if VAR is undefined in the environment.")
1197 (str)
1198 Lisp_Object str;
1199{
1200 register char *val;
1201 CHECK_STRING (str, 0);
1202 val = (char *) egetenv (XSTRING (str)->data);
1203 if (!val)
1204 return Qnil;
1205 return build_string (val);
1206}
1207#endif /* MAINTAIN_ENVIRONMENT */
1208 1193
1209void 1194void
1210syms_of_editfns () 1195syms_of_editfns ()
@@ -1266,9 +1251,6 @@ syms_of_editfns ()
1266 defsubr (&Sunix_sync); 1251 defsubr (&Sunix_sync);
1267 defsubr (&Smessage); 1252 defsubr (&Smessage);
1268 defsubr (&Sformat); 1253 defsubr (&Sformat);
1269#ifndef MAINTAIN_ENVIRONMENT /* in environ.c */
1270 defsubr (&Sgetenv);
1271#endif
1272 1254
1273 defsubr (&Sinsert_buffer_substring); 1255 defsubr (&Sinsert_buffer_substring);
1274 defsubr (&Ssubst_char_in_region); 1256 defsubr (&Ssubst_char_in_region);