Commit graph

533 commits

Author SHA1 Message Date
Stefan Monnier
f34574c6d5 (search_embedded_absfilename): Fix last change. 2005-03-30 22:33:00 +00:00
Stefan Monnier
c70a4df6d2 (Fexpand_file_name): Use IS_DEVICE_SEP.
(file_name_absolute_p): New fun, extracted from Ffile_name_absolute_p.
(Ffile_name_absolute_p): Use it.
(search_embedded_absfilename): New fun, extracted from Fsubstitute_in_file_name.
Use file_name_absolute_p.  Free the pw data after use.
(Fsubstitute_in_file_name): Use it.
After cutting a prefix, re-check file-name-handler.
2005-03-28 21:31:14 +00:00
Richard M. Stallman
7c0f6118c3 (Fcopy_file, Frename_file, Fadd_name_to_file)
(Fmake_symbolic_link): Use G to read the new file name.
2005-03-17 23:36:03 +00:00
Stefan Monnier
dac24db404 (Fmake_symbolic_link): Fix last change. 2005-03-12 01:37:51 +00:00
Richard M. Stallman
1ffc5c90de (Frename_file, Fadd_name_to_file)
(Fmake_symbolic_link): If NEWNAME or LINKNAME is a directory,
expand the basename of FILE relative to it.
2005-03-11 23:49:25 +00:00
Kenichi Handa
87e3d54cf9 (Finsert_file_contents): Call Fcheck_coding_system
before calling setup_coding_system so that autoloading of a coding
system work.
2005-03-11 11:59:42 +00:00
Thien-Thi Nguyen
ad204e956a (Fexpand_file_name) [VMS]:
Use NO_HYPHENS_IN_FILENAMES, not VMS4_4.
2005-03-04 21:57:21 +00:00
Thien-Thi Nguyen
ad708ae59b (Fexpand_file_name) [VMS]: Don't upcase the name
"manually"; this is now handled generally via FILE_SYSTEM_CASE.
2005-03-04 17:15:50 +00:00
Thien-Thi Nguyen
c155895220 (FILE_SYSTEM_CASE): Define macro if not already defined.
(Ffile_name_directory): Use FILE_SYSTEM_CASE unconditionally.
(Fexpand_file_name): Likewise.
2005-03-03 20:17:24 +00:00
Richard M. Stallman
7f08b80e33 (Fcopy_file): Doc fix. 2005-01-21 20:51:52 +00:00
Kenichi Handa
37a3c7744c (Finsert_file_contents): Don't use
current_buffer->buffer_file_coding_system even if REPLACE is
non-nil.  Call Qafter_insert_file_set_coding with the second arg
VISIT.
2004-12-30 12:28:41 +00:00
Steven Tamm
b15325b22a * dispextern.h: Change HAVE_CARBON to MAC_OS.
(struct glyph_string): Likewise.
* emacs.c (main) [MAC_OS8]: Call mac_term_init instead of
	mac_initialize.
* fileio.c (Fnext_read_file_uses_dialog_p, Fread_file_name):
	Change TARGET_API_MAC_CARBON to HAVE_CARBON.
* fns.c (vector): Change MAC_OSX to MAC_OS.
* frame.c (x_set_frame_parameters, x_report_frame_params)
	(x_set_fullscreen): Remove #ifndef HAVE_CARBON.
	(x_set_border_width, Vdefault_frame_scroll_bars): Change
	HAVE_CARBON to MAC_OS.
* image.c [MAC_OS]: Include sys/stat.h.
	[MAC_OS && !MAC_OSX]: Include sys/param.h, ImageCompression.h, and
	QuickTimeComponents.h.
