alphapapa / org-super-agenda

Supercharge your Org daily/weekly agenda by grouping items
GNU General Public License v3.0
1.35k stars 107 forks source link

Mode Enabled Message #131

Closed bhgomes closed 4 years ago

bhgomes commented 4 years ago

Is it necessary to have this message when the mode is enabled?

(message (if org-super-agenda-mode
             "org-super-agenda-mode enabled."
             "org-super-agenda-mode disabled."))

I'm not experienced enough in emacs-lisp to know if there's a way to remove this with advices.

alphapapa commented 4 years ago

The message exists because the mode modifies the behavior of the agenda commands without being visible to the user, so it's important to know whether the mode is enabled. For experienced users, it's not necessary, but for users who are less intimately familiar with Org Agenda, it is a helpful reminder.

If the message must be disabled, you could advise the minor mode function using :around advice which uses cl-letf to rebind message's symbol function to ignore, or something like that.

bhgomes commented 4 years ago

Thanks for the clarification. I'll close this as it doesnt require attention from maintainers of this library.

hpfr commented 2 years ago

For future searchers:

(defun org-super-agenda-mode-silence (fn &rest args)
  "Disable the org-super-agenda-mode toggle message"
  (let ((inhibit-message t)
        (message-log-max nil))
    (apply fn args)))

(advice-add 'org-super-agenda-mode :around
            #'org-super-agenda-mode-silence)

I definitely think there should be a customization variable for this behavior. I don't know of another global minor mode that uses messages like this.

alphapapa commented 2 years ago

@hpfr I see various modes issuing "enabled/disabled" messages in my Emacs all the time. Anyway, if you'd like to add a defcustom, patches welcome. :)