From: Uwe Brauer <oub@mat.ucm.es>
To: help-gnu-emacs@gnu.org
Subject: Re: [SOLVED]
Date: Tue, 26 Jul 2022 06:57:31 +0200 [thread overview]
Message-ID: <871qu8ii84.fsf@mat.ucm.es> (raw)
In-Reply-To: 87czdsakea.fsf@web.de
[-- Attachment #1: Type: text/plain, Size: 3123 bytes --]
>>> "MH" == Michael Heerdegen <michael_heerdegen@web.de> writes:
> Uwe Brauer <oub@mat.ucm.es> writes:
>> Well I tried
>>
>> (defadvice set-property (before removeproperties activate)
>> "Remove all text properties before setting the property"
>> (let ((inhibit-read-only t))
>> (set-text-properties (region-beginning) (region-end) nil)))
>>
>> But it did not work
> Wouldn't it be appropriate to refresh your knowledge about advices?
Well I tried this as well, and tried out the new advice-add
functionality.
Here is what I tried
(defun my-remove-all-text-properties-region ()
(interactive) ;; that is not important
(let ((inhibit-read-only t))
(set-text-properties (region-beginning) (region-end) nil)))
Then
(advice-add 'set-property :before #'my-remove-all-text-properties-region)
or
(advice-add 'set-property :around #'my-remove-all-text-properties-region)
Result: no effect
I tried
(advice-add 'copy-to-register :before #'my-remove-all-text-properties-region)
or
(advice-add 'copy-to-register :around #'my-remove-all-text-properties-region)
Results in an error:
,----
| Debugger entered--Lisp error: (wrong-number-of-arguments
| #f(compiled-function () (interactive nil) #<bytecode
| 0x1f6825029d2a6658>) 1)
| my-remove-all-text-properties-region(#f(compiled-function (register
| start end &optional delete-flag region) "Copy region into register
| REGISTER.\nWith prefix arg, delete as well.\nCalled from program,
| takes five args: REGISTER, START, END, DELETE-FLAG,\nand REGION. START
| and END are buffer positions indicating what to copy.\nThe optional
| argument REGION if non-nil, indicates that we're not just\ncopying
| some text between START and END, but we're copying the
| region.\n\nInteractively, reads the register using
| `register-read-with-preview'." (interactive #f(compiled-function ()
| #<bytecode -0x19b31a6142e6ce87>)) #<bytecode 0x18af6be063d3e91b>))
| apply(my-remove-all-text-properties-region #f(compiled-function
| (register start end &optional delete-flag region) "Copy region into
| register REGISTER.\nWith prefix arg, delete as well.\nCalled from
| program, takes five args: REGISTER, START, END, DELETE-FLAG,\nand
| REGION. START and END are buffer positions indicating what to
| copy.\nThe optional argument REGION if non-nil, indicates that we're
| not just\ncopying some text between START and END, but we're copying
| the region.\n\nInteractively, reads the register using
| `register-read-with-preview'." (interactive #f(compiled-function ()
| #<bytecode -0x19b31a6142e6ce87>)) #<bytecode 0x18af6be063d3e91b>) nil)
| copy-to-register() funcall-interactively(copy-to-register)
| call-interactively(copy-to-register nil nil)
| command-execute(copy-to-register)
`----
At this point I give up
Uwe
--
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.
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
next prev parent reply other threads:[~2022-07-26 4:57 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-23 16:45 problems with better-registers: turn-off-all-minor modes or remove all text-properties Uwe Brauer
2022-07-23 20:35 ` 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 ` Uwe Brauer [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2022-10-02 20:18 add-log-time-format with time? Uwe Brauer
2022-10-03 6:49 ` [SOLVED] (was: add-log-time-format with time?) Uwe Brauer
2022-10-03 11:33 ` Emanuel Berg
2022-10-09 5:51 ` [SOLVED] Uwe Brauer
2021-10-06 15:53 how to randomize (scample) regions in a an (org) buffer Uwe Brauer
2021-10-06 16:35 ` [SOLVED] (was: how to randomize (scample) regions in a an (org) buffer) Uwe Brauer
2021-10-06 19:59 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-06 20:24 ` [SOLVED] Uwe Brauer
2021-10-06 20:58 ` [SOLVED] Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-07 7:05 ` [SOLVED] Uwe Brauer
2021-10-07 8:15 ` [SOLVED] Emanuel Berg via Users list for the GNU Emacs text editor
2010-08-13 14:37 Prefix-Arg (non-interactive!) in Info Memnon Anon
2010-08-13 15:17 ` Eli Zaretskii
2010-08-13 15:50 ` Memnon Anon
2010-08-13 16:09 ` Eli Zaretskii
2010-08-13 17:04 ` Memnon Anon
2010-08-13 19:33 ` Eli Zaretskii
2010-08-13 20:58 ` [Solved] (was: Prefix-Arg (non-interactive!) in Info) Memnon Anon
2010-08-14 8:05 ` Eli Zaretskii
2010-08-14 21:18 ` [Solved] Memnon Anon
2010-08-14 22:27 ` [Solved] Eli Zaretskii
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=871qu8ii84.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).