[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [SOLVED]
From: |
Uwe Brauer |
Subject: |
Re: [SOLVED] |
Date: |
Tue, 26 Jul 2022 06:57:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
>>> "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.
smime.p7s
Description: S/MIME cryptographic signature
- Re: problems with better-registers: turn-off-all-minor modes or remove all text-properties, (continued)
- Re: problems with better-registers: turn-off-all-minor modes or remove all text-properties, Michael Heerdegen, 2022/07/23
- Re: problems with better-registers: turn-off-all-minor modes or remove all text-properties, Michael Heerdegen, 2022/07/24
- Re: problems with better-registers: turn-off-all-minor modes or remove all text-properties, Uwe Brauer, 2022/07/24
- [SOLVED] (was: problems with better-registers: turn-off-all-minor modes or remove all text-properties), Uwe Brauer, 2022/07/24
- Re: [SOLVED], Michael Heerdegen, 2022/07/24
- Re: [SOLVED], Uwe Brauer, 2022/07/25
- Re: [SOLVED], Uwe Brauer, 2022/07/25
- Re: [SOLVED], Stefan Monnier, 2022/07/25
- Re: [SOLVED], Uwe Brauer, 2022/07/25
- Re: [SOLVED], Michael Heerdegen, 2022/07/25
- Re: [SOLVED],
Uwe Brauer <=
- Re: [SOLVED], Thorsten Bonow, 2022/07/26
- Re: [SOLVED], Uwe Brauer, 2022/07/26
- Re: [SOLVED], Yuri Khan, 2022/07/26
- Re: [SOLVED], Michael Heerdegen, 2022/07/26
- Re: [SOLVED], Uwe Brauer, 2022/07/27
- Re: [SOLVED], Yuri Khan, 2022/07/27
- Re: [SOLVED$, Uwe Brauer, 2022/07/28