From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: include clause in interactive command Date: Mon, 02 Dec 2024 08:07:23 +0100 Message-ID: <878qsypnpw.fsf@gnu.org> References: <7zmmIocUfe2mvq1pwg2UbEEviligcunflNe_dNFVyWq_xQEccwl6YLeOEZglqTXDEDe7pwOVMHDXeo_JLqx8mXYbzCJvCRViOuA23fFOA2Y=@protonmail.com> <7e1162435f2226ee105fa78c36e0d23f@fuzy.me> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26313"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.7; emacs 31.0.50 Cc: Zhengyi Fu , Heime To: Heime via Users list for the GNU Emacs text editor Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 02 08:08:09 2024 Return-path: Envelope-to: geh-help-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 1tI0XR-0006fu-B7 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 02 Dec 2024 08:08:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tI0Ws-0005NW-JC; Mon, 02 Dec 2024 02:07:35 -0500 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 1tI0Wo-0005Mv-9I for help-gnu-emacs@gnu.org; Mon, 02 Dec 2024 02:07:31 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tI0Wm-0002lk-K6; Mon, 02 Dec 2024 02:07:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Mwqs5duSgBzyagIzuBQE2vJIffWShtRl1gONvqSG6mc=; b=d3XGLQrmBOFzPirEpDz1 jkyNR1gNCEwc98g7XtdMfz43bQqMVyyu471liBo8NqozM9udrcv25AphEWCQX/JLNW81IC2dMys1T unLnc52/T8PknJY4zV/stvdKdElKsWP9OE6l6DC1LOzVm2Sq6HPzYgvgHxt3FxZ5++vwUgpZdyUp9 LB+g/hz6keJNscsNSxyJxmSvwo2iTy41BDMDxSOx7Z7ZpjIDrplJNmB/HaSt1t7SXOHP9SnDM+8B/ gP/qXylkGkZXTKjZ/c81nLnljoh7LkRQsym3JzcMVa5brrTcB6kN0E9rC1QeupZlpVeqek6ZPWSjz ru/mvq+oSDqc+w==; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrheekgddutddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvvefujghffgffkfggtgesthdtredttdertden ucfhrhhomhepvfgrshhsihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenuc ggtffrrghtthgvrhhnpeeluddvgeefuddvjeekfeetleegtefgveehhfeuffeuffeghefg ueefgfdvffegtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieej feekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilh drfhhmpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthho pehhvghimhgvsghorhhgihgrsehprhhothhonhhmrghilhdrtghomhdprhgtphhtthhope hisehfuhiihidrmhgvpdhrtghpthhtohephhgvlhhpqdhgnhhuqdgvmhgrtghssehgnhhu rdhorhhg X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail In-Reply-To: (Heime via Users list for the's message of "Sun, 01 Dec 2024 12:00:16 +0000") X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148486 Archived-At: Heime via Users list for the GNU Emacs text editor writes: > A mistake. I am referring to require. > > For instance, this will call require everytime the function is called > interactively. Should one call the require only once and avoid an > interactive function from calling a require command each time? > > (defun feruler () > (interactive) > > (require 'ruler-mode) > (set-face-attribute 'ruler-mode-current-column nil > :background "#ff4500" :foreground "#ffffff")) That's no problem, nothing will happen if it's already loaded (as indicated by the `require' docs). It can be suitable in cases where your program/mode usually doesn't use ruler-mode but only this or some interactive commands like feruler use it. In that case, ruler-mode is only loaded when it's actually used/needed. Bye, Tassilo