cproctor / qualitative-coding

Qualitative coding for computer scientists
Other
12 stars 3 forks source link

Add Emacs "support" #12

Closed jloow closed 10 months ago

jloow commented 3 years ago

"Support" for Emacs (i.e. opening the files in a similar manner to how they are opened in Vim) can be added by by modifying the run command:

run(["emacs", "-Q", "--eval",
             "(progn (find-file \"{}\") (split-window-right) (other-window 1) (find-file \"{}\") (scroll-all-mode))".format(*files)])

This opens the corpus file and the code file in two separate windows, with scrolling synced between the two windows.

The exact flags to pass can be discussed (-Q loads Emacs without a config file, for example; -nw opens Emacs in a terminal) as can whether to start a new instance of Emacs or if one should use emacsclient instead.

Emacs doesn't accept Windows-style paths, so for this to work under Windows, the file paths need to be converted to posix-style paths. In my fork, I solved this by calling open_editor as such: self.open_editor([f.as_posix(), code_file.as_posix()]).

cproctor commented 2 years ago

Hi, sorry I didn't see this until now--thanks for the contribution! I'll test it out and add it to the next release.

jloow commented 2 years ago

Looking at #16, with the editor option, I'm thinking that could be a suitable implementation.

cproctor commented 10 months ago

Merging this into #24.