To: vim_dev@googlegroups.com Subject: Patch 8.2.4038 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4038 Problem: Various code not used when features are disabled. Solution: Add #ifdefs. (Dominique Pellé, closes #9491) Files: src/alloc.c, src/buffer.c, src/charset.c, src/clipboard.c, src/cmdhist.c, src/crypt.c, src/edit.c, src/eval.c, src/evalbuffer.c, src/evalfunc.c, src/ex_docmd.c, src/globals.h, src/gui_xim.c, src/hashtab.c, src/highlight.c, src/insexpand.c, src/main.c, src/mark.c, src/message.c, src/misc1.c, src/misc2.c, src/ops.c, src/option.c, src/option.h, src/optionstr.c, src/register.c, src/scriptfile.c, src/tag.c, src/term.c, src/typval.c, src/usercmd.c, src/userfunc.c, src/vim9script.c, src/vim9type.c *** ../vim-8.2.4037/src/alloc.c 2021-12-31 19:59:48.866000515 +0000 --- src/alloc.c 2022-01-08 12:29:45.316753277 +0000 *************** *** 151,156 **** --- 151,157 ---- return lalloc(size, TRUE); } + #if defined(FEAT_QUICKFIX) || defined(PROTO) /* * alloc() with an ID for alloc_fail(). */ *************** *** 163,168 **** --- 164,170 ---- #endif return lalloc(size, TRUE); } + #endif /* * Allocate memory and set all bytes to zero. *************** *** 178,183 **** --- 180,186 ---- return p; } + #if defined(FEAT_SIGNS) || defined(PROTO) /* * Same as alloc_clear() but with allocation id for testing */ *************** *** 190,195 **** --- 193,199 ---- #endif return alloc_clear(size); } + #endif /* * Allocate memory like lalloc() and set all bytes to zero. *************** *** 648,653 **** --- 652,658 ---- ga_clear(gap); } + #if defined(FEAT_EVAL) || defined(PROTO) /* * Copy a growing array that contains a list of strings. */ *************** *** 682,687 **** --- 687,693 ---- to->ga_len = from->ga_len; return OK; } + #endif /* * Initialize a growing array. Don't forget to set ga_itemsize and *** ../vim-8.2.4037/src/buffer.c 2022-01-01 15:58:19.106486379 +0000 --- src/buffer.c 2022-01-08 12:29:45.316753277 +0000 *************** *** 138,143 **** --- 138,144 ---- return retval; } + #if defined(FEAT_EVAL) || defined(PROTO) /* * Ensure buffer "buf" is loaded. Does not trigger the swap-exists action. */ *************** *** 154,159 **** --- 155,161 ---- aucmd_restbuf(&aco); } } + #endif /* * Open current buffer, that is: open the memfile and read the file into *************** *** 5609,5614 **** --- 5611,5617 ---- return buf != NULL && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'r'; } + #if defined(FEAT_PROP_POPUP) || defined(PROTO) /* * Return TRUE if "buf" is a buffer for a popup window. */ *************** *** 5618,5623 **** --- 5621,5627 ---- return buf != NULL && buf->b_p_bt != NULL && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'o'; } + #endif /* * Return TRUE if "buf" is a "nofile", "acwrite", "terminal" or "prompt" *************** *** 5632,5637 **** --- 5636,5642 ---- || buf->b_p_bt[0] == 'p'); } + #if defined(FEAT_QUICKFIX) || defined(PROTO) /* * Return TRUE if "buf" has 'buftype' set to "nofile". */ *************** *** 5640,5645 **** --- 5645,5651 ---- { return buf != NULL && buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f'; } + #endif /* * Return TRUE if "buf" is a "nowrite", "nofile", "terminal" or "prompt" *** ../vim-8.2.4037/src/charset.c 2021-12-30 15:29:14.284333311 +0000 --- src/charset.c 2022-01-08 12:29:45.316753277 +0000 *************** *** 1476,1481 **** --- 1476,1482 ---- return p; } + #if defined(FEAT_EVAL) || defined(PROTO) /* * skip over ' ', '\t' and '\n'. */ *************** *** 1488,1493 **** --- 1489,1495 ---- ++p; return p; } + #endif /* * getwhitecols: return the number of whitespace *** ../vim-8.2.4037/src/clipboard.c 2021-12-31 22:48:56.575368905 +0000 --- src/clipboard.c 2022-01-08 12:29:45.316753277 +0000 *************** *** 1540,1545 **** --- 1540,1546 ---- /* * Property callback to get a timestamp for XtOwnSelection. */ + # if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)) || defined(PROTO) static void clip_x11_timestamp_cb( Widget w, *************** *** 1592,1597 **** --- 1593,1599 ---- XtAddEventHandler(w, PropertyChangeMask, False, /*(XtEventHandler)*/clip_x11_timestamp_cb, (XtPointer)NULL); } + # endif static void clip_x11_request_selection_cb( *** ../vim-8.2.4037/src/cmdhist.c 2022-01-01 15:58:19.106486379 +0000 --- src/cmdhist.c 2022-01-08 12:29:45.316753277 +0000 *************** *** 37,47 **** --- 37,49 ---- return history[hist_type]; } + #if defined(FEAT_VIMINFO) || defined(PROTO) void set_histentry(int hist_type, histentry_T *entry) { history[hist_type] = entry; } + #endif int * get_hisidx(int hist_type) *************** *** 49,59 **** --- 51,63 ---- return &hisidx[hist_type]; } + #if defined(FEAT_VIMINFO) || defined(PROTO) int * get_hisnum(int hist_type) { return &hisnum[hist_type]; } + #endif /* * Translate a history character to the associated type number. *** ../vim-8.2.4037/src/crypt.c 2022-01-05 17:49:10.869225139 +0000 --- src/crypt.c 2022-01-08 12:29:45.316753277 +0000 *************** *** 247,252 **** --- 247,253 ---- } + #if defined(FEAT_SODIUM) || defined(PROTO) /* * Get maximum crypt method specific length of the file header in bytes. */ *************** *** 265,270 **** --- 266,272 ---- } return max; } + #endif /* * Set the crypt method for buffer "buf" to "method_nr" using the int value as *** ../vim-8.2.4037/src/edit.c 2022-01-04 17:01:40.598663106 +0000 --- src/edit.c 2022-01-08 12:29:45.316753277 +0000 *************** *** 1715,1720 **** --- 1715,1721 ---- } } + #if defined(FEAT_JOB_CHANNEL) || defined(PROTO) /* * Set the insert start position for when using a prompt buffer. */ *************** *** 1728,1733 **** --- 1729,1735 ---- Insstart_blank_vcol = MAXCOL; arrow_used = FALSE; } + #endif /* * Undo the previous edit_putchar(). *** ../vim-8.2.4037/src/eval.c 2022-01-07 12:45:24.111723148 +0000 --- src/eval.c 2022-01-08 12:36:03.032975738 +0000 *************** *** 654,702 **** } /* - * Call Vim script function "func" and return the result as a number. - * Returns -1 when calling the function fails. - * Uses argv[0] to argv[argc - 1] for the function arguments. argv[argc] should - * have type VAR_UNKNOWN. - */ - varnumber_T - call_func_retnr( - char_u *func, - int argc, - typval_T *argv) - { - typval_T rettv; - varnumber_T retval; - - if (call_vim_function(func, argc, argv, &rettv) == FAIL) - return -1; - - retval = tv_get_number_chk(&rettv, NULL); - clear_tv(&rettv); - return retval; - } - - /* - * Call Vim script function like call_func_retnr() and drop the result. - * Returns FAIL when calling the function fails. - */ - int - call_func_noret( - char_u *func, - int argc, - typval_T *argv) - { - typval_T rettv; - - if (call_vim_function(func, argc, argv, &rettv) == FAIL) - return FAIL; - clear_tv(&rettv); - return OK; - } - - /* * Call Vim script function "func" and return the result as a string. ! * Uses "argv" and "argc" as call_func_retnr(). * Returns NULL when calling the function fails. */ void * --- 654,662 ---- } /* * Call Vim script function "func" and return the result as a string. ! * Uses "argv[0]" to "argv[argc - 1]" for the function arguments. "argv[argc]" ! * should have type VAR_UNKNOWN. * Returns NULL when calling the function fails. */ void * *************** *** 718,724 **** /* * Call Vim script function "func" and return the result as a List. ! * Uses "argv" and "argc" as call_func_retnr(). * Returns NULL when there is something wrong. */ void * --- 678,684 ---- /* * Call Vim script function "func" and return the result as a List. ! * Uses "argv" and "argc" as call_func_retstr(). * Returns NULL when there is something wrong. */ void * *************** *** 4783,4788 **** --- 4743,4750 ---- return abort; } + #if defined(FEAT_LUA) || defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \ + || defined(PROTO) /* * Mark a dict and its items with "copyID". * Returns TRUE if setting references failed somehow. *************** *** 4797,4802 **** --- 4759,4765 ---- } return FALSE; } + #endif /* * Mark a list and its items with "copyID". *** ../vim-8.2.4037/src/evalbuffer.c 2022-01-06 13:24:45.789265688 +0000 --- src/evalbuffer.c 2022-01-08 12:29:45.320753285 +0000 *************** *** 864,872 **** } #endif // FEAT_EVAL ! #if defined(FEAT_JOB_CHANNEL) \ ! || defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) \ ! || defined(PROTO) /* * Make "buf" the current buffer. restore_buffer() MUST be called to undo. * No autocommands will be executed. Use aucmd_prepbuf() if there are any. --- 864,870 ---- } #endif // FEAT_EVAL ! #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) || defined(PROTO) /* * Make "buf" the current buffer. restore_buffer() MUST be called to undo. * No autocommands will be executed. Use aucmd_prepbuf() if there are any. *** ../vim-8.2.4037/src/evalfunc.c 2022-01-06 13:24:45.793265684 +0000 --- src/evalfunc.c 2022-01-08 12:29:45.320753285 +0000 *************** *** 3529,3534 **** --- 3529,3535 ---- } } + #if defined(FEAT_LUA) || defined(PROTO) /* * Get next line from a string containing NL separated lines. * Called by do_cmdline() to get the next line. *************** *** 3570,3575 **** --- 3571,3577 ---- do_cmdline(NULL, get_str_line, (void *)&str, DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT|DOCMD_KEYTYPED); } + #endif /* * Get next line from a list. *** ../vim-8.2.4037/src/ex_docmd.c 2022-01-05 20:24:34.272005652 +0000 --- src/ex_docmd.c 2022-01-08 12:29:45.320753285 +0000 *************** *** 3082,3087 **** --- 3082,3088 ---- return OK; } + #if defined(FEAT_EVAL) || defined(PROTO) /* * Return TRUE if "cmod" has anything set. */ *************** *** 3110,3115 **** --- 3111,3117 ---- } return FALSE; } + #endif /* * Apply the command modifiers. Saves current state in "cmdmod", call *************** *** 3393,3398 **** --- 3395,3401 ---- *d = NUL; } + #if defined(FEAT_EVAL) || defined(PROTO) /* * If "start" points "&opt", "&l:opt", "&g:opt" or "$ENV" return a pointer to * the name. Otherwise just return "start". *************** *** 3413,3418 **** --- 3416,3422 ---- name += 1; return name; } + #endif /* * Find an Ex command by its name, either built-in or user. *** ../vim-8.2.4037/src/globals.h 2022-01-04 17:01:40.598663106 +0000 --- src/globals.h 2022-01-08 12:29:45.320753285 +0000 *************** *** 440,446 **** --- 440,448 ---- #endif + #ifdef FEAT_EVAL EXTERN int did_source_packages INIT(= FALSE); + #endif // Magic number used for hashitem "hi_key" value indicating a deleted item. // Only the address is used. *************** *** 1153,1159 **** --- 1155,1163 ---- EXTERN cmdmod_T cmdmod; // Ex command modifiers + #ifdef FEAT_EVAL EXTERN int is_export INIT(= FALSE); // :export {cmd} + #endif EXTERN int msg_silent INIT(= 0); // don't print messages EXTERN int emsg_silent INIT(= 0); // don't print error messages *************** *** 1190,1196 **** --- 1194,1202 ---- #endif ; EXTERN int ex_normal_busy INIT(= 0); // recursiveness of ex_normal() + #ifdef FEAT_EVAL EXTERN int in_feedkeys INIT(= 0); // ex_normal_busy set in feedkeys() + #endif EXTERN int ex_normal_lock INIT(= 0); // forbid use of ex_normal() #ifdef FEAT_EVAL *************** *** 1394,1401 **** --- 1400,1409 ---- EXTERN long sub_nsubs; // total number of substitutions EXTERN linenr_T sub_nlines; // total number of lines changed + #ifdef FEAT_EVAL // Used when a compiled :substitute has an expression. EXTERN struct subs_expr_S *substitute_instr INIT(= NULL); + #endif // table to store parsed 'wildmode' EXTERN char_u wim_flags[4]; *************** *** 1588,1594 **** --- 1596,1604 ---- EXTERN char top_bot_msg[] INIT(= N_("search hit TOP, continuing at BOTTOM")); EXTERN char bot_top_msg[] INIT(= N_("search hit BOTTOM, continuing at TOP")); + #ifdef FEAT_EVAL EXTERN char line_msg[] INIT(= N_(" line ")); + #endif #ifdef FEAT_CRYPT EXTERN char need_key_msg[] INIT(= N_("Need encryption key for \"%s\"")); *** ../vim-8.2.4037/src/gui_xim.c 2022-01-01 21:59:11.030521935 +0000 --- src/gui_xim.c 2022-01-08 12:29:45.320753285 +0000 *************** *** 125,130 **** --- 125,131 ---- } #endif + #if defined(FEAT_EVAL) || defined(PROTO) /* * Mark the global 'imactivatefunc' and 'imstatusfunc' callbacks with 'copyID' * so that they are not garbage collected. *************** *** 134,147 **** { int abort = FALSE; ! #if defined(FEAT_EVAL) && \ ! (defined(FEAT_XIM) || defined(IME_WITHOUT_XIM) || defined(VIMDLL)) abort = set_ref_in_callback(&imaf_cb, copyID); abort = abort || set_ref_in_callback(&imsf_cb, copyID); ! #endif return abort; } #if defined(FEAT_XIM) || defined(PROTO) --- 135,148 ---- { int abort = FALSE; ! # if defined(FEAT_XIM) || defined(IME_WITHOUT_XIM) || defined(VIMDLL) abort = set_ref_in_callback(&imaf_cb, copyID); abort = abort || set_ref_in_callback(&imsf_cb, copyID); ! # endif return abort; } + #endif #if defined(FEAT_XIM) || defined(PROTO) *** ../vim-8.2.4037/src/hashtab.c 2020-09-11 19:36:32.462574370 +0100 --- src/hashtab.c 2022-01-08 12:29:45.320753285 +0000 *************** *** 288,293 **** --- 288,294 ---- ++ht->ht_locked; } + #if defined(FEAT_PROP_POPUP) || defined(PROTO) /* * Lock a hashtable at the specified number of entries. * Caller must make sure no more than "size" entries will be added. *************** *** 299,304 **** --- 300,306 ---- (void)hash_may_resize(ht, size); ++ht->ht_locked; } + #endif /* * Unlock a hashtable: allow ht_array changes again. *** ../vim-8.2.4037/src/highlight.c 2022-01-05 17:49:10.873225135 +0000 --- src/highlight.c 2022-01-08 12:29:45.320753285 +0000 *************** *** 343,348 **** --- 343,349 ---- NULL }; + #if defined(FEAT_SYN_HL) || defined(PROTO) /* * Returns the number of highlight groups. */ *************** *** 369,374 **** --- 370,376 ---- { return HL_TABLE()[id].sg_link; } + #endif void init_highlight( *** ../vim-8.2.4037/src/insexpand.c 2022-01-08 10:38:43.954908318 +0000 --- src/insexpand.c 2022-01-08 12:29:45.320753285 +0000 *************** *** 263,269 **** --- 263,271 ---- /* * Functions to check the current CTRL-X mode. */ + #ifdef FEAT_CINDENT int ctrl_x_mode_none(void) { return ctrl_x_mode == 0; } + #endif int ctrl_x_mode_normal(void) { return ctrl_x_mode == CTRL_X_NORMAL; } int ctrl_x_mode_scroll(void) { return ctrl_x_mode == CTRL_X_SCROLL; } int ctrl_x_mode_whole_line(void) { return ctrl_x_mode == CTRL_X_WHOLE_LINE; } *** ../vim-8.2.4037/src/main.c 2022-01-01 21:59:11.034521924 +0000 --- src/main.c 2022-01-08 12:29:45.320753285 +0000 *************** *** 1091,1102 **** --- 1091,1105 ---- was_safe = FALSE; } + #if defined(FEAT_EVAL) || defined(MESSAGE_QUEUE) || defined(PROTO) int get_was_safe_state(void) { return was_safe; } + #endif + #if defined(MESSAGE_QUEUE) || defined(PROTO) /* * Invoked when leaving code that invokes callbacks. Then trigger * SafeStateAgain, if it was safe when starting to wait for a character. *************** *** 1137,1142 **** --- 1140,1146 ---- "SafeState: back to waiting, not triggering SafeStateAgain"); #endif } + #endif /* *** ../vim-8.2.4037/src/mark.c 2022-01-01 21:59:11.034521924 +0000 --- src/mark.c 2022-01-08 12:29:45.320753285 +0000 *************** *** 1368,1373 **** --- 1368,1374 ---- } #endif + #if defined(FEAT_VIMINFO) || defined(PROTO) /* * Return a pointer to the named file marks. */ *************** *** 1376,1381 **** --- 1377,1383 ---- { return namedfm; } + #endif #if defined(FEAT_EVAL) || defined(PROTO) /* *** ../vim-8.2.4037/src/message.c 2022-01-02 19:25:22.846078499 +0000 --- src/message.c 2022-01-08 12:29:45.320753285 +0000 *************** *** 876,881 **** --- 876,882 ---- siemsg(_(e_internal_error_str), where); } + #if defined(FEAT_EVAL) || defined(PROTO) /* * Like internal_error() but do not call abort(), to avoid tests using * test_unknown() and test_void() causing Vim to exit. *************** *** 885,890 **** --- 886,892 ---- { semsg(_(e_internal_error_str), where); } + #endif // emsg3() and emsgn() are in misc2.c to avoid warnings for the prototypes. *************** *** 894,899 **** --- 896,902 ---- semsg(_(e_invalid_register_name_str), transchar(name)); } + #if defined(FEAT_EVAL) || defined(PROTO) /* * Give an error message which contains %s for "name[len]". */ *************** *** 905,910 **** --- 908,914 ---- semsg(msg, copy == NULL ? "NULL" : (char *)copy); vim_free(copy); } + #endif /* * Like msg(), but truncate to a single line if p_shm contains 't', or when *** ../vim-8.2.4037/src/misc1.c 2022-01-04 21:30:43.541800349 +0000 --- src/misc1.c 2022-01-08 12:29:45.320753285 +0000 *************** *** 1896,1902 **** vim_setenv(var, (char_u *)""); #endif } - #endif /* --- 1896,1901 ---- *************** *** 1914,1919 **** --- 1913,1919 ---- && STRICMP(name, "VIMRUNTIME") == 0) didset_vimruntime = FALSE; } + #endif /* * Our portable version of setenv. *************** *** 2230,2235 **** --- 2230,2236 ---- } } + # if defined(FEAT_SPELL) || defined(PROTO) /* * Like line_breakcheck() but check 100 times less often. */ *************** *** 2242,2247 **** --- 2243,2249 ---- ui_breakcheck(); } } + #endif #if defined(VIM_BACKTICK) || defined(FEAT_EVAL) \ || (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \ *** ../vim-8.2.4037/src/misc2.c 2022-01-02 21:26:12.315264334 +0000 --- src/misc2.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 2424,2429 **** --- 2424,2430 ---- return OK; } + #if defined(EXITFREE) || defined(PROTOS) /* * Free the memory allocated by get_user_name() */ *************** *** 2432,2437 **** --- 2433,2439 ---- { vim_free(username); } + #endif #ifndef HAVE_QSORT /* *** ../vim-8.2.4037/src/ops.c 2022-01-05 16:08:59.524426437 +0000 --- src/ops.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 3350,3355 **** --- 3350,3356 ---- } #endif + #if defined(FEAT_EVAL) || defined(PROTO) /* * Mark the global 'operatorfunc' callback with 'copyID' so that it is not * garbage collected. *************** *** 3359,3370 **** { int abort = FALSE; - #ifdef FEAT_EVAL abort = set_ref_in_callback(&opfunc_cb, copyID); - #endif return abort; } /* * Handle the "g@" operator: call 'operatorfunc'. --- 3360,3370 ---- { int abort = FALSE; abort = set_ref_in_callback(&opfunc_cb, copyID); return abort; } + #endif /* * Handle the "g@" operator: call 'operatorfunc'. *** ../vim-8.2.4037/src/option.c 2022-01-05 20:24:34.276005641 +0000 --- src/option.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 753,758 **** --- 753,759 ---- options[opt_idx].def_val[VI_DEFAULT] = (char_u *)(long_i)val; } + #if defined(FEAT_PROP_POPUP) || defined(PROTO) /* * Set all window-local and buffer-local options to the Vim default. * local-global options will use the global value. *************** *** 784,789 **** --- 785,791 ---- curwin = save_curwin; curbuf = curwin->w_buffer; } + #endif #if defined(EXITFREE) || defined(PROTO) /* *************** *** 5535,5540 **** --- 5537,5543 ---- return options[opt_idx].var; } + #if defined(FEAT_EVAL) || defined(PROTO) /* * Return the full name of the option at 'opt_idx' */ *************** *** 5543,5548 **** --- 5546,5552 ---- { return (char_u *)options[opt_idx].fullname; } + #endif /* * Get the value of 'equalprg', either the buffer-local one or the global one. *** ../vim-8.2.4037/src/option.h 2021-12-21 09:11:45.625393271 +0000 --- src/option.h 2022-01-08 12:29:45.324753289 +0000 *************** *** 486,492 **** --- 486,494 ---- EXTERN char_u *p_ccv; // 'charconvert' #endif EXTERN int p_cdh; // 'cdhome' + #ifdef FEAT_CINDENT EXTERN char_u *p_cino; // 'cinoptions' + #endif #ifdef FEAT_CMDWIN EXTERN char_u *p_cedit; // 'cedit' EXTERN long p_cwh; // 'cmdwinheight' *************** *** 730,742 **** EXTERN char_u *p_mp; // 'makeprg' #endif EXTERN char_u *p_mps; // 'matchpairs' - #ifdef FEAT_SIGNS - EXTERN char_u *p_scl; // signcolumn - #endif - #ifdef FEAT_SYN_HL - EXTERN char_u *p_cc; // 'colorcolumn' - EXTERN int p_cc_cols[256]; // array for 'colorcolumn' columns - #endif EXTERN long p_mat; // 'matchtime' EXTERN long p_mco; // 'maxcombine' #ifdef FEAT_EVAL --- 732,737 ---- *************** *** 840,846 **** --- 835,843 ---- EXTERN char_u *p_ruf; // 'rulerformat' #endif EXTERN char_u *p_pp; // 'packpath' + #ifdef FEAT_QUICKFIX EXTERN char_u *p_qftf; // 'quickfixtextfunc' + #endif EXTERN char_u *p_rtp; // 'runtimepath' EXTERN long p_sj; // 'scrolljump' #if defined(MSWIN) && defined(FEAT_GUI) *************** *** 949,955 **** --- 946,954 ---- #define SWB_NEWTAB 0x008 #define SWB_VSPLIT 0x010 #define SWB_USELAST 0x020 + #ifdef FEAT_SYN_HL EXTERN char_u *p_syn; // 'syntax' + #endif EXTERN long p_ts; // 'tabstop' EXTERN int p_tbs; // 'tagbsearch' EXTERN char_u *p_tc; // 'tagcase' *************** *** 1026,1033 **** # define TTYM_URXVT 0x40 # define TTYM_SGR 0x80 #endif - EXTERN char_u *p_udir; // 'undodir' #ifdef FEAT_PERSISTENT_UNDO EXTERN int p_udf; // 'undofile' #endif EXTERN long p_ul; // 'undolevels' --- 1025,1032 ---- # define TTYM_URXVT 0x40 # define TTYM_SGR 0x80 #endif #ifdef FEAT_PERSISTENT_UNDO + EXTERN char_u *p_udir; // 'undodir' EXTERN int p_udf; // 'undofile' #endif EXTERN long p_ul; // 'undolevels' *** ../vim-8.2.4037/src/optionstr.c 2022-01-07 16:55:27.112417600 +0000 --- src/optionstr.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 454,459 **** --- 454,460 ---- unblock_autocmds(); } + #if defined(FEAT_PROP_POPUP) || defined(PROTO) /* * Like set_string_option_direct(), but for a buffer-local option in "buf". * Blocks autocommands to avoid the old curbuf becoming invalid. *************** *** 477,482 **** --- 478,484 ---- curwin->w_buffer = curbuf; unblock_autocmds(); } + #endif /* * Set a string option to a new value, and handle the effects. *** ../vim-8.2.4037/src/register.c 2022-01-05 20:24:34.280005633 +0000 --- src/register.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 38,78 **** --- 38,90 ---- #endif static void dis_msg(char_u *p, int skip_esc); + #if defined(FEAT_VIMINFO) || defined(PROTO) yankreg_T * get_y_regs(void) { return y_regs; } + #endif + #if defined(FEAT_CLIPBOARD) || defined(PROTO) yankreg_T * get_y_register(int reg) { return &y_regs[reg]; } + #endif + #if defined(FEAT_CLIPBOARD) || defined(FEAT_VIMINFO) || defined(FEAT_EVAL) || defined(PROTO) yankreg_T * get_y_current(void) { return y_current; } + #endif + #if defined(FEAT_CLIPBOARD) || defined(FEAT_VIMINFO) || defined(PROTO) yankreg_T * get_y_previous(void) { return y_previous; } + #endif + #if defined(FEAT_CLIPBOARD) || defined(PROTO) void set_y_current(yankreg_T *yreg) { y_current = yreg; } + #endif + #if defined(FEAT_CLIPBOARD) || defined(FEAT_VIMINFO) || defined(PROTO) void set_y_previous(yankreg_T *yreg) { y_previous = yreg; } + #endif void reset_y_append(void) *************** *** 474,479 **** --- 486,492 ---- */ static int execreg_lastc = NUL; + #if defined(FEAT_VIMINFO) || defined(PROTO) int get_execreg_lastc(void) { *************** *** 485,490 **** --- 498,504 ---- { execreg_lastc = lastc; } + #endif /* * When executing a register as a series of ex-commands, if the *************** *** 2308,2313 **** --- 2322,2328 ---- } } + #if defined(FEAT_EVAL) || defined(PROTO) /* * Return the index of the register "" points to. */ *************** *** 2316,2321 **** --- 2331,2337 ---- { return y_previous == NULL ? -1 : y_previous - &y_regs[0]; } + #endif /* * ":dis" and ":registers": Display the contents of the yank registers. *** ../vim-8.2.4037/src/scriptfile.c 2022-01-05 20:24:34.280005633 +0000 --- src/scriptfile.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 1635,1642 **** } # endif - #endif - linenr_T get_sourced_lnum( char_u *(*fgetline)(int, void *, int, getline_opt_T), --- 1635,1640 ---- *************** *** 1646,1651 **** --- 1644,1650 ---- ? ((source_cookie_T *)cookie)->sourcing_lnum : SOURCING_LNUM; } + #endif static char_u * get_one_sourceline(source_cookie_T *sp) *** ../vim-8.2.4037/src/tag.c 2022-01-05 20:24:34.280005633 +0000 --- src/tag.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 102,107 **** --- 102,108 ---- // Used instead of NUL to separate tag fields in the growarrays. #define TAG_SEP 0x02 + #if defined(FEAT_EVAL) || defined(PROTO) /* * Reads the 'tagfunc' option value and convert that to a callback value. * Invoked when the 'tagfunc' option is set. The option value can be a name of *************** *** 125,132 **** return OK; } ! #if defined(EXITFREE) || defined(PROTO) void free_tagfunc_option(void) { --- 126,134 ---- return OK; } + #endif ! # if defined(EXITFREE) || defined(PROTO) void free_tagfunc_option(void) { *************** *** 134,141 **** free_callback(&tfu_cb); # endif } ! #endif /* * Mark the global 'tagfunc' callback with 'copyID' so that it is not garbage * collected. --- 136,144 ---- free_callback(&tfu_cb); # endif } ! # endif + #if defined(FEAT_EVAL) || defined(PROTO) /* * Mark the global 'tagfunc' callback with 'copyID' so that it is not garbage * collected. *************** *** 145,153 **** { int abort = FALSE; - #ifdef FEAT_EVAL abort = set_ref_in_callback(&tfu_cb, copyID); - #endif return abort; } --- 148,154 ---- *************** *** 159,170 **** void set_buflocal_tfu_callback(buf_T *buf UNUSED) { - #ifdef FEAT_EVAL free_callback(&buf->b_tfu_cb); if (tfu_cb.cb_name != NULL && *tfu_cb.cb_name != NUL) copy_callback(&buf->b_tfu_cb, &tfu_cb); - #endif } /* * Jump to tag; handling of tag commands and tag stack --- 160,170 ---- void set_buflocal_tfu_callback(buf_T *buf UNUSED) { free_callback(&buf->b_tfu_cb); if (tfu_cb.cb_name != NULL && *tfu_cb.cb_name != NUL) copy_callback(&buf->b_tfu_cb, &tfu_cb); } + #endif /* * Jump to tag; handling of tag commands and tag stack *** ../vim-8.2.4037/src/term.c 2022-01-07 19:24:16.190993980 +0000 --- src/term.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 3991,3996 **** --- 3991,3997 ---- } } + #ifdef FEAT_GUI /* * Check whether the cursor is invisible due to an ongoing cursor-less sleep */ *************** *** 3999,4004 **** --- 4000,4006 ---- { return cursor_is_asleep; } + #endif /* * Disable the cursor and mark it disabled by cursor-less sleep *** ../vim-8.2.4037/src/typval.c 2022-01-05 20:24:34.280005633 +0000 --- src/typval.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 528,533 **** --- 528,534 ---- || check_for_dict_arg(args, idx) != FAIL); } + #if defined(FEAT_JOB_CHANNEL) || defined(PROTO) /* * Give an error and return FAIL unless "args[idx]" is a channel or a job. */ *************** *** 576,581 **** --- 577,583 ---- return (args[idx].v_type == VAR_UNKNOWN || check_for_job_arg(args, idx) != FAIL); } + #endif /* * Give an error and return FAIL unless "args[idx]" is a string or *************** *** 642,647 **** --- 644,650 ---- || check_for_lnum_arg(args, idx)); } + #if defined(FEAT_JOB_CHANNEL) || defined(PROTO) /* * Give an error and return FAIL unless "args[idx]" is a string or a blob. */ *************** *** 655,660 **** --- 658,664 ---- } return OK; } + #endif /* * Give an error and return FAIL unless "args[idx]" is a string or a list. *** ../vim-8.2.4037/src/usercmd.c 2022-01-06 21:41:07.653593304 +0000 --- src/usercmd.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 319,324 **** --- 319,325 ---- return NULL; } + #ifdef FEAT_EVAL /* * Get the name of user command "idx". "cmdidx" can be CMD_USER or * CMD_USER_BUF. *************** *** 343,348 **** --- 344,350 ---- } return NULL; } + #endif /* * Function given to ExpandGeneric() to obtain the list of user address type *************** *** 394,399 **** --- 396,402 ---- return (char_u *)command_complete[idx].name; } + #ifdef FEAT_EVAL int cmdcomplete_str_to_type(char_u *complete_str) { *************** *** 405,410 **** --- 408,414 ---- return EXPAND_NOTHING; } + #endif /* * List user commands starting with "name[name_len]". *** ../vim-8.2.4037/src/userfunc.c 2022-01-07 18:20:48.370967086 +0000 --- src/userfunc.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 39,44 **** --- 39,45 ---- hash_init(&func_hashtab); } + #if defined(FEAT_PROFILE) || defined(PROTO) /* * Return the function hash table */ *************** *** 47,52 **** --- 48,54 ---- { return &func_hashtab; } + #endif /* * Get one function argument. *** ../vim-8.2.4037/src/vim9script.c 2022-01-07 13:38:20.423442096 +0000 --- src/vim9script.c 2022-01-08 12:29:45.324753289 +0000 *************** *** 115,120 **** --- 115,121 ---- #endif } + #if defined(FEAT_EVAL) || defined(PROTO) /* * When in Vim9 script give an error and return FAIL. */ *************** *** 159,164 **** --- 160,166 ---- } return FALSE; } + #endif /* * Return TRUE if "p" points at a "#" not followed by one '{'. *** ../vim-8.2.4037/src/vim9type.c 2022-01-07 20:18:13.545706409 +0000 --- src/vim9type.c 2022-01-08 12:36:43.052966032 +0000 *************** *** 532,543 **** } void - type_mismatch(type_T *expected, type_T *actual) - { - arg_type_mismatch(expected, actual, 0); - } - - void arg_type_mismatch(type_T *expected, type_T *actual, int arg_idx) { where_T where = WHERE_INIT; --- 532,537 ---- *** ../vim-8.2.4037/src/version.c 2022-01-08 10:38:43.954908318 +0000 --- src/version.c 2022-01-08 12:32:03.828913541 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4038, /**/ -- Place mark here ->[ ]<- if you want a dirty monitor. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///