unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* problems with better-registers: turn-off-all-minor modes or remove all text-properties
@ 2022-07-23 16:45 Uwe Brauer
  2022-07-23 20:35 ` Thorsten Bonow
  2022-07-24  0:09 ` Michael Heerdegen
  0 siblings, 2 replies; 27+ messages in thread
From: Uwe Brauer @ 2022-07-23 16:45 UTC (permalink / raw)
  To: help-gnu-emacs



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. 




^ permalink raw reply	[flat|nested] 27+ messages in thread
* add-log-time-format with time?
@ 2022-10-02 20:18 Uwe Brauer
  2022-10-03  6:49 ` [SOLVED] (was: add-log-time-format with time?) Uwe Brauer
  0 siblings, 1 reply; 27+ messages in thread
From: Uwe Brauer @ 2022-10-02 20:18 UTC (permalink / raw)
  To: help-gnu-emacs


Hi

According to 

(defcustom add-log-time-format 'add-log-iso8601-time-string
  "*Function that defines the time format.
For example, `add-log-iso8601-time-string', which gives the
date in international ISO 8601 format,
and `current-time-string' are two valid values."
  :type '(radio (const :tag "International ISO 8601 format"
		       add-log-iso8601-time-string)
		(const :tag "Old format, as returned by `current-time-string'"
		       current-time-string)
		(function :tag "Other"))
  :group 'change-log)

The possible entries in a ChangeLog are 
,----
| 
| Sun Oct  2 21:56:09 2022  Uwe Brauer  <oub@mat.ucm.es>
| 
| 	* new.org (Third section): 4 
`----


Or

,----
| 2022-10-02  Uwe Brauer  <oub@mat.ucm.es>
| 
| 	* first.org (this is new file): 4 a new file
`----

How could I achieve 


,----
| 2022-10-02  21:56:09 Uwe Brauer  <oub@mat.ucm.es>
| 
| 	* first.org (this is new file): 4 a new file
`----


I tried 

(defun my-changelog-date-format ()
  "A simple hack to obtain `2022-10-02 22:10'."
  (interactive)
  (insert (format-time-string "%Y-%m-%d %H:%M")))

Choice:
( ) International ISO 8601 format
( ) Old format, as returned by ‘current-time-string’
(*) Other: my-changelog-date-format
    State : SAVED and set.
   Function that defines the time format. Hide
   For example, ‘add-log-iso8601-time-string’, which gives the
   date in international ISO 8601 format,
   and ‘current-time-string’ are two valid values.

But it did not work.

Any ideas

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. 




^ permalink raw reply	[flat|nested] 27+ messages in thread
* how to randomize (scample) regions in a an (org) buffer
@ 2021-10-06 15:53 Uwe Brauer
  2021-10-06 16:35 ` [SOLVED] (was: how to randomize (scample) regions in a an (org) buffer) Uwe Brauer
  0 siblings, 1 reply; 27+ messages in thread
From: Uwe Brauer @ 2021-10-06 15:53 UTC (permalink / raw)
  To: help-gnu-emacs



Hi

I need to replace private information in my org files, but only region wide.

I found 
https://www.reddit.com/r/emacs/comments/6pc0ts/sanitize_buffer_by_replacing_words_with_random/

Where two such functions are discussed, one is even for org files,
however only buffer wide and the code looks rather complicated to me.

Anybody knows about such a function?

Thanks 

Uwe Brauer 




^ permalink raw reply	[flat|nested] 27+ messages in thread
* Prefix-Arg (non-interactive!) in Info
@ 2010-08-13 14:37 Memnon Anon
  2010-08-13 15:17 ` Eli Zaretskii
  0 siblings, 1 reply; 27+ messages in thread
From: Memnon Anon @ 2010-08-13 14:37 UTC (permalink / raw)
  To: help-gnu-emacs

[ Fairly long mail, questions are at the very bottom.]
Hi,

Someone had a fairly easy question on the orgmode ml:

,----[ Message-ID: <0vhbizzap7.fsf@gmail.com> ]
| I'd like to bind `C-u C-c C-x C-i' to the <f10> key in emacs 23.
`----

So, I thought this should be easy to find in the Info documentation and 
started looking through the relevant documentation via the indices, and
plain repeated `C-s' for things like C-u, universal argument etc.

But it was surprisingly difficult to find an answer to a simple
question: How do I non-interactively! pass a prefix argument to a
function?

On the one hand, it strengthened my remembrance, that C-u =
argument of 4, C-u C-u = argument of 16 etc, but I found no way how to
put this into good use; first tries in *scratch* failed.

On the contrary, this FAQ entry suggested another way and put me on the
wrong track for a minute or two:

,----[ (info "(efaq)Replying to the sender of a message") ]
| 12.6 How can I force Rmail to reply to the sender of a message, but not the other recipients?
|
| Ron Isaacson <isaacson@seas.upenn.edu> says: When you hit <r> to reply
| in Rmail, by default it CCs all of the original recipients (everyone on
! the original `To' and `CC' lists). With a prefix argument (i.e., typing
! `C-u' before <r>), it replies only to the sender.  However, going
! through the whole `C-u' business every time you want to reply is a
! pain.  This is the best fix I've been able to come up with:
| 
|      (defun rmail-reply-t ()
|        "Reply only to the sender of the current message. (See rmail-reply.)"
|        (interactive)
!        (rmail-reply t))
|      (add-hook 'rmail-mode-hook
|        (lambda ()
|          (define-key rmail-mode-map "r" 'rmail-reply-t)
|          (define-key rmail-mode-map "R" 'rmail-reply)))
`----
( Thinking: "C-u = Argument t?!" Nah, this can not be right, can it?
  But this other guy [Message ID: <87ocd71jz6.fsf@gmx.net>]
  suggested exactly that ...")

I finally gave up and went to google, where I found the right(?)
solution: 

,----[ http://www.emacs.uniyar.ac.ru/doc/em24h/emacs200.htm ]
| (define-key c++-mode-map [(f6)] (definteractive (comment-region '(4)))) 
| [...]
| definteractive declares an anonymous function at point with the body
! containing a call to comment region with argument '(4), which is the
! Lisp representation for the C-u prefix argument.
`----

Up to now, I was not only able to find such information in Info, I even
found them easily and quicker than with google, so I am wondering:

      Did I miss a crucial Info page? (I think so, but ... which?)
      If not, is this worth a wishlist bug against the documentation?
      If so, where would you suggest to put this information?

Memnon



^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2022-10-09  5:51 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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                     ` [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
  -- 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

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).