unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#45759: [PATCH] Remove unused argument from set_frame_menubar
@ 2021-01-10 11:53 Stefan Kangas
  2021-01-20 22:07 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kangas @ 2021-01-10 11:53 UTC (permalink / raw)
  To: 45759

[-- Attachment #1: Type: text/plain, Size: 142 bytes --]

Severity: wishlist

The set_frame_menubar argument first_time has been unused since at least
1998, AFAICT.  I think it can be safely removed.

[-- Attachment #2: 0001-Remove-unused-argument-from-set_frame_menubar.patch --]
[-- Type: text/x-diff, Size: 5385 bytes --]

From 3e4963268f3926282b9d81442f2bf8d774f8e699 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
Date: Sat, 9 Jan 2021 11:18:29 +0100
Subject: [PATCH] Remove unused argument from set_frame_menubar

* src/w32menu.c (set_frame_menubar):
* src/xmenu.c (set_frame_menubar): Remove unused argument.
All callers updated.
---
 src/frame.h   |  2 +-
 src/w32fns.c  |  2 +-
 src/w32menu.c | 10 ++++------
 src/xdisp.c   |  2 +-
 src/xmenu.c   | 14 ++++++--------
 5 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/src/frame.h b/src/frame.h
index 8cf41dc004..01644222c1 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1687,7 +1687,7 @@ #define EMACS_CLASS "Emacs"
                                              Lisp_Object component,
                                              Lisp_Object subclass);
 
-extern void set_frame_menubar (struct frame *f, bool first_time, bool deep_p);
+extern void set_frame_menubar (struct frame *f, bool deep_p);
 extern void frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
 extern void free_frame_menubar (struct frame *);
 extern bool frame_ancestor_p (struct frame *af, struct frame *df);
diff --git a/src/w32fns.c b/src/w32fns.c
index c1e18ff7fa..65c522214a 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -1607,7 +1607,7 @@ w32_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
 	  if (!old)
 	    /* Make menu bar when there was none.  Emacs 25 waited until
 	       the next redisplay for this to take effect.  */
-	    set_frame_menubar (f, false, true);
+	    set_frame_menubar (f, true);
 	  else
 	    {
 	      /* Remove menu bar.  */
diff --git a/src/w32menu.c b/src/w32menu.c
index 8bf0c46203..3bf7666394 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -155,7 +155,7 @@ w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
 void
 w32_activate_menubar (struct frame *f)
 {
-  set_frame_menubar (f, false, true);
+  set_frame_menubar (f, true);
 
   /* Lock out further menubar changes while active.  */
   f->output_data.w32->menubar_active = 1;
@@ -258,12 +258,10 @@ menubar_selection_callback (struct frame *f, void * client_data)
 }
 
 \f
-/* Set the contents of the menubar widgets of frame F.
-   The argument FIRST_TIME is currently ignored;
-   it is set the first time this is called, from initialize_frame_menubar.  */
+/* Set the contents of the menubar widgets of frame F.  */
 
 void
-set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
+set_frame_menubar (struct frame *f, bool deep_p)
 {
   HMENU menubar_widget = f->output_data.w32->menubar_widget;
   Lisp_Object items;
@@ -511,7 +509,7 @@ initialize_frame_menubar (struct frame *f)
   /* This function is called before the first chance to redisplay
      the frame.  It has to be, so the frame will have the right size.  */
   fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
-  set_frame_menubar (f, true, true);
+  set_frame_menubar (f, true);
 }
 
 /* Get rid of the menu bar of frame F, and free its storage.
diff --git a/src/xdisp.c b/src/xdisp.c
index 6a4304d194..cac78d5233 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12873,7 +12873,7 @@ update_menu_bar (struct frame *f, bool save_match_data, bool hooks_run)
                  the selected frame should be allowed to set it.  */
               if (f == SELECTED_FRAME ())
 #endif
-		set_frame_menubar (f, false, false);
+		set_frame_menubar (f, false);
 	    }
 	  else
 	    /* On a terminal screen, the menu bar is an ordinary screen
diff --git a/src/xmenu.c b/src/xmenu.c
index ea3813a64e..a83fffbf1c 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -289,7 +289,7 @@ DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_i
   block_input ();
 
   if (FRAME_EXTERNAL_MENU_BAR (f))
-    set_frame_menubar (f, false, true);
+    set_frame_menubar (f, true);
 
   menubar = FRAME_X_OUTPUT (f)->menubar_widget;
   if (menubar)
@@ -368,7 +368,7 @@ DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_i
   f = decode_window_system_frame (frame);
 
   if (FRAME_EXTERNAL_MENU_BAR (f))
-    set_frame_menubar (f, false, true);
+    set_frame_menubar (f, true);
 
   menubar = FRAME_X_OUTPUT (f)->menubar_widget;
   if (menubar)
@@ -433,7 +433,7 @@ x_activate_menubar (struct frame *f)
     return;
 #endif
 
-  set_frame_menubar (f, false, true);
+  set_frame_menubar (f, true);
   block_input ();
   popup_activated_flag = 1;
 #ifdef USE_GTK
@@ -677,12 +677,10 @@ apply_systemfont_to_menu (struct frame *f, Widget w)
 
 #endif
 
-/* Set the contents of the menubar widgets of frame F.
-   The argument FIRST_TIME is currently ignored;
-   it is set the first time this is called, from initialize_frame_menubar.  */
+/* Set the contents of the menubar widgets of frame F.  */
 
 void
-set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
+set_frame_menubar (struct frame *f, bool deep_p)
 {
   xt_or_gtk_widget menubar_widget, old_widget;
 #ifdef USE_X_TOOLKIT
@@ -1029,7 +1027,7 @@ initialize_frame_menubar (struct frame *f)
   /* This function is called before the first chance to redisplay
      the frame.  It has to be, so the frame will have the right size.  */
   fset_menu_bar_items (f, menu_bar_items (FRAME_MENU_BAR_ITEMS (f)));
-  set_frame_menubar (f, true, true);
+  set_frame_menubar (f, true);
 }
 
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#45759: [PATCH] Remove unused argument from set_frame_menubar
  2021-01-10 11:53 bug#45759: [PATCH] Remove unused argument from set_frame_menubar Stefan Kangas
@ 2021-01-20 22:07 ` Lars Ingebrigtsen
  2021-01-30 15:17   ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-20 22:07 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 45759

Stefan Kangas <stefan@marxist.se> writes:

> The set_frame_menubar argument first_time has been unused since at least
> 1998, AFAICT.  I think it can be safely removed.

Looks good to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#45759: [PATCH] Remove unused argument from set_frame_menubar
  2021-01-20 22:07 ` Lars Ingebrigtsen
@ 2021-01-30 15:17   ` Stefan Kangas
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2021-01-30 15:17 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 45759

tags 45759 fixed
close 45759 28.1
thanks

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Stefan Kangas <stefan@marxist.se> writes:
>
>> The set_frame_menubar argument first_time has been unused since at least
>> 1998, AFAICT.  I think it can be safely removed.
>
> Looks good to me.

Thanks, pushed to master as commit 3555657585.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-30 15:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-10 11:53 bug#45759: [PATCH] Remove unused argument from set_frame_menubar Stefan Kangas
2021-01-20 22:07 ` Lars Ingebrigtsen
2021-01-30 15:17   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).