Screw It: The Search for the Perfect EDC Screwdriv.Review: All Systems Red: The Murderbot Diaries.Using Tasker's Bluetooth Connection Event to Tackl.Making emacs happier on a Chromebook: An ssh and c.In the case of oauth2 it started the authentication process as smoothly as if I had been on a windowing system. ), Alt-Tab over to a browser window and hit Control-V to paste the URL that emacs tried to visit. If others are determined to use your Chromebook, you can at least assert a little more control by allowing only specific Google accounts to use your device. This means that I can evaluate (oauth2-auth-and-store. The result: evaluating browse-url places the URL not only in the emacs kill ring, but also in my Chromebook's paste buffer. With this code in place, emacs' kill ring is automtically sync'd with my Chromebook's copy and paste buffer. ![]() I have the invaluable osc52.el library configured in my init like so: (require 'osc52) In this particular case, I'm on a Chromebook using the Secure Shell App. In a console version of emacs, browse-url captures the URL in the kill ring where I can manually work with it. It provides an SSH agent implementation that can be used with the Secure Shell Chrome extension. On Windows or Mac, browse-url seamlessly opens URLs like it always has. Provides an SSH Agent implementation for Chrome's Secure Shell extension This is a bare-bones SSH agent extension for Google Chrome. (setq browse-url-browser-function 'kill-url-browse-url-function)) Here's the code to do this: (defun kill-url-browse-url-function (url &rest ignore) And I don't need to store the URL in a file, I can store the URL in a temporary and easily accessible location: the kill ring. Turns out, this is surprisingly easy to do. I could then grab the URL from the file, copy into my browser and be off and running. ![]() What if I sidestepped the browser issue? What if I convinced browse-url to store the URL in a file or somewhere else out of the way. So while I fixed the "No usable browser found" error, I was no closer to using oauth2 on a console version of emacs. When I invoke oauth2-auth-and-store the system attempts to open a convoluted URL that doesn't render right in eww. While this is nifty, it's not very useful. For example: (setq browse-url-browser-function 'eww-browse-url) It didn't take long before I learned that I could make the message go away by telling browse-url to use a native emacs web browser such as eww. I searched Google and haphazardly poked around the browse-url library. This time I was ssh'd into an AWS EC2 instance running a terminal version of emacs and was greeted with with the error: No usable browser found. It was magic.Ī few days later, eager to make improvements to my code, I again evaluated the above snippet. With the token defined, I was able to make authenticated API requests to Blogger. I copied the access code from my browser back into the emacs prompt. "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" The search key is located above the shift key on the left. Ctrl + search key + period key (.) at the same time. Evaluating this code opened up a browser window and started me down the OAuth permission process: (defvar bs-blogger-token If you want to simulate Ctrl + Insert on a Chromebook you can press the. ![]() ![]() I first experimented with oauth2 on my Mac. This library simplifies access to a slew of APIs and has single handedly added a number of mini-projects to my TODO list. If you hacve some problems, there are some hints on the library paths and variables that you may check.I recently learned of, and started playing with, emacs' oauth2 support.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |