mov macosrec -record ' %s ' -mov -output ' > ' # speed. (buffer-file-name path) override so > picks it up (path (dwim-shell-commands-generate-path "~/Desktop" (car window) ".mov")) ( let* ((window (dwim-shell-commands-macos-select-window)) "Select and start recording a macOS window." ( defun dwim-shell-commands-macos-start-recording-window () Since we're talking ffmpeg, here's all it takes to have gif conversion handy: If it ever took you a little while to find the right command incantation to get things right, only to forget all about it next time you need it ( I'm looking at you ffmpeg), dwim-shell-command can help you easily save things for posterity and make them easily accessible in the future. dwim-shell-commands-video-to-optimized-gif.dwim-shell-commands-pdf-password-protect.dwim-shell-commands-git-clone-clipboard-url-to-downloads.dwim-shell-commands-git-clone-clipboard-url.dwim-shell-commands-files-combined-size.To give you an idea of the kinds of things I'm using DWIM commands for, check the following out: If you've never heard of DWIM, it stands for "Do what I mean". I kid, but it's become a pretty painless process for me. Integrating command line utilities into Emacs and making them quickly accessible seems to have become a full-time hobby of mine. The source block powering this magic trick looks as follows:Ĭommand line utilities can be invoked in all sorts of ways, but I'm an Emacs nutter so you can see where this is going… I want Emacs key bindings to control the lot. Now, if we pull our org babel rabbit out of our Emacs magic hat, we can use :results table to print the list as an org table. We can subsequently get each variable's corresponding docs using (get symbol 'variable-documentation) and put it into a list. We can use custom-variable-p to check for that. Out of all matching, we should only keep custom variables. Since we're filtering symbols from chatgpt-shell, we can start by including only those whose symbol-name match "^chatgpt-shell". We can use it to extract the symbols we're after. It iterates over obarray, Emacs's symbol table. Turns out mapatoms is just what I needed. A peak into apropos.el quickly got me on my way. I had no idea how to go about this, but apropos-variable and apropos-command surely knew where to fetch the details from. Not ideal, as it'll require a little more careful maintenance in the future.Įmacs being the self-documenting editor that it is, I figured I should be able to extract customizable variables, commands, along with their respective docs, and generate these very same org tables. While the table docs didn't take long to build manually, they quickly became out of sync with their elisp counterparts. | chatgpt-shell-system-prompt | The system message helps set the behavior of the assistant. | chatgpt-shell-curl-additional-options | Additional options for `curl' command. | chatgpt-shell-display-function | Function to display the shell. Emacs: Reveal in macOS Finder (DWIM style).dwim-shell-command usages: pdftotext and scp.dwim-shell-command with template prompts.Emacs: DWIM shell command (multi-language).Emacs: Password-protect current pdf (revisited).I've covered many of the use-cases before: In addition to replacing shell-command with dwim-shell-command, I also use it to bring all sorts of command line utilities to familiar Emacs workflows (in dired or current buffers), without having to remember complex command invocations. Automatically injecting files (from dired or other buffers) or kill ring.If you're unfamiliar with dwim-shell-command, it enables Emacs shell commands with DWIM behaviour: You're likely gonna share this link, right? Automatically copy the upload URL to kill-ring.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |