On Linux, the built-in el files are all read-only, so no problem.
But on MS Windows, what happens is like this:
- I get curious about the definition of the command isearch-forward, so I type ctrl–h
f isearch-forwardand click on the linkisearch.elfrom the help to get to the definition of the function. - While I am reading its definition, I press ctrl–h or ctrl–c many times, but I have previously set Caps Lock as another Ctrl key, so sometimes it happens that I release Caps Lock too early, in which case ctrl–h or ctrl–c becomes inserting
horc. - Sometimes I notice that and undo it, but sometimes I don’t notice it, and I even save them all with ctrl–x
s.
What is a good way to protect the built-in el files from me on MS Windows?
Change the permissions to be read-only.
The sequence will open up the file
isearch.el, then use dired on its directory. At which point you mark all the files, and then change permissions to be read only.You’ll also want to do it for the sub directories. So whip up a macro and run it until you’re done.
Starting in the
lispdired buffer (the one you created up there), go to the first file (right below.and..), and begin:There, you have defined a macro to go to the next directory, enter it, mark all its files read only, and leave the directory. Now run it several times (20 for Emacs 23.1).
And you’re done.
If you have a cygwin shell, it’d be a lot easier to just do