From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Uwe Brauer Newsgroups: gmane.emacs.help Subject: problems with better-registers: turn-off-all-minor modes or remove all text-properties Date: Sat, 23 Jul 2022 18:45:06 +0200 Message-ID: <87wnc3dbhp.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38759"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:aG6r0HQW8ZYn1ZvPD2lP3ttMciI= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 23 18:45:57 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oFIGL-0009su-Dr for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Jul 2022 18:45:57 +0200 Original-Received: from localhost ([::1]:49986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFIGK-0002MN-9U for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Jul 2022 12:45:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFIFi-0002ME-GA for help-gnu-emacs@gnu.org; Sat, 23 Jul 2022 12:45:18 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:33800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFIFg-0006sX-ES for help-gnu-emacs@gnu.org; Sat, 23 Jul 2022 12:45:18 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oFIFc-0008t5-RV for help-gnu-emacs@gnu.org; Sat, 23 Jul 2022 18:45:12 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:138574 Archived-At: Hi better-registers found in https://github.com/emacsmirror/emacswiki.org/blob/master/better-registers.el is unfortunately no longer maintained. It allows, among other things, to save registers in a file for future sessions. While there is no problem in saving some text of a buffer in fundamental mode to a specific resister. However for example message mode, that has in my case quite a bit of minor modes turn on, results in a saving of the sort. ,---- | | (set-register 49 #(" | Test again | and again | -- | I strongly condemn Putin's war of aggression against the Ukraine. I | support to deliver weapons to Ukraine's military. I support the ban of | Russia from SWIFT. I support the EU membership of the Ukraine. " 0 1 | (fontified t) 1 11 (fontified t) 11 22 (fontified t) 22 23 (fontified t) | 23 25 (fontified t rear-nonsticky t field signature pabbrev-added t) 25 | 26 (fontified t rear-nonsticky t field signature) 26 27 (fontified t) 27 | 28 (fontified t pabbrev-added t) 28 29 (fontified t) 29 37 (fontified t | pabbrev-added t) 37 38 (fontified t) 38 45 (fontified t pabbrev-added t) | 45 46 (fontified t) 46 53 (fontified t pabbrev-added t) 53 54 (fontified | t) 54 57 (fontified t pabbrev-added t) 57 58 (fontified t) 58 60 | (fontified t pabbrev-added t) 60 61 (fontified t) 61 71 (fontified t | pabbrev-added t) 71 72 (fontified t) 72 79 (fontified t pabbrev-added t) | 79 80 (fontified t) 80 83 (fontified t pabbrev-added t) 83 84 (fontified | t) 84 91 (fontified t pabbrev-added t) 91 93 (fontified t) 93 94 | (fontified t pabbrev-added t) 94 95 (fontified t) 95 102 (fontified t | pabbrev-added t) 102 103 (fontified t) 103 105 (fontified t | pabbrev-added t) 105 106 (fontified t) 106 113 (fontified t | pabbrev-added t) 113 114 (fontified t) 114 121 (fontified t | pabbrev-added t) 121 122 (fontified t) 122 124 (fontified t | pabbrev-added t) 124 125 (fontified t) 125 134 (fontified t | pabbrev-added t) 134 135 (fontified t) 135 143 (fontified t | pabbrev-added t) 143 146 (fontified t) 146 147 (fontified t | pabbrev-added t) 147 148 (fontified t) 148 155 (fontified t | pabbrev-added t) 155 156 (fontified t) 156 159 (fontified t | pabbrev-added t) 159 160 (fontified t) 160 163 (fontified t | pabbrev-added t) 163 164 (fontified t) 164 166 (fontified t | pabbrev-added t) 166 167 (fontified t) 167 173 (fontified t | pabbrev-added t) 173 174 (fontified t) 174 178 (fontified t | pabbrev-added t) 178 179 (fontified t) 179 184 (fontified t | pabbrev-added t) 184 186 (fontified t) 186 187 (fontified t | pabbrev-added t) 187 188 (fontified t) 188 195 (fontified t | pabbrev-added t) 195 196 (fontified t) 196 199 (fontified t | pabbrev-added t) 199 200 (fontified t) 200 202 (fontified t | pabbrev-added t) 202 203 (fontified t) 203 213 (fontified t | pabbrev-added t) 213 214 (fontified t) 214 216 (fontified t | pabbrev-added t) 216 217 (fontified t) 217 220 (fontified t | pabbrev-added t) 220 221 (fontified t) 221 228 (fontified t | pabbrev-added t) 228 231 (fontified t))) `---- Which in turn causes problems when loading a file with such saved resisters. Two workaround occured to me, but both did not work 1. Turn off all minor mode (which might be the culprit of all the face stuff that is added) by using (defun disable-all-minor-modes () (interactive) (mapc (lambda (mode-symbol) (when (functionp mode-symbol) ;; some symbols are functions which aren't normal mode functions (ignore-errors (funcall mode-symbol -1)))) minor-mode-list)) Found in https://emacs.stackexchange.com/questions/42239/how-to-disable-all-the-minor-modes-when-a-specific-major-mode-is-enabled-with 2. Or delete all the text-properties, by something like this (let ((inhibit-read-only t)) (set-text-properties (point-min) (point-max) nil)) It did not work neither. Any idea? Thanks and regards Uwe Brauer -- I strongly condemn Putin's war of aggression against the Ukraine. I support to deliver weapons to Ukraine's military. I support the ban of Russia from SWIFT. I support the EU membership of the Ukraine.