[Top][All Lists]

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

Activating a minor-mode

From: angelomolina
Subject: Activating a minor-mode
Date: Mon, 14 Mar 2022 19:13:58 +0100 (CET)

Have a minor mode with the following code.  I want to enable `F11` to execute 

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"))


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) )

(define-minor-mode toro-minor-mode
  :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]