1
0
forked from aniani/vim

patch 8.1.1767: FEAT_SESSION defined separately

Problem:    FEAT_SESSION defined separately.
Solution:   Make FEAT_SESSION depend on FEAT_EVAL.
This commit is contained in:
Bram Moolenaar
2019-07-28 15:21:55 +02:00
parent 2a9c9f6d89
commit f96ae0b5a2
7 changed files with 26 additions and 33 deletions

View File

@@ -231,9 +231,7 @@ static void f_matchstr(typval_T *argvars, typval_T *rettv);
static void f_matchstrpos(typval_T *argvars, typval_T *rettv); static void f_matchstrpos(typval_T *argvars, typval_T *rettv);
static void f_max(typval_T *argvars, typval_T *rettv); static void f_max(typval_T *argvars, typval_T *rettv);
static void f_min(typval_T *argvars, typval_T *rettv); static void f_min(typval_T *argvars, typval_T *rettv);
#ifdef vim_mkdir
static void f_mkdir(typval_T *argvars, typval_T *rettv); static void f_mkdir(typval_T *argvars, typval_T *rettv);
#endif
static void f_mode(typval_T *argvars, typval_T *rettv); static void f_mode(typval_T *argvars, typval_T *rettv);
#ifdef FEAT_MZSCHEME #ifdef FEAT_MZSCHEME
static void f_mzeval(typval_T *argvars, typval_T *rettv); static void f_mzeval(typval_T *argvars, typval_T *rettv);
@@ -694,9 +692,7 @@ static struct fst
{"matchstrpos", 2, 4, f_matchstrpos}, {"matchstrpos", 2, 4, f_matchstrpos},
{"max", 1, 1, f_max}, {"max", 1, 1, f_max},
{"min", 1, 1, f_min}, {"min", 1, 1, f_min},
#ifdef vim_mkdir
{"mkdir", 1, 3, f_mkdir}, {"mkdir", 1, 3, f_mkdir},
#endif
{"mode", 0, 1, f_mode}, {"mode", 0, 1, f_mode},
#ifdef FEAT_MZSCHEME #ifdef FEAT_MZSCHEME
{"mzeval", 1, 1, f_mzeval}, {"mzeval", 1, 1, f_mzeval},
@@ -7945,7 +7941,6 @@ mkdir_recurse(char_u *dir, int prot)
return r; return r;
} }
#ifdef vim_mkdir
/* /*
* "mkdir()" function * "mkdir()" function
*/ */
@@ -7989,7 +7984,6 @@ f_mkdir(typval_T *argvars, typval_T *rettv)
} }
rettv->vval.v_number = vim_mkdir_emsg(dir, prot); rettv->vval.v_number = vim_mkdir_emsg(dir, prot);
} }
#endif
/* /*
* "mode()" function * "mode()" function

View File

@@ -307,7 +307,6 @@ static void ex_tag_cmd(exarg_T *eap, char_u *name);
static char_u *arg_all(void); static char_u *arg_all(void);
#ifndef FEAT_SESSION #ifndef FEAT_SESSION
# define ex_loadview ex_ni # define ex_loadview ex_ni
# define ex_mkrc ex_ni
#endif #endif
#ifndef FEAT_EVAL #ifndef FEAT_EVAL
# define ex_compiler ex_ni # define ex_compiler ex_ni
@@ -8433,8 +8432,7 @@ close_redir(void)
#endif #endif
} }
#if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \ #if (defined(FEAT_SESSION) || defined(FEAT_EVAL)) || defined(PROTO)
|| defined(PROTO)
int int
vim_mkdir_emsg(char_u *name, int prot) vim_mkdir_emsg(char_u *name, int prot)
{ {

View File

@@ -559,9 +559,9 @@
/* /*
* +mksession ":mksession" command. * +mksession ":mksession" command.
* Requires +windows and +vertsplit. * fully depends on +eval
*/ */
#if defined(FEAT_NORMAL) #if defined(FEAT_EVAL)
# define FEAT_SESSION # define FEAT_SESSION
#endif #endif

View File

