Commit Graph

106 Commits

Author SHA1 Message Date
Leonard den Ottolander 17108c8b2e edit/edit.c, edit/editcmddef.h, edit/editkeys.c: Add Ctrl-S to toggle syntax
highlighting.
2006-02-01 17:07:11 +00:00
Pavel Tsekov 450fe431fc * edit.c (edit_auto_indent): Remove redundant parameters.
Change the indentation strategy to copy whitespace
from the previous line instead of filling up with allegedly
equivalent whitespace depending on the tab setting.
(edit_execute_cmd): Accomodate change of parameters to
edit_auto_indent().
2006-01-26 15:42:56 +00:00
Roland Illig 9be77996d6 Replaced the
editor_option_backup_ext_int hack with a string configuration
	variable, which allows the backup extension to have more than
	just four characters.
2005-09-07 08:54:11 +00:00
Leonard den Ottolander f21564b9e6 * edit/choosesyntax.c: Create file. Menu option to override syntax
highlighting.
* edit/Makefile.am: Add choosesyntax.c.
* edit/edit.c (edit_init): Set option_auto_syntax to 1 on every invokation
of the editor.
* edit/edit.h: Pass char*** to edit_load_syntax(). Add parameters for
syntax dialog and override.
* edit/editmenu.c (menu_options): Add menu option to override syntax
hightlighting.
* edit/editoptions.c (edit_options_dialog): Pass option_syntax_type to
edit_load_syntax().
* edit/syntax.c (edit_read_syntax_file): Dynamically allocate and fill
syntax list pnames.
* edit/syntax.c (edit_load_syntax): Use char*** for syntax list.
* src/wtools.h: #include "widget.h" and remove redundant declarations
of Dlg_head and WListbox.
2005-07-24 13:37:58 +00:00
Roland Illig 073907ec5f * usermap.c: Allow user-defined keyboard bindings for mcedit.
* usermap.h: Likewise.
	* Makefile.am: Likewise.
	* editcmd.c: Define new editor commands which had been coded
	inline before.
	This change also affects some other files.
	* edit-widget.h: Invented a new type edit_key_map_type instead of
	using long for.
	* editkeys.c: Using that type.
2005-07-20 11:56:30 +00:00
Pavel Roskin 1f60f44145 Update postal address of Free Software Foundation. 2005-05-27 03:35:10 +00:00
Pavel Roskin 21ea3f6740 * *.c: Remove duplicate includes. 2005-05-10 20:57:11 +00:00
Roland Illig ecc08f6c60 * edit.h: Removed unnecessary #include directives ...
* *.c: ... and added them here.
2005-02-22 17:00:36 +00:00
Roland Illig 15342acba1 * edit.c: Fixed some whitespacing issues. 2005-02-07 20:28:13 +00:00
Roland Illig 05d2881a71 * *.c: Removed trailing whitespace. 2005-02-07 07:31:19 +00:00
Roland Illig 13737b1de1 * edit.c (user_menu): Don't use catstrs anymore. 2005-02-07 06:18:13 +00:00
Roland Illig 64eed6e12b * edit.h (catstrs): Changed the return type to "const char *".
* editcmd.c (catstrs): Likewise.
	* edit.c (user_menu): Added const qualifiers.
	* editcmd.c: Likewise.
	* syntax.c: Likewise.
2005-02-07 06:02:59 +00:00
Roland Illig c90e9d1b95 * edit.c: Improved message formatting. 2005-02-06 23:58:59 +00:00
Roland Illig 6dc6158ff1 * edit.h: Removed NO_INLINE_GETBYTE conditional. The name was
misleading, as it really meant INLINE_GETBYTE. Furthermore,
	it has not been working since the split of edit.h into edit-widget.h.
	* edit.c: Likewise.