* mac.c [!MAC_OSX] (mac_wait_next_event): Add extern.
	[!MAC_OSX] (select): Use mac_wait_next_event.
	[!MAC_OSX] (run_mac_command): Change EXEC_SUFFIXES to
	Vexec_suffixes.
	[!MAC_OSX] (select, run_mac_command): Change `#ifdef
	TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'.
	(mac_clear_font_name_table): Add extern.
	(Fmac_clear_font_name_table): New defun.
	(syms_of_mac): Defsubr it.
	[MAC_OSX] (SELECT_POLLING_PERIOD_USEC): New define.
	[MAC_OSX] (select_and_poll_event): New function.
	[MAC_OSX] (sys_select): Use it.
	[MAC_OSX && SELECT_USE_CFSOCKET] (socket_callback): New function.
	[MAC_OSX && SELECT_USE_CFSOCKET]
	(SELECT_TIMEOUT_THRESHOLD_RUNLOOP, EVENT_CLASS_SOCK): New defines.
	[MAC_OSX] (sys_select) [SELECT_USE_CFSOCKET]: Use CFSocket and
	RunLoop for simultaneously monitoring two kinds of inputs, window
	events and process outputs, without periodically polling.
* macfns.c (mac_initialized): Remove extern.
	(stricmp): Put in #if 0.  All callers changed to use xstricmp in
	xfaces.c.
	(strnicmp): Decrement `n' at the end of each loop, not the
	beginning.
	(check_mac): Use the term "Mac native windows" instead of "Mac
	OS".
	(check_x_display_info, x_display_info_for_name): Sync with xfns.c.
	(mac_get_rdb_resource): New function (from w32reg.c).
	(x_get_string_resource): Use it.
	(install_window_handler): Add extern.
	(mac_window): New function.
	(Fx_create_frame): Use it instead of make_mac_frame.  Set
	parameter for Qfullscreen.  Call x_wm_set_size_hint.
	(Fx_open_connection, Fx_close_connection): New defuns.
	(syms_of_macfns): Defsubr them.
	(x_create_tip_frame) [TARGET_API_MAC_CARBON]: Add
	kWindowNoUpdatesAttribute to the window attribute.
	(x_create_tip_frame) [!TARGET_API_MAC_CARBON]: Use NewCWindow.
	(x_create_tip_frame): Don't call ShowWindow.
	(Fx_show_tip): Call ShowWindow.
	(Fx_file_dialog): Change `#ifdef TARGET_API_MAC_CARBON' to `#if
	TARGET_API_MAC_CARBON'.
	(mac_frame_parm_handlers): Set handlers for Qfullscreen.
	(syms_of_macfns) [MAC_OSX]: Initialize mac_in_use to 0.
