summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-08-08 16:38:42 +0200
committerBram Moolenaar <Bram@vim.org>2010-08-08 16:38:42 +0200
commit09092155a66388bbd7be8d16debb35abfcfae700 (patch)
tree4cbe7f4f0d5c763405f721f7f5dba08864e53ef3
parent83687a72155c70c062c689a9c545b5cdf5ebd0b4 (diff)
downloadvim-git-09092155a66388bbd7be8d16debb35abfcfae700.tar.gz
Remove unused code.
-rw-r--r--runtime/doc/syntax.txt14
-rw-r--r--runtime/doc/todo.txt2
-rw-r--r--src/buffer.c6
-rw-r--r--src/dosinst.c36
-rw-r--r--src/edit.c36
-rw-r--r--src/ex_getln.c7
-rw-r--r--src/getchar.c17
-rw-r--r--src/gui.c7
-rw-r--r--src/gui_athena.c15
-rw-r--r--src/gui_gtk_x11.c46
-rw-r--r--src/gui_motif.c18
-rw-r--r--src/gui_w32.c62
-rw-r--r--src/gui_x11.c11
-rw-r--r--src/hashtab.c15
-rw-r--r--src/if_py_both.h2
-rw-r--r--src/if_tcl.c7
-rw-r--r--src/integration.c112
-rw-r--r--src/integration.h9
-rw-r--r--src/main.c4
-rw-r--r--src/memline.c20
-rw-r--r--src/misc1.c18
-rw-r--r--src/misc2.c21
-rw-r--r--src/move.c47
-rw-r--r--src/netbeans.c25
-rw-r--r--src/os_unix.c6
-rw-r--r--src/popupmnu.c11
-rw-r--r--src/screen.c11
-rw-r--r--src/syntax.c7
-rw-r--r--src/ui.c58
-rw-r--r--src/uninstal.c24
-rw-r--r--src/workshop.c55
31 files changed, 15 insertions, 714 deletions
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index c34b10c2c..9a65d814d 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt* For Vim version 7.3e. Last change: 2010 Aug 04
+*syntax.txt* For Vim version 7.3e. Last change: 2010 Aug 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -92,12 +92,12 @@ highlighting, include the ":gui" command in the |gvimrc|: >
NOTE: Using ":gui" in the |gvimrc| means that "gvim -f" won't start in the
foreground! Use ":gui -f" then.
-
-You can toggle the syntax on/off with this command >
- :if exists("syntax_on") | syntax off | else | syntax enable | endif
+ *g:syntax_on*
+You can toggle the syntax on/off with this command: >
+ :if exists("g:syntax_on") | syntax off | else | syntax enable | endif
To put this into a mapping, you can use: >
- :map <F7> :if exists("syntax_on") <Bar>
+ :map <F7> :if exists("g:syntax_on") <Bar>
\ syntax off <Bar>
\ else <Bar>
\ syntax enable <Bar>
@@ -925,7 +925,7 @@ Example: >
or >
// vim:syntax=c.doxygen
-It can also be done automatically for c, cpp and idl files by setting the
+It can also be done automatically for C, C++, C# and IDL files by setting the
global or buffer-local variable load_doxygen_syntax. This is done by adding
the following to your .vimrc. >
:let g:load_doxygen_syntax=1
@@ -3168,7 +3168,7 @@ and may be mixed with patterns.
Not all commands accept all arguments. This table shows which arguments
can not be used for all commands:
- *E395* *E396*
+ *E395*
contains oneline fold display extend concealends~
:syntax keyword - - - - - -
:syntax match yes - yes yes yes -
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index e4bdbc513..f10ee6943 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -33,8 +33,6 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
Before release 7.3:
- Rename vim73 branch to default (hints: Xavier de Gaye, 2010 May 23)
-Should readfile() ignore BOM when not in binary mode?
-
Bug: searching for tags file uses 'suffixesadd', should not happen. (Dominique
Pelle, 2010 June 28)
diff --git a/src/buffer.c b/src/buffer.c
index 0b3742b30..ad484b452 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -398,13 +398,7 @@ close_buffer(win, buf, action)
/* Return when a window is displaying the buffer or when it's not
* unloaded. */
if (buf->b_nwindows > 0 || !unload_buf)
- {
-#if 0 /* why was this here? */
- if (buf == curbuf)
- u_sync(); /* sync undo before going to another buffer */
-#endif
return;
- }
/* Always remove the buffer when there is no file name. */
if (buf->b_ffname == NULL)
diff --git a/src/dosinst.c b/src/dosinst.c
index 84d171baf..0ff8e69b6 100644
--- a/src/dosinst.c
+++ b/src/dosinst.c
@@ -32,9 +32,6 @@ char *default_bat_dir = NULL; /* when not NULL, use this as the default
directory to write .bat files in */
char *default_vim_dir = NULL; /* when not NULL, use this as the default
install dir for NSIS */
-#if 0
-char homedir[BUFSIZE]; /* home directory or "" */
-#endif
/*
* Structure used for each choice the user can make.
@@ -720,39 +717,6 @@ inspect_system(void)
fclose(fd);
else
*oldvimrc = NUL;
-
-#if 0 /* currently not used */
- /*
- * Get default home directory.
- * Prefer $HOME if it's set. For Win NT use $HOMEDRIVE and $HOMEPATH.
- * Otherwise, if there is a "c:" drive use that.
- */
- p = getenv("HOME");
- if (p != NULL && *p != NUL && strlen(p) < BUFSIZE)
- strcpy(homedir, p);
- else
- {
- p = getenv("HOMEDRIVE");
- if (p != NULL && *p != NUL && strlen(p) + 2 < BUFSIZE)
- {
- strcpy(homedir, p);
- p = getenv("HOMEPATH");
- if (p != NULL && *p != NUL && strlen(homedir) + strlen(p) < BUFSIZE)
- strcat(homedir, p);
- else
- strcat(homedir, "\\");
- }
- else
- {
- struct stat st;
-
- if (stat("c:\\", &st) == 0)
- strcpy(homedir, "c:\\");
- else
- *homedir = NUL;
- }
- }
-#endif
}
/*
diff --git a/src/edit.c b/src/edit.c
index ed5b79859..04a17ebf7 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -192,9 +192,6 @@ static int spell_bad_len = 0; /* length of located bad word */
#endif
static void stop_insert __ARGS((pos_T *end_insert_pos, int esc));
static int echeck_abbr __ARGS((int));
-#if 0
-static void replace_push_off __ARGS((int c));
-#endif
static int replace_pop __ARGS((void));
static void replace_join __ARGS((int off));
static void replace_pop_ins __ARGS((void));
@@ -3352,19 +3349,6 @@ ins_compl_new_leader()
compl_restarting = FALSE;
}
-#if 0 /* disabled, made CTRL-L, BS and typing char jump to original text. */
- if (!compl_used_match)
- {
- /* Go to the original text, since none of the matches is inserted. */
- if (compl_first_match->cp_prev != NULL
- && (compl_first_match->cp_prev->cp_flags & ORIGINAL_TEXT))
- compl_shown_match = compl_first_match->cp_prev;
- else
- compl_shown_match = compl_first_match;
- compl_curr_match = compl_shown_match;
- compl_shows_dir = compl_direction;
- }
-#endif
compl_enter_selects = !compl_used_match;
/* Show the popup menu with a different set of matches. */
@@ -7152,26 +7136,6 @@ replace_push_mb(p)
}
#endif
-#if 0
-/*
- * call replace_push(c) with replace_offset set to the first NUL.
- */
- static void
-replace_push_off(c)
- int c;
-{
- char_u *p;
-
- p = replace_stack + replace_stack_nr;
- for (replace_offset = 1; replace_offset < replace_stack_nr;
- ++replace_offset)
- if (*--p == NUL)
- break;
- replace_push(c);
- replace_offset = 0;
-}
-#endif
-
/*
* Pop one item from the replace stack.
* return -1 if stack empty
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 8a18a4cce..2475bb9c1 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -640,13 +640,6 @@ getcmdline(firstc, count, indent)
c = p_wc;
}
}
-#if 0 /* If enabled <Down> on a file takes you _completely_ out of wildmenu */
- if (p_wmnu
- && (xpc.xp_context == EXPAND_FILES
- || xpc.xp_context == EXPAND_MENUNAMES)
- && (c == K_UP || c == K_DOWN))
- xpc.xp_context = EXPAND_NOTHING;
-#endif
#endif /* FEAT_WILDMENU */
diff --git a/src/getchar.c b/src/getchar.c
index f1a4dda06..c892b4645 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -5087,13 +5087,6 @@ static struct initmap
#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
/* Use the Windows (CUA) keybindings. */
# ifdef FEAT_GUI
-# if 0 /* These are now used to move tab pages */
- {(char_u *)"<C-PageUp> H", NORMAL+VIS_SEL},
- {(char_u *)"<C-PageUp> <C-O>H",INSERT},
- {(char_u *)"<C-PageDown> L$", NORMAL+VIS_SEL},
- {(char_u *)"<C-PageDown> <C-O>L<C-O>$", INSERT},
-# endif
-
/* paste, copy and cut */
{(char_u *)"<S-Insert> \"*P", NORMAL},
{(char_u *)"<S-Insert> \"-d\"*P", VIS_SEL},
@@ -5104,12 +5097,6 @@ static struct initmap
{(char_u *)"<C-X> \"*d", VIS_SEL},
/* Missing: CTRL-C (cancel) and CTRL-V (block selection) */
# else
-# if 0 /* These are now used to move tab pages */
- {(char_u *)"\316\204 H", NORMAL+VIS_SEL}, /* CTRL-PageUp is "H" */
- {(char_u *)"\316\204 \017H",INSERT}, /* CTRL-PageUp is "^OH"*/
- {(char_u *)"\316v L$", NORMAL+VIS_SEL}, /* CTRL-PageDown is "L$" */
- {(char_u *)"\316v \017L\017$", INSERT}, /* CTRL-PageDown ="^OL^O$"*/
-# endif
{(char_u *)"\316w <C-Home>", NORMAL+VIS_SEL},
{(char_u *)"\316w <C-Home>", INSERT+CMDLINE},
{(char_u *)"\316u <C-End>", NORMAL+VIS_SEL},
@@ -5119,7 +5106,7 @@ static struct initmap
# ifdef FEAT_CLIPBOARD
# ifdef DJGPP
{(char_u *)"\316\122 \"*P", NORMAL}, /* SHIFT-Insert is "*P */
- {(char_u *)"\316\122 \"-d\"*P", VIS_SEL}, /* SHIFT-Insert is "-d"*P */
+ {(char_u *)"\316\122 \"-d\"*P", VIS_SEL}, /* SHIFT-Insert is "-d"*P */
{(char_u *)"\316\122 \022\017*", INSERT}, /* SHIFT-Insert is ^R^O* */
{(char_u *)"\316\222 \"*y", VIS_SEL}, /* CTRL-Insert is "*y */
# if 0 /* Shift-Del produces the same code as Del */
@@ -5129,7 +5116,7 @@ static struct initmap
{(char_u *)"\030 \"-d", VIS_SEL}, /* CTRL-X is "-d */
# else
{(char_u *)"\316\324 \"*P", NORMAL}, /* SHIFT-Insert is "*P */
- {(char_u *)"\316\324 \"-d\"*P", VIS_SEL}, /* SHIFT-Insert is "-d"*P */
+ {(char_u *)"\316\324 \"-d\"*P", VIS_SEL}, /* SHIFT-Insert is "-d"*P */
{(char_u *)"\316\324 \022\017*", INSERT}, /* SHIFT-Insert is ^R^O* */
{(char_u *)"\316\325 \"*y", VIS_SEL}, /* CTRL-Insert is "*y */
{(char_u *)"\316\327 \"*d", VIS_SEL}, /* SHIFT-Del is "*d */
diff --git a/src/gui.c b/src/gui.c
index 90209bedc..87930c6b7 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -1571,14 +1571,7 @@ gui_write(s, len)
{
char_u *p;
int arg1 = 0, arg2 = 0;
- /* this doesn't make sense, disabled until someone can explain why it
- * would be needed */
-#if 0 && (defined(RISCOS) || defined(WIN16))
- int force_cursor = TRUE; /* JK230798, stop Vim being smart or
- our redraw speed will suffer */
-#else
int force_cursor = FALSE; /* force cursor update */
-#endif
int force_scrollbar = FALSE;
static win_T *old_curwin = NULL;
diff --git a/src/gui_athena.c b/src/gui_athena.c
index ffb65ae2f..7cd08c6e3 100644
--- a/src/gui_athena.c
+++ b/src/gui_athena.c
@@ -236,21 +236,6 @@ gui_x11_create_widgets()
*/
gui.border_offset = gui.border_width;
-#if 0 /* not needed? */
- XtInitializeWidgetClass(formWidgetClass);
- XtInitializeWidgetClass(boxWidgetClass);
- XtInitializeWidgetClass(coreWidgetClass);
-#ifdef FEAT_MENU
- XtInitializeWidgetClass(menuButtonWidgetClass);
-#endif
- XtInitializeWidgetClass(simpleMenuWidgetClass);
-#ifdef FEAT_GUI_NEXTAW
- XtInitializeWidgetClass(scrollbarWidgetClass);
-#else
- XtInitializeWidgetClass(vim_scrollbarWidgetClass);
-#endif
-#endif
-
/* The form containing all the other widgets */
vimForm = XtVaCreateManagedWidget("vimForm",
formWidgetClass, vimShell,
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 2a4b52064..76ca4fef7 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -4484,52 +4484,6 @@ gui_mch_get_font(char_u *name, int report_error)
return NULL;
}
- /*
- * The fixed-width check has been disabled for GTK+ 2. Rationale:
- *
- * - The check tends to report false positives, particularly
- * in non-Latin locales or with old X fonts.
- * - Thanks to our fixed-width hack in gui_gtk2_draw_string(),
- * GTK+ 2 Vim is actually capable of displaying variable width
- * fonts. Those will just be spaced out like in AA xterm.
- * - Failing here for the default font causes GUI startup to fail
- * even with wiped out configuration files.
- * - The font dialog displays all fonts unfiltered, and it's rather
- * annoying if 95% of the listed fonts produce an error message.
- */
-#if 0
- {
- /* Check that this is a mono-spaced font. Naturally, this is a bit
- * hackish -- fixed-width isn't really suitable for i18n text :/ */
- PangoLayout *layout;
- unsigned int i;
- int last_width = -1;
- const char test_chars[] = { 'W', 'i', ',', 'x' }; /* arbitrary */
-
- layout = pango_layout_new(gui.text_context);
- pango_layout_set_font_description(layout, font);
-
- for (i = 0; i < G_N_ELEMENTS(test_chars); ++i)
- {
- int width;
-
- pango_layout_set_text(layout, &test_chars[i], 1);
- pango_layout_get_size(layout, &width, NULL);
-
- if (last_width >= 0 && width != last_width)
- {
- pango_font_description_free(font);
- font = NULL;
- break;
- }
-
- last_width = width;
- }
-
- g_object_unref(layout);
- }
-#endif
-
return font;
}
diff --git a/src/gui_motif.c b/src/gui_motif.c
index 397ab597d..51e6112cc 100644
--- a/src/gui_motif.c
+++ b/src/gui_motif.c
@@ -1335,18 +1335,11 @@ gui_mch_add_menu_item(menu, idx)
else
wid = 4;
-#if 0
- /* We better use a FormWidget here, since it's far more
- * flexible in terms of size. */
- type = xmFormWidgetClass;
- XtSetArg(args[n], XmNwidth, wid); n++;
-#else
type = xmSeparatorWidgetClass;
XtSetArg(args[n], XmNwidth, wid); n++;
XtSetArg(args[n], XmNminWidth, wid); n++;
XtSetArg(args[n], XmNorientation, XmVERTICAL); n++;
XtSetArg(args[n], XmNseparatorType, XmSHADOW_ETCHED_IN); n++;
-#endif
}
else
{
@@ -2947,17 +2940,6 @@ gui_mch_compute_footer_height()
return (int) height + top + bottom + (shadow << 1);
}
-#if 0 /* not used */
- void
-gui_mch_set_footer_pos(h)
- int h; /* textArea height */
-{
- XtVaSetValues(footer,
- XmNtopOffset, h + 7,
- NULL);
-}
-#endif
-
void
gui_mch_enable_footer(showit)
int showit;
diff --git a/src/gui_w32.c b/src/gui_w32.c
index 1fdc99396..3a54e817e 100644
--- a/src/gui_w32.c
+++ b/src/gui_w32.c
@@ -682,40 +682,6 @@ _OnSettingChange(UINT n)
return 0;
}
-#if 0 /* disabled, a gap appears below and beside the window, and the window
- can be moved (in a strange way) */
-/*
- * Even though we have _DuringSizing() which makes the rubber band a valid
- * size, we need this for when the user maximises the window.
- * TODO: Doesn't seem to adjust the width though for some reason.
- */
- static BOOL
-_OnWindowPosChanging(
- HWND hwnd,
- LPWINDOWPOS lpwpos)
-{
- RECT workarea_rect;
-
- if (!(lpwpos->flags & SWP_NOSIZE))
- {
- if (IsMaximized(hwnd)
- && (os_version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
- || (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
- && os_version.dwMajorVersion >= 4)))
- {
- SystemParametersInfo(SPI_GETWORKAREA, 0, &workarea_rect, 0);
- lpwpos->x = workarea_rect.left;
- lpwpos->y = workarea_rect.top;
- lpwpos->cx = workarea_rect.right - workarea_rect.left;
- lpwpos->cy = workarea_rect.bottom - workarea_rect.top;
- }
- gui_mswin_get_valid_dimensions(lpwpos->cx, lpwpos->cy,
- &lpwpos->cx, &lpwpos->cy);
- }
- return 0;
-}
-#endif
-
#ifdef FEAT_NETBEANS_INTG
static void
_OnWindowPosChanged(
@@ -3078,14 +3044,8 @@ gui_mch_dialog(
return dfltbutton; /* return default option */
#endif
-#if 0
- /* If there is no window yet, open it. */
- if (s_hwnd == NULL && gui_mch_init() == FAIL)
- return dfltbutton;
-#else
if (s_hwnd == NULL)
get_dialog_font_metrics();
-#endif
if ((type < 0) || (type > VIM_LAST_TYPE))
type = 0;
@@ -3443,15 +3403,6 @@ gui_mch_dialog(
DLG_NONBUTTON_CONTROL + 0, (WORD)0x0082,
dlg_icons[type]);
-#if 0
- /* Dialog message */
- p = add_dialog_element(p, SS_LEFT,
- PixelToDialogX(2 * dlgPaddingX + DLG_ICON_WIDTH),
- PixelToDialogY(dlgPaddingY),
- (WORD)(PixelToDialogX(messageWidth) + 1),
- PixelToDialogY(msgheight),
- DLG_NONBUTTON_CONTROL + 1, (WORD)0x0082, message);
-#else
/* Dialog message */
p = add_dialog_element(p, ES_LEFT|scroll_flag|ES_MULTILINE|ES_READONLY,
PixelToDialogX(2 * dlgPaddingX + DLG_ICON_WIDTH),
@@ -3459,7 +3410,6 @@ gui_mch_dialog(
(WORD)(PixelToDialogX(messageWidth) + 1),
PixelToDialogY(msgheight),
DLG_NONBUTTON_CONTROL + 1, (WORD)0x0081, message);
-#endif
/* Edit box */
if (textfield != NULL)
@@ -4289,18 +4239,6 @@ dyn_imm_load(void)
return;
}
-# if 0 /* not used */
- int
-dyn_imm_unload(void)
-{
- if (!hLibImm)
- return FALSE;
- FreeLibrary(hLibImm);
- hLibImm = NULL;
- return TRUE;
-}
-# endif
-
#endif
#if defined(FEAT_SIGN_ICONS) || defined(PROTO)
diff --git a/src/gui_x11.c b/src/gui_x11.c
index f955bc85d..b61aae077 100644
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -3392,17 +3392,6 @@ gui_x11_get_last_mouse_event()
* to provide room for the bitmap! */
# define SIGN_WIDTH (gui.char_width * 2)
-#if 0 /* not used */
- void
-gui_mch_clearsign(row)
- int row;
-{
- if (gui.in_use)
- XClearArea(gui.dpy, gui.wid, 0, TEXT_Y(row) - gui.char_height,
- SIGN_WIDTH, gui.char_height, FALSE);
-}
-#endif
-
void
gui_mch_drawsign(row, col, typenr)
int row;
diff --git a/src/hashtab.c b/src/hashtab.c
index e0d3e1a08..8b53aa401 100644
--- a/src/hashtab.c
+++ b/src/hashtab.c
@@ -492,25 +492,10 @@ hash_hash(key)
want to crash if we get one. */
p = key + 1;
-#if 0
- /* ElfHash algorithm, which is supposed to have an even distribution.
- * Suggested by Charles Campbell. */
- hash_T g;
-
- while (*p != NUL)
- {
- hash = (hash << 4) + *p++; /* clear low 4 bits of hash, add char */
- g = hash & 0xf0000000L; /* g has high 4 bits of hash only */
- if (g != 0)
- hash ^= g >> 24; /* xor g's high 4 bits into hash */
- }
-#else
-
/* A simplistic algorithm that appears to do very well.
* Suggested by George Reilly. */
while (*p != NUL)
hash = hash * 101 + *p++;
-#endif
return hash;
}
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 8a2e32bb1..10c614855 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -405,7 +405,7 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
#endif
static PyObject *
-VimEval(PyObject *self UNUSED, PyObject *args)
+VimEval(PyObject *self UNUSED, PyObject *args UNUSED)
{
#ifdef FEAT_EVAL
char *expr;
diff --git a/src/if_tcl.c b/src/if_tcl.c
index 6ec48cc05..f87407d4f 100644
--- a/src/if_tcl.c
+++ b/src/if_tcl.c
@@ -1494,13 +1494,6 @@ tclgetref(interp, refstartP, prefix, vimobj, proc)
else
{
ref = (struct ref *)Tcl_Alloc(sizeof(struct ref));
-#if 0 /* Tcl_Alloc either succeeds or does not return */
- if (!ref)
- {
- Tcl_SetResult(interp, "out of memory", TCL_STATIC);
- return NULL;
- }
-#endif
ref->interp = NULL;
ref->next = (struct ref *)(*refstartP);
(*refstartP) = (void *)ref;
diff --git a/src/integration.c b/src/integration.c
index 88962755b..8de684c07 100644
--- a/src/integration.c
+++ b/src/integration.c
@@ -392,7 +392,7 @@ messageFromEserve(XtPointer clientData UNUSED,
pingNum = atoi(&cmd[5]);
workshop_send_ack(ackNum);
- WHAT DO I DO HERE?
+ /* WHAT DO I DO HERE? */
#endif
}
HANDLE_ERRORS(cmd);
@@ -754,51 +754,6 @@ void workshop_disconnect()
* Utility functions
*/
-#if 0
-/* Set icon for the window */
-void
-workshop_set_icon(Display *display, Widget shell, char **xpmdata,
- int width, int height)
-{
- Pixel bgPixel;
- XpmAttributes xpmAttributes;
- XSetWindowAttributes attr;
- Window iconWindow;
- int depth;
- int screenNum;
- Pixmap pixmap;
-
- /* Create the pixmap/icon window which is shown when you
- * iconify the sccs viewer
- * This code snipped was adapted from Sun WorkShop's source base,
- * setIcon.cc.
- */
- XtVaGetValues(shell, XmNbackground, &bgPixel, NULL);
- screenNum = XScreenNumberOfScreen(XtScreen(shell));
- depth = DisplayPlanes(display, screenNum);
- xpmAttributes.valuemask = XpmColorSymbols;
- xpmAttributes.numsymbols = 1;
- xpmAttributes.colorsymbols =
- (XpmColorSymbol *)XtMalloc(sizeof (XpmColorSymbol) *
- xpmAttributes.numsymbols);
- xpmAttributes.colorsymbols[0].name = NOCATGETS("BgColor");
- xpmAttributes.colorsymbols[0].value = NULL;
- xpmAttributes.colorsymbols[0].pixel = bgPixel;
- if (XpmCreatePixmapFromData(display,
- RootWindow(display, screenNum), xpmdata, &pixmap,
- NULL, &xpmAttributes) >= 0) {
- attr.background_pixmap = pixmap;
- iconWindow = XCreateWindow(display, RootWindow(display,
- screenNum), 0, 0, width, height, 0, depth,
- (unsigned int)CopyFromParent,
- CopyFromParent, CWBackPixmap, &attr);
-
- XtVaSetValues(shell,
- XtNiconWindow, iconWindow, NULL);
- }
- XtFree((char *)xpmAttributes.colorsymbols);
-}
-#endif
/* Minimize and maximize shells. From libutil's shell.cc. */
@@ -933,39 +888,6 @@ Boolean workshop_get_width_height(int *width, int *height)
return success;
}
-#if 0
-Boolean workshop_get_rows_cols(int *rows, int *cols)
-{
- static int r = 0;
- static int c = 0;
- static Boolean firstTime = True;
- static Boolean success = False;
-
- if (firstTime) {
- char *settings;
-
- settings = getenv(NOCATGETS("SPRO_GUI_ROWS_COLS"));
- if (settings != NULL) {
- r = atoi(settings);
- settings = strrchr(settings, ':');
- if (settings++ != NULL) {
- c = atoi(settings);
- }
- if (r > 0 && c > 0) {
- success = True;
- }
- firstTime = False;
- }
- }
-
- if (success) {
- *rows = r;
- *cols = c;
- }
- return success;
-}
-#endif
-
/*
* Toolbar code
*/
@@ -1050,20 +972,6 @@ void workshop_set_option_first(char *name, char *value)
}
-#if 0
-/*
- * Send information to eserve on certain editor events
- * You must make sure these are called when necessary
- */
-void workshop_file_closed(char *filename)
-{
- char buffer[2*MAXPATHLEN];
- vim_snprintf(buffer, sizeof(buffer),
- NOCATGETS("deletedFile %s\n"), filename);
- dummy = write(sd, buffer, strlen(buffer));
-}
-#endif
-
void workshop_file_closed_lineno(char *filename, int lineno)
{
char buffer[2*MAXPATHLEN];
@@ -1093,24 +1001,6 @@ void workshop_file_saved(char *filename)
workshop_moved_marks(filename);
}
-#if 0
-void workshop_file_modified(char *filename)
-{
- char buffer[2*MAXPATHLEN];
- vim_snprintf(buffer, sizeof(buffer),
- NOCATGETS("modifiedFile %s\n"), filename);
- dummy = write(sd, buffer, strlen(buffer));
-}
-
-void workshop_move_mark(char *filename, int markId, int newLineno)
-{
- char buffer[2*MAXPATHLEN];
- vim_snprintf(buffer, sizeof(buffer),
- NOCATGETS("moveMark %s %d %d\n"), filename, markId, newLineno);
- dummy = write(sd, buffer, strlen(buffer));
-}
-#endif
-
void workshop_frame_moved(int new_x, int new_y, int new_w, int new_h)
{
char buffer[200];
diff --git a/src/integration.h b/src/integration.h
index e984f56ca..65daea77d 100644
--- a/src/integration.h
+++ b/src/integration.h
@@ -410,15 +410,6 @@ void workshop_hotkey_pressed(void *frame, void *clientData);
int workshop_invoked(void);
#endif
-#if 0
-/*
- *Set the desktop icon of the current shell to the given xpm icon.
- * Standard WorkShop desktop icons should be 48x48.
- */
-void workshop_set_icon(Display *display, Widget shell, char **xpmdata,
- int width, int height);
-#endif
-
/* Minimize (iconify) the given shell */
void workshop_minimize_shell(Widget shell);
diff --git a/src/main.c b/src/main.c
index cadc2efd2..435e6074e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3255,10 +3255,6 @@ usage()
# endif
main_msg(_("-display <display>\tRun vim on <display>"));
main_msg(_("-iconic\t\tStart vim iconified"));
-# if 0
- main_msg(_("-name <name>\t\tUse resource as if vim was <name>"));
- mch_msg(_("\t\t\t (Unimplemented)\n"));
-# endif
main_msg(_("-background <color>\tUse <color> for the background (also: -bg)"));
main_msg(_("-foreground <color>\tUse <color> for normal text (also: -fg)"));
main_msg(_("-font <font>\t\tUse <font> for normal text (also: -fn)"));
diff --git a/src/memline.c b/src/memline.c
index 16b3b3561..136f80508 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -3355,26 +3355,6 @@ ml_firstmarked()
return (linenr_T) 0;
}
-#if 0 /* not used */
-/*
- * return TRUE if line 'lnum' has a mark
- */
- int
-ml_has_mark(lnum)
- linenr_T lnum;
-{
- bhdr_T *hp;
- DATA_BL *dp;
-
- if (curbuf->b_ml.ml_mfp == NULL
- || (hp = ml_find_line(curbuf, lnum, ML_FIND)) == NULL)
- return FALSE;
-
- dp = (DATA_BL *)(hp->bh_data);
- return (int)((dp->db_index[lnum - curbuf->b_ml.ml_locked_low]) & DB_MARKED);
-}
-#endif
-
/*
* clear all DB_MARKED flags
*/
diff --git a/src/misc1.c b/src/misc1.c
index ef7c10c5e..911ba4a21 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -2413,24 +2413,6 @@ pchar_cursor(c)
+ curwin->w_cursor.col) = c;
}
-#if 0 /* not used */
-/*
- * Put *pos at end of current buffer
- */
- void
-goto_endofbuf(pos)
- pos_T *pos;
-{
- char_u *p;
-
- pos->lnum = curbuf->b_ml.ml_line_count;
- pos->col = 0;
- p = ml_get(pos->lnum);
- while (*p++)
- ++pos->col;
-}
-#endif
-
/*
* When extra == 0: Return TRUE if the cursor is before or on the first
* non-blank in the line.
diff --git a/src/misc2.c b/src/misc2.c
index 8492b3e81..21c5b42e9 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1824,27 +1824,6 @@ vim_strnicmp(s1, s2, len)
}
#endif
-#if 0 /* currently not used */
-/*
- * Check if string "s2" appears somewhere in "s1" while ignoring case.
- * Return NULL if not, a pointer to the first occurrence if it does.
- */
- char_u *
-vim_stristr(s1, s2)
- char_u *s1;
- char_u *s2;
-{
- char_u *p;
- int len = STRLEN(s2);
- char_u *end = s1 + STRLEN(s1) - len;
-
- for (p = s1; p <= end; ++p)
- if (STRNICMP(p, s2, len) == 0)
- return p;
- return NULL;
-}
-#endif
-
/*
* Version of strchr() and strrchr() that handle unsigned char strings
* with characters from 128 to 255 correctly. It also doesn't return a
diff --git a/src/move.c b/src/move.c
index 3dd45c00d..173063134 100644
--- a/src/move.c
+++ b/src/move.c
@@ -543,19 +543,6 @@ changed_cline_bef_curs_win(wp)
|VALID_CHEIGHT|VALID_TOPLINE);
}
-#if 0 /* not used */
-/*
- * Call this function when the length of the cursor line (in screen
- * characters) has changed, and the position of the cursor doesn't change.
- * Need to take care of w_botline separately!
- */
- void
-changed_cline_aft_curs()
-{
- curwin->w_valid &= ~VALID_CHEIGHT;
-}
-#endif
-
/*
* Call this function when the length of a line (in screen characters) above
* the cursor have changed.
@@ -613,18 +600,6 @@ invalidate_botline_win(wp)
wp->w_valid &= ~(VALID_BOTLINE|VALID_BOTLINE_AP);
}
-#if 0 /* never used */
-/*
- * Mark curwin->w_botline as approximated (because of some small change in the
- * buffer).
- */
- void
-approximate_botline()
-{
- curwin->w_valid &= ~VALID_BOTLINE;
-}
-#endif
-
void
approximate_botline_win(wp)
win_T *wp;
@@ -632,28 +607,6 @@ approximate_botline_win(wp)
wp->w_valid &= ~VALID_BOTLINE;
}
-#if 0 /* not used */
-/*
- * Return TRUE if curwin->w_botline is valid.
- */
- int
-botline_valid()
-{
- return (curwin->w_valid & VALID_BOTLINE);
-}
-#endif
-
-#if 0 /* not used */
-/*
- * Return TRUE if curwin->w_botline is valid or approximated.
- */
- int
-botline_approximated()
-{
- return (curwin->w_valid & VALID_BOTLINE_AP);
-}
-#endif
-
/*
* Return TRUE if curwin->w_wrow and curwin->w_wcol are valid.
*/
diff --git a/src/netbeans.c b/src/netbeans.c
index 68914eb12..f5a158965 100644
--- a/src/netbeans.c
+++ b/src/netbeans.c
@@ -2031,11 +2031,6 @@ nb_do_cmd(
handle_key_queue();
}
-#if 0 /* never used */
- buf->internalname = (char *)alloc_clear(8);
- sprintf(buf->internalname, "<%d>", bufno);
- buf->netbeansOwns = 0;
-#endif
/* =====================================================================*/
}
else if (streq((char *)cmd, "setFullName"))
@@ -3252,26 +3247,8 @@ netbeans_removed(
void
netbeans_unmodified(buf_T *bufp UNUSED)
{
- if (!NETBEANS_OPEN)
- return;
-
-#if 0
- char_u buf[128];
- int bufno;
- nbbuf_T *nbbuf;
-
- /* This has been disabled, because NetBeans considers a buffer modified
+ /* This is a no-op, because NetBeans considers a buffer modified
* even when all changes have been undone. */
- nbbuf = nb_bufp2nbbuf_fire(bufp, &bufno);
- if (nbbuf == NULL)
- return;
-
- nbbuf->modified = 0;
-
- sprintf((char *)buf, "%d:unmodified=%d\n", bufno, r_cmdno);
- nbdebug(("EVT: %s", buf));
- nb_send((char *)buf, "netbeans_unmodified");
-#endif
}
/*
diff --git a/src/os_unix.c b/src/os_unix.c
index 6d4d499d8..a82c65dcb 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -669,12 +669,6 @@ mch_delay(msec, ignoreinput)
WaitForChar(msec);
}
-#if 0 /* disabled, no longer needed now that regmatch() is not recursive */
-# if defined(HAVE_GETRLIMIT)
-# define HAVE_STACK_LIMIT
-# endif
-#endif
-
#if defined(HAVE_STACK_LIMIT) \
|| (!defined(HAVE_SIGALTSTACK) && defined(HAVE_SIGSTACK))
# define HAVE_CHECK_STACK_GROWTH
diff --git a/src/popupmnu.c b/src/popupmnu.c
index 9dce37848..0afa0b7bc 100644
--- a/src/popupmnu.c
+++ b/src/popupmnu.c
@@ -472,17 +472,6 @@ pum_redraw()
}
}
-#if 0 /* not used yet */
-/*
- * Return the index of the currently selected item.
- */
- int
-pum_get_selected()
-{
- return pum_selected;
-}
-#endif
-
/*
* Set the index of the currently selected item. The menu will scroll when
* necessary. When "n" is out of range don't scroll.
diff --git a/src/screen.c b/src/screen.c
index 7b8a757ff..a933d6cb0 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -9429,18 +9429,13 @@ showmode()
{
MSG_PUTS_ATTR("--", attr);
#if defined(FEAT_XIM)
-# if 0 /* old version, changed by SungHyun Nam July 2008 */
- if (xic != NULL && im_get_status() && !p_imdisable
- && curbuf->b_p_iminsert == B_IMODE_IM)
-# else
if (
-# ifdef FEAT_GUI_GTK
+# ifdef FEAT_GUI_GTK
preedit_get_status()
-# else
+# else
im_get_status()
-# endif
- )
# endif
+ )
# ifdef FEAT_GUI_GTK /* most of the time, it's not XIM being used */
MSG_PUTS_ATTR(" IM", attr);
# else
diff --git a/src/syntax.c b/src/syntax.c
index 802ebec53..fbc123cc1 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -4509,13 +4509,6 @@ get_syn_options(arg, opt, conceal_char)
}
else if (flagtab[fidx].argtype == 2)
{
-#if 0 /* cannot happen */
- if (opt->cont_in_list == NULL)
- {
- EMSG(_("E396: containedin argument not accepted here"));
- return NULL;
- }
-#endif
if (get_id_list(&arg, 11, &opt->cont_in_list) == FAIL)
return NULL;
}
diff --git a/src/ui.c b/src/ui.c
index a05490c67..9a044767b 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -901,64 +901,6 @@ clip_process_selection(button, col, row, repeated_click)
#endif
}
-#if 0 /* not used */
-/*
- * Called after an Expose event to redraw the selection
- */
- void
-clip_redraw_selection(x, y, w, h)
- int x;
- int y;
- int w;
- int h;
-{
- VimClipboard *cb = &clip_star;
- int row1, col1, row2, col2;
- int row;
- int start;
- int end;
-
- if (cb->state == SELECT_CLEARED)
- return;
-
- row1 = check_row(Y_2_ROW(y));
- col1 = check_col(X_2_COL(x));
- row2 = check_row(Y_2_ROW(y + h - 1));
- col2 = check_col(X_2_COL(x + w - 1));
-
- /* Limit the rows that need to be re-drawn */
- if (cb->start.lnum > row1)
- row1 = cb->start.lnum;
- if (cb->end.lnum < row2)
- row2 = cb->end.lnum;
-
- /* Look at each row that might need to be re-drawn */
- for (row = row1; row <= row2; row++)
- {
- /* For the first selection row, use the starting selection column */
- if (row == cb->start.lnum)
- start = cb->start.col;
- else
- start = 0;
-
- /* For the last selection row, use the ending selection column */
- if (row == cb->end.lnum)
- end = cb->end.col;
- else
- end = Columns;
-
- if (col1 > start)
- start = col1;
-
- if (col2 < end)
- end = col2 + 1;
-
- if (end > start)
- gui_mch_invert_rectangle(row, start, 1, end - start);
- }
-}
-#endif
-
# if defined(FEAT_GUI) || defined(PROTO)
/*
* Redraw part of the selection if character at "row,col" is inside of it.
diff --git a/src/uninstal.c b/src/uninstal.c
index 99cdc679c..0532eb9f3 100644
--- a/src/uninstal.c
+++ b/src/uninstal.c
@@ -286,30 +286,6 @@ remove_start_menu(void)
}
#endif
-#if 0 /* currently not used */
-/*
- * Return TRUE when we're on Windows 95/98/ME.
- */
- static int
-win95(void)
-{
- static int done = FALSE;
- static DWORD PlatformId;
-
- if (!done)
- {
- OSVERSIONINFO ovi;
-
- ovi.dwOSVersionInfoSize = sizeof(ovi);
- GetVersionEx(&ovi);
- PlatformId = ovi.dwPlatformId;
- done = TRUE;
- }
- /* Win NT/2000/XP is VER_PLATFORM_WIN32_NT */
- return PlatformId == VER_PLATFORM_WIN32_WINDOWS;
-}
-#endif
-
static void
delete_uninstall_key(void)
{
diff --git a/src/workshop.c b/src/workshop.c
index c9c52954d..89f55efc7 100644
--- a/src/workshop.c
+++ b/src/workshop.c
@@ -41,18 +41,12 @@ void workshop_hotkeys(Boolean);
static Boolean isShowing(int);
static win_T *get_window(buf_T *);
-#if 0
-static int get_buffer_number(buf_T *);
-#endif
static void updatePriority(Boolean);
static char *addUniqueMnemonic(char *, char *);
static char *fixup(char *);
static char *get_selection(buf_T *);
static char *append_selection(int, char *, int *, int *);
static void load_buffer_by_name(char *, int);
-#if 0
-static void load_buffer_by_number(int, int);
-#endif
static void load_window(char *, int lnum);
static void warp_to_pc(int);
#ifdef FEAT_BEVAL
@@ -477,22 +471,6 @@ workshop_delete_mark(
coloncmd(cbuf, TRUE);
}
-#if 0 /* not used */
- void
-workshop_delete_all_marks(
- void *window,
- Boolean doRefresh)
-{
-#ifdef WSDEBUG_TRACE
- if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
- wstrace("workshop_delete_all_marks(%#x, %s)\n",
- window, doRefresh ? "True" : "False");
-#endif
-
- coloncmd("sign unplace *", TRUE);
-}
-#endif
-
int
workshop_get_mark_lineno(
char *filename,
@@ -517,19 +495,6 @@ workshop_get_mark_lineno(
}
-#if 0 /* not used */
- void
-workshop_adjust_marks(Widget *window, int pos,
- int inserted, int deleted)
-{
-#ifdef WSDEBUG_TRACE
- if (WSDLEVEL(WS_TRACE_VERBOSE | WS_TRACE))
- wstrace("XXXworkshop_adjust_marks(%s, %d, %d, %d)\n",
- window ? XtName(window) : "<None>", pos, inserted, deleted);
-#endif
-}
-#endif
-
/*
* Are there any moved marks? If so, call workshop_move_mark on
* each of them now. This is how eserve can find out if for example
@@ -1362,26 +1327,6 @@ get_window(
}
-#if 0 /* not used */
- static int
-get_buffer_number(
- buf_T *buf) /* buffer to get position of */
-{
- buf_T *bp; /* iterate over buffer list */
- int pos; /* the position in the buffer list */
-
- pos = 1;
- for (bp = firstbuf; bp != NULL; bp = bp->b_next)
- {
- if (bp == buf)
- return pos;
- pos++;
- }
-
- return 1;
-}
-#endif
-
static void
updatePriority(
Boolean subMenu) /* if True then start new submenu pri */