2005-01-30 20:34:58 +00:00
Andrew V. Samoilov 12d24222db * edit.c (edit_clean): g_free handles NULL argument too,
no need for the comparison.
            (edit_move_backward_lots): Likewise.
        * editcmd.c (edit_set_filename): Likewise.
            (edit_replace_cmd): Likewise.
            (edit_search_cmd): Likewise.
            (edit_sort_cmd): Likewise.
            (edit_mail_dialog): Likewise.
        * syntax.c (syntax_g_free): Likewise.
            (edit_read_syntax_rules): Likewise.
2004-09-24 22:37:00 +00:00
Roland Illig 9c65d36bdd * edit.c: Replaced NULL with (char *) NULL. Likewise for 0, where
NULL was meant.
	* editcmd.c: Likewise.
	* editlock.c: Likewise.
	* editwidget.c: Likewise.
	* syntax.c: Likewise.
2004-09-24 14:57:57 +00:00
Roland Illig 243e84706e * Code cleanup: Added const qualifier for variables and
function declarations where possible. No functional changes.
2004-08-29 18:45:56 +00:00
Roland Illig 6cefb6d3bb Made the data type of some variables more appropriate. 2004-08-16 03:12:05 +00:00
Roland Illig 3b421b32bb Moved a semicolon outside of a declaration macro. 2004-08-15 19:34:37 +00:00
Pavel Roskin 90ae5d102d * edit.c (edit_execute_key_command): Return void, the result is
never used.
(edit_execute_cmd): Likewise.
2004-02-04 22:27:58 +00:00
Pavel Roskin 8bc40b44f0 Fix includes not to rely on $(top_srcdir) being in the include path. 2003-10-29 08:54:22 +00:00
Pavel Roskin e90a7540a2 * edit.h: Make static all functions and variables that don't
need to be global.  Remove unused functions.  Adjust all
dependencies.
2003-10-14 21:48:40 +00:00
Pavel Roskin 38265d418d * edit.h: Get rid of WIDGET_COMMAND, update all dependencies. 2003-09-07 19:08:07 +00:00
Pavel Roskin cf9acd036e * edit-widget.h: Resurrect "dir" field in WEdit to store
directory for relative filenames.

* edit.c (edit_clean): Release edit->dir.

* editcmd.c (edit_save_file): Use absolute filename.
Temporarily disable safe save and backups on remote VFS because
it doesn't work - again.
2003-07-31 16:38:07 +00:00
Pavel Roskin 58572c60da * edit.c (edit_execute_cmd): Enable user menu in mcedit. 2003-07-25 18:52:28 +00:00
Pavel Roskin dadbdd25e9 * editcmd.c (edit_quit_cmd): Rename to ...
(edit_ok_to_exit): ... this.  Don't stop dialog - this function
is called by the dialog code.
* editwidget.c (edit_dialog_callback): Process DLG_VALIDATE
event.  Don't exit it the user wants to continue editing.
* edit.c (edit_execute_cmd): Close the dialog - it will ask user
if necessary.
2003-07-21 03:54:47 +00:00
Pavel Roskin 9bc8df86ad * editcmd.c (edit_quit_cmd): Don't save this command in the undo
stack.  Don't force any refresh.  Don't delete unsaved files, do
it ...
* edit.c (edit_clean): ... here.  This ensures that unsaved
files from the mcedit command line are erased on Ctrl-n.
2003-07-20 23:24:25 +00:00
Pavel Roskin 4b8f0b02b2 * edit.c (edit_clean): Remove stale lock if any. 2003-07-09 00:21:09 +00:00
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 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 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 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 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 0454cf6eb1 * edit.c: Use edit->stack_disable instead of static variable. 2002-12-16 05:21:42 +00:00
Pavel Roskin 74714227fb Fix closing the same file twice. 2002-12-16 05:01:02 +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 2eb1245290 Comment change. 2002-12-16 01:38:24 +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 2048c47dfb Comment change. 2002-12-15 22:58:33 +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 ceb3e9eb60 Comment fixes. 2002-12-15 02:54:00 +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
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