* macgui.h [!MAC_OSX]: Don't include Controls.h.  Include
	Windows.h.
	(Window): Typedef to WindowPtr and move outside `#if
	TARGET_API_MAC_CARBON'.
	(XSizeHints): New struct.
* macterm.c (x_update_begin, x_update_end)
	[TARGET_API_MAC_CARBON]: Disable screen updates during update of a
	frame.
	(x_draw_glyph_string_background, x_draw_glyph_string_foreground)
	[MAC_OS8]: Use XDrawImageString/XDrawImageString16.
	(construct_mouse_click): Put in #if 0.
	(x_check_fullscreen, x_check_fullscreen_move): Remove decls.
	(x_scroll_bar_create, x_scroll_bar_handle_click): Change `#ifdef
	TARGET_API_MAC_CARBON' to `#if TARGET_API_MAC_CARBON'.
	(activate_scroll_bars, deactivate_scroll_bars)
	[!TARGET_API_MAC_CARBON]: Use ActivateControl/DeactivateControl.
	(x_make_frame_visible) [TARGET_API_MAC_CARBON]: Reposition window
	if the position is neither user-specified nor program-specified.
	(x_free_frame_resources): Free size_hints.
	(x_wm_set_size_hint): Allocate size_hints if needed.  Set
	size_hints.
	(mac_clear_font_name_table): New function.
	(mac_do_list_fonts): Initialize font_name_table if needed.
	(x_list_fonts): Don't initialize font_name_table.  Add BLOCK_INPUT
	around mac_do_list_fonts.
	(mac_unload_font): New function.
	(x_load_font): Add BLOCK_INPUT around XLoadQueryFont.
	(init_mac_drag_n_drop, mac_do_receive_drag): Enclose declarations
	and definitions with #if TARGET_API_MAC_CARBON.
	[USE_CARBON_EVENTS] (mac_handle_window_event): Add decl.
	(install_window_handler): Add decl.
	(do_window_update): Add BeginUpdate/EndUpdate for the tooltip
	window.  Use UpdateControls.  Get the rectangle that should be
	updated and restrict the target of expose_frame to it.
	(do_grow_window): Set minimum height/width according to
	size_hints.
	(do_grow_window) [TARGET_API_MAC_CARBON]: Use ResizeWindow.
	(do_zoom_window): Don't use x_set_window_size.
	[USE_CARBON_EVENTS] (mac_handle_window_event): New function.
	(install_window_handler): New function.
	[!USE_CARBON_EVENTS] (mouse_region): New variable.
	[!USE_CARBON_EVENTS] (mac_wait_next_event): New function.
	(XTread_socket) [USE_CARBON_EVENTS]: Move call to
	GetEventDispatcherTarget inside BLOCK_INPUT.
	(XTread_socket) [!USE_CARBON_EVENTS]: Use mac_wait_next_event.
	Update mouse_region when mouse is moved.
	(make_mac_frame): Remove.
	(make_mac_terminal_frame): Put in #ifdef MAC_OS8.  Initialize
	mouse pointer shapes.  Change values of f->left_pos and
	f->top_pos.  Don't use make_mac_frame.  Use NewCWindow.  Don't
	call ShowWindow.
	(mac_initialize_display_info) [MAC_OSX]: Create mac_id_name from
	Vinvocation_name and Vsystem_name.
	(mac_make_rdb): New function (from w32term.c).
	(mac_term_init): Use it.  Add BLOCK_INPUT.  Error if display has
	already been opened.  Don't pass argument to
	mac_initialize_display_info.  Don't set dpyinfo->height/width.
	Add entries to x_display_list and x_display_name_list.
	(x_delete_display): New function.
	(mac_initialize): Don't call mac_initialize_display_info.
	(syms_of_macterm) [!MAC_OSX]: Don't call Fprovide.
* macterm.h (check_mac): Add extern.
	(struct mac_output): New member size_hints.
	(FRAME_SIZE_HINTS): New macro.
	(mac_unload_font): Add extern.
* xdisp.c (expose_window, expose_frame): Remove kludges for Mac.
* xfaces.c (clear_font_table) [MAC_OS]: call mac_unload_font.
2004-12-27 17:27:30 +00:00
Richard M. Stallman
75fa7206f0 (Fread_file_name): Delete duplicates in
file-name-history when history_delete_duplicates is true.
2004-12-21 11:33:16 +00:00
Andreas Schwab
b72915a740 Don't declare Fmsdos_downcase_filename. 2004-11-07 11:08:45 +00:00
Jan Djärv
238a44a865 * dosfns.c (Fdos_memget, Fdos_memput): Use integer variable offs in
comparisons with integers instead of Lisp_Object address.
(Fmsdos_set_keyboard): Declare argument allkeys.

* msdos.c (IT_set_frame_parameters): Use EQ, not ==, for Lisp_Object:s.

* dired.c: extern declare Fmsdos_downcase_filename on MSDOS to avoid
int/Lisp_Object mixup.

* fileio.c: Ditto.
2004-11-07 09:13:26 +00:00
Kim F. Storm
d4a42098b2 (Ffile_modes): Doc fix.
(auto_save_1): Check for Ffile_modes nil value.
2004-11-05 12:33:07 +00:00
Jan Djärv
88208bb85c * fileio.c (Fnext_read_file_uses_dialog_p): New function. 2004-11-04 15:19:49 +00:00
Jan Djärv
f9d64bb358 * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Fx_file_dialog if only directories should be read.

