From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: defalias inside a defun Date: Tue, 09 Apr 2024 12:13:47 +0000 Message-ID: References: <86le5mzxaz.fsf@p200300d6270a69d99ce50a63538851d9.dip0.t-ipconnect.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24156"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Joost Kremers Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 09 14:14:58 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 1ruANN-00064F-HY for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 09 Apr 2024 14:14:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruAMe-0003y3-5E; Tue, 09 Apr 2024 08:14:12 -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 1ruAMb-0003xl-S4 for help-gnu-emacs@gnu.org; Tue, 09 Apr 2024 08:14:10 -0400 Original-Received: from mail-4325.protonmail.ch ([185.70.43.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruAMO-0001Ej-A2 for help-gnu-emacs@gnu.org; Tue, 09 Apr 2024 08:14:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1712664831; x=1712924031; bh=tTT43EBFpA0xj+jrUj2EPcxGKvCfQFNFF8wIH1vniLA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=KaV3Dt/3dsBY+HB7xJF0ZpTPblWvyP+h1kUgK05OpaI5DsYgq3yu4gYBTTVbxCphu L1Scnuu81hdBR1ANlcH6WjrwbcgLvCI7RVXOGVf0u7GvRGaT5aO5gvWWjMFeqxTawx DUFPVzjKblhsyBBngq3yZiizQUx1ylHrN5MA0RE2r3QTiVv2srsQLE1fyWy4ksdgUI zk0/zW8csjV/MSfXzv+YPfzlK0tTUsOdfptypQ5x9gzst5BVz1me29n0u7lriTT9pX I/kaGpyNB0IJ4Sw/MwSCl2Ehqjv15EQ0vFvNQ7WRoUjcd9i01m+16Pkp8acB+3waWH Nko08ph0jGdHQ== In-Reply-To: <86le5mzxaz.fsf@p200300d6270a69d99ce50a63538851d9.dip0.t-ipconnect.de> Feedback-ID: 57735886:user:proton Received-SPF: pass client-ip=185.70.43.25; envelope-from=heimeborgia@protonmail.com; helo=mail-4325.protonmail.ch 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, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:146278 Archived-At: On Tuesday, April 9th, 2024 at 9:43 PM, Joost Kremers wrote: > On Sat, Apr 06 2024, Heime wrote: >=20 > > Would it be acceptable to call a defalias inside a defun ?\ >=20 >=20 > "Acceptable" how? Stylistically? Technically? Technically. I want to make available some aliases dependent upon certain modes.=20 (defun gali-exigens (seltr) "Load requirements based upon specific major modes and define `gali' commands to access `avus' functionalities using alternative names via aliases." (pcase seltr ;;------------------------------------------------------------ ("Bash" (require 'avus-bash) (defalias 'gali-bash-zilindr #'avus-bash-zilindr "Insert bash constructs.")) ;;------------------------------------------------------------ ("Latex" (require 'avus-latex) (defalias 'gali-latex-zilindr #'avus-latex-zilindr "Insert latex constructs.") (defalias 'gali-latex-vjero #'avus-latex-vjero "Insert latex probability constructs.") (defalias 'gali-latex-ams #'avus-latex-ams "Insert latex ams constructs.") (defalias 'gali-latex-stix #'avus-latex-stix "Insert latex stix constructs.")) ) =20 > Technically, I don't think it matters whether defalias occurs at the top = level > or inside a defun. >=20 > Stylistically, I don't really see anything wrong with it, but there's no > accounting for taste. :-) >=20 > -- > Joost Kremers > Life has its moments