all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: Heime <heimeborgia@protonmail.com>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Make command available accordnig to major mode
Date: Tue, 02 Apr 2024 16:20:56 +0000	[thread overview]
Message-ID: <XjAl77a2sJ-ZMY2HiIDdkds5qpMWADxV5aJvvu0lKDDOUIbT-1oBV1_XH_8yT6y_KIr_IiVlq7_t_-AJehf-sZ6nf2HjV0kSb773lSBSdPE=@protonmail.com> (raw)
In-Reply-To: <AXiw78nevM7DkxYj2c4vZzzSLa_TcaiBl9bX7rTPmLcBWPqDOwSjpUsBlBIJZvj18sbGoHV2iIcbLFqOXmZFm_rqCnSnDt96-Ts7jJ1KeoQ=@protonmail.com>

Have different files that are to be used according to the specific 
major mode (avus-elisp, avus-bash) of the file I am working on.

I made the following inside a minor-mode named gali-minor-mode.

What can I do so that when a bash file gets loaded, I get the functionality
provided by avus-bash when I enable gali-minor-mode

(defun gali-avus ()
  "Require libraries based on major mode."
  (interactive)

  (cond

    ( (or (eq major-mode 'lisp-interaction-mode)
          (eq major-mode 'emacs-lisp-mode))
        (require 'avus-elisp) )

    ( (eq major-mode 'sh-mode)
        (require 'avus-bash) ) ))




  reply	other threads:[~2024-04-02 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 11:44 Make command available accordnig to major mode Heime
2024-04-02 16:20 ` Heime [this message]
2024-04-03 11:23 ` Michael Albinus
2024-04-03 12:00   ` Heime
2024-04-03 12:14     ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='XjAl77a2sJ-ZMY2HiIDdkds5qpMWADxV5aJvvu0lKDDOUIbT-1oBV1_XH_8yT6y_KIr_IiVlq7_t_-AJehf-sZ6nf2HjV0kSb773lSBSdPE=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.