Posts by bram85@emacs.ch
 (DIR) Post #AVz1LBnb5DFowRB8aG by bram85@emacs.ch
       2023-05-24T14:50:17Z
       
       0 likes, 0 repeats
       
       @galdor depends on your use-cases of course. My (only) use-case is to encrypt a file for secure storage / transfer, for which I use age nowadays.https://age-encryption.org/
       
 (DIR) Post #AWBqEzlrqLESLXbVoW by bram85@emacs.ch
       2023-05-30T19:10:34Z
       
       0 likes, 0 repeats
       
       @anniegreens using @forgejo. In principle it's #selfhosted, but you can also use the instance at @Codeberg .
       
 (DIR) Post #AWTRZGrozQpZ9TEt2e by bram85@emacs.ch
       2023-06-08T05:37:24Z
       
       0 likes, 1 repeats
       
       Giving #meow a try, turns out I've been missing modal editing a bit. After all, I've used Vim for a longer time than #emacs so far.Meow does not mimic the same keys as vim, which is OK since I've forgotten most of the keys anyway. Still it needs a bit of time to get used to.One question though, how to move to a visual hint number >10?https://github.com/meow-edit/meow
       
 (DIR) Post #AWTT50ZLDlR9pDIC92 by bram85@emacs.ch
       2023-06-08T07:22:26Z
       
       0 likes, 0 repeats
       
       @mitchmarq42xyz ok, thanks. So implicitly you have to type one 0 or two 0's to reach the other hints.
       
 (DIR) Post #AWUFSlrkKmBwyRIXWS by bram85@emacs.ch
       2023-06-08T11:05:44Z
       
       0 likes, 1 repeats
       
       @otfrom there's `meow-escape-or-normal-modal` to get me out of a situation like this. In my brief usage I had to resort to this function for a couple of times.
       
 (DIR) Post #AWq5sT05XQX4nMvxL6 by bram85@emacs.ch
       2023-06-19T04:47:46Z
       
       0 likes, 1 repeats
       
       My new #emacs package `persist-state`, to regularly save bookmarks, history, recent files (and more), has reached MELPA:https://melpa.org/#/persist-stateWhy such a package, as all of these packages have save functionality out of the box? Most often, these save functions are called on `emacs-kill-hook`. This works nice if you always exit Emacs cleanly. However, Emacs may crash, freeze or the underlying host may fall flat on its face, and all updates to the list of recent files, bookmarks, history, etc. are lost during your 183 days of `emacs-uptime`.This package silently saves all of this metadata regularly. Note it does not replicate `auto-save-mode`, which saves buffer content regularly.persist-state supports a number of packages out of the box:- bookmark- desktop- Eshell history- Prescient- recentf- savehistFor other packages that have some form of save functions, you can customize the list of save functions to be called regularly.Check the README for more info.https://codeberg.org/bram85/emacs-persist-state
       
 (DIR) Post #AXIIXvkGgd6GXLZRMe by bram85@emacs.ch
       2023-07-02T19:41:16Z
       
       0 likes, 1 repeats
       
       #emacs package persist-state 0.3 available on (stable) MELPA.This package regularly saves your Emacs state (bookmarks, history,recent files, etc.) when idle for a brief moment. In case Emacs isidle for a longer time, no state is saved.Version 0.3 adds support for regularly saving your buffer positions using the builtin saveplace package.https://stable.melpa.org/#/persist-state
       
 (DIR) Post #AXz7mhj7vlqDP1s69w by bram85@emacs.ch
       2023-02-01T10:57:51Z
       
       1 likes, 0 repeats
       
       Inspired by the blog post linked below, I added #git diff support for #orgmode files. This will show the heading title in the corresponding @@ block for each hunk.So the .gitattributes entry is simply:    *.org diff=orgThe .gitconfig block is:    [diff "org"]        xfuncname="^\\*+ +(.*)$"Read the whole blog post for the proper setup, it will show you how to do something similar for definitions in Common #Lisp or #Emacs Lisp.https://www.n16f.net/blog/improving-git-diffs-for-lisp/
       
 (DIR) Post #AZDNwGqQ7dpyYBB9Lk by bram85@emacs.ch
       2023-08-29T06:45:45Z
       
       0 likes, 0 repeats
       
       @louis Overall speaking I like the toki pona language, although I still have some doubts with the level of expression you can reach with the limited vocabulary. Time will tell.A few observations after a few weeks:- The limited vocabulary is a feature: it makes you more mindful about what you say and how to decompose something in more elemental concepts. I think that was also the intent of the language's creator.- The grammar is simple and (almost) free of exceptions.- I like the blend of many 'real' languages coming together: English, Dutch / German, Russian, Mandarin and more (but those are the ones I'm familiar with to different extents).So at least it's a fun language to learn, its usefulness is yet to be seen. But learning a language is more than learning some words and rules, I already notice how it changes the way you think.
       
 (DIR) Post #AZGkj3q42xlGrwYuuW by bram85@emacs.ch
       2023-08-30T19:52:17Z
       
       0 likes, 1 repeats
       
       Here's a function using #magit to show the diff of the current buffer since a certain date/time.My use-case: I put my work notes in a single org file. When our daily standup starts I can quickly review what I worked on / wrote down in the last 24 hours.https://apps.bram85.nl/git/bram/gists/src/commit/cb4c371e5ce68ba89afce0ae020e6b6f4161d237/gists/magit-diff-range-current-buffer.el#emacs
       
 (DIR) Post #AZUxSh5odaf6u2N3AW by bram85@emacs.ch
       2023-09-06T18:13:53Z
       
       0 likes, 0 repeats
       
       @fox you might be looking for org-special-blocks. No experience with it, though.https://alhassy.com/org-special-block-extras/
       
 (DIR) Post #AcoOyPCZUx0wEjF5v6 by bram85@emacs.ch
       2023-12-14T20:02:35Z
       
       0 likes, 1 repeats
       
       Getting `gpg-agent' to work properly inside #termux and have it properly accessed from #emacs is a bit tricky.The first issue is Android related: by default the agent will spawn as a top level process. This makes the process prone to be randomly killed by Android for memory management purposes, causing you to enter your passphrase more often than you may have configured.Since I always run Emacs anyway, I chose to execute it from the Emacs init file, and passing a shell for the `--daemon' flag. Then it becomes a child process and won't be killed at random. It occupies a hidden buffer /*gpg-agent*/.,----| (defconst my/termux-p (getenv "ANDROID_ROOT"))| | (when my/termux-p|   (start-process "gpg-agent" " *gpg-agent*" "gpg-agent" "--daemon" "/bin/sh"))`----The second issue is 'knowing' the correct TTY such that `pinentry' shows up correctly inside Emacs (using `(setq epg-pinentry-mode 'loopback)').Outside Emacs, `pinentry' shows up in the right place because the GPG manual dictates to have your $GPG_TTY set to the output of the `tty' command, preferably from your shell initialization.Inside Emacs, the correct TTY may change: run `tty' inside `eshell' and it may output /dev/pts/1. Open another real terminal, go back to `eshell' and run `tty' again: /dev/pts/2. So commands inside `eshell', such as `gpg', `ssh' and `git' cannot rely on a fixed $GPG_TTY that was set when starting Emacs. With the wrong value, the loopback pinentry fails and no passphrase is prompted from the minibuffer. Instead, the terminal that displays Emacs gets messed up.One could fix it with the following inside `eshell':,----| tty| (setenv "GPG_TTY" "/dev/pts/2")| gpg-connect-agent updatestartuptty /bye`----Which needs to be executed every time you're about to run something that might trigger a `pinentry' (including remote operations with Magit or TRAMP).These steps can be performed from various hooks such that any subprocess gets the proper $GPG_TTY to which Emacs responds.First a function to retrieve the `tty' output /synchronously/. If we don't wait, a `ssh' subprocess may have been spawned in the meantime with an outdated/incorrect $GPG_TTY.,----| (defun my/get-pty ()|   (with-temp-buffer|     (let* ((process-connection-type t) ; force PTY allocation|            (proc (start-process "tty" (current-buffer) "tty")))|       (while (process-live-p proc)|         (accept-process-output proc 0.01 nil t)) ; wait for process to terminate|       (car (string-lines (buffer-string)))))) ; return process output`----And then a function we can use for hooks to actually update $GPG_TTY and make sure that SSH uses the correct display for a possible passphrase prompt.,----| (defun my/hook/set-gpg-tty ()|   (setenv "GPG_TTY" (my/get-pty))|   (call-process "gpg-connect-agent" nil nil nil "updatestartuptty" "/bye"))`----Finally, I attached this hook in three places:,----| (add-hook 'find-file-hook #'my/hook/set-gpg-tty)  ; for TRAMP| (add-hook 'magit-pre-start-git-hook #'my/hook/set-gpg-tty)| (add-hook 'eshell-pre-command-hook #'my/hook/set-gpg-tty 0 t)`----Which covers my (potential) GPG/SSH usage within Emacs. Now, anytime a I perform a GPG / SSH operation, the $GPG_TTY variable is set properly and if needed, the passhprase prompt shows up in the minibuffer.
       
 (DIR) Post #AcuSsru0YY6nlaFccC by bram85@emacs.ch
       2023-12-17T19:10:04Z
       
       0 likes, 0 repeats
       
       @mms I discovered the Universal Summarizer by Kagi yesterday. Given a YouTube URL it will present you a textual summary of this video.I used it to reduce a 2h System Crafters video to a summary I could read in half a minute. It's pretty amazing.https://kagi.com/summarizer/index.html
       
 (DIR) Post #Ad3ywpBlHmRKR41t3I by bram85@emacs.ch
       2023-12-22T09:04:00Z
       
       0 likes, 1 repeats
       
       The screenshot in yesterday's toot on #fastgpt displays the question: what makes it better than ChatGPT?The funny thing is it missed out on two major aspects:1. The model is open source:https://github.com/labring/FastGPT/2. Also I like the fact more that Kagi provides the search results on which the answer was based. This gives more transparency than ChatGPT does.Downside: it's not really a chat, it answers one question at a time without followup. But that is being worked on, apparently.If you're curious, you can see for yourself at https://kagi.com/fastgpt.https://emacs.ch/@bram85/111620681768693603
       
 (DIR) Post #Ad42QHZ1AO8GhRe4rA by bram85@emacs.ch
       2023-12-21T22:07:18Z
       
       0 likes, 1 repeats
       
       Started a new #emacs package providing a shell for #kagi #FastGPT: kagi.el.Of course, inspired by @xenodium's fantastic chatgpt-shell package. In fact, both use the underlying shell-maker package for the heavy lifting.Still very rough, lots of refinements to be done. But the basics work.https://codeberg.org/bram85/kagi.el
       
 (DIR) Post #Ad4VUqcPfn5fFVlLge by bram85@emacs.ch
       2023-12-22T13:54:09Z
       
       0 likes, 0 repeats
       
       @kir @louis do you have credit on your Kagi account? Without balance the API will spit out a 502.
       
 (DIR) Post #AdFQbiHih54MOi65aa by bram85@emacs.ch
       2023-12-27T21:43:28Z
       
       0 likes, 1 repeats
       
       Added a section to the README to integrate my #kagi.el #emacs package with #embark.This allows you to:- Summarize buffer content from the minibuffer (e.g. from `switch-buffer`)- Summarize a URL when calling `embark-act` while point is on a URL.- Summarize the region when calling `embark-act`.In all these contexts, hit 'K s' from the embark-act menu.Might be turned as part of the package in some way.https://codeberg.org/bram85/kagi.el#user-content-headline-7
       
 (DIR) Post #AdV1A4zNpW78VqqElc by bram85@emacs.ch
       2024-01-03T20:08:04Z
       
       0 likes, 1 repeats
       
       A while ago I shared a [toot] to create a denote entry from a URL. It fetches the URL from the clipboard, retrieves the default title from the web and proposes it as such. In the meantime I made this a bit smoother. Next to the clipboard, it will also look at the text at point and the current elfeed entry to get URL candidates.I put a short demo on Asciinema: https://asciinema.org/a/oWH0taGbOHbfOBcmdOsEO9wUuThe current implementation can be found on my site: https://apps.bram85.nl/git/bram/gists/src/commit/b04e6762031db22ea53de64c5e478fb16191\ e1f1/gists/denote-create-note-url.el Previous toot: https://emacs.ch/@bram85/111150204263888493
       
 (DIR) Post #AddG30J5PggnAU7CD2 by bram85@emacs.ch
       2024-01-08T06:16:21Z
       
       0 likes, 1 repeats
       
       kagi.el is now available on MELPA and MELPA Stable.https://melpa.org/#/kagiThis #emacs package provides access to #kagi's #FastGPT (inspired my chatgpt-shell) and the Universal Summarizer to summarize buffers, regions or URLs.In the future I hope to implement the other APIs as well, which are more search oriented.Check the README for the setup instructions.https://codeberg.org/bram85/kagi.el/src/branch/main/README.org
       
 (DIR) Post #AdeyCRhXDcFdWwWpcW by bram85@emacs.ch
       2024-01-09T05:37:12Z
       
       0 likes, 1 repeats
       
       In #emacs, dired-mode and occur-mode both have edit modes.In dired-mode, you enter edit mode by disabling read-only mode (C-x C-q), while in occur-mode you press 'e'. To address this inconsistency, add the following to your init file:(keymap-set occur-mode-map "C-x C-q" #'occur-edit-mode)