Anonymous avatar Anonymous committed fdf5507

updated for version 7.0022

Comments (0)

Files changed (20)

runtime/doc/eval.txt

-*eval.txt*      For Vim version 7.0aa.  Last change: 2004 Oct 24
+*eval.txt*      For Vim version 7.0aa.  Last change: 2004 Dec 10
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
 getcwd()			String	the current working directory
 getfperm( {fname})		String	file permissions of file {fname}
 getfsize( {fname})		Number	size in bytes of file {fname}
+getfontname( [{name}])		String	name of font being used
 getftime( {fname})		Number	last modification time of file
 getftype( {fname})		String	description of type of file {fname}
 getline( {lnum})		String	line {lnum} from current buffer
 		If {fname} is a directory, 0 is returned.
 		If the file {fname} can't be found, -1 is returned.
 
+getfontname([{name}])					*getfontname()*
+		Without an argument returns the name of the normal font being
+		used.  Like what is used for the Normal highlight group
+		|hl-Normal|.
+		With an argument a check is done whether {name} is a valid
+		font name.  If not then an empty string is returned.
+		Otherwise the actual font name is returned, or {name} if the
+		GUI does not support obtaining the real name.
+		Only works when the GUI is running, thus not you your vimrc or
+		Note that the GTK 2 GUI accepts any font name, thus checking
+		for a valid name does not work.
+		gvimrc file.  Use the |GUIEnter| autocommand to use this
+		function just after the GUI has started.
+
 getfperm({fname})					*getfperm()*
 		The result is a String, which is the read, write, and execute
 		permissions of the given file {fname}.
 getcmdline()	eval.txt	/*getcmdline()*
 getcmdpos()	eval.txt	/*getcmdpos()*
 getcwd()	eval.txt	/*getcwd()*
+getfontname()	eval.txt	/*getfontname()*
 getfperm()	eval.txt	/*getfperm()*
 getfsize()	eval.txt	/*getfsize()*
 getftime()	eval.txt	/*getftime()*
 hebrew.txt	hebrew.txt	/*hebrew.txt*
 help	various.txt	/*help*
 help-context	help.txt	/*help-context*
+help-tags	tags	1
 help-translated	various.txt	/*help-translated*
 help-xterm-window	various.txt	/*help-xterm-window*
 help.txt	help.txt	/*help.txt*
 	    continue;
 	}
 
+	/* Wildcards won't be expanded below, the replacement is taken
+	 * literally.  But do expand "~/file", "~user/file" and "$HOME/file". */
+	if (vim_strchr(repl, '$') != NULL || vim_strchr(repl, '~') != NULL)
+	{
+	    char_u *l = repl;
+
+	    repl = expand_env_save(repl);
+	    vim_free(l);
+	}
+
 	/* Need to escape white space et al. with a backslash.  Don't do this
 	 * for shell commands (may have to use quotes instead).  Don't do this
 	 * for non-unix systems when there is a single argument (spaces don't
 	if (!im_xim_isvalid_imactivate())
 	    EMSG(_("E599: Value of 'imactivatekey' is invalid"));
 #endif
+	/* When 'cmdheight' was set during startup it may not have taken
+	 * effect yet. */
+	if (p_ch != 1L)
+	    command_height(1L);
 
 	return;
     }
 		    font = gui_mch_get_font(wide_name, FALSE);
 		    if (font != NOFONT)
 		    {
+			gui_mch_free_font(gui.wide_font);
 			gui.wide_font = font;
 			set_string_option_direct((char_u *)"gfw", -1,
 							 wide_name, OPT_FREE);
 }
 #endif
 
+char_u *gui_mch_getfontname(GuiFont font)
+{
+    return vim_strsave((char_u *)"default");
+}
+
 int gui_mch_init_font(char_u *font_name, int fontset)
 {
     /*D("gui_mch_init_font");*/
 }
 
     GuiFont
-gui_mch_get_font( char_u *name, int giveErrorIfMissing)
+gui_mch_get_font(char_u *name, int giveErrorIfMissing)
 {
     /*D("gui_mch_get_font");*/
     return NULL;
 }
 