@@ -159,7 +159,11 @@ static const GtkTargetEntry dnd_targets[] =
*/ */
# define DEFAULT_FONT "Monospace 10" # define DEFAULT_FONT "Monospace 10"
#if !(defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)) #if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)
# define USE_GNOME_SESSION
#endif
#if !defined(FEAT_GUI_GNOME)
/* /*
* Atoms used to communicate save-yourself from the X11 session manager. There * Atoms used to communicate save-yourself from the X11 session manager. There
* is no need to move them into the GUI struct, since they should be constant. * is no need to move them into the GUI struct, since they should be constant.
@@ -377,7 +381,7 @@ static int gui_argc = 0;
static char **gui_argv = NULL; static char **gui_argv = NULL;
static const char *role_argument = NULL; static const char *role_argument = NULL;
#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) #if defined(USE_GNOME_SESSION)
static const char *restart_command = NULL; static const char *restart_command = NULL;
static char *abs_restart_command = NULL; static char *abs_restart_command = NULL;
#endif #endif
@@ -404,7 +408,7 @@ gui_mch_prepare(int *argc, char **argv)
int i = 0; int i = 0;
int len = 0; int len = 0;
#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) #if defined(USE_GNOME_SESSION)
/* /*
* Determine the command used to invoke Vim, to be passed as restart * Determine the command used to invoke Vim, to be passed as restart
* command to the session manager. If argv[0] contains any directory * command to the session manager. If argv[0] contains any directory
@@ -580,7 +584,7 @@ gui_mch_prepare(int *argc, char **argv)
gui_mch_free_all(void) gui_mch_free_all(void)
{ {
vim_free(gui_argv); vim_free(gui_argv);
#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) #if defined(USE_GNOME_SESSION)
vim_free(abs_restart_command); vim_free(abs_restart_command);
#endif #endif
} }
@@ -2274,7 +2278,7 @@ drag_data_received_cb(GtkWidget *widget,
#endif /* FEAT_DND */ #endif /* FEAT_DND */
#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) #if defined(USE_GNOME_SESSION)
/* /*
* GnomeClient interact callback. Check for unsaved buffers that cannot * GnomeClient interact callback. Check for unsaved buffers that cannot
* be abandoned and pop up a dialog asking the user for confirmation if * be abandoned and pop up a dialog asking the user for confirmation if
@@ -2437,7 +2441,7 @@ setup_save_yourself(void)
} }
} }
#else /* !(FEAT_GUI_GNOME && FEAT_SESSION) */ #else // !USE_GNOME_SESSION
# ifdef USE_XSMP # ifdef USE_XSMP
/* /*
@@ -2571,7 +2575,7 @@ global_event_filter(GdkXEvent *xev,
return GDK_FILTER_CONTINUE; return GDK_FILTER_CONTINUE;
} }
#endif /* !(FEAT_GUI_GNOME && FEAT_SESSION) */ #endif // !USE_GNOME_SESSION
/* /*
@@ -2624,14 +2628,14 @@ mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED)
g_list_free(icons); g_list_free(icons);
} }
#if !(defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)) #if !defined(USE_GNOME_SESSION)
/* Register a handler for WM_SAVE_YOURSELF with GDK's low-level X I/F */ /* Register a handler for WM_SAVE_YOURSELF with GDK's low-level X I/F */
gdk_window_add_filter(NULL, &global_event_filter, NULL); gdk_window_add_filter(NULL, &global_event_filter, NULL);
#endif #endif
/* Setup to indicate to the window manager that we want to catch the /* Setup to indicate to the window manager that we want to catch the
* WM_SAVE_YOURSELF event. For GNOME, this connects to the session * WM_SAVE_YOURSELF event. For GNOME, this connects to the session
* manager instead. */ * manager instead. */
#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) #if defined(USE_GNOME_SESSION)
if (using_gnome) if (using_gnome)
#endif #endif
setup_save_yourself(); setup_save_yourself();
@@ -3933,7 +3937,7 @@ gui_mch_init(void)
gui.visibility = GDK_VISIBILITY_UNOBSCURED; gui.visibility = GDK_VISIBILITY_UNOBSCURED;
#endif #endif
#if !(defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)) #if !defined(USE_GNOME_SESSION)
wm_protocols_atom = gdk_atom_intern("WM_PROTOCOLS", FALSE); wm_protocols_atom = gdk_atom_intern("WM_PROTOCOLS", FALSE);
save_yourself_atom = gdk_atom_intern("WM_SAVE_YOURSELF", FALSE); save_yourself_atom = gdk_atom_intern("WM_SAVE_YOURSELF", FALSE);
#endif #endif
@@ -4039,7 +4043,7 @@ gui_mch_init(void)
return OK; return OK;
} }
#if (defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)) || defined(PROTO) #if defined(USE_GNOME_SESSION) || defined(PROTO)
/* /*
* This is called from gui_start() after a fork() has been done. * This is called from gui_start() after a fork() has been done.
* We have to tell the session manager our new PID. * We have to tell the session manager our new PID.
@@ -4057,7 +4061,7 @@ gui_mch_forked(void)
gnome_client_set_process_id(client, getpid()); gnome_client_set_process_id(client, getpid());
} }
} }
#endif /* FEAT_GUI_GNOME && FEAT_SESSION */ #endif // USE_GNOME_SESSION
#if GTK_CHECK_VERSION(3,0,0) #if GTK_CHECK_VERSION(3,0,0)
static GdkRGBA static GdkRGBA

