aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2001-01-22 15:17:50 +0000
committerGerd Moellmann2001-01-22 15:17:50 +0000
commit57c28064ec94eb47731713517c910bdbda84a34e (patch)
tree663a4d23f6d4310cdd2f5c907b04a7b915d1dc8a /src
parent57760935c1e3e53aad96a4ab82b42ec2df7eb634 (diff)
downloademacs-57c28064ec94eb47731713517c910bdbda84a34e.tar.gz
emacs-57c28064ec94eb47731713517c910bdbda84a34e.zip
(Ftool_bar_lines_needed): New function.
(syms_of_xdisp): Defsubr it.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/xdisp.c33
2 files changed, 36 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f85dd0e7602..b4db657e1f3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12001-01-22 Gerd Moellmann <gerd@gnu.org> 12001-01-22 Gerd Moellmann <gerd@gnu.org>
2 2
3 * xdisp.c (Ftool_bar_lines_needed): New function.
4 (syms_of_xdisp): Defsubr it.
5
3 * editfns.c (Fformat): Don't extend text properties from arguments 6 * editfns.c (Fformat): Don't extend text properties from arguments
4 to padding chars in the result. 7 to padding chars in the result.
5 8
diff --git a/src/xdisp.c b/src/xdisp.c
index 0e6e6d32484..78515968823 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7411,6 +7411,38 @@ tool_bar_lines_needed (f)
7411} 7411}
7412 7412
7413 7413
7414DEFUN ("tool-bar-lines-needed", Ftool_bar_lines_needed, Stool_bar_lines_needed,
7415 0, 1, 0,
7416 "Return the number of lines occupied by the tool bar of FRAME.")
7417 (frame)
7418 Lisp_Object frame;
7419{
7420 struct frame *f;
7421 struct window *w;
7422 int nlines = 0;
7423
7424 if (NILP (frame))
7425 frame = selected_frame;
7426 else
7427 CHECK_FRAME (frame, 0);
7428 f = XFRAME (frame);
7429
7430 if (WINDOWP (f->tool_bar_window)
7431 || (w = XWINDOW (f->tool_bar_window),
7432 XFASTINT (w->height) > 0))
7433 {
7434 update_tool_bar (f, 1);
7435 if (f->n_tool_bar_items)
7436 {
7437 build_desired_tool_bar_string (f);
7438 nlines = tool_bar_lines_needed (f);
7439 }
7440 }
7441
7442 return make_number (nlines);
7443}
7444
7445
7414/* Display the tool-bar of frame F. Value is non-zero if tool-bar's 7446/* Display the tool-bar of frame F. Value is non-zero if tool-bar's
7415 height should be changed. */ 7447 height should be changed. */
7416 7448
@@ -13929,6 +13961,7 @@ syms_of_xdisp ()
13929 defsubr (&Strace_redisplay_toggle); 13961 defsubr (&Strace_redisplay_toggle);
13930 defsubr (&Strace_to_stderr); 13962 defsubr (&Strace_to_stderr);
13931#endif 13963#endif
13964 defsubr (&Stool_bar_lines_needed);
13932 13965
13933 staticpro (&Qmenu_bar_update_hook); 13966 staticpro (&Qmenu_bar_update_hook);
13934 Qmenu_bar_update_hook = intern ("menu-bar-update-hook"); 13967 Qmenu_bar_update_hook = intern ("menu-bar-update-hook");