# HG changeset patch # User Bram Moolenaar # Date 1564320604 -7200 # Node ID 554240b9574b1b899ece87d455cc496f586946d6 # Parent c1629b49142cedf1418b62c5371099020311ad75 patch 8.1.1767: FEAT_SESSION defined separately commit https://github.com/vim/vim/commit/f96ae0b5a2e9e097c38cec04ec35364565d42271 Author: Bram Moolenaar Date: Sun Jul 28 15:21:55 2019 +0200 patch 8.1.1767: FEAT_SESSION defined separately Problem: FEAT_SESSION defined separately. Solution: Make FEAT_SESSION depend on FEAT_EVAL. diff --git a/src/evalfunc.c b/src/evalfunc.c --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -231,9 +231,7 @@ static void f_matchstr(typval_T *argvars static void f_matchstrpos(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); -#ifdef vim_mkdir static void f_mkdir(typval_T *argvars, typval_T *rettv); -#endif static void f_mode(typval_T *argvars, typval_T *rettv); #ifdef FEAT_MZSCHEME static void f_mzeval(typval_T *argvars, typval_T *rettv); @@ -694,9 +692,7 @@ static struct fst {"matchstrpos", 2, 4, f_matchstrpos}, {"max", 1, 1, f_max}, {"min", 1, 1, f_min}, -#ifdef vim_mkdir {"mkdir", 1, 3, f_mkdir}, -#endif {"mode", 0, 1, f_mode}, #ifdef FEAT_MZSCHEME {"mzeval", 1, 1, f_mzeval}, @@ -7945,7 +7941,6 @@ mkdir_recurse(char_u *dir, int prot) return r; } -#ifdef vim_mkdir /* * "mkdir()" function */ @@ -7989,7 +7984,6 @@ f_mkdir(typval_T *argvars, typval_T *ret } rettv->vval.v_number = vim_mkdir_emsg(dir, prot); } -#endif /* * "mode()" function diff --git a/src/ex_docmd.c b/src/ex_docmd.c --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -307,7 +307,6 @@ static void ex_tag_cmd(exarg_T *eap, cha static char_u *arg_all(void); #ifndef FEAT_SESSION # define ex_loadview ex_ni -# define ex_mkrc ex_ni #endif #ifndef FEAT_EVAL # define ex_compiler ex_ni @@ -8433,8 +8432,7 @@ close_redir(void) #endif } -#if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \ - || defined(PROTO) +#if (defined(FEAT_SESSION) || defined(FEAT_EVAL)) || defined(PROTO) int vim_mkdir_emsg(char_u *name, int prot) { diff --git a/src/feature.h b/src/feature.h --- a/src/feature.h +++ b/src/feature.h @@ -559,9 +559,9 @@ /* * +mksession ":mksession" command. - * Requires +windows and +vertsplit. + * fully depends on +eval */ -#if defined(FEAT_NORMAL) +#if defined(FEAT_EVAL) # define FEAT_SESSION #endif diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -159,7 +159,11 @@ static const GtkTargetEntry dnd_targets[ */ # 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 * 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 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 char *abs_restart_command = NULL; #endif @@ -404,7 +408,7 @@ gui_mch_prepare(int *argc, char **argv) int i = 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 * 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) { vim_free(gui_argv); -#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) +#if defined(USE_GNOME_SESSION) vim_free(abs_restart_command); #endif } @@ -2274,7 +2278,7 @@ drag_data_received_cb(GtkWidget *widget #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 * 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 /* @@ -2571,7 +2575,7 @@ global_event_filter(GdkXEvent *xev, return GDK_FILTER_CONTINUE; } -#endif /* !(FEAT_GUI_GNOME && FEAT_SESSION) */ +#endif // !USE_GNOME_SESSION /* @@ -2624,14 +2628,14 @@ mainwin_realize(GtkWidget *widget UNUSED 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 */ gdk_window_add_filter(NULL, &global_event_filter, NULL); #endif /* Setup to indicate to the window manager that we want to catch the * WM_SAVE_YOURSELF event. For GNOME, this connects to the session * manager instead. */ -#if defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION) +#if defined(USE_GNOME_SESSION) if (using_gnome) #endif setup_save_yourself(); @@ -3933,7 +3937,7 @@ gui_mch_init(void) gui.visibility = GDK_VISIBILITY_UNOBSCURED; #endif -#if !(defined(FEAT_GUI_GNOME) && defined(FEAT_SESSION)) +#if !defined(USE_GNOME_SESSION) wm_protocols_atom = gdk_atom_intern("WM_PROTOCOLS", FALSE); save_yourself_atom = gdk_atom_intern("WM_SAVE_YOURSELF", FALSE); #endif @@ -4039,7 +4043,7 @@ gui_mch_init(void) 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. * 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()); } } -#endif /* FEAT_GUI_GNOME && FEAT_SESSION */ +#endif // USE_GNOME_SESSION #if GTK_CHECK_VERSION(3,0,0) static GdkRGBA diff --git a/src/proto.h b/src/proto.h --- a/src/proto.h +++ b/src/proto.h @@ -183,9 +183,7 @@ void qsort(void *base, size_t elm_count, # endif # include "regexp.pro" # include "screen.pro" -# ifdef FEAT_SESSION -# include "session.pro" -# endif +# include "session.pro" # if defined(FEAT_CRYPT) || defined(FEAT_PERSISTENT_UNDO) # include "sha256.pro" # endif diff --git a/src/session.c b/src/session.c --- a/src/session.c +++ b/src/session.c @@ -1063,7 +1063,6 @@ write_session_file(char_u *filename) static int mksession_nl = FALSE; // use NL only in put_eol() #endif -#if defined(FEAT_SESSION) || defined(PROTO) /* * ":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") == FAIL) failed = TRUE; -# ifdef FEAT_SEARCH_EXTRA +#ifdef FEAT_SEARCH_EXTRA if (no_hlsearch && put_line(fd, "nohlsearch") == FAIL) failed = TRUE; -# endif +#endif if (put_line(fd, "doautoall SessionLoadPost") == FAIL) failed = TRUE; if (eap->cmdidx == CMD_mksession) @@ -1264,7 +1263,7 @@ ex_mkrc(exarg_T *eap) if (failed) emsg(_(e_write)); -#if defined(FEAT_EVAL) && defined(FEAT_SESSION) +#if defined(FEAT_SESSION) else if (eap->cmdidx == CMD_mksession) { // successful session write - set this_session var @@ -1293,9 +1292,7 @@ theend: #endif } -#endif // FEAT_SESSION - -#if defined(FEAT_VIMINFO) || defined(FEAT_SESSION) +#if (defined(FEAT_VIMINFO) || defined(FEAT_SESSION)) || defined(PROTO) var_flavour_T var_flavour(char_u *varname) { diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -778,6 +778,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1767, +/**/ 1766, /**/ 1765,