如何使用Emacs编辑Google Drive文本文档并将我的更改镜像回Google Doc?
我找到了一个Google command line program,以及一个叫做gclient的东西,它是Emacsspeak的一部分,但它们似乎需要Linux或Windows,而我使用的是Aquamacs。或者我只是不知道如何安装它们。
这可行吗?
发布于 2013-10-05 22:00:16
可以从macports安装googlecl
。然后,您可以使用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
并没有像它应该的那样工作。
发布于 2014-10-10 20:22:47
不需要获取、编辑(Emacs)和推送文件。
首先在你的mac上安装"Google Drive“。然后您可以直接编辑该文件。在~/Google\ Drive下查找。
发布于 2015-10-25 04:00:17
另一个使用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 " ")))))))
https://stackoverflow.com/questions/18390467
复制