[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: defalias inside a defun
From: |
Heime |
Subject: |
Re: defalias inside a defun |
Date: |
Tue, 09 Apr 2024 12:13:47 +0000 |
On Tuesday, April 9th, 2024 at 9:43 PM, Joost Kremers
<joostkremers@fastmail.fm> wrote:
> On Sat, Apr 06 2024, Heime wrote:
>
> > Would it be acceptable to call a defalias inside a defun ?\
>
>
> "Acceptable" how? Stylistically? Technically?
Technically. I want to make available some aliases dependent upon certain
modes.
(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.")) )
> Technically, I don't think it matters whether defalias occurs at the top level
> or inside a defun.
>
> Stylistically, I don't really see anything wrong with it, but there's no
> accounting for taste. :-)
>
> --
> Joost Kremers
> Life has its moments