Skip to main content
added 143 characters in body
Source Link
ruby_object
  • 517
  • 2
  • 15

In the end, I used https://www.emacswiki.org/emacs/AlarmBell and added some code to overwrite-mode-hook. So now I get a visible alarm, which may be better than completely disabling the key. Time will tell if this is better than the other answer.

(defun double-flash-mode-line () (let ((flash-sec (/ 1.0 20))) (invert-face 'mode-line) (run-with-timer flash-sec nil #'invert-face 'mode-line) (run-with-timer (* 2 flash-sec) nil #'invert-face 'mode-line) (run-with-timer (* 3 flash-sec) nil #'invert-face 'mode-line))) (add-hook 'overwrite-mode-hook #'(lambda () (double-flash-mode-line))) 

In the end I used https://www.emacswiki.org/emacs/AlarmBell and added some code to overwrite-mode-hook

(defun double-flash-mode-line () (let ((flash-sec (/ 1.0 20))) (invert-face 'mode-line) (run-with-timer flash-sec nil #'invert-face 'mode-line) (run-with-timer (* 2 flash-sec) nil #'invert-face 'mode-line) (run-with-timer (* 3 flash-sec) nil #'invert-face 'mode-line))) (add-hook 'overwrite-mode-hook #'(lambda () (double-flash-mode-line))) 

In the end, I used https://www.emacswiki.org/emacs/AlarmBell and added some code to overwrite-mode-hook. So now I get a visible alarm, which may be better than completely disabling the key. Time will tell if this is better than the other answer.

(defun double-flash-mode-line () (let ((flash-sec (/ 1.0 20))) (invert-face 'mode-line) (run-with-timer flash-sec nil #'invert-face 'mode-line) (run-with-timer (* 2 flash-sec) nil #'invert-face 'mode-line) (run-with-timer (* 3 flash-sec) nil #'invert-face 'mode-line))) (add-hook 'overwrite-mode-hook #'(lambda () (double-flash-mode-line))) 
deleted 281 characters in body
Source Link
ruby_object
  • 517
  • 2
  • 15

In the end I have adopted somebody alse's answerused https://www.emacswiki.org/emacs/AlarmBell and added some code to overwrite-mode-hook

;;; based on ;; https://stackoverflow.com/questions/1511737/how-do-you-list-the-active-minor-modes-in-emacs (defun whichdouble-activeflash-modes (mode-symb) "Give a message of which minor modes are enabled in the current buffer." (interactive) (letline ((active-modes))   (mapc (lambdalet (mode) (conditionflash-case nil (ifsec (and/ (symbolp1.0 mode20) (symbol-value mode))   (add-toinvert-listface 'active'mode-modes mode)line)   (errorrun-with-timer flash-sec nil) )#'invert-face 'mode-line)   minor(run-modewith-list) timer (message "Active* modes2 areflash-sec) %s"nil active#'invert-modesface 'mode-line)   ;; find if active modes have our mode (run-with-timer (* 3 flash-sec) (membernil mode#'invert-symbface active'mode-modesline) ))   (which-activeadd-modeshook 'overwrite-mode-hook #'(lambda () (double-flash-mode-line))) 

I have adopted somebody alse's answer

;;; based on ;; https://stackoverflow.com/questions/1511737/how-do-you-list-the-active-minor-modes-in-emacs (defun which-active-modes (mode-symb) "Give a message of which minor modes are enabled in the current buffer." (interactive) (let ((active-modes))   (mapc (lambda (mode) (condition-case nil (if (and (symbolp mode) (symbol-value mode))   (add-to-list 'active-modes mode))   (error nil) ))   minor-mode-list)  (message "Active modes are %s" active-modes )   ;; find if active modes have our mode  (member mode-symb active-modes) )) (which-active-modes 'overwrite-mode) 

In the end I used https://www.emacswiki.org/emacs/AlarmBell and added some code to overwrite-mode-hook

(defun double-flash-mode-line () (let ((flash-sec (/ 1.0 20))) (invert-face 'mode-line) (run-with-timer flash-sec nil #'invert-face 'mode-line) (run-with-timer (* 2 flash-sec) nil #'invert-face 'mode-line) (run-with-timer (* 3 flash-sec) nil #'invert-face 'mode-line)))   (add-hook 'overwrite-mode-hook #'(lambda () (double-flash-mode-line))) 
Source Link
ruby_object
  • 517
  • 2
  • 15

I have adopted somebody alse's answer

;;; based on ;; https://stackoverflow.com/questions/1511737/how-do-you-list-the-active-minor-modes-in-emacs (defun which-active-modes (mode-symb) "Give a message of which minor modes are enabled in the current buffer." (interactive) (let ((active-modes)) (mapc (lambda (mode) (condition-case nil (if (and (symbolp mode) (symbol-value mode)) (add-to-list 'active-modes mode)) (error nil) )) minor-mode-list) (message "Active modes are %s" active-modes ) ;; find if active modes have our mode (member mode-symb active-modes) )) (which-active-modes 'overwrite-mode)