tritoneparadox5 · 2022-12-08 17:33
I'm having trouble finding how to copy and paste notes from some windows files I have in OneNote vs emacs.
My org-mode files are in UTF-8 and I am mid process of moving a lot of info at work from OneNote into emacs to try to consolidate a few years worth of notes in OneNote, Joplin, Logsec, Obsidian...
Anyway, when the bullet points are copied into Emacs, I get \\225 characters that are the code for the windows bullet point and I can't save the file without errors into UTF-8 like I do with my other files.
I saved it as Raw text now to try and use M-x find-file-literally and M-x replace-string but when I type in the code as it looks in emacs, I can't replace '\\225' with a dash '-' to convert it to a emacs normal list.
Am I using the find-file-literally wrong? I can manually change all of the text but I've done that a few times and tried a few things now and I don't know what I need to do to replace the \\225, \\247, type characters that come over from whatever windows type character they are.
Also, I am on Windows 10, using emacs 28.2 and doom-emacs.
Attached are screenshots of what it looks like and what buffer output I get trying to convert all this.
https://preview.redd.it/cnue745lmp4a1.png?width=1125&format=png&auto=webp&s=d80f3a9dfa392eb9b628816954a9c645c6b5ed4a
​
https://preview.redd.it/yg41ea4nmp4a1.png?width=677&format=png&auto=webp&s=fb29213e71abc376f6cdc011d83f025437e02b15
​
https://preview.redd.it/tjojzg1omp4a1.png?width=789&format=png&auto=webp&s=c84948856e8981dfccea67991aa3456f62dfb57c
eli-zaretskii · 2022-12-08 18:28
By "copy and paste" do you mean mark with the mouse, Ctrl-C in OneNote and then C-y in Emacs? Or do you mean something else?
And what do you mean by "bullets are copied"? copied how?
And why are you using `find-file-literally`? Are you visiting files written by OneNote? if so, why not visit them normally, or tell Emacs how to decode them? AFAIK OneNote uses the system ANSI codepage, in which case Emacs running on Windows should decode it easily, because Emacs knows about the system codepage.
So I would expect that by just visiting your OneNote files normally, and then saving them in UTF-8, you should get what you want.
tritoneparadox5 · 2022-12-08 19:04
So, I’ve been using eMacs for about 2-3 months now. Probably should have said that and I’m still figuring out some basic functions and key maps and some of the best ways to do things.
I have been selecting all of the text in the OneNote application then Ctrl+C. Then in eMacs I am clicking on the open line and using the evil normal mode binding of “p” for put like in VIM.
That comes over with all the \225 like characters in emacs. When I go to save emacs pops up with a list of unknown UTF-8 characters and asks to save the org file in raw text or I feel like I’ve seen it say in UTF-8-dos format.
Something else I could add is I don’t know if the text format really matters so much. And the find file literally was the only thing google search and places like stack overflow would say to try and allow the replace function to find and replace the text in an eMacs buffer. Nothing has actually explained why that would work rather than doing it with a file just normally opened in a buffer. It’s just all I’ve seen to find on the subject.
And I’m tired of manually deleting and adding - + * on the list lines manually. So I thought I’d ask here.
Thanks for asking me to clarify what I was doing to copy.
HM0880 · 2022-12-08 23:23
There are at least two options.
1) Say "yes" to utf-8-dos encoding.
2) Copy the \225 character and replace it with the bullet you want. (You don't *need* different bullet characters on each level in Org.)
[Edit: add new line]
eli-zaretskii · 2022-12-10 14:48
I don't use VIM, so I don't now what "p" does in VIM.
What I can suggest is to select text in OneNote, then Ctrl+C, then in Emacs press Ctrl+y. This should insert the characters correctly, as they are in OneNote, and should not produce raw bytes like `225.