help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Activating a minor-mode


From: angelomolina
Subject: Re: Activating a minor-mode
Date: Mon, 14 Mar 2022 20:20:47 +0100 (CET)

I also want to activate the minor-mode globally.  How could I activate a 
minor-mode globally?



Mar 14, 2022, 18:13 by help-gnu-emacs@gnu.org:

> Have a minor mode with the following code.  I want to enable `F11` to execute 
> `voyager-sweep`.
>
> But having difficulty get the minor mode to function.  Would I need an 
> `add-hook` ? 
>
> Have added the following
>
> (defun typex-toro-voyager ()
>   "Launches toro voyager."
>   (add-to-list 'load-path "~/Opstk/bin/arktika")
>   (require 'toro "toro-voyager"))
>
> (typex-toromona-voyager)
>
> Here is the relevant code that defines the minor-mode.
>
> (defun voyager-keytrigger ()
>    "Set keybinding for changing mode"
>    (global-unset-key [f11])
>    (global-set-key (kbd "<f11>") 'voyager-sweep) )
>
> ;;;###autoload
> (define-minor-mode toro-minor-mode
>   "todo"
>   :lighter " toro"  ; indicator in mode-line
>
>   (set-face-attribute 'font-lock-comment-face nil
>      :weight (face-attribute 'default :weight))
>
>   (when toro-minor-mode  ; evaluates true when mode enabled
>     (set-face-attribute 'default nil :weight 'bold)
>     (toro-voyager-keytrigger)  ))
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]