[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom
From: |
Juri Linkov |
Subject: |
bug#42865: 28.0.50; Add new 'copy-region-quietly' defcustom |
Date: |
Sun, 15 Nov 2020 22:40:20 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) |
>> The message text changes not often. But the symbol approach is much worse
>> because it takes the freedom from users - in case of symbols the developers
>> decide whether to allow the users to inhibit messages or not. When
>> developers
>> allow to inhibit some messages by adding a new symbol to the message
>> function,
>> then it takes many years until the users can start using new symbols to
>> inhibit messages after the next release.
>
> I think you convinced me, thanks. I still think people will shoot
> themselves in the foot, but OTOH we are hardly strangers to that.
In bug#44629 Eli reminded about set-message-function, and indeed
it's possible to make it safer by checking both the command name
and message regexp. For example:
(put 'kill-ring-save 'inhibit-message "^Copied text ")
(put 'save-buffer 'inhibit-message "^Wrote ")
(put 'read-only-mode 'inhibit-message "^View mode: type ")
(defun inhibit-message-function (message)
(and this-command
(get this-command 'inhibit-message)
(string-match-p (get this-command 'inhibit-message) message)))
(setq set-message-function 'inhibit-message-function)