Mercurial > hg > xemacs-beta
comparison src/buffer.c @ 5125:b5df3737028a ben-lisp-object
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 24 Feb 2010 01:58:04 -0600 |
parents | 623d57b7fbe8 b46c89ccbed3 |
children | 2a462149bd6a |
comparison
equal
deleted
inserted
replaced
5124:623d57b7fbe8 | 5125:b5df3737028a |
---|---|
305 printing_unreadable_object ("#<killed buffer>"); | 305 printing_unreadable_object ("#<killed buffer>"); |
306 else | 306 else |
307 printing_unreadable_object ("#<buffer %s>", XSTRING_DATA (b->name)); | 307 printing_unreadable_object ("#<buffer %s>", XSTRING_DATA (b->name)); |
308 } | 308 } |
309 else if (!BUFFER_LIVE_P (b)) | 309 else if (!BUFFER_LIVE_P (b)) |
310 write_c_string (printcharfun, "#<killed buffer>"); | 310 write_ascstring (printcharfun, "#<killed buffer>"); |
311 else if (escapeflag) | 311 else if (escapeflag) |
312 write_fmt_string_lisp (printcharfun, "#<buffer %S>", 1, b->name); | 312 write_fmt_string_lisp (printcharfun, "#<buffer %S>", 1, b->name); |
313 else | 313 else |
314 print_internal (b->name, printcharfun, 0); | 314 print_internal (b->name, printcharfun, 0); |
315 } | 315 } |
369 If the FRAME argument is t, then the global (non-frame) ordering is | 369 If the FRAME argument is t, then the global (non-frame) ordering is |
370 returned instead. | 370 returned instead. |
371 */ | 371 */ |
372 (frame)) | 372 (frame)) |
373 { | 373 { |
374 return Fmapcar (Qcdr, | 374 Lisp_Object args[2]; |
375 EQ (frame, Qt) ? Vbuffer_alist : | 375 args[0] = Qcdr; |
376 decode_frame (frame)->buffer_alist); | 376 args[1] = EQ (frame, Qt) ? |
377 Vbuffer_alist : decode_frame (frame)->buffer_alist; | |
378 return FmapcarX (countof (args), args); | |
377 } | 379 } |
378 | 380 |
379 Lisp_Object | 381 Lisp_Object |
380 get_buffer (Lisp_Object name, int error_if_deleted_or_does_not_exist) | 382 get_buffer (Lisp_Object name, int error_if_deleted_or_does_not_exist) |
381 { | 383 { |
784 | 786 |
785 count = 1; | 787 count = 1; |
786 while (1) | 788 while (1) |
787 { | 789 { |
788 qxesprintf (number, "<%d>", ++count); | 790 qxesprintf (number, "<%d>", ++count); |
789 gentemp = concat2 (name, build_intstring (number)); | 791 gentemp = concat2 (name, build_istring (number)); |
790 if (!NILP (ignore)) | 792 if (!NILP (ignore)) |
791 { | 793 { |
792 tem = Fstring_equal (gentemp, ignore); | 794 tem = Fstring_equal (gentemp, ignore); |
793 if (!NILP (tem)) | 795 if (!NILP (tem)) |
794 return gentemp; | 796 return gentemp; |
1994 { | 1996 { |
1995 /* This function can GC */ | 1997 /* This function can GC */ |
1996 staticpro (&QSFundamental); | 1998 staticpro (&QSFundamental); |
1997 staticpro (&QSscratch); | 1999 staticpro (&QSscratch); |
1998 | 2000 |
1999 QSFundamental = build_string ("Fundamental"); | 2001 QSFundamental = build_ascstring ("Fundamental"); |
2000 QSscratch = build_string (DEFER_GETTEXT ("*scratch*")); | 2002 QSscratch = build_ascstring ("*scratch*"); |
2001 | 2003 |
2002 DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook /* | 2004 DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook /* |
2003 List of hooks to be run before killing local variables in a buffer. | 2005 List of hooks to be run before killing local variables in a buffer. |
2004 This should be used by any mode that temporarily alters the contents or | 2006 This should be used by any mode that temporarily alters the contents or |
2005 the read-only state of the buffer. See also `kill-all-local-variables'. | 2007 the read-only state of the buffer. See also `kill-all-local-variables'. |
2255 defs->category_table = Vstandard_category_table; | 2257 defs->category_table = Vstandard_category_table; |
2256 #endif /* MULE */ | 2258 #endif /* MULE */ |
2257 defs->syntax_table = Vstandard_syntax_table; | 2259 defs->syntax_table = Vstandard_syntax_table; |
2258 defs->mirror_syntax_table = | 2260 defs->mirror_syntax_table = |
2259 XCHAR_TABLE (Vstandard_syntax_table)->mirror_table; | 2261 XCHAR_TABLE (Vstandard_syntax_table)->mirror_table; |
2260 defs->modeline_format = build_string ("%-"); /* reset in loaddefs.el */ | 2262 defs->modeline_format = build_ascstring ("%-"); /* reset in loaddefs.el */ |
2261 defs->case_fold_search = Qt; | 2263 defs->case_fold_search = Qt; |
2262 defs->selective_display_ellipses = Qt; | 2264 defs->selective_display_ellipses = Qt; |
2263 defs->tab_width = make_int (8); | 2265 defs->tab_width = make_int (8); |
2264 defs->ctl_arrow = Qt; | 2266 defs->ctl_arrow = Qt; |
2265 defs->fill_column = make_int (70); | 2267 defs->fill_column = make_int (70); |
2932 Ibyte *errmess; | 2934 Ibyte *errmess; |
2933 GET_STRERROR (errmess, errno); | 2935 GET_STRERROR (errmess, errno); |
2934 stderr_out ("`getcwd' failed: %s: changing default directory to %s\n", | 2936 stderr_out ("`getcwd' failed: %s: changing default directory to %s\n", |
2935 errmess, DEFAULT_DIRECTORY_FALLBACK); | 2937 errmess, DEFAULT_DIRECTORY_FALLBACK); |
2936 | 2938 |
2937 if (qxe_chdir ((Ibyte *)DEFAULT_DIRECTORY_FALLBACK) < 0) | 2939 if (qxe_chdir ((Ibyte *) DEFAULT_DIRECTORY_FALLBACK) < 0) |
2938 { | 2940 { |
2939 GET_STRERROR (errmess, errno); | 2941 GET_STRERROR (errmess, errno); |
2940 | 2942 |
2941 fatal ("could not `chdir' to `%s': %s\n", | 2943 fatal ("could not `chdir' to `%s': %s\n", |
2942 DEFAULT_DIRECTORY_FALLBACK, errmess); | 2944 DEFAULT_DIRECTORY_FALLBACK, errmess); |
2961 } | 2963 } |
2962 | 2964 |
2963 #ifdef WIN32_NATIVE | 2965 #ifdef WIN32_NATIVE |
2964 { | 2966 { |
2965 Ibyte *newinit = mswindows_canonicalize_filename (initial_directory); | 2967 Ibyte *newinit = mswindows_canonicalize_filename (initial_directory); |
2966 xfree (initial_directory, Ibyte *); | 2968 xfree (initial_directory); |
2967 initial_directory = newinit; | 2969 initial_directory = newinit; |
2968 } | 2970 } |
2969 | 2971 |
2970 { | 2972 { |
2971 /* Make the real wd be the location of xemacs.exe to avoid conflicts | 2973 /* Make the real wd be the location of xemacs.exe to avoid conflicts |
2979 p = qxetcsrchr (modname, '\\'); | 2981 p = qxetcsrchr (modname, '\\'); |
2980 assert (p); | 2982 assert (p); |
2981 XECOPY_TCHAR (p, '\0'); | 2983 XECOPY_TCHAR (p, '\0'); |
2982 | 2984 |
2983 qxeSetCurrentDirectory (modname); | 2985 qxeSetCurrentDirectory (modname); |
2984 xfree (modname, Extbyte *); | 2986 xfree (modname); |
2985 } | 2987 } |
2986 #endif | 2988 #endif |
2987 } | 2989 } |
2988 | 2990 |
2989 void | 2991 void |
2996 init_buffer_2 (void) | 2998 init_buffer_2 (void) |
2997 { | 2999 { |
2998 /* This function can GC */ | 3000 /* This function can GC */ |
2999 Fset_buffer (Fget_buffer (QSscratch)); | 3001 Fset_buffer (Fget_buffer (QSscratch)); |
3000 | 3002 |
3001 current_buffer->directory = build_intstring (initial_directory); | 3003 current_buffer->directory = build_istring (initial_directory); |
3002 | 3004 |
3003 #if 0 /* FSFmacs */ | 3005 #if 0 /* FSFmacs */ |
3004 /* #### is this correct? */ | 3006 /* #### is this correct? */ |
3005 temp = get_minibuffer (0); | 3007 temp = get_minibuffer (0); |
3006 XBUFFER (temp)->directory = current_buffer->directory; | 3008 XBUFFER (temp)->directory = current_buffer->directory; |