* lisp.h: Fx_file_dialog takes 5 parameters.

* xfns.c (Fx_file_dialog): Both Motif and GTK version:  Add
parameter only_dir_p.
In Motif version, don't put DEFAULT_FILENAME in filter part of the
dialog, just text field part.  Do not add DEFAULT_FILENAME
to list of files if it isn't there.
In GTK version, pass only_dir_p parameter to xg_get_file_name.

* macfns.c (Fx_file_dialog): Add parameter only_dir_p.  Check
only_dir_p instead of comparing prompt to "Dired".  When using
a save dialog, add option kNavDontConfirmReplacement, change title
to "Enter name", change text for save button to "Ok".

* w32fns.c (Fx_file_dialog): Add parameter only_dir_p.  Check
only_dir_p instead of comparing prompt to "Dired".

* gtkutil.c (xg_get_file_with_chooser)
(xg_get_file_with_selection): New functions, only defined ifdef
HAVE_GTK_FILE_CHOOSER_DIALOG_NEW and HAVE_GTK_FILE_SELECTION_NEW
respectively.
(xg_get_file_name): Add parameter only_dir_p.
Call xg_get_file_with_chooser or xg_get_file_with_selection
depending on HAVE_GTK_FILE* and the value of use_old_gtk_file_dialog.
(xg_initialize): New DEFVAR_BOOL use_old_gtk_file_dialog.

