0

How can I diminish flyspell-mode (the one built-in to emacs)? With use-package, none of the following work:

(use-package flyspell-mode
  :diminish)

(use-package flyspell-mode
  :diminish 'flyspell-mode)

(use-package flyspell-mode
  :config
  (eval-after-load "flyspell". '(diminish 'flyspell-mode)))

I would like to diminish flyspell-mode everywhere, but particularly in org buffers.

This is the full package configuration:

(use-package flyspell-mode
  :init
  (setq flyspell-issue-message-flag nil) 

  :hook ; Enable flyspell in specific modes
  (text-mode  org-mode  change-log-mode-hook  log-edit-mode-hook)

  :diminish 'flyspell-mode
  )

2 Answers 2

1

I was also trying to find a solution to this problem. It appears that adding this to my init solves it:

(setq flyspell-mode-line-string nil)

Inspecting minor-mode-alist, it turns out that for flyspell-mode its value is set to flyspell-mode-line-string.

Value:
((diff-minor-mode " Diff")
 (flyspell-mode flyspell-mode-line-string)
 (ispell-minor-mode " Spell")
 (highlight-indent-guides-mode #1="")

I think this "confuses" diminish, and hence, the mode is not "diminished".

1
  • jrdpastors' answer successfully diminished "Fly" from my mode line. Note: the line (setq flyspell-mode-line-string nil) had to be added outside the use-package block for flyspell-mode.
    – Snelephant
    Commented Jun 29, 2021 at 12:46
1

Use the following:

(use-package flyspell
  :diminish 'flyspell-mode)

It wants the mode that is provided by flyspell, which is called flyspell-mode.

Without use-package:

(require 'flyspell)
(diminish 'flyspell-mode)
5
  • Still no success. Could it be related to the sequence in which packages and modes are loaded? Diminish works for everything else in my config.el.
    – Snelephant
    Commented Feb 1, 2018 at 19:23
  • Hmmm, that's taken right out of my config. Did you use-package/require diminish before this code?
    – Dodgie
    Commented Feb 1, 2018 at 20:04
  • Yes, (require 'diminish) is in my init.el, and precedes flyspell. Every other mode seems to diminish successfully
    – Snelephant
    Commented Feb 2, 2018 at 19:02
  • By the way, in the use-package line, if I use flyspell as in your example instead of flyspell-mode as in my example, I receive the error: File mode specification error: (error Autoloading failed to define function flyspell) Could this be a clue? In fact, there is no flyspell package in my elpa directory, yet flyspell-mode works.
    – Snelephant
    Commented Feb 2, 2018 at 19:09
  • I honestly have no idea why your (use-package flyspell-mode) does not throw an error; I do not know of a package called "flyspell-mode". I've edited to use require, only. Let me know if that works. If it does, then there is something fugazi, here.
    – Dodgie
    Commented Feb 3, 2018 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.