From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron Newsgroups: gmane.emacs.devel Subject: Re: How to autoload easy-menu? Date: Fri, 13 Oct 2023 09:13:00 +0200 Message-ID: References: <87o7h84ptr.fsf@breatheoutbreathe.in> <87pm1jv6r2.fsf@breatheoutbreathe.in> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21796"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Emacs Devel Mailing List , Adam Porter To: Joseph Turner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 13 09:14:11 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qrCN9-0005Ua-4z for ged-emacs-devel@m.gmane-mx.org; Fri, 13 Oct 2023 09:14:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrCMB-0005UM-Tx; Fri, 13 Oct 2023 03:13:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrCM8-0005U1-Qv for emacs-devel@gnu.org; Fri, 13 Oct 2023 03:13:08 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrCM5-0005qB-SD for emacs-devel@gnu.org; Fri, 13 Oct 2023 03:13:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1697181183; bh=OAhfswzVyfWVyWNQ3qMGhvKp5Yq/lFbEfJ0H4FUT/rw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LKS8ZcViIv484h8WivrPCizUGIEXPjg2rmQEY6vnDcsS1csv0tT+mRuaNnnLgLAW4 pMnE6RuPIb3dfzZVx6JpHbJi3ieJ6yQwTkM3FnYOMbVY23fYS/SAT2xAlm+sBkSQ7i e8C47p6INxQN8sSmLV8IwutRoLaXkPKQyRTEBH+EjCXW7/HOtvq/22P5MEDYmhaHM2 jMeaSRU8AvXSEZ/i6AuocGeoGpoog6MYLyikSgZl5eIXI54e9p1dzz7QCXGPJtcDCz tVD5wBlkR25+P87HDcYYoTnxvVdNwfszakGI7+zNGsmWTPINEbtP8myjH/kJDoJxDx +d5M6pWdeBxPA== In-Reply-To: <87pm1jv6r2.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Thu, 12 Oct 2023 14:17:41 -0700") Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:311430 Archived-At: Hello Joseph, Joseph Turner writes: > Joseph Turner writes: >> Would you someone kindly point me toward an example of an autoloaded >> menu-bar using easymenu.el? > > Here's how we do it in hyperdrive.el now: > > https://git.sr.ht/~ushin/hyperdrive.el/tree/55c04f5d6071ca9737675af8374257a520313e51/item/hyperdrive.el#L1111 > > The downside is that hyperdrive.el and its dependencies will now always > be loaded when Emacs starts and `menu-bar-mode` is enabled. > > Please share your suggestions! Thank you!! I've just installed `hyperdrive` and restarted Emacs. Without changing anything in my init file, I now see the "Hyperdrive" menu under "Tools" in the menu bar. Personally, I find that a little too intrusive, since I don't expect merely installing a package to change Emacs without an explicit toggle. So my suggestion would be to add a global minor mode, maybe called `hyperdrive-menu-mode`, that adds the "Hyperdrive" menu under "Tools". Then you can autoload `hyperdrive-menu-mode`, so users just need to do call this mode in their init file if they so desire. Best, Eshel