1 2002-06-24 Pavel Roskin <proski@gnu.org>
3 * edit.c (check_file_access): Return 1 on all errors, document
4 this behavior. Set edit->delete_file to 1 for newly created
6 (edit_open_file): Don't set edit->delete_file, it's now done in
8 Reported by Saso <saso@bojler.dhs.org>
10 2002-05-13 Andrew V. Samoilov <kai@cmail.ru>
12 * editcmd.c (edit_save_file): Call mc_chown() and mc_chmod()
13 before mc_open() to prevent hangs over ftpfs.
15 * edit.h: Remove open, close, write, read and mkdir definitions.
16 * edit.c: Use mc_open, mc_close, mc_write, mc_read, mc_rename,
17 mc_chmod and mc_chown. Don't cast (char *) to (unsigned long)
18 in pointer arithmetics.
19 * editcmd.c: Likewise.
21 2002-03-25 Andrew V. Samoilov <kai@cmail.ru>
23 * syntax.c (edit_read_syntax_file): Use system wide Syntax
24 Highlighting definitions' file if there is no users one.
26 2002-03-18 Pavel Roskin <proski@gnu.org>
28 * edit.h: Use eregex.h, not regex.h.
29 From Alexander Varakin <avarakin00@hotmail.com>
31 2002-02-27 Andrew V. Samoilov <kai@cmail.ru>
33 * editcmd.c (edit_replace_cmd): Eliminate fin_string
34 and use message() to fix possible buffer overflow.
35 (edit_search_cmd): Likewise.
37 2002-02-18 Andrew V. Samoilov <kai@cmail.ru>
39 * syntax.c (convert): Fix buffer overflow for ".*\" cases.
41 2002-01-22 Pavel Roskin <proski@gnu.org>
43 * editdraw.c (edit_scroll_screen_over_cursor): Do nothing if the
44 edit widget has zero width or height.
46 2002-01-21 Pavel Roskin <proski@gnu.org>
48 * edit.c: Rename DELETE to DELCHAR to avoid macro redefinition
52 2002-01-21 Matthias Urban <murban@cs.uni-magdeburg.de>
54 * edit.c: Add support for CK_Complete_Word event.
55 * editcmddef.h: Likewise.
56 * edit_key_translator.c (cooledit_key_map): Bind Alt-Tab to
58 (emacs_key_map): Likewise.
59 * editcmd.c: Implement word completion.
61 2002-01-21 Pavel Roskin <proski@gnu.org>
63 * editmenu.c (CmdMenuEmacs): Add mail command without shortcut.
64 Users of emacs keys should be able to send mail too.
66 2002-01-15 Andrew V. Samoilov <kai@cmail.ru>
68 * syntax.c (syntax_g_free): New macro to release and NULLify
69 glib allocated memory area(s).
70 (strdup_convert): Rename to ...
71 (convert): ... this. Don't strdup passed string.
72 (get_args): Use convert instead of strdup_convert.
73 (free_args): Make it do notning macro.
74 (open_include_file): Eliminate p array. Use glib function to
75 construct error_file_name. Use PATH_SEP instead of '/';
76 (edit_read_syntax_file): Use PATH_SEP_STR.
77 (edit_load_syntax): Use syntax_g_free to release error_file_name.
78 (edit_read_syntax_rules): Likewise.
79 Eliminate c->single_char. It's only written but never read.
81 * edit.h (struct context_rule): Comment out single_char field.
82 It is written once but never read.
84 * edit-widget.h: Use PATH_SEP_STR.
86 2001-12-22 Andrew V. Samoilov <kai@cmail.ru>
88 * editcmd.c (edit_goto_cmd): Use g_free to release f.
89 (edit_save_file): Use PATH_SEP instead of '/'.
90 Undefine "close" before closing file created by mc_mkstemps.
91 Define close to mc_close after it - temporary fix.
93 (sprintf_p): Don't cast (char *) to (unsigned long).
95 * syntax.c (read_one_line): Undo last patch - errno is a
96 function on some systems. Check ferror() status before
97 everithing else if fgetc returns EOF.
98 Accept last line without trailing newline.
100 (compare_word_to_right): Don't cast p and q to unsigned long.
101 (apply_rules_going_right): Likewise.
103 2001-12-21 Pavel Roskin <proski@gnu.org>
105 * edit.c (user_menu): Don't move the cursor before and after
107 Reported by Matthias Urban <murban@cs.uni-magdeburg.de>
109 * syntax.c (read_one_line): Clear errno before using it. Don't
110 use the result of fgetc() if errno is EINTR.
112 2001-11-28 Andrew V. Samoilov <kai@cmail.ru>
114 * syntax.c (apply_rules_going_right): Fix crash for lines like
115 \s+ \n lightgray/13 red
117 (read_one_line): Use EOF instead of -1.
118 (get_args): Fix buffer overflow for l without trailing
120 (break_a): New macro.
121 (edit_read_syntax_rules): Use break_a to fix memory leaks.
122 (edit_load_syntax): Eliminate s and use message to prevent
125 * editdraw.c (edit_render): Eliminate f. It's only written
128 2001-11-27 Andrew V. Samoilov <kai@cmail.ru>
130 * editmenu.c (edit_wrap_cmd): Use g_free() on the result
133 2001-11-22 Andrew V. Samoilov <kai@cmail.ru>
135 * editcmd.c (edit_save_file): Use g_free() on the result of
137 (edit_replace_cmd): Fix rare memory leaks.
139 2001-11-19 Andrew V. Samoilov <kai@cmail.ru>
141 * edit.c (edit_renew): Release dir after use.
143 * editcmd.c (edit_replace_dialog): Eliminate tsearch_text,
144 treplace_text and targ_order.
145 (edit_replace_cmd): edit_replace_dialog gives g_malloced
146 strings, so g_strdup/g_free have to be used. Accept only
147 positive pattern number in Scanf search and replace.
148 (edit_save_file): Enable safe save and backups on remote VFS.
150 2001-11-16 Andrew V. Samoilov <kai@cmail.ru>
152 * edit_key_translator.c (cooledit_key_map):
153 Add C-k, CK_Delete_To_Line_End.
155 * edit.c (user_menu): Don't assign block_file twice.
157 2001-11-07 Andrew V. Samoilov <kai@cmail.ru>
159 * edit.c (edit_reload): destroy_dlg g_free()s widget(s), so
160 g_malloc/g_free have to be used.
161 (edit_init): Ditto. Eliminate st.
163 2001-11-05 Andrew V. Samoilov <kai@cmail.ru>
165 * edit.h (edit_execute_cmd): Declare it here.
167 * edit.c: Remove edit_execute_cmd declaration.
168 (edit_execute_cmd): Use edit_print_string instead of edit_printf.
170 * editcmd.c: Remove edit_execute_cmd declaration.
171 (edit_search_dialog): Eliminate tsearch_text.
172 (edit_search_cmd): edit_search_dialog gives g_malloc()ed exp.
173 Use g_strdup/g_free instead of strdup/free.
174 (edit_mail_dialog): quick_dialog use g_strdup, so g_free
176 (edit_load_cmd): input_dialog returns g_malloc(ed) string,
177 so g_free has to be used.
178 (edit_save_block_cmd): Likewise.
179 (edit_insert_file_cmd): Likewise.
180 (edit_sort_cmd): Likewise.
181 (edit_save_as_cmd): Likewise. Memory leak fixed.
183 * bookmark.c (book_mark_clear): Eliminate rend.
184 It's only written but never read.
185 (book_mark_flush): Likewise.
186 (book_mark_inc): Likewise.
187 (book_mark_dec): Likewise.
189 2001-10-23 Pavel Roskin <proski@gnu.org>
191 * edit.c (user_menu): If the error file is missing, treat it as
192 success. Truncate block file unconditionally.
194 2001-10-22 Pavel Roskin <proski@gnu.org>
196 * edit.c: Stop using _EDIT_C definition. Move variable
197 declarations from edit.h, make static or eliminate if possible.
198 Report errors immediately.
200 * editwidget.c (edit): Don't report errors from edit_init(),
201 they are reported in place.
203 2001-10-20 Pavel Roskin <proski@gnu.org>
205 * editcmd.c (sprintf_p): Declare with the printf attribute.
208 * edit.h: Declare edit_printf() with the printf attribute.
210 2001-10-18 Pavel Roskin <proski@gnu.org>
212 * edit.c (check_file_access): Only allow to edit regular files.
213 Use stat() before open() to prevent hangs on pipes, use fstat()
214 afterwards if stat() was unsuccessful.
216 2001-09-17 Pavel Roskin <proski@gnu.org>
218 * edit.h: Don't use macro `stat' - it's already a macro on
219 Solaris 8 with large file support.
220 * editcmd.c: Replace stat() with mc_stat().
223 2001-09-11 Pavel Roskin <proski@gnu.org>
225 * syntax.c (syntax_text): Remove, it's a separate file now.
226 (upgrade_syntax_file): Remove.
227 (edit_read_syntax_file): Use check_for_default().
229 2001-09-08 Pavel Roskin <proski@gnu.org>
231 * edit.h: Remove some useless definitions.
233 2001-09-07 Pavel Roskin <proski@gnu.org>
235 * Makefile.am: Don't define "MIDNIGHT" - it's unused now.
237 * edit.c: Eliminate all code disabled for the text edition.
238 * editcmddef.h: Likewise.
239 * editmenu.c: Likewise.
240 * editwidget.c: Likewise.
241 * syntax.c: Likewise.
242 * wordproc.c: Likewise.
244 * edit-widget.h: Change ~/.cedit to ~/.mc/cedit to keep mcedit
245 files separate from cooledit.
247 * bookmark.c: Eliminate all code disabled for the text edition.
248 * edit-widget.h: Likewise.
249 * editcmd.c: Likewise.
250 * editdraw.c: Likewise.
251 * editoptions.c: Likewise.
253 * edit.h: Eliminate all code disabled for the text edition.
254 Reorder and simplify includes.
257 2001-09-06 Pavel Roskin <proski@gnu.org>
259 * syntax.c (syntax_text): Add PHP support from Cooledit.
261 2001-09-04 Pavel Roskin <proski@gnu.org>
263 * Makefile.am (AM_CFLAGS): Remove CFLAGS, don't use substituted
266 * syntax.c (syntax_text): Remove useless ']' in the Perl and
267 Python rules. Change shell script rule to use more portable
270 * editcmd.c (edit_block_process_cmd): Prepend space to the
271 command to avoid polluting bash history. Document arguments.
272 Fix crash if block is 0 - not used currently.
274 2001-08-26 Pavel Roskin <proski@gnu.org>
276 * Makefile.am: Don't install libedit.a.
278 * Makefile.in: Converted to ...
279 * Makefile.am: ... this.
281 2001-08-24 Pavel Roskin <proski@gnu.org>
283 * Makefile.in (EDITSRC): Add headers.
284 (CPPFLAGS): Remove reference to gtkedit.
286 Copy all necessary files from gtkedit.
287 * Makefile.in (EDITLINKS): Merge with EDITSRC, remove all
290 2001-08-24 Pavel Roskin <proski@gnu.org>
292 * syntax.c (syntax_text): Fix recognizing pdksh and zsh scripts.
294 2001-08-23 Pavel Roskin <proski@gnu.org>
296 * editcmd.c (edit_block_process_cmd): Use execute(), not
297 my_system() to relieve interactive scripts, such as spell
298 checker, from saving and restoring the terminal.
300 2001-08-19 Pavel Roskin <proski@gnu.org>
302 * gtkedit.c: Include <sys/param.h> if present - it should always
303 be included before <glib.h> to avoid redefining MIN and MAX.
304 * editcmd.c [!MIDNIGHT]: Undefine B_ENTER and B_CANCEL before
307 * edit.h: Include <sys/param.h> if present. Include Gtk+
308 headers as system headers.
309 * gtkedit.c: Include Gtk+ headers as system headers.
311 2001-08-18 Pavel Roskin <proski@gnu.org>
313 * syntax.c (syntax_text): Highlight *.pot as PO files.
315 * edit.h [GTK]: Fix definition of edit_message_dialog().
316 * gtkedit.c (gtk_edit_dialog_message): Use "OK" button, not
317 "Cancel", for consistency with the text edition.
319 2001-08-17 Pavel Roskin <proski@gnu.org>
321 * syntax.c (syntax_text): Add support for PO files.
323 2001-08-12 Pavel Roskin <proski@gnu.org>
325 * edit.c: Handle CK_Shell.
326 * editcmddef.h: Define CK_Shell.
327 * editmenu.c (FileMenu): Remove C-o from the "Open file..."
329 (FileMenuEmacs): Likewise.
331 2001-08-06 Andrew V. Samoilov <kai@cmail.ru>
333 * editcmd.c (edit_replace_prompt): Fix menu location calculation.
335 2001-08-01 Pavel Roskin <proski@gnu.org>
337 * editcmd.c (edit_save_file): Temporarily disable safe save
338 and backups on remote VFS because it doesn't work. Use
339 mc_mkstemps() instead of tempnam().
341 2001-07-29 Pavel Roskin <proski@gnu.org>
343 * syntax.c (syntax_text): Add support for S-Lang.
345 2001-07-28 Pavel Roskin <proski@gnu.org>
347 * editcmd.c (menu_save_mode_cmd): Resurrect i18n code lost in
348 the last resync with Cooledit.
349 Reported by David Martin <dmartina@excite.es>
351 * gtkedit.c (gtk_edit_delete_cb): Handler for "delete_event".
354 2001-07-27 Pavel Roskin <proski@gnu.org>
356 * edit.c: Fix include.
358 2001-07-20 Pavel Roskin <proski@gnu.org>
360 * syntax.c (open_include_file) [GTK]: Use mc_home instead of
363 2001-07-19 Pavel Roskin <proski@gnu.org>
365 * editcmd.c (edit_canonicalize_pathname): Don't ever use
366 getwd(), use g_get_current_dir() instead.
368 * editoptions.c (edit_options_dialog): Call edit_load_syntax()
369 if user turned syntax highlighting off to unload the rules.
371 2001-07-17 Pavel Roskin <proski@gnu.org>
373 * edit.h [MIDNIGHT]: Declare wedit.
374 * editmenu.c: Remove wedit declaration.
375 * editoptions.c (edit_options_dialog): Load syntax rules if user
376 turned syntax highlighting on.
377 * syntax.c (edit_load_syntax): Don't load rules if syntax
378 highlighting is disabled.
380 2001-07-13 Pavel Roskin <proski@gnu.org>
382 * editoptions.c (edit_options_dialog): Allow numbers for tab
383 spacing. Reported by mharris@redhat.com.
384 http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=34852
386 * editcmd.c (menu_save_mode_cmd): Give meaningful names to the
387 input fields instead of "i" so that they have separate history.
388 * editoptions.c (edit_options_dialog): Likewise.
390 2001-07-11 Pavel Roskin <proski@gnu.org>
392 * editdraw.c (status_string): Use g_snprintf() instead of
394 From Libor Motyèka <l_motycka@ortex.cz>
396 2001-07-10 Pavel Roskin <proski@gnu.org>
398 * gtkeditkey.c (edit_translate_key): When processing bindings
399 with Alt check that Shift is not pressed - it's handled later.
401 2001-07-05 Pavel Roskin <proski@gnu.org>
403 * editdraw.c: Comment fixes.
405 2001-06-26 Pavel Roskin <proski@gnu.org>
407 * edit-widget.h (editor_widget): Rename `stat' to `stat1' to
408 avoid problems on Solaris with 64-bit file access, when `stat'
409 is a macro. All users adjusted.
410 Reported by Maksym Polyakov <polyama@yahoo.com>.
412 2001-06-25 Pavel Roskin <proski@gnu.org>
414 * gtkedit.c: Remove home_dir - it's declared in main.c.
416 2001-06-15 Pavel Roskin <proski@gnu.org>
418 * editcmd.c (canonicalize_pathname) [GTK]: Rename to ...
419 (edit_canonicalize_pathname): ... this to avoid namespace clash.
420 * edit.h [MIDNIGHT]: Include "src/cmd.h" and "src/user.h".
421 Remove declarations duplicating "src/user.h".
422 [GTK]: Include "src/dialog.h" and "src/util.h".
424 * editmenu.c (edit_wrap_cmd): Fix declaration.
425 (edit_about_cmd): Likewise.
426 * editwidget.c (get_key_state): Likewise.
428 * editcmd.c (edit_quit_cmd): Don't use strcmp on the result of
429 gtk_dialog_cauldron() since it's NULL if the dialog has been
430 closed without using buttons.
432 * edit.c (edit_execute_cmd): Put time format to a variable to
433 avoid gcc warning about Y2K issues with %c in strftime().
435 2001-06-14 Pavel Roskin <proski@gnu.org>
437 * edit.c: Declare cmd_F* static. Comment out cmd_F9.
439 * edit.c: Use indented #error for compatibility with old C
442 2001-06-13 Pavel Roskin <proski@gnu.org>
444 * edit.c (edit_execute_cmd) [GTK]: Disable user menu - it
446 (user_menu) [GTK]: Disable.
447 * gtkedit.c (tb_items): Use complete words. Disable pull-down
450 2001-06-09 Pavel Roskin <proski@gnu.org>
452 * editcmd.c (catstrs): Use interactive_display() without
453 specifying the help file.
454 From Andrew V. Samoilov.
456 2001-06-08 Andrew V. Samoilov <sav@bcs.zp.ua>
458 * editcmd.c [HAVE_CHARSET]: Really include charset.h.
459 * editmenu.c (edit_wrap_cmd): Memory leaking fixed.
461 2001-06-05 Pavel Roskin <proski@gnu.org>
463 * edit.c [HAVE_CHARSET]: Include charsets.h and selcodepage.h.
464 * editcmd.c [HAVE_CHARSET]: Add charset conversion support.
465 * editdraw.c [HAVE_CHARSET]: Likewise.
466 From Andrew V. Samoilov <sav@bcs.zp.ua>
467 and Walery Studennikov <hqsoftware@mail.ru>.
469 2001-06-01 Pavel Roskin <proski@gnu.org>
471 * gtkedit.h: Warning fix - use stricter declarations for
472 destroy_me and destroy_me_user_data.
474 2001-05-31 Pavel Roskin <proski@gnu.org>
476 * Makefile.in: Define HAVE_X and HAVE_GNOME, not just GTK -
477 header files are using them.
479 * editdraw.c (edit_render) [GTK]: Revert previous patch, it
482 2001-05-31 Andrew V. Samoilov <sav@bcs.zp.ua>
484 * editdraw.c (edit_status): Use strcpy (s, ) instead of
487 (set_color) [MIDNIGHT]: Became a macro.
488 (render_edit_text) [defined(MIDNIGHT) || defined(GTK)]: Warning fix.
489 (edit_render) [GTK]: Eliminate win variable.
490 (key_pending) [!GTK]: Warning fix.
492 2001-05-30 Pavel Roskin <proski@gnu.org>
494 * editdraw.c (status_string): Use is_printable(). Declare
495 static. Eliminate intermediate buffer. Use memset() for filling.
496 Print byte as unsigned. Use C notation for hex numbers.
498 * editdraw.c (status_string): Don't print non-printable chars.
499 Better formatting. Print "<EOF>" at the end of file instead of
500 -1. Use snprintf instead of sprintf.
502 2001-05-30 Andrew V. Samoilov <sav@bcs.zp.ua>
504 * syntax.c (open_include_file) [MIDNIGHT]: Don't hardcode location
505 of syntax file(s) with LIBDIR, use mc_home instead.
506 From Ludovic Drolez <ludovic.drolez@freealter.com>.
508 (syntax_text): Use perl.syntax to highlight perl modules (.pm).
510 2001-05-18 Pavel Roskin <proski@gnu.org>
512 * editcmd.c (edit_replace_prompt): Warning fix.
514 2001-02-26 Pavel Roskin <proski@gnu.org>
516 * editcmd.c (edit_delete_macro_cmd) [MIDNIGHT]: Don't use
517 CK_Macro on the argument to edit_delete_macro().
519 * edit.c (edit_init_file): Remove, it's useless. All the
520 necessary files should be created when needed.
521 * edit.h: Remove declaration of edit_init_file().
523 2000-11-01 Andrew V. Samoilov <sav@bcs.zp.ua>
525 * editcmd.c (canonicalize_pathname) [GTK]: memory leaking fixed
527 2000-10-30 Pavel Roskin <proski@gnu.org>
529 * editcmd.c (canonicalize_pathname) [GTK]: Make the argument
531 (edit_split_filename) [GTK]: Make the second argument constant
532 to match the declaration.
534 2000-10-30 Andrew V. Samoilov <sav@bcs.zp.ua>
536 * editcmd.c (edit_save_file): better error handling on writting
538 (edit_sort_cmd): saved sort options proposed in dialog
540 edit.h, editcmd.c: declaration for edit_save_block () added
542 (edit_split_filename): f constified
544 * edit.c (edit_init) [ENABLE_NLS]: option_whole_chars_search
545 expanded by national letters using current locale on first call
547 (edit_file_is_open) [MIDNIGHT]: all occurences and related code
550 (edit_execute_cmd): typo in error message fixed
552 2000-09-30 Pavel Roskin <proski@gnu.org>
554 * libgettext.h: Removed, shouldn't be here.
555 * Makefile.in: Adjusted to remove libgettext.h
557 2000-09-15 Andrew V. Samoilov <sav@bcs.zp.ua>
559 * editcmd.c (edit_delete_macro, edit_(load|save)_macro_cmd): don't
560 translate keywords written to macro file or macro don't work, at least
561 for Cyrillic. Made this as separate commit, so, if it seriously breaks
562 compatibility it's easy to revert it.
564 2000-09-15 Andrew V. Samoilov <sav@bcs.zp.ua>
566 * editcmd.c (edit_save_file): fopen()+fwrite()+fclose() replaced
567 by open()+write()+close() to restore possibility to edit files
568 over Midnight Commander's VFSes
570 (edit_replace_cmd) [MIDNIGHT]: some more right algorithm to calculate
571 menu coordinates used. I don't like if menu hides replaced text.
573 (edit_goto_cmd): Memory leaking fixed when f is empty string
575 2000-09-07 Andrew V. Samoilov <sav@bcs.zp.ua>
577 * edit.c (check_file_access) [MIDNIGHT,GTK]: error message localized;
578 some cosmetics changes to avoid annoying warnings
580 * editcmd.c (edit_save_file): pclose returns 0 on success,
581 file fclose()d when fwrite fails
583 (pipe_mail): malloc () + sprintf () replaced by g_strdup_printf ()
585 * syntax.c (syntax_text): Makefile replaced by [Mm]akefile to cover
586 makefile and GNUmakefile
587 (upgrade_syntax_file): infinitive loop fixed when rule file
588 is outdated but it cannot be unlinked/overwritten
590 2000-08-30 Pavel Roskin <proski@gnu.org>
592 * editwidget.c [!MIDNIGHT]: include xdnd.h
593 * Makefile.in: distribute xdnd.h
595 2000-08-18 Pavel Roskin <proski@gnu.org>
597 * Makefile.in: adjusted list of distributed files.
598 Added rule for rebuilding Makefile
600 2000-08-08 Pavel Roskin <proski@gnu.org>
602 * gtkedit.c [GTK]: don't include mousemark.h
603 * gtkedit.h [GTK]: likewise
605 2000-08-03 Pavel Roskin <proski@gnu.org>
607 * mousemark.c, mousemark.h: removed
608 * Makefile.in: don't distribute mousemark.h
609 * gtkedit.c [MIDNIGHT]: don't include mousemark.h
610 * gtkedit.h [MIDNIGHT]: likewise
612 2000-07-20 Andrew V. Samoilov <sav@bcs.zp.ua>
614 * gtkedit/editcmd.c (edit_save_file): check fclose()s return value
615 to prevent loss of data
616 (edit_block_process_cmd): don't translate empty string
618 * gtkedit/edit.h (edit_get_write_filter, edit_write_stream,
619 edit_init_file): added declarations
621 * edit.c (edit_filters): constified
622 (edit_get_write_filter): filename constified
623 (user_menu): don't translate empty string
625 * syntax.c (syntax_text): constified
626 (upgrade_syntax_file): syntax_line constified, f closed after use