View File

@@ -183,9 +183,7 @@ void qsort(void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void
# endif # endif
# include "regexp.pro" # include "regexp.pro"
# include "screen.pro" # include "screen.pro"
# ifdef FEAT_SESSION # include "session.pro"
# include "session.pro"
# endif
# if defined(FEAT_CRYPT) || defined(FEAT_PERSISTENT_UNDO) # if defined(FEAT_CRYPT) || defined(FEAT_PERSISTENT_UNDO)
# include "sha256.pro" # include "sha256.pro"
# endif # endif

View File

@@ -1063,7 +1063,6 @@ write_session_file(char_u *filename)
static int mksession_nl = FALSE; // use NL only in put_eol() static int mksession_nl = FALSE; // use NL only in put_eol()
#endif #endif
#if defined(FEAT_SESSION) || defined(PROTO)
/* /*
* ":mkexrc", ":mkvimrc", ":mkview" and ":mksession". * ":mkexrc", ":mkvimrc", ":mkview" and ":mksession".
*/ */
@@ -1244,10 +1243,10 @@ ex_mkrc(exarg_T *eap)
if (put_line(fd, "let &so = s:so_save | let &siso = s:siso_save") if (put_line(fd, "let &so = s:so_save | let &siso = s:siso_save")
== FAIL) == FAIL)
failed = TRUE; failed = TRUE;
# ifdef FEAT_SEARCH_EXTRA #ifdef FEAT_SEARCH_EXTRA
if (no_hlsearch && put_line(fd, "nohlsearch") == FAIL) if (no_hlsearch && put_line(fd, "nohlsearch") == FAIL)
failed = TRUE; failed = TRUE;
# endif #endif
if (put_line(fd, "doautoall SessionLoadPost") == FAIL) if (put_line(fd, "doautoall SessionLoadPost") == FAIL)
failed = TRUE; failed = TRUE;
if (eap->cmdidx == CMD_mksession) if (eap->cmdidx == CMD_mksession)
@@ -1264,7 +1263,7 @@ ex_mkrc(exarg_T *eap)
if (failed) if (failed)
emsg(_(e_write)); emsg(_(e_write));
#if defined(FEAT_EVAL) && defined(FEAT_SESSION) #if defined(FEAT_SESSION)
else if (eap->cmdidx == CMD_mksession) else if (eap->cmdidx == CMD_mksession)
{ {
// successful session write - set this_session var // successful session write - set this_session var
@@ -1293,9 +1292,7 @@ theend:
#endif #endif
} }
#endif // FEAT_SESSION #if (defined(FEAT_VIMINFO) || defined(FEAT_SESSION)) || defined(PROTO)
#if defined(FEAT_VIMINFO) || defined(FEAT_SESSION)
var_flavour_T var_flavour_T
var_flavour(char_u *varname) var_flavour(char_u *varname)
{ {

View File

@@ -777,6 +777,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1767,
/**/ /**/
1766, 1766,
/**/ /**/