0

I asked a question here which has not been answered yet.

I was able to pinpoint where my problem originated from in the core files. If I could just delete those lines, I reckon my problem would be fixed.

Right now, cc-mode.el is in read-mode only when I open it from the help menu. How can I modify it directly?

EDIT: The question that led me to this thought has been answered and the solution works perfectly without changing the core files.

Alan
  • 37
  • 5
  • 2
    Emacs users generally prefer to leave the core files in the original state and create new functions using the same names, or use `defalias` with a new function, or use an `advice` to modify an existing function. I have never known of anyone other than myself who wants to modify the core files directly .... One can modify a core file which has not been baked into the Emacs executable and then re-byte-compile the file. I personally separated that particular library completely by creating a new one with a prefix in front of each namespace; e.g., `my-cc-mode.el` and all variables/functions. – lawlist Mar 17 '22 at 06:29
  • 2
    You don't need to: you can always copy the library into your own file, make changes there and make sure that your copy of the library is loaded last. In the specific case you mention, have you tried the solution suggested in the [answer](https://emacs.stackexchange.com/a/70976/14825)? – NickD Mar 17 '22 at 12:15
  • 1
    I think the answer to the question is "Don't do that." IOW, it's the wrong question - pretty much an [X-Y question](https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). Someone might want to post an answer here similar to the comments by lawlist and NickD. Otherwise, OP: consider specifying in this question why you think you really want/need to do what you ask how to do. – Drew Mar 17 '22 at 14:44
  • @NickD Now I have and that works nicely. Thank you for the suggestion above! – Alan Mar 17 '22 at 15:47
  • @Drew It's not an XY problem as I posted the actual problem too. Since that one has been answered, I currently have no need for this hacky solution. However, I don't think any other question covers this. So, having an answer would still be nice (the answer could say why it's bad practice and what you should look for instead or something). – Alan Mar 17 '22 at 16:01
  • 1
    Again: "consider specifying in this question *why you think you really want/need* to do what you ask how to do." – Drew Mar 17 '22 at 17:10
  • @Drew Again: I **don't** want/need this. The initial issue that prompted this thought was resolved. Do you want me to extrapolate another possible issue where I might need this? If you think there is no value in keeping the question up for another beginner with a similar 'XY question', then purge the question. – Alan Mar 17 '22 at 18:59

0 Answers0