[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Make command available accordnig to major mode
From: |
Michael Albinus |
Subject: |
Re: Make command available accordnig to major mode |
Date: |
Wed, 03 Apr 2024 13:23:55 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Heime <heimeborgia@protonmail.com> writes:
Hi,
> I have a file gali.el and want to be able to call the command
> gali-bash only when I am in sh-mode. What can I do.
>
> ;; ----------------------------------------------------
>
> File bovu/bovu-bash.el
>
> (defconst bovu-bash-func
> "FCNAME ()
> {
> ACTN
> }")
>
> (provide 'bovu-bash)
>
> ;; -------------------------------------------------------
>
> File gali.el
>
> (defun gali-bash (actm)
> (interactive)
> (insert bovu-bash-func))
(defun gali-bash (actm)
(interactive nil 'sh-mode)
(insert bovu-bash-func))
Best regards, Michael.