+/*
+ * Return the name of font "font" in allocated memory.
+ * We always use the default font.
+ */
+    char_u *
+gui_mch_get_fontname(GuiFont font, char_u *name)
+{
+    return vim_strsave((char_u *)"default");
+}
+
     void
 gui_mch_set_font(GuiFont font)
 {
 }
 
 /*
+ * Return the name of font "font" in allocated memory.
+ */
+    char_u *
+gui_mch_get_fontname(GuiFont font, char_u *name)
+{
+    return vim_strsave(((VimFont *)font)->name);
+}
+
+/*
  * Set the current text font.
  */
     void

src/gui_kde_x11.cc

 	vmw->menuBar()->insertItem("&KVim", vmw->w->menu);
 #endif
 	if (startfont!=NULL)
-	    gui_mch_init_font((char_u*)startfont->latin1(),0);
+	    gui_mch_init_font((char_u*)startfont->latin1(), FALSE);
 
 	if (startsize!=NULL)
 	    vmw->resize(startsize->width(), startsize->height());
 gui_mch_init_font(char_u * font_name, int fontset)//{{{
 {
 	QString fontname;
-	GuiFont font=NULL;
+	GuiFont font = NULL;
 
-	if (font_name==NULL)
+	if (font_name == NULL)
 	{
 #if 0
 #if QT_VERSION>=300
 	font = new QFont();
 	font->fromString( fontname );
 */
+#ifdef FEAT_XFONTSET
+	if (fontset)
+	    font = gui_mch_get_fontset(font_name, TRUE, TRUE);
+	if (font == NULL)
+#endif
+	    font = gui_mch_get_font(font_name, FALSE);
+
+	if (font == NULL)
+	    return FAIL;
+	if (fontname.contains('*') && fontname.contains('-'))
+	    return FAIL;
+
 	gui_mch_free_font(gui.norm_font);
 #ifdef FEAT_XFONTSET
 	gui_mch_free_fontset(gui.fontset);
+	gui.fontset = NOFONTSET;
 	if (fontset)
-	    font = gui_mch_get_fontset(font_name,TRUE,TRUE);
+	{
+	    gui.fontset = font;
+	    gui.norm_font = NOFONT;
+	}
+	else
 #endif
-	if (font == NULL) {
-	    font = gui_mch_get_font(font_name,FALSE);
 	    gui.norm_font = font;
-#ifdef FEAT_XFONTSET
-	    gui.fontset=NOFONTSET;
-#endif
-	}
-#ifdef FEAT_XFONTSET
-	else {
-	    gui.fontset=font;
-	    gui.norm_font=NOFONT;
-	}
-#endif
-
-	if (font == NULL)
-		return FAIL;
-
-	if (fontname.contains('*') && fontname.contains('-'))
-		return FAIL;
 
 	/* Compute the width of the character cell.  Some fonts include
 	 * double-width characters.  Use the width of ASCII characters to find
 }//}}}
 
 /*
+ * Return the name of font "font" in allocated memory.
+ * Don't know how to get the actual name, thus use the provided name.
+ */
+    char_u *
+gui_mch_get_fontname(font, name)
+    GuiFont font;
+    char_u  *name;
+{
+    if (name == NULL)
+	return NULL;
+    return vim_strsave(name);
+}
+
+/*
  * Set the current text font.
  * Since we create all GC on demand, we use just gui.current_font to
  * indicate the desired current font.
 	    /* Caller is able to clean up */
 	    /* TODO: Should be clean up or not? For safety. */
 #ifdef USE_SIOUX
-	    printf("aevt_odoc: AEGetNthPtr error: %d\n", newError);
+	    printf("aevt_odoc: AEGetNthPtr error: %ld\n", (long)newError);
 #endif
 	    return(fnames);
 	}
     if (error)
     {
 #ifdef USE_SIOUX
-	printf("aevt_odoc: AEGetParamDesc error: %d\n", error);
+	printf("aevt_odoc: AEGetParamDesc error: %ld\n", (long)error);
 #endif
 	return(error);
     }
     if (error)
     {
 #ifdef USE_SIOUX
-	printf("aevt_odoc: AEGetParamPtr error: %d\n", error);
+	printf("aevt_odoc: AEGetParamPtr error: %ld\n", (long)error);
 #endif
 	return(error);
     }
 
 #ifdef USE_SIOUX
-    printf("aevt_odoc: lineNum: %d, startRange %d, endRange %d, [date %lx]\n",
-	    thePosition.lineNum, thePosition.startRange, thePosition.endRange,
-	    thePosition.theDate);
+    printf("aevt_odoc: lineNum: %d, startRange %ld, endRange %ld, [date %lx]\n",
+	    (int)thePosition.lineNum,
+	    (long)thePosition.startRange, (long)thePosition.endRange,
+	    (long)thePosition.theDate);
 #endif
 /*
     error = AEGetParamDesc(theAEvent, keyAEPosition, typeChar, &thePosition);
     {
 	if (thePosition.lineNum >= 0)
 	{
-	    lnum = thePosition.lineNum;
+	    lnum = thePosition.lineNum + 1;
 	/*  oap->motion_type = MLINE;
 	    setpcmark();*/
 	    if (lnum < 1L)
 	    else if (lnum > curbuf->b_ml.ml_line_count)
 		lnum = curbuf->b_ml.ml_line_count;
 	    curwin->w_cursor.lnum = lnum;
+	    curwin->w_cursor.col = 0;
 	/*  beginline(BL_SOL | BL_FIX);*/
 	}
 	else
 
     /* Update the screen display */
     update_screen(NOT_VALID);
