Pavel Roskin
5ff5f8e9d1
* edit-widget.h: Add new field loading_done.
...
* edit.c (edit_init): Set loading_done.
(edit_insert): Don't call edit_modification() before the file is
completely loaded.
2003-07-09 00:18:11 +00:00
Pavel Roskin
59593d0e1b
* edit-widget.h: Eliminate unused explicit_syntax field.
2003-07-08 23:58:36 +00:00
Pavel Roskin
729a855b29
* edit-widget.h: Stop misusing "unsigned char" for boolean.
...
Eliminate have_frame - it's unused. Adjust all dependencies.
2003-07-08 23:46:01 +00:00
Pavel Roskin
6b63507463
* editkeys.c: Leave only distinct entries in cooledit_key_map
...
and emacs_key_map. Move the rest to common_key_map.
2003-06-14 05:02:33 +00:00
Pavel Roskin
9dae056016
* editkeys.c (emacs_key_map): Move Atl-'>' and Alt-'<' ...
...
(common_key_map): ... here.
2003-06-10 00:35:55 +00:00
Pavel Roskin
4a398f0ee7
* editcmd.c (edit_ext_cmd): Fix memory leak.
2003-06-05 17:55:50 +00:00
Pavel Roskin
bdc56f331b
* editcmd.c: Implement pasting the output of any external
...
command.
* editmenu.c: Add menu entries for that.
* editcmddef.h: Add new command CK_ExtCmd.
2003-05-30 21:06:10 +00:00
Pavel Roskin
e95373535c
* edit.c: Move edit_modification() before actions to provide
...
proper repainting if there are dialogs invoked by actions.
2003-04-05 01:43:58 +00:00
Pavel Roskin
66a823861f
* editlock.c: Split lock into user@host and pid and report them
...
separately.
2003-04-05 01:29:15 +00:00
Pavel Roskin
ebf1bcfa33
* edit.c (edit_load_file): Use vfs_file_is_local(), not
...
vfs_current_is_local().
* editlock.c (edit_lock_file): Disable locking on VFS.
2003-04-02 22:25:00 +00:00
Pavel Roskin
d88b75838a
* editlock.c, editlock.h: New files. Implement file locking in
...
Emacs style, as documented in JED editor sources.
* Makefile.am: Add those files to build tree.
* edit-widget.c (WEdit): New property 'locked', 0 on edit_init.
* edit.c (edit_modification): Lock buffer on modification.
* editcmd.c (edit_save_cmd, edit_save_as_cmd): Handle locking
during file save.
(edit_load_file_from_filename): Unlock. Remove 2 duplicate
lines (handled by edit_init).
(edit_quit_cmd): Unlock.
2003-04-02 19:36:10 +00:00
Pavel Roskin
d4336795e6
* edit.h: Make it easier to tweak buffer size and maximal number
...
of buffers.
2003-03-12 07:07:27 +00:00
Pavel Roskin
7cdbc354c2
* editkeys.c (common_key_map): Delete previous word by
...
Alt-Backspace. Fix Ctrl-Backspace on some terminals.
Reported by Andrew V. Samoilov <sav@bcs.zp.ua>
2003-03-07 21:47:32 +00:00
Andrew V. Samoilov
6f35fce869
* syntax.c (edit_read_syntax_file): Fix segmentation violation.
2003-03-06 18:42:33 +00:00
Andrew V. Samoilov
902cd4834b
* syntax.c (edit_read_syntax_rules): Check for list of defines
...
is already initialized.
(edit_read_syntax_file): Process `include ...` before first
`file ...`, so color definitions can be stored separately.
2003-03-04 09:52:40 +00:00
Andrew V. Samoilov
599f3e8bfb
* syntax.c (subst_defines): New function to substitute defines.
...
(this_try_alloc_color_pair): Move color substitution ...
(edit_read_syntax_rules): ... here. Use subst_defines() to
substitute colors for contexts and keywords. Allow multiword
defines.
2003-03-03 13:37:45 +00:00
Andrew V. Samoilov
6a8a443ed2
* syntax.c (edit_read_syntax_rules): Add args argument and it
...
use instead of own auto args array to share this area with ...
(edit_read_syntax_file): ... this. Adjust for the above.
Use strncpy() instead of unsafe strcpy().
2003-02-26 19:01:40 +00:00
Pavel Roskin
0158eaf0f3
* syntax.c (defines): New static variable for list of defines.
...
(mc_defines_destroy): New function to release memory of key
pair.
(destroy_defines): New function to destroy list of defines
completely.
(this_try_alloc_color_pair): Use strncpy() instead of unsafe
strcpy(). Use values from list of defines to substitute given
parameters.
(edit_read_syntax_rules): Initialize list of defines and process
new "define" keyword. Use strncpy() instead of unsafe strcpy().
(edit_free_syntax_rules): Destroy list of defines.
2003-02-25 15:07:53 +00:00
Andrew V. Samoilov
ebc8d1690a
* editmenu.c (OptMenuEmacs): Define as OptMenu.
...
(SearReplMenuEmacs): Define as SearReplMenu.
(EditMenuEmacs): Define as EditMenu.
2003-02-21 23:32:06 +00:00
Pavel Roskin
0da0c44f87
* (OptMenu): Add "Learn Keys".
...
(OptMenuEmacs): Likewise.
2003-01-28 17:56:53 +00:00
Andrew V. Samoilov
a132b94cf9
* edit-widget.h (struct macro): Move definition ...
...
* edit.h: ... here to fix compilation on HP-UX.
2003-01-27 15:46:40 +00:00
Pavel Roskin
812bac9a33
* editkeys.c: Move key maps to the file scope. Put common keys
...
to a separate table common_key_map.
(edit_translate_key): Remove unused argument x_keycode.
2002-12-25 22:53:07 +00:00
Pavel Roskin
e0bbeb7085
* editkeys.c (edit_translate_key): Treat Shift-Enter as return
...
without indent. Useful when pasting multiline text with
Shift-button3 or Shift-Insert with autoindent enabled.
2002-12-25 05:46:03 +00:00
Pavel Roskin
554acb2837
* editkeys.c (edit_translate_key): Treat Ctrl-Home and Ctrl-End
...
like Ctrl-PgUp and Ctrl-PgDown respectively.
2002-12-23 10:18:22 +00:00
Pavel Roskin
ab43e6db88
* edit_key_translator.c: Rename to ...
...
* editkeys.c: ... this.
* edit.c (edit_translate_key): Move to editkeys.c.
* Makefile.am: Adjust for the above.
2002-12-23 10:13:35 +00:00
Pavel Roskin
d6947e39cf
* edit.c (edit_translate_key): Remove x_state argument, it's now
...
a part of x_keycode.
* editwidget.c (get_key_state): Remove.
2002-12-21 08:46:50 +00:00
Andrew V. Samoilov
4718c1105d
* editcmd.c (edit_block_process_cmd): Quote filename.
2002-12-19 13:01:34 +00:00
Andrew V. Samoilov
bce2ba99e9
* edit.h (edit_save_mode_t): New enum for file saving mode.
...
* editcmd.c (): Use edit_save_mode_t.
(pipe_mail): Quote to, subject and cc with name_quote().
* edit.c (edit_get_filter): Use quoted filename.
(edit_get_write_filter): Use quoted writename.
(edit_push_action): Use g_realloc().
2002-12-18 20:04:39 +00:00
Pavel Roskin
e0a241f570
* editcmd.c (edit_goto_cmd): Add support for negative line
...
numbers, which are counted from the last line. Use strtol(), so
hex numbers are supported as well.
2002-12-16 07:13:12 +00:00
Pavel Roskin
0454cf6eb1
* edit.c: Use edit->stack_disable instead of static variable.
2002-12-16 05:21:42 +00:00
Pavel Roskin
857565ca21
* edit.c (check_file_access): Use non-blocking open() followed
...
by fstat() to avoid race conditions. Don't ask users to
recompile the editor.
2002-12-16 01:59:49 +00:00
Pavel Roskin
8148b4973c
* edit.c (edit_reload): Don't initialize edit->macro_i, because
...
edit_init() takes care of it.
* editwidget.c (edit): Likewise.
2002-12-16 01:27:44 +00:00
Pavel Roskin
aaf569bd48
* edit.h: Don't inclide malloc.h. Use g_malloc() and g_free()
...
instead. Adjust all dependencies.
2002-12-15 18:55:53 +00:00
Pavel Roskin
77bd4c7f55
* edit.c (edit_load_file): Merge edit_open_file(). Disable fast
...
loading on non-local VFS because the file size can be wrong.
(init_dynamic_edit_buffers): Split into edit_init_buffers() and
edit_load_file_fast().
2002-12-15 09:47:25 +00:00
Pavel Roskin
433726e56b
* (edit_init): Move file loading to ...
...
(edit_load_file): ... a separate function.
2002-12-15 08:07:02 +00:00
Pavel Roskin
6716e7ecff
* edit.c (init_dynamic_edit_buffers): Remove unused code to
...
support loading text from buffer.
2002-12-15 06:53:52 +00:00
Pavel Roskin
ca658f44a6
* editcmd.c (edit_split_filename): Rename to edit_set_filename,
...
use g_malloc() and g_free() on edit->filename.
2002-12-15 02:40:38 +00:00
Andrew V. Samoilov
ce29907cce
Fix typo
2002-12-10 08:27:03 +00:00
Pavel Roskin
581cf41929
* edit.c (edit_open_file): Remove "text" and "text_size"
...
arguments. Adjust all callers.
2002-12-08 09:10:38 +00:00
Pavel Roskin
78155218a6
* edit.c (edit_move_to_column): Remove, use
...
edit_move_to_prev_col() instead.
2002-12-08 08:18:57 +00:00
Pavel Roskin
c935eaa6c2
* edit.c: Commit the rest of the position saving code.
...
(edit_load_position): New function, load position.
(edit_save_position): New function, save position.
(edit_init): Take new argument "line". If it's 0, load position
from .mc/filepos.
(edit_clean): Save file position to .mc/filepos even if the file
is not being saved.
* editwidget.c (edit): Don't set the initial line, pass it to
edit_init().
2002-12-08 07:47:59 +00:00
Pavel Roskin
2f2864e500
* syntax.c (edit_load_syntax): Reuse more informative error
...
message.
2002-12-08 01:57:35 +00:00
Pavel Roskin
c3cdbeb001
* edit.c (check_file_access): Use O_EXCL when opening new files.
...
Don't allow editing stale symlinks.
Reported by Max Derzhak <max@linux.zp.ua>
2002-12-08 00:55:03 +00:00
Pavel Roskin
f2ccab3adc
* edit-widget.h: Remove "from_here" and "to_here".
...
* edit.c (edit_purge_widget): New function - clean struct WEdit
except the Widget part.
2002-12-06 04:49:58 +00:00
Pavel Roskin
dceb3b50d4
* editcmd.c: Include dialog.h.
...
Reported by Frédéric L. W. Meunier <lists@pervalidus.net>
2002-12-04 07:20:19 +00:00
Pavel Roskin
dd7f5798fa
* edit.h: Remove "dir" field in WEdit - it's always an empty
...
string. Adjust all dependencies.
2002-11-30 19:50:51 +00:00
Pavel Roskin
9a4513aceb
* editcmd.c (edit_get_save_file): Remove first argument, it's
...
unused.
(edit_get_save_file): Likewise.
2002-11-30 18:49:20 +00:00
Pavel Roskin
75fbf0b2f5
* syntax.c: Make structures key_word, context_rule and
...
_syntax_marker opaque.
2002-11-30 18:07:42 +00:00
Pavel Roskin
41fbb5099f
* edit.c: Use g_malloc() and g_free() on buffers1 and buffers2.
...
Eliminate CMalloc.
(edit_get_buffer_as_text): Remove, it's unused.
2002-11-30 17:53:12 +00:00
Pavel Roskin
29f1543919
* editcmd.c (edit_set_search_parameters): Use g_malloc().
...
(edit_complete_word_cmd): Use g_free().
2002-11-30 17:41:07 +00:00