如何使用Emacs编辑Google云端硬盘文本文档并将我的更改反映回Google文档?
我找到了Google command line program,以及名为gclient的内容,它是Emacsspeak的一部分,但它们似乎需要Linux或Windows,我在OSX上使用Aquamacs。或许我只是不明白如何安装它们。
这可行吗?
答案 0 :(得分:5)
googlecl
可以从macports安装。然后,您可以使用emacs server打开包含本地emacs的文件。
安装完成后,您可以按照以下命令操作:
$ google docs list # gets a list of the files
$ google docs get <FILE> /tmp/edit$$.txt # gets the <FILE> to /tmp/edit$$.tmp
$ emacsclient /tmp/edit$$.tmp
$ google docs upload /tmp/edit$$.tmp <FILE>
但是,我发现google docs get
不能正常工作。
答案 1 :(得分:2)
无需获取,编辑(emacs)和推送文件。
首先安装&#34; Google Drive&#34;在你的Mac上。 然后,您可以直接编辑该文件。查看〜/ Google \ Drive。
答案 2 :(得分:0)
使用gdrive的另一个选项(需要helm才能完成)
(defvar gdocs-folder-id "<gdrive folder for exported docs>"
"location for storing org to gdocs exported files, use 'gdrive list -t <foldername>' to find the id")
(defun gdoc-export-buffer ()
"Export current buffer as google doc to folder irentified by gdocs-folder-id"
(interactive)
(shell-command
(format "gdrive upload --convert --mimetype text/plain --parent %s --file %s"
gdocs-folder-id buffer-file-name)))
(defun gdoc-import-buffer (doc)
"Import a file in gdocs-folder-id into current buffer"
(interactive
(list
(completing-read "Choose one: "
(split-string
(shell-command-to-string
(format "gdrive list -q \"'%s' in parents\"" gdocs-folder-id)) "\n"))))
(insert (replace-regexp-in-string (string ?\C-m) (string ?\C-j) (shell-command-to-string
(format "gdrive download -s --format txt --id %s" (car (split-string doc " ")))))))