* edit.h: Removed the leading PATH_SEP_STR from EDIT_DIR, as the
latter is not an absolute directory. * edit.c: Adjusted the users of EDIT_DIR. * editcmd.c: Likewise. * syntax.c: Likewise. * src/user.c: Likewise.
Этот коммит содержится в:
родитель
249e1c43e7
Коммит
c29b321563
@ -1,3 +1,12 @@
|
|||||||
|
2006-02-03 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
|
* edit.h: Removed the leading PATH_SEP_STR from EDIT_DIR, as the
|
||||||
|
latter is not an absolute directory.
|
||||||
|
* edit.c: Adjusted the users of EDIT_DIR.
|
||||||
|
* editcmd.c: Likewise.
|
||||||
|
* syntax.c: Likewise.
|
||||||
|
* src/user.c: Likewise.
|
||||||
|
|
||||||
2006-02-02 Leonard den Ottolander <leonard den ottolander nl>
|
2006-02-02 Leonard den Ottolander <leonard den ottolander nl>
|
||||||
|
|
||||||
* edit.c (edit_execute_cmd): Reload syntax on toggle to on.
|
* edit.c (edit_execute_cmd): Reload syntax on toggle to on.
|
||||||
|
@ -2672,7 +2672,7 @@ user_menu (WEdit * edit)
|
|||||||
int nomark;
|
int nomark;
|
||||||
struct stat status;
|
struct stat status;
|
||||||
long start_mark, end_mark;
|
long start_mark, end_mark;
|
||||||
char *block_file = concat_dir_and_file (home_dir, BLOCK_FILE);
|
char *block_file = concat_dir_and_file (home_dir, PATH_SEP_STR BLOCK_FILE);
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
nomark = eval_marks (edit, &start_mark, &end_mark);
|
nomark = eval_marks (edit, &start_mark, &end_mark);
|
||||||
|
@ -297,7 +297,7 @@ extern int edit_confirm_save;
|
|||||||
extern int column_highlighting;
|
extern int column_highlighting;
|
||||||
|
|
||||||
/* File names */
|
/* File names */
|
||||||
#define EDIT_DIR PATH_SEP_STR ".mc" PATH_SEP_STR "cedit"
|
#define EDIT_DIR ".mc" PATH_SEP_STR "cedit"
|
||||||
#define SYNTAX_FILE EDIT_DIR PATH_SEP_STR "Syntax"
|
#define SYNTAX_FILE EDIT_DIR PATH_SEP_STR "Syntax"
|
||||||
#define CLIP_FILE EDIT_DIR PATH_SEP_STR "cooledit.clip"
|
#define CLIP_FILE EDIT_DIR PATH_SEP_STR "cooledit.clip"
|
||||||
#define MACRO_FILE EDIT_DIR PATH_SEP_STR "cooledit.macros"
|
#define MACRO_FILE EDIT_DIR PATH_SEP_STR "cooledit.macros"
|
||||||
|
@ -602,7 +602,7 @@ static FILE *edit_open_macro_file (const char *r)
|
|||||||
{
|
{
|
||||||
const char *filename;
|
const char *filename;
|
||||||
int file;
|
int file;
|
||||||
filename = catstrs (home_dir, MACRO_FILE, (char *) NULL);
|
filename = catstrs (home_dir, PATH_SEP_STR MACRO_FILE, (char *) NULL);
|
||||||
if ((file = open (filename, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1)
|
if ((file = open (filename, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1)
|
||||||
return 0;
|
return 0;
|
||||||
close (file);
|
close (file);
|
||||||
@ -640,7 +640,7 @@ edit_delete_macro (WEdit * edit, int k)
|
|||||||
if (saved_macros_loaded)
|
if (saved_macros_loaded)
|
||||||
if ((j = macro_exists (k)) < 0)
|
if ((j = macro_exists (k)) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
g = fopen (catstrs (home_dir, TEMP_FILE, (char *) NULL), "w");
|
g = fopen (catstrs (home_dir, PATH_SEP_STR TEMP_FILE, (char *) NULL), "w");
|
||||||
if (!g) {
|
if (!g) {
|
||||||
edit_error_dialog (_(" Delete macro "),
|
edit_error_dialog (_(" Delete macro "),
|
||||||
get_sys_error (_(" Cannot open temp file ")));
|
get_sys_error (_(" Cannot open temp file ")));
|
||||||
@ -670,7 +670,7 @@ edit_delete_macro (WEdit * edit, int k)
|
|||||||
}
|
}
|
||||||
fclose (f);
|
fclose (f);
|
||||||
fclose (g);
|
fclose (g);
|
||||||
if (rename (catstrs (home_dir, TEMP_FILE, (char *) NULL), catstrs (home_dir, MACRO_FILE, (char *) NULL)) == -1) {
|
if (rename (catstrs (home_dir, PATH_SEP_STR TEMP_FILE, (char *) NULL), catstrs (home_dir, PATH_SEP_STR MACRO_FILE, (char *) NULL)) == -1) {
|
||||||
edit_error_dialog (_(" Delete macro "),
|
edit_error_dialog (_(" Delete macro "),
|
||||||
get_sys_error (_(" Cannot overwrite macro file ")));
|
get_sys_error (_(" Cannot overwrite macro file ")));
|
||||||
return 1;
|
return 1;
|
||||||
@ -2233,7 +2233,7 @@ edit_save_block (WEdit * edit, const char *filename, long start,
|
|||||||
/* copies a block to clipboard file */
|
/* copies a block to clipboard file */
|
||||||
static int edit_save_block_to_clip_file (WEdit * edit, long start, long finish)
|
static int edit_save_block_to_clip_file (WEdit * edit, long start, long finish)
|
||||||
{
|
{
|
||||||
return edit_save_block (edit, catstrs (home_dir, CLIP_FILE, (char *) NULL), start, finish);
|
return edit_save_block (edit, catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL), start, finish);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2272,7 +2272,7 @@ int edit_cut_to_X_buf_cmd (WEdit * edit)
|
|||||||
|
|
||||||
void edit_paste_from_X_buf_cmd (WEdit * edit)
|
void edit_paste_from_X_buf_cmd (WEdit * edit)
|
||||||
{
|
{
|
||||||
edit_insert_file (edit, catstrs (home_dir, CLIP_FILE, (char *) NULL));
|
edit_insert_file (edit, catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2324,7 +2324,7 @@ edit_save_block_cmd (WEdit *edit)
|
|||||||
if (eval_marks (edit, &start_mark, &end_mark))
|
if (eval_marks (edit, &start_mark, &end_mark))
|
||||||
return 1;
|
return 1;
|
||||||
exp =
|
exp =
|
||||||
edit_get_save_file (catstrs (home_dir, CLIP_FILE, (char *) NULL),
|
edit_get_save_file (catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL),
|
||||||
_(" Save Block "));
|
_(" Save Block "));
|
||||||
edit_push_action (edit, KEY_PRESS + edit->start_display);
|
edit_push_action (edit, KEY_PRESS + edit->start_display);
|
||||||
if (exp) {
|
if (exp) {
|
||||||
@ -2353,7 +2353,7 @@ edit_save_block_cmd (WEdit *edit)
|
|||||||
int
|
int
|
||||||
edit_insert_file_cmd (WEdit *edit)
|
edit_insert_file_cmd (WEdit *edit)
|
||||||
{
|
{
|
||||||
char *exp = edit_get_load_file (catstrs (home_dir, CLIP_FILE, (char *) NULL),
|
char *exp = edit_get_load_file (catstrs (home_dir, PATH_SEP_STR CLIP_FILE, (char *) NULL),
|
||||||
_(" Insert File "));
|
_(" Insert File "));
|
||||||
edit_push_action (edit, KEY_PRESS + edit->start_display);
|
edit_push_action (edit, KEY_PRESS + edit->start_display);
|
||||||
if (exp) {
|
if (exp) {
|
||||||
@ -2389,7 +2389,7 @@ int edit_sort_cmd (WEdit * edit)
|
|||||||
edit_error_dialog (_(" Sort block "), _(" You must first highlight a block of text. "));
|
edit_error_dialog (_(" Sort block "), _(" You must first highlight a block of text. "));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
edit_save_block (edit, catstrs (home_dir, BLOCK_FILE, (char *) NULL), start_mark, end_mark);
|
edit_save_block (edit, catstrs (home_dir, PATH_SEP_STR BLOCK_FILE, (char *) NULL), start_mark, end_mark);
|
||||||
|
|
||||||
exp = input_dialog (_(" Run Sort "),
|
exp = input_dialog (_(" Run Sort "),
|
||||||
_(" Enter sort options (see manpage) separated by whitespace: "),
|
_(" Enter sort options (see manpage) separated by whitespace: "),
|
||||||
@ -2400,7 +2400,7 @@ int edit_sort_cmd (WEdit * edit)
|
|||||||
g_free (old);
|
g_free (old);
|
||||||
old = exp;
|
old = exp;
|
||||||
|
|
||||||
e = system (catstrs (" sort ", exp, " ", home_dir, BLOCK_FILE, " > ", home_dir, TEMP_FILE, (char *) NULL));
|
e = system (catstrs (" sort ", exp, " ", home_dir, PATH_SEP_STR BLOCK_FILE, " > ", home_dir, PATH_SEP_STR TEMP_FILE, (char *) NULL));
|
||||||
if (e) {
|
if (e) {
|
||||||
if (e == -1 || e == 127) {
|
if (e == -1 || e == 127) {
|
||||||
edit_error_dialog (_(" Sort "),
|
edit_error_dialog (_(" Sort "),
|
||||||
@ -2418,7 +2418,7 @@ int edit_sort_cmd (WEdit * edit)
|
|||||||
|
|
||||||
if (edit_block_delete_cmd (edit))
|
if (edit_block_delete_cmd (edit))
|
||||||
return 1;
|
return 1;
|
||||||
edit_insert_file (edit, catstrs (home_dir, TEMP_FILE, (char *) NULL));
|
edit_insert_file (edit, catstrs (home_dir, PATH_SEP_STR TEMP_FILE, (char *) NULL));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2439,7 +2439,7 @@ edit_ext_cmd (WEdit *edit)
|
|||||||
if (!exp)
|
if (!exp)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
e = system (catstrs (exp, " > ", home_dir, TEMP_FILE, (char *) NULL));
|
e = system (catstrs (exp, " > ", home_dir, PATH_SEP_STR TEMP_FILE, (char *) NULL));
|
||||||
g_free (exp);
|
g_free (exp);
|
||||||
|
|
||||||
if (e) {
|
if (e) {
|
||||||
@ -2450,7 +2450,7 @@ edit_ext_cmd (WEdit *edit)
|
|||||||
|
|
||||||
edit->force |= REDRAW_COMPLETELY;
|
edit->force |= REDRAW_COMPLETELY;
|
||||||
|
|
||||||
edit_insert_file (edit, catstrs (home_dir, TEMP_FILE, (char *) NULL));
|
edit_insert_file (edit, catstrs (home_dir, PATH_SEP_STR TEMP_FILE, (char *) NULL));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2471,8 +2471,8 @@ edit_block_process_cmd (WEdit *edit, const char *shell_cmd, int block)
|
|||||||
char *quoted_name = NULL;
|
char *quoted_name = NULL;
|
||||||
|
|
||||||
o = catstrs (mc_home, shell_cmd, (char *) NULL); /* original source script */
|
o = catstrs (mc_home, shell_cmd, (char *) NULL); /* original source script */
|
||||||
h = catstrs (home_dir, EDIT_DIR, shell_cmd, (char *) NULL); /* home script */
|
h = catstrs (home_dir, PATH_SEP_STR EDIT_DIR, shell_cmd, (char *) NULL); /* home script */
|
||||||
b = catstrs (home_dir, BLOCK_FILE, (char *) NULL); /* block file */
|
b = catstrs (home_dir, PATH_SEP_STR BLOCK_FILE, (char *) NULL); /* block file */
|
||||||
|
|
||||||
if (!(script_home = fopen (h, "r"))) {
|
if (!(script_home = fopen (h, "r"))) {
|
||||||
if (!(script_home = fopen (h, "w"))) {
|
if (!(script_home = fopen (h, "w"))) {
|
||||||
@ -2524,8 +2524,8 @@ edit_block_process_cmd (WEdit *edit, const char *shell_cmd, int block)
|
|||||||
* $3 - file where error messages should be put
|
* $3 - file where error messages should be put
|
||||||
* (for compatibility with old scripts).
|
* (for compatibility with old scripts).
|
||||||
*/
|
*/
|
||||||
system (catstrs (" ", home_dir, EDIT_DIR, shell_cmd, " ", quoted_name,
|
system (catstrs (" ", home_dir, PATH_SEP_STR EDIT_DIR, shell_cmd, " ", quoted_name,
|
||||||
" ", home_dir, BLOCK_FILE " /dev/null", (char *) NULL));
|
" ", home_dir, PATH_SEP_STR BLOCK_FILE " /dev/null", (char *) NULL));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
@ -2533,7 +2533,7 @@ edit_block_process_cmd (WEdit *edit, const char *shell_cmd, int block)
|
|||||||
* Arguments:
|
* Arguments:
|
||||||
* $1 - name of the edited file.
|
* $1 - name of the edited file.
|
||||||
*/
|
*/
|
||||||
system (catstrs (" ", home_dir, EDIT_DIR, shell_cmd, " ",
|
system (catstrs (" ", home_dir, PATH_SEP_STR EDIT_DIR, shell_cmd, " ",
|
||||||
quoted_name, (char *) NULL));
|
quoted_name, (char *) NULL));
|
||||||
}
|
}
|
||||||
g_free (quoted_name);
|
g_free (quoted_name);
|
||||||
|
@ -671,7 +671,7 @@ static FILE *open_include_file (const char *filename)
|
|||||||
return fopen (filename, "r");
|
return fopen (filename, "r");
|
||||||
|
|
||||||
g_free (error_file_name);
|
g_free (error_file_name);
|
||||||
error_file_name = g_strconcat (home_dir, EDIT_DIR PATH_SEP_STR,
|
error_file_name = g_strconcat (home_dir, PATH_SEP_STR EDIT_DIR PATH_SEP_STR,
|
||||||
filename, (char *) NULL);
|
filename, (char *) NULL);
|
||||||
f = fopen (error_file_name, "r");
|
f = fopen (error_file_name, "r");
|
||||||
if (f)
|
if (f)
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
update_panels().
|
update_panels().
|
||||||
* Makefile.am: ecs-test needs $(INTLLIBS).
|
* Makefile.am: ecs-test needs $(INTLLIBS).
|
||||||
* main.c (init_xterm_support): Eterm can handle mouse events, too.
|
* main.c (init_xterm_support): Eterm can handle mouse events, too.
|
||||||
|
* user.c: Adjusted the use of EDIT_DIR, since it has no leading
|
||||||
|
PATH_SEP_STR anymore.
|
||||||
|
|
||||||
2006-02-03 Roland Illig <roland.illig@gmx.de>
|
2006-02-03 Roland Illig <roland.illig@gmx.de>
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ expand_format (struct WEdit *edit_widget, char c, int quote)
|
|||||||
case 'k': /* block file name */
|
case 'k': /* block file name */
|
||||||
case 'b': /* block file name / strip extension */ {
|
case 'b': /* block file name / strip extension */ {
|
||||||
if (edit_widget) {
|
if (edit_widget) {
|
||||||
char *file = g_strconcat (home_dir, BLOCK_FILE, (char *) NULL);
|
char *file = g_strconcat (home_dir, PATH_SEP_STR BLOCK_FILE, (char *) NULL);
|
||||||
fname = (*quote_func) (file, 0);
|
fname = (*quote_func) (file, 0);
|
||||||
g_free (file);
|
g_free (file);
|
||||||
return fname;
|
return fname;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user