From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thorsten Bonow Newsgroups: gmane.emacs.help Subject: Re: problems with better-registers: turn-off-all-minor modes or remove all text-properties Date: Sat, 23 Jul 2022 22:35:32 +0200 Message-ID: <877d43d0tn.fsf@post.rwth-aachen.de> References: <87wnc3dbhp.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6774"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:pJ2d+wnxsPWUOmQS0Ad+rVlUqhc= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 23 22:54:44 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 1oFM95-0001bv-KG for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Jul 2022 22:54:43 +0200 Original-Received: from localhost ([::1]:52668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFM93-0000ib-TQ for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Jul 2022 16:54:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFM4g-0000hu-Iy for help-gnu-emacs@gnu.org; Sat, 23 Jul 2022 16:50:12 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:57390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFM4c-0006bV-DJ for help-gnu-emacs@gnu.org; Sat, 23 Jul 2022 16:50:08 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oFM4Y-0006Bn-Ky for help-gnu-emacs@gnu.org; Sat, 23 Jul 2022 22:50:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ 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:138575 Archived-At: >>>>> Uwe Brauer writes: > 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. Hi, could you please be more specific about the problems? I ran a few quick tests with savehist mode; worked for me: (savehist-mode 1) (setq savehist-additional-variables '(register-alist)) This saves minibuffer history and `register-alist' in `savehist-file' (defaults to "~/.emacs.d/history"). Toto > 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 -- Sent from my GNU Emacs running on GNU/Linux