unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: help-gnu-emacs@gnu.org
Subject: problems with better-registers: turn-off-all-minor modes or remove all text-properties
Date: Sat, 23 Jul 2022 18:45:06 +0200	[thread overview]
Message-ID: <87wnc3dbhp.fsf@mat.ucm.es> (raw)



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. 




             reply	other threads:[~2022-07-23 16:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-23 16:45 Uwe Brauer [this message]
2022-07-23 20:35 ` problems with better-registers: turn-off-all-minor modes or remove all text-properties Thorsten Bonow
2022-07-24  0:09 ` Michael Heerdegen
2022-07-24  3:59   ` Michael Heerdegen
2022-07-24  5:39     ` Uwe Brauer
2022-07-24 19:51       ` [SOLVED] (was: problems with better-registers: turn-off-all-minor modes or remove all text-properties) Uwe Brauer
2022-07-24 22:36         ` [SOLVED] Michael Heerdegen
2022-07-25  5:37           ` [SOLVED] Uwe Brauer
2022-07-25  5:49             ` [SOLVED] Uwe Brauer
2022-07-25 17:09               ` [SOLVED] Stefan Monnier via Users list for the GNU Emacs text editor
2022-07-25 19:49                 ` [SOLVED] Uwe Brauer
2022-07-25 22:37                   ` [SOLVED] Michael Heerdegen
2022-07-26  4:57                     ` [SOLVED] Uwe Brauer
2022-07-26 13:01                       ` [SOLVED] Thorsten Bonow
2022-07-26 15:02                         ` [SOLVED] Uwe Brauer
2022-07-26 16:23                           ` [SOLVED] Yuri Khan
2022-07-26 23:28                             ` [SOLVED] Michael Heerdegen
2022-07-27 10:50                             ` [SOLVED] Uwe Brauer
2022-07-27 15:04                               ` [SOLVED] Yuri Khan
2022-07-28 14:46                                 ` [SOLVED$ Uwe Brauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnc3dbhp.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).