atomic-chrome icon indicating copy to clipboard operation
atomic-chrome copied to clipboard

Missing feature

Open Mihara opened this issue 7 years ago • 5 comments

Thanks for making this, the original edit-server.el and its accompanying extension can be quite wonky sometimes.

That said, the original edit-server also has this feature: you could, depending on the url of the buffer, apply an extra processing step on save. In my case, I use it to edit in Markdown and have my text come out in bbcode in the actual form. I don't quite see how could I accomplish that with atomic-chrome, because even the buffer name does not contain the URL, and page titles are not very reliable.

In fact, could it be possible to set up something like copying the text into a temporary buffer, running a hook on it before sending to the browser, and leaving the actual buffer in Emacs untouched?

Mihara avatar Mar 16 '17 08:03 Mihara

@Mihara

You can set a specific major-mode depending on the page URL by setting the custome variable atomic-chrome-url-major-mode-alist. So you can apply an extra processing step by adding it to the major-mode.

Also, you need to set atomic-chrome-enable-auto-update to nil if the extra process is done when the buffer is saved. Otherwise, the content of the buffer is sent every time when you input a character.

alpha22jp avatar May 19 '17 13:05 alpha22jp

You mean I would have to create a new derived major mode for every URL? That strikes me as exceedingly inconvenient.

Mihara avatar May 19 '17 23:05 Mihara

@Mihara

How about implementing a hook which is invoked before the editing buffer is saved depending on the page URL? Does it satisfy your request?

alpha22jp avatar May 28 '17 01:05 alpha22jp

Just about any kind of hook will do, as long as whatever runs in it can get the full URL of the page somehow and make its own decision on whether to process the text or not.

Mihara avatar May 29 '17 08:05 Mihara

Great point. I'm trying to use this package with feishu docs feishu docs which provides similar features like google docs. Yet I have to parse its html form into human readable forms like markdown or org-mode and vise versa. Is there any hook or setting to support it? Thanks! ! @alpha22jp

sharefantasy avatar May 25 '20 06:05 sharefantasy