* gtkutil.h (xg_get_file_name): Add parameter only_dir_p.
2004-11-02 08:21:16 +00:00
Michael Albinus
38fe4f64ed * fileio.c (auto_save_1) Call Ffile_modes for remote files. 2004-10-03 17:40:07 +00:00
Kenichi Handa
e254e5e586 (Finsert_file_contents): Be sure to free composition data. 2004-09-29 23:41:54 +00:00
Stefan Monnier
4b70e2c95f (Finsert_file_contents): Fix case of replacement in a narrowed buffer. 2004-09-15 00:28:04 +00:00
Luc Teirlinck
f844ba4efd Delete declaration for removed Vauto_save_file_format.
(build_annotations): Adapt to replacement of `auto-save-file-format'
with the new buffer-local variable `buffer-auto-save-file-format'.
(syms_of_fileio): Delete DEFVAR_LISP for auto-save-file-format.
2004-09-08 02:30:12 +00:00
Steven Tamm
2222855e83 Fixing whitespace style issue with #define 2004-08-29 16:56:17 +00:00
Steven Tamm
6eb3ee72e0 fileio.c (Fread_file_name): Call x_file_dialog on carbon on
tool-bar/menu click
macfns.c (Fx_file_dialog): Implemented using NavServices
2004-08-26 18:28:44 +00:00
John Paul Wallington
d35c2489f7 (Fread_file_name): Doc fix. 2004-08-14 12:47:42 +00:00
Stefan Monnier
0cedd530e3 (make_temp_name): Handle multibyte prefixes. 2004-08-07 20:57:19 +00:00
Richard M. Stallman
36e50520bb (Fwrite_region): Doc fix. 2004-07-24 21:39:32 +00:00
Luc Teirlinck
e5fcddc8f8 (Fvisited_file_modtime): Return a list of two integers,
instead of a cons.
2004-07-14 22:47:11 +00:00
John Paul Wallington
316ef0dcf1 (read_file_name_completion_ignore_case): New variable.
(syms_of_fileio): Declare and initialise it.
(Fread_file_name): Bind `completion-ignore-case' to respect it.
2004-07-04 21:08:56 +00:00
Richard M. Stallman
abd5b7f2f0 (Fread_file_name): Expand DIR if not absolute. 2004-05-22 22:17:17 +00:00
Andreas Schwab
f59abab94a (Frename_file): Remove extra argument in call to
Fmake_symbolic_link.
2004-05-10 11:55:18 +00:00
Jan Djärv
440c7d00c4 fileio.c (Frename_file): Put symlink handling inside #ifdef S_IFLNK. 2004-05-04 19:23:31 +00:00
Jan Djärv
f72b5416b9 * fileio.c (barf_or_query_if_file_exists): Use lstat.
(Frename_file): Handle renaming of symlinks across file systems.
2004-05-04 13:54:50 +00:00
Eli Zaretskii
819da85b3b (Fset_file_times): New function.
(syms_of_fileio): Intern and staticpro it.
2004-04-27 13:30:11 +00:00
Luc Teirlinck
d01ca4a8d2 (Fverify_visited_file_modtime, Fvisited_file_modtime):
Add hyperlink to Elisp manual to the docstring.
2004-04-15 02:32:32 +00:00
Stefan Monnier
72d967dd1a (Fread_file_name): Set completion-ignore-case for case-insensitive systems. 2004-03-18 02:58:45 +00:00
Eli Zaretskii
dcdbbb5dc5 (Fcopy_file): If NEWNAME is a directory, expand the
basename of FILE relative to it, not FILE itself.
2004-02-02 20:52:20 +00:00
Luc Teirlinck
238aedc973 (Fread_file_name_internal): Correctly handle the case where
insert-default-directory is nil.
(Fread_file_name): Always return an empty string if the user exits
with an empty minibuffer.  Adapt the docstring accordingly.
(syms_of_fileio): Adapt the docstring of insert-default-directory to
the change in Fread_file_name.
2004-01-31 04:24:23 +00:00
Richard M. Stallman
dc2628c113 (choose_write_coding_system): Ignore auto_saving
if using the visited file for auto saves.
(Fwrite_region): Don't update SAVE_MODIFF
if auto-saving in visited file.
2003-12-29 11:24:14 +00:00
Jan Djärv
03d6484ea4 Add variable use-file-dialog to control use of file dialogs. 2003-11-29 10:44:36 +00:00
Miles Bader
ab5796a9f9 Add arch taglines 2003-09-01 15:45:59 +00:00
Richard M. Stallman
2a6f12e29a (Fwrite_region): Fix conditional expression to issue the right message. 2003-08-17 00:24:34 +00:00
Stefan Monnier
29ea8ae9da (Finsert_file_contents): Use delete_all_overlays. 2003-07-22 19:07:49 +00:00
Stefan Monnier
854afafc34 (Finsert_file_contents): Use new type for overlays_(before|after). 2003-07-09 14:50:51 +00:00
Richard M. Stallman
0c328a0ef5 (Fwrite_region): Alternate messages for append and partial write. 2003-06-22 00:04:10 +00:00
Kai Großjohann
b8f75eda19 (Fcopy_file): Doc fix: copies file modes, too. 2003-06-13 08:40:16 +00:00
Kenichi Handa
4a38de71d8 (Fwrite_region): Save and restore restriction. 2003-06-12 23:23:48 +00:00
Kenichi Handa
356a62243a (Qauto_save_coding, auto_save_coding): New variables.
(Finsert_file_contents): If coding-system-for-read is bound to
Qauto_save_coding, use the coding system emacs-mule with special
setting for recovering a file.
(choose_write_coding_system): On auto saving, use the coding
system emacs-mule with special setting for auto saving.
(syms_of_fileio) <Qauto_save_coding>: Intern and staticpro it.
2003-05-31 01:58:13 +00:00
Richard M. Stallman
b4bd27c59a (Fdelete_file): Handle symlinks pointing to directories. 2003-05-16 18:50:24 +00:00
Jason Rumney
5adcec2317 (Ffile_symlink_p): Let handlers handle symlinks even
when system does not support them.
2003-05-07 22:14:01 +00:00