+#ifdef FEAT_VISUAL
+    /* Select the text if possible */
+    if (gotPosition)
+    {
+        VIsual_active = TRUE;
+        VIsual_select = FALSE;
+        if (thePosition.lineNum < 0)
+	{
+            VIsual_mode = 'v';
+            VIsual = curwin->w_cursor;
+            goto_byte(thePosition.endRange);
+        }
+        else
+	{
+            VIsual_mode = 'V';
+            VIsual = curwin->w_cursor;
+            VIsual.col = 0;
+        }
+    }
+#endif
     setcursor();
     out_flush();
 
+    /* Fake mouse event to wake from stall */
+    PostEvent(mouseUp, 0);
+
   finished:
     AEDisposeDesc(&theList); /* dispose what we allocated */
 
     if (error)
     {
 #ifdef USE_SIOUX
-	printf("aevt_odoc: HandleUnusedParms error: %d\n", error);
+	printf("aevt_odoc: HandleUnusedParms error: %ld\n", (long)error);
 #endif
 	return(error);
     }
 							   kEventPriorityLow))
 	goto bail;
 
+    ReleaseEvent(bogusEvent);
+
     if (noErr == GetWindowBounds(gui.VimWindow, kWindowContentRgn, &bounds))
     {
 	point.h -= bounds.left;
     count = j;
 
     gui_handle_drop(x, y, modifiers, fnames, count);
+
+    /* Fake mouse event to wake from stall */
+    PostEvent(mouseUp, 0);
+
     return noErr;
 }
 
     FontInfo	font_info;
     short	font_id;
     GuiFont	font;
+    char_u	used_font_name[512];
 
     if (font_name == NULL)
     {
 	{
 	    /* Then pickup the standard application font */
 	    font_id = GetAppFont();
+	    STRCPY(used_font_name, "default");
 	}
+	else
+	    STRCPY(used_font_name, "Monaco");
 	font = (suggestedSize << 16) + ((long) font_id & 0xFFFF);
     }
 #if defined(USE_CARBONIZED) && defined(MACOS_X)
     else if (STRCMP(font_name, "*") == 0)
     {
-	char_u *new_p_guifont, font_name[512];
-
-	font = gui_mac_select_font(font_name);
+	char_u *new_p_guifont;
+
+	font = gui_mac_select_font(used_font_name);
 	if (font == NOFONT)
 	    return FAIL;
 
 	/* Set guifont to the name of the selected font. */
-	new_p_guifont = alloc(STRLEN(font_name) + 1);
+	new_p_guifont = alloc(STRLEN(used_font_name) + 1);
 	if (new_p_guifont != NULL)
 	{
-	    STRCPY(new_p_guifont, font_name);
+	    STRCPY(new_p_guifont, used_font_name);
 	    vim_free(p_guifont);
 	    p_guifont = new_p_guifont;
 	    /* Replace spaces in the font name with underscores. */
     else
     {
 	font = gui_mac_find_font(font_name);
+	STRNCPY(used_font_name, font_name, sizeof(used_font_name));
+	used_font_name[sizeof(used_font_name) - 1] = NUL;
 
 	if (font == NOFONT)
 	    return FAIL;
     }
+
     gui.norm_font = font;
 
+    hl_set_font_name(used_font_name);
+
     TextSize(font >> 16);
     TextFont(font & 0xFFFF);
 
 }
 
 /*
+ * Return the name of font "font" in allocated memory.
+ * Don't know how to get the actual name, thus use the provided name.
+ */
+    char_u *
+gui_mch_get_fontname(font, name)
+    GuiFont font;
+    char_u  *name;
+{
+    if (name == NULL)
+	return NULL;
+    return vim_strsave(name);
+}
+
+/*
  * Set the current text font.
  */
     void
 	    vim_free( font_name );
 	    return( FAIL );
 	}
+
 	gui_mch_free_font( gui.norm_font );
 	gui.norm_font = font_tag;
     }
     return( FAIL );
 }
 
+/*
+ * Return the name of font "font" in allocated memory.
+ * Don't know how to get the actual name, thus use the provided name.
+ */
+    char_u *
+gui_mch_get_fontname(font, name)
+    GuiFont font;
+    char_u  *name;
+{
+    if (name == NULL)
+	return NULL;
+    return vim_strsave(name);
+}
+
     void
 gui_mch_set_font(GuiFont font)
 {
 }
 
 /*
+ * Return the name of font "font" in allocated memory.
+ * Don't know how to get the actual name, thus use the provided name.
+ */
+    char_u *
+gui_mch_get_fontname(font, name)
+    GuiFont font;
+    char_u  *name;
+{
+    if (name == NULL)
+	return NULL;
+    return vim_strsave(name);
+}
+
+/*
  * Set the current text font.
  */
     void
     int		giveErrorIfMissing)
 {
     LOGFONT	lf;
-    GuiFont	font;
-
-    get_logfont(&lf, name, NULL);
-    font = get_font_handle(&lf);
+    GuiFont	font = NOFONT;
+
+    if (get_logfont(&lf, name, NULL, giveErrorIfMissing) == OK)
+	font = get_font_handle(&lf);
     if (font == NOFONT && giveErrorIfMissing)
 	EMSG2(_(e_font), name);
     return font;
 }
+
+/*
+ * Return the name of font "font" in allocated memory.
+ * Don't know how to get the actual name, thus use the provided name.
+ */
+    char_u *
+gui_mch_get_fontname(font, name)
+    GuiFont font;
+    char_u  *name;
+{
+    if (name == NULL)
+	return NULL;
+    return vim_strsave(name);
+}
+
     void
 gui_mch_free_font(GuiFont font)
 {
 #endif
 }
 
+    static char_u *
+logfont2name(LOGFONT lf)
+{
+    char	*p;
+    char	*res;
+    char	*charset_name;
+
+    charset_name = charset_id2name((int)lf.lfCharSet);
+    res = alloc((unsigned)(strlen(lf.lfFaceName) + 20
+		    + (charset_name == NULL ? 0 : strlen(charset_name) + 2)));
+    if (res != NULL)
+    {
+	p = res;
+	/* make a normal font string out of the lf thing:*/
+	sprintf((char *)p, "%s:h%d", lf.lfFaceName, pixels_to_points(
+			 lf.lfHeight < 0 ? -lf.lfHeight : lf.lfHeight, TRUE));
+	while (*p)
+	{
+	    if (*p == ' ')
+		*p = '_';
+	    ++p;
+	}
+#ifndef MSWIN16_FASTTEXT
+	if (lf.lfItalic)
+	    STRCAT(p, ":i");
+	if (lf.lfWeight >= FW_BOLD)
+	    STRCAT(p, ":b");
+#endif
+	if (lf.lfUnderline)
+	    STRCAT(p, ":u");
+	if (lf.lfStrikeOut)
+	    STRCAT(p, ":s");
+	if (charset_name != NULL)
+	{
+	    STRCAT(p, ":c");
+	    STRCAT(p, charset_name);
+	}
+    }
+
+    return res;
+}
+
 /*
- * Initialise vim to use the font with the given name.	Return FAIL if the font
- * could not be loaded, OK otherwise.
+ * Initialise vim to use the font with the given name.
+ * Return FAIL if the font could not be loaded, OK otherwise.
  */
     int
 gui_mch_init_font(char_u *font_name, int fontset)
 {
     LOGFONT	lf;
     GuiFont	font = NOFONT;
+    char_u	*p;
 
     /* Load the font */
-    if (get_logfont(&lf, font_name, NULL))
+    if (get_logfont(&lf, font_name, NULL, TRUE) == OK)
 	font = get_font_handle(&lf);
     if (font == NOFONT)
 	return FAIL;
+
     if (font_name == NULL)
 	font_name = lf.lfFaceName;
 #if defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME)
     gui.norm_font = font;
     current_font_height = lf.lfHeight;
     GetFontSize(font);
-    hl_set_font_name(lf.lfFaceName);
-
-    /* When setting 'guifont' to "*" replace it with the actual font name. */
-    if (STRCMP(font_name, "*") == 0 && STRCMP(p_guifont, "*") == 0)
+
+    p = logfont2name(lf);
+    if (p != NULL)
     {
-	char	    *charset_name;
-	char_u	    *p;
-
-	charset_name = charset_id2name((int)lf.lfCharSet);
-	p = alloc((unsigned)(strlen(lf.lfFaceName) + 20
-		    + (charset_name == NULL ? 0 : strlen(charset_name) + 2)));
-	if (p != NULL)
+	hl_set_font_name(p);
+
+	/* When setting 'guifont' to "*" replace it with the actual font name.
+	 * */
+	if (STRCMP(font_name, "*") == 0 && STRCMP(p_guifont, "*") == 0)
 	{
-	    /* make a normal font string out of the lf thing:*/
-	    sprintf((char *)p, "%s:h%d", lf.lfFaceName, pixels_to_points(
-			 lf.lfHeight < 0 ? -lf.lfHeight : lf.lfHeight, TRUE));
 	    vim_free(p_guifont);
 	    p_guifont = p;
-	    while (*p)
-	    {
-		if (*p == ' ')
-		    *p = '_';
-		++p;
-	    }
-#ifndef MSWIN16_FASTTEXT
-	    if (lf.lfItalic)
-		STRCAT(p, ":i");
-	    if (lf.lfWeight >= FW_BOLD)
-		STRCAT(p, ":b");
-#endif
-	    if (lf.lfUnderline)
-		STRCAT(p, ":u");
-	    if (lf.lfStrikeOut)
-		STRCAT(p, ":s");
-	    if (charset_name != NULL)
-	    {
-		STRCAT(p, ":c");
-		STRCAT(p, charset_name);
-	    }
 	}
+	else
+	    vim_free(p);
     }
 
 #ifndef MSWIN16_FASTTEXT
      * Initialise the font according to 'printfont'
      */
     memset(&fLogFont, 0, sizeof(fLogFont));
-    if (!get_logfont(&fLogFont, p_pfn, prt_dlg.hDC))
+    if (get_logfont(&fLogFont, p_pfn, prt_dlg.hDC, TRUE) == FAIL)
     {
 	EMSG2(_("E613: Unknown printer font: %s"), p_pfn);
 	mch_print_cleanup();
     return OK;
 }
 
+/*
+ * Get font info from "name" into logfont "lf".
+ * Return OK for a valid name, FAIL otherwise.
+ */
     int
 get_logfont(
-    LOGFONT *lf,
-    char_u  *name,
-    HDC printer_dc)
+    LOGFONT	*lf,
+    char_u	*name,
+    HDC		printer_dc,
+    int		verbose)
 {
     char_u	*p;
     int		i;
 
     *lf = s_lfDefault;
     if (name == NULL)
-	return 1;
+	return OK;
 
     if (STRCMP(name, "*") == 0)
     {
 	if (ChooseFont(&cf))
 	    goto theend;
 #else
-	return 0;
+	return FAIL;
 #endif
     }
 
     for (p = name; *p && *p != ':'; p++)
     {
 	if (p - name + 1 > LF_FACESIZE)
-	    return 0;			/* Name too long */
+	    return FAIL;			/* Name too long */
 	lf->lfFaceName[p - name] = *p;
     }
     if (p != name)
 		did_replace = TRUE;
 	    }
 	if (!did_replace || init_logfont(lf) == FAIL)
-	    return 0;
+	    return FAIL;
     }
 
     while (*p == ':')
 			    p += strlen(cp->name);
 			    break;
 			}
-		    if (cp->name == NULL)
+		    if (cp->name == NULL && verbose)
 		    {
 			sprintf((char *)IObuff, _("E244: Illegal charset name \"%s\" in font name \"%s\""), p, name);
 			EMSG(IObuff);
 		    break;
 		}
 	    default:
-		sprintf((char *)IObuff,
-			_("E245: Illegal char '%c' in font name \"%s\""),
-			p[-1], name);
-		EMSG(IObuff);
-		break;
+		if (verbose)
+		{
+		    sprintf((char *)IObuff,
+			    _("E245: Illegal char '%c' in font name \"%s\""),
+			    p[-1], name);
+		    EMSG(IObuff);
+		}
+		return FAIL;
 	}
 	while (*p == ':')
 	    p++;
 	    mch_memmove(lastlf, lf, sizeof(LOGFONT));
     }
 
-    return 1;
+    return OK;
 }
 
 #endif /* defined(FEAT_GUI) || defined(FEAT_PRINTER) */
     static RETSIGTYPE
 catch_sigpwr SIGDEFARG(sigarg)
 {
+    /* this is not required on all systems, but it doesn't hurt anybody */
+    signal(SIGPWR, (RETSIGTYPE (*)())catch_sigpwr);
     /*
      * I'm not sure we get the SIGPWR signal when the system is really going
      * down or when the batteries are almost empty.  Just preserve the swap
 #endif
 
 #ifdef SIGHASARG
-    /* When SIGHUP is blocked: postpone its effect and return here.  This
-     * avoids that a non-reentrant function is interrupted, e.g., free(). */
-    if (entered == 0 && sigarg == SIGHUP && !handle_sighup(SIGHUP_RCV))
+    /* When SIGHUP, SIGQUIT, etc. are blocked: postpone the effect and return
+     * here.  This avoids that a non-reentrant function is interrupted, e.g.,
+     * free().  Calling free() again may then cause a crash. */
+    if (entered == 0
+	    && (0
+# ifdef SIGHUP
+		|| sigarg == SIGHUP
+# endif
+# ifdef SIGQUIT
+		|| sigarg == SIGQUIT
+# endif
+# ifdef SIGTERM
+		|| sigarg == SIGTERM
+# endif
+# ifdef SIGPWR
+		|| sigarg == SIGPWR
+# endif
+# ifdef SIGUSR1
+		|| sigarg == SIGUSR1
+# endif
+# ifdef SIGUSR2
+		|| sigarg == SIGUSR2
+# endif
+		)
+	    && !handle_signal(sigarg))
 	SIGRETURN;
 #endif
 
 }
 
 /*
- * Handling of SIGHUP:
- * "when" == SIGHUP_RCV:  when busy, postpone, otherwise return TRUE
- * "when" == SIGHUP_BLOCK: Going to be busy, block SIGHUP
- * "when" == SIGHUP_UNBLOCK: Going wait, unblock SIGHUP
+ * Handling of SIGHUP, SIGQUIT and SIGTERM:
+ * "when" == a signal: when busy, postpone, otherwise return TRUE
+ * "when" == SIGNAL_BLOCK: Going to be busy, block signals
+ * "when" == SIGNAL_UNBLOCK: Going wait, unblock signals
  * Returns TRUE when Vim should exit.
  */
     int
-handle_sighup(when)
-    int		when;
+handle_signal(sig)
+    int		sig;
 {
-    static int got_sighup = FALSE;
-    static int blocked = FALSE;
-
-    switch (when)
+    static int got_signal = 0;
+    static int blocked = TRUE;
+
+    switch (sig)
     {
-	case SIGHUP_RCV:     if (!blocked)
+	case SIGNAL_BLOCK:   blocked = TRUE;
+			     break;
+
+	case SIGNAL_UNBLOCK: blocked = FALSE;
+			     if (got_signal != 0)
+			     {
+				 kill(getpid(), got_signal);
+				 got_signal = 0;
+			     }
+			     break;
+
+	default:	     if (!blocked)
 				 return TRUE;	/* exit! */
-			     got_sighup = TRUE;
-			     got_int = TRUE;    /* break any loops */
-			     break;
-
-	case SIGHUP_BLOCK:   blocked = TRUE;
-			     break;
-
-	case SIGHUP_UNBLOCK: blocked = FALSE;
-			     if (got_sighup)
-				 kill(getpid(), SIGHUP);
+			     got_signal = sig;
+#ifdef SIGPWR
+			     if (sig != SIGPWR)
+#endif
+				 got_int = TRUE;    /* break any loops */
 			     break;
     }
     return FALSE;

src/proto/gui_gtk.pro

 char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
 char_u *gui_mch_browsedir __ARGS((char_u *title, char_u *initdir));
 int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int def_but, char_u *textfield));
-int gui_mch_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int def_but, char_u *textfield));
 void gui_mch_show_popupmenu __ARGS((vimmenu_T *menu));
 void gui_make_popup __ARGS((char_u *path_name));
 void gui_mch_find_dialog __ARGS((exarg_T *eap));

src/proto/gui_gtk_x11.pro

 char_u *gui_mch_font_dialog __ARGS((char_u *oldval));
 int gui_mch_init_font __ARGS((char_u *font_name, int fontset));
 GuiFont gui_mch_get_font __ARGS((char_u *name, int report_error));
+char_u *gui_mch_get_fontname __ARGS((GuiFont font, char_u *name));
 void gui_mch_set_font __ARGS((GuiFont font));
 void gui_mch_set_fontset __ARGS((GuiFontset fontset));
 void gui_mch_free_font __ARGS((GuiFont font));

src/proto/gui_photon.pro

 int gui_mch_init_font __ARGS((char_u *vim_font_name, int fontset));
 int gui_mch_adjust_charsize __ARGS((void));
 GuiFont gui_mch_get_font __ARGS((char_u *vim_font_name, int report_error));
+char_u *gui_mch_get_fontname __ARGS((GuiFont font, char_u *name));
 void gui_mch_set_font __ARGS((GuiFont font));
 void gui_mch_free_font __ARGS((GuiFont font));
 /* vim: set ft=c : */

src/proto/gui_w16.pro

 void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
 int gui_mch_adjust_charsize __ARGS((void));
 GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
+char_u *gui_mch_get_fontname __ARGS((GuiFont font, char_u *name));
 void gui_mch_free_font __ARGS((GuiFont font));
 guicolor_T gui_mch_get_color __ARGS((char_u *name));
 int gui_mch_haskey __ARGS((char_u *name));
 void gui_mch_newfont __ARGS((void));
 void gui_mch_settitle __ARGS((char_u *title, char_u *icon));
 void mch_set_mouse_shape __ARGS((int shape));
+char_u *gui_mch_browsedir __ARGS((char_u *title, char_u *initdir));
 char_u *gui_mch_browse __ARGS((int saving, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter));
 int get_cmd_args __ARGS((char *prog, char *cmdline, char ***argvp, char **tofree));
 void gui_mch_prepare __ARGS((int *argc, char **argv));

src/proto/gui_w32.pro

 void gui_mch_create_scrollbar __ARGS((scrollbar_T *sb, int orient));
 int gui_mch_adjust_charsize __ARGS((void));
 GuiFont gui_mch_get_font __ARGS((char_u *name, int giveErrorIfMissing));
+char_u *gui_mch_get_fontname __ARGS((GuiFont font, char_u *name));
 void gui_mch_free_font __ARGS((GuiFont font));
 guicolor_T gui_mch_get_color __ARGS((char_u *name));
 int gui_mch_haskey __ARGS((char_u *name));

src/proto/os_unix.pro

 void mch_suspend __ARGS((void));
 void mch_init __ARGS((void));
 void reset_signals __ARGS((void));
-int handle_sighup __ARGS((int when));
+int handle_signal __ARGS((int sig));
 int mch_check_win __ARGS((int argc, char **argv));
 int mch_input_isatty __ARGS((void));
 int mch_can_restore_title __ARGS((void));
 # include <XSUB.h>
 #endif
 
-/* values for handle_sighup() */
-#define SIGHUP_RCV	1
-#define SIGHUP_BLOCK	2
-#define SIGHUP_UNBLOCK  3
+/* values for handle_signal() that are not a signal */
+#define SIGNAL_BLOCK	-1
+#define SIGNAL_UNBLOCK  -2
 #ifndef UNIX
-# define handle_sighup(x) /* nothing */
+# define handle_signal(x) 0
 #endif
 
 #endif /* VIM__H */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.