From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58406: 29.0.50; Bars refactoring? Date: Mon, 10 Oct 2022 16:08:44 +0800 Message-ID: <87bkqkm777.fsf@yahoo.com> References: <87a6641648.fsf@elite.giraud> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14397"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) Cc: 58406@debbugs.gnu.org To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 10 10:23:13 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oho49-0003YC-GF for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Oct 2022 10:23:13 +0200 Original-Received: from localhost ([::1]:34098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oho48-0008H9-Hn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Oct 2022 04:23:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohnqR-0004Q0-Au for bug-gnu-emacs@gnu.org; Mon, 10 Oct 2022 04:09:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohnqR-0007NJ-1O for bug-gnu-emacs@gnu.org; Mon, 10 Oct 2022 04:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ohnqQ-0006Eh-T8 for bug-gnu-emacs@gnu.org; Mon, 10 Oct 2022 04:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Oct 2022 08:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58406 X-GNU-PR-Package: emacs Original-Received: via spool by 58406-submit@debbugs.gnu.org id=B58406.166538934223965 (code B ref 58406); Mon, 10 Oct 2022 08:09:02 +0000 Original-Received: (at 58406) by debbugs.gnu.org; 10 Oct 2022 08:09:02 +0000 Original-Received: from localhost ([127.0.0.1]:45836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohnqP-0006EQ-Rb for submit@debbugs.gnu.org; Mon, 10 Oct 2022 04:09:02 -0400 Original-Received: from sonic311-23.consmr.mail.ne1.yahoo.com ([66.163.188.204]:37304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohnqN-0006Dq-JN for 58406@debbugs.gnu.org; Mon, 10 Oct 2022 04:09:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1665389332; bh=m2gKyl0L6pmE5h3EgmUMKqQiagQpXCkPNQSD39orkh4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=VcMIKqTxoeZE+sku2m0wfw9Dc1FEmsaSC3xh7qQJkhMweemxYtLlb5BxBgXurfaziSklcrBOphcNbwy62CMkSr7/NUNMXdjmGeBdyf8bVXP06L6MROxh5TuEK+TbZpQLp5gZYbUL74BTz4U8Yo8uURyLe3nyzSipdUGm0Ay0Ub7DW2VvOXZlVvnvZGtwBREIpqhT8VfiIM0cJdpclz+CXLo0R0b7erVnh1ZtMPJR1GsFOnHOwd13mQmzBG0gZd57TaHs4Tca8FY4wsfsUwJ6BEUjlm+xv5mmENiSvg431z+32gewLn0loLjr0yqTSJEB+uYFy+Kv6y4R0jp+sxO8dQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1665389332; bh=cy92M79gMD+AZJzAU4UyByGEF7mHKJy3dth8VUILFvU=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=YvJioCGRAjNNUDHYX3fpt7WZQ6OMcTrR3VfaYYwcXBbENDU+gkMYJJtxyK0TGOw0TyWol1AagFZxHSGrlKpZmhapyl9HTTnt+e51tgRX10rlnTRkrY0PF4YQVMNXEpDnM0reWSDfkhmKjZMGlbdKL11RVTJZvelciBteeTEjKnXNLrDR0fG8lp6KiKjriIBPWpOWzUhlen7VXAXQkBkNBpPfF4pJAxloj0lBImL+/RBJZm/jD0tV1jxGU9Ji3fgLltiz86TGU3aX16OHsO8YMMqxowQYHWi5hoWTTqBIoGwGDIQdIO6JsiWYnAT5kiV4pd5hPra9fbnQaTY5QC8Luw== X-YMail-OSG: ZS_TGXMVM1nUMUCUv5PZJX8r10FH86PngdGe_vCHmBH2BXsxnKTXv9DlvKjxG4Z iDEovRcE9kkxt9JcGE532tlzh2vFH4HDFo05URndaztdCuYdk8KtKQZZ6RSgmpIsRWzG4JpVqviQ Ssj.ad72Bv.27_eDECJ8LwAVEyKrUjpB6fweGrwGaQTEoqJju_rezgoeyquW4JWgmVd0Fj_caOgt csdtb4f9bW3p59TQrEGnK4oPyO2aYAFqganXCMhfEgGaq.pYmYiEyO.ufgbHkMk3OvnfKmeKcYSM PnOHA6nZkIETitv7X9T4ppEuwdrJ4SkffoB1OlSo2Hkb3VmGzAFlMgVFkTvvLi0ppDVSbYtcNUG2 kto20o5w2VvWzl_ardjSAFnLsVCIaiBXtJMbvlhKOSgatVOxzkGpsgL1DvePIopA_rWVq3DgVBig WIn.V2qE.nk6M7mQIS_qe9NBWdQpZZ7muV7TL6802LHi27dLQZ50aU6gG2mXGAP9yL0dgvB6dTv2 skeQ_zqtEGBJ8GoYPBNlIqC6_UHD3DgVSpT5m83ilrqOY3pTQ6hnRc0XBZyugJ_Yew9JRxHyMHde QLOsuwqi1li53hVYesyvFM_eeHPsy79jeZPwAPrke3mZsdyqlZM6OLOXeKW64sYOhUt2CbGbBezI .IOGbgE7z_8EH_LP.voSy1hv.HDMPv3_rt5chSevCGMSzr89LZiK7axjOmrgFfMwhcxi2vyW90kZ q.EET36e0GjWKEIFBdpqCl_3vgRboK.LHMYteIvkM8c6orVDZkLAprauYRQvwMa.De.9u2bDEiGF YGgoPCViE6BCU78a2Fsn0g42fYghpRVGtdvxOxH4bT X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ne1.yahoo.com with HTTP; Mon, 10 Oct 2022 08:08:52 +0000 Original-Received: by hermes--production-sg3-7794f55d99-zgcwh (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID eb91fd9854cc89c3c315473ae1dda635; Mon, 10 Oct 2022 08:08:49 +0000 (UTC) In-Reply-To: <87a6641648.fsf@elite.giraud> (Manuel Giraud's message of "Mon, 10 Oct 2022 09:37:43 +0200") X-Mailer: WebService/1.1.20702 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244988 Archived-At: Manuel Giraud 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.)