unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Manuel Giraud <manuel@ledu-giraud.fr>
Cc: 58406@debbugs.gnu.org
Subject: bug#58406: 29.0.50; Bars refactoring?
Date: Mon, 10 Oct 2022 16:08:44 +0800	[thread overview]
Message-ID: <87bkqkm777.fsf@yahoo.com> (raw)
In-Reply-To: <87a6641648.fsf@elite.giraud> (Manuel Giraud's message of "Mon, 10 Oct 2022 09:37:43 +0200")

Manuel Giraud <manuel@ledu-giraud.fr> writes:

> I'm trying to have some kind of highlight feature on the no-toolkit menu
> bar.  As this feature is already present in tool/tab bar, I'd like to
> mimic those.

What kind of highlight?

> +enum bar_type
> +  {
> +    MENU_BAR,
> +    TAB_BAR,
> +    TOOL_BAR
> +  };

These enums are definitely named too generally.  They could conflict
with other libraries down the road.

> +/* Get information about the bar item which is displayed in GLYPH on
> +   frame F.  Return in *PROP_IDX the index where bar item properties
> +   start in the bar items.  For TAB_BAR, return in CLOSE_P an
> +   indication whether the click was on the close-tab icon of the tab.
> +   Value is false if GLYPH doesn't display a bar item.  */
> +
> +static bool
> +bar_item_info (ENUM_BF(bar_type) bar, struct frame *f, struct glyph *glyph,
> +	       int *prop_idx, bool *close_p)

Why ENUM_BF?

BTW, I really don't recommend doing this kind of refactoring so close to
cutting the Emacs 29 branch.  Last year I and Alan Third found and fixed
several obscure bugs related to the tab bar code being a poor cargo cult
of the tool bar code, introducing subtle differences between both pieces
of code.  Any refactoring there is likely to introduce more bugs, or to
reintroduce old ones, and those bugs are much too subtle to find before
November (or even February.)





  reply	other threads:[~2022-10-10  8:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10  7:37 bug#58406: 29.0.50; Bars refactoring? Manuel Giraud
2022-10-10  8:08 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-10-10  8:37   ` Manuel Giraud
2022-10-10  8:51     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-10  9:01       ` Eli Zaretskii
2022-10-10 10:05         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-10 11:24           ` Eli Zaretskii
2022-10-10 13:42             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-10 12:10       ` Manuel Giraud
2022-10-10 13:41         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-10 14:30           ` Manuel Giraud
2022-10-10 16:08             ` Eli Zaretskii
2022-10-11  0:32             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-10  8:58     ` Eli Zaretskii
2022-10-10  8:45 ` Eli Zaretskii
2022-10-10 11:58   ` Manuel Giraud

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bkqkm777.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=58406@debbugs.gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=manuel@ledu-giraud.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).