Render README.org as HTML on Sourcehut
https://breatheoutbreathe.in/blog/2024-12-10-sourcehut-org-mode-readme.html
https://redd.it/1hbp67r
@r_emacs
package Jujutsushi a package for Jujutsu
I keep hearing good things about jujutsu and have been curious whether there is an Emacs interface to jj
out there since Magit is so good.
Found jujutsushi that is in early development in case anyone else is looking for similar.
Does anyone know of any other projects to provide transient like interface to jj
?
https://redd.it/1hbmpub
@r_emacs
package nice-org-html
nice-org-html is now in MELPA. It helps with exporting and publishing .org files to readable, responsive, customizable HTML, in part by deriving colors for light and dark modes from user-specified Emacs themes. An exported version of the README with link to a sample is available here. Default styling suggestions welcome.
https://redd.it/1hbjq6n
@r_emacs
Iter Vitae - Hackable Curriculum Vitae / Resume generator in Guile Scheme - Early Preview
https://redd.it/1hbe2xm
@r_emacs
My \bigcap and \bigcup look really ugly when rendered
Looks like my three-yeard old painted them :). Is that just font? I am using source code pro. Which font does have pretty math symbols and is also good for programming?
Is this also why \bigcup and \bigcap are smaller than \cup and \cap?
https://redd.it/1hb5035
@r_emacs
Guile Emacs development has started again after a decade
https://emacsconf.org/2024/talks/guile/
https://redd.it/1hb4om4
@r_emacs
Android emacs: finger/stylus support for hyperbole buttons
https://www.gnu.org/software/hyperbole/ is an emacs package with many functionalities, but its main functionality is to follow implicit links ("buttons" in hyperbole terminology), at least I believe so.
I recently began using hyperbole in Android emacs, and soon realized that I did not know how to follow hyperbole implicit links, by pointing and clicking. The problem is that a touch screen interface works essentially as a one button mouse, and we do not want to activate implicit buttons inadvertently.
So I added an icon to the Android emacs toolbar, and bound that to the hyperbole action key. I can now use my finger or stylus to put the cursor on an implicit button, then click on the hyperbole action key icon in the toolbar.
Here is how I configured this in doom emacs. This should work in other configs to, if one changes "use-package!" to "use-package".(use-package! hyperbole
:defer t
:config
(hyperbole-mode 1)
(setq hsys-org-enable-smart-keys t)
(tool-bar-add-item
"fwd-arrow" 'hkey-either
'hkey-either
:help "Hyperbole action key"))
Note the ":defer t". To start hyperbole, I invoke "M-x hyperbole". By deferring the start of hyperbole, I can ensure that the toolbar has already been setup, and is ready to be further configured.
At present I have some problem with my doom emacs configuration, leading to that emacs starts up with the toolbar hidden. I have compensated for that by adding the following to my config:(after! consult
(tool-bar-mode 1))
The icon is part of Android emacs, and is in directory "/assets/etc/images". To list the contents of this directory, one must use something that is part of the emacs APK, not part of the Termux APK, as Termux does not have access to emacs directory "/assets/". So one can for example use eshell's built in ls command, but not the ls in "M-x shell".
https://redd.it/1haz1rf
@r_emacs
hyperdrive.el v0.5.0: Explore the interactive peer graphv0.5.0
of hyperdrive.el is available on NonGNU ELPA!
hyperdrive.el is an Emacs interface to hyperdrive, a mutable,
versioned, peer-to-peer shared filesystem. Among other things,
hyperdrive.el has these features: Share unlimited files of unlimited
size; Explore file history with built-in versioning; Stream video and
audio; No signup or account creation; Free as in Freedom!
Highlights of v0.5.0
:
- Explore the graph of your sources of information (other hyperdrive
peers) with an interactive graph view (backed by Graphviz) and list
view (backed by taxy-magit-section.el).
- Right click on a hyperdrive to open the context menu about it.
- Added support for storing key/value data in a hyperbee.
- Simplified the logic for accessing file history.
Check out our recent video presentation at EmacsConf to see how the
peer graph works!
For the full set of changes and fixes, check out the hyperdrive.el
CHANGELOG.
Feedback welcome! Thank you!!
https://redd.it/1hawd0f
@r_emacs
Minor Mode for Advent Of Code https://gist.github.com/dhruvasagar/6d1cf62d772a35bbc9b0326e370d4f63
I created a system for quickly solving, testing, running solutions for AOC (though this can be used for any other system with tweaks) for VIM. I recently started using Emacs so wanted to port it and here's my attempt.
This provides mappings to run code against tinput file (test input) or finally against input. There's also a mapping to download input that relies on setting aoc-session-cookie.
Just sharing if this helps someone.
https://redd.it/1hawbsn
@r_emacs
How does lsp-mode determine the root of the project?
When I open up a file inside a project(lets say the linux kernel), it seems to open up in much higher level directory than the project is in
Lets say I open: \~/Projects/C/Kernel/linux-6.12.4/include/net/sock.h or whatever and lsp-mode says: clang connected on \~/Projects/C, while both .clangd and compile_commands.json are in \~/Projects/C/Kernel/linux-6.12.4/.
How does lsp-mode try and determine the root of the project?
Also, the settings from the \~/Projects/C/Kernel/linux-6.12.4/.clangd are not being detected by emacs.
https://redd.it/1hajswv
@r_emacs
git repository with two project.el
projects
Is it possible to have one git repository with two directories, each of which is a project by itself? In other words, when I open it using `project.el` I want each of the subdirectory to be considered as a separate project.
https://redd.it/1hab4ge
@r_emacs
[new package] gotest-ts - run go tests with gotest.el and tree-sitter
https://github.com/chmouel/gotest-ts.el
https://redd.it/1haa3zx
@r_emacs
New package: eglot-inactive-regions
Hi, I’d like to share `eglot-inactive-regions`, an eglot extension that dims the colors of inactive #ifdef
branches in C/C++ code, leveraging language server knowledge about build-time options and defines.
Previously known as clangd-inactive-regions
, the package has been available on GitHub for a while but never got to properly announce it. It is also now included in NonGNU ELPA.
Currently supported servers:
clangd (using the `inactiveRegions` capability)
ccls (using skippedRanges
notifications)
If you know other languanges (or LSP servers with similar extensions) where this may be relevant please let me know!
## Changes for Existing Users
For the probably few users of the previous version (clangd-inactive-regions
), there are some breaking changes:
The package is now a global minor mode, so it no longer needs to be added to `eglot` hooks. Once enabled globally, it will activate automatically in relevant buffers.
Configuration is now handled through the Emacs Customize interface (M-x customize-group inactive-regions
), so initial settings may require some adjustment.
My suggestion is to start new with the configuration in github README and experiment from there.
Feedback and contributions always welcome!
https://redd.it/1ha82xj
@r_emacs
Emacs startup preferring .el.gz files instead of .el files
Hi all,
I'm in the midst of porting over my working Emacs 29.4 setup (using elpaca
and use-package
) from an old X11 computer to a new Wayland one (using the "Pure GTK" build of Emacs).
For whatever reason, when Emacs starts up, it exclusively searches for *.el.gz
files and seems to ignore the *.el
files already available in the elpaca/builds
directory. Thus, whenever I try to start Emacs, it spits a "File is missing" error at me (e.g., File is missing: /path/to/emacs/directory/elpaca/builds/elpaca.el.gz
).
If I go in and manually gzip
the appropriate file, Emacs loads it without issue and moves on to the next missing *.el.gz
file.
I've also tried to limit loaded suffixes, i.e., (setq load-suffixes '(".el" ".elc" ".so"))
. However, this causes further breakage down the line (loading just hangs).
Does anyone know how to make Emacs preferentially load *.el
files on startup? Or at least defer to an *.el
file when a *.el.gz
file isn't available? I guess another solution is to try to get elpaca
to compress everything to *.el.gz
when building the local package repo, although this seems unnecessary. Thanks for your help!
https://redd.it/1h9oteg
@r_emacs
I have limited experience with git, but I use emacs. Should I dive into git using magit, or should I “practice” first using it from the command line?
For context, I use emacs for latex, a little organizing with org, and rather simple python programming. But when debugging a python script I feel the need to try out a bunch of things and sometimes it happens that I forget to revert some change. This seems a good use case for git.
Like some people, I used git a while ago but got a little scared when I accidentally completely lost my bearings in a folder and ended up deleting something unintentionally. (Yes, panic gitting is a thing).
I know magit exists and everyone says it’s great, but if I need to get re-used to the basics of git again, should I use it right off the bat?
https://redd.it/1h9q2hu
@r_emacs
Weekly Tips, Tricks, &c. Thread — 2024-12-11 / week 50
This is a thread for smaller, miscellaneous items that might not warrant a full post on their own.
See this search for previous "Weekly Tips, Tricks, &c." Threads.
Don't feel constrained in regards to what you post, just keep your post vaguely, generally on the topic of emacs.
https://redd.it/1hbov34
@r_emacs
So happy to have discovered markdown-dnd-images
I am so happy to have discovered markdown-dnd-images
, which elegantly solves the problem of dragging and dropping images into Markdown files. With this tool, working in Markdown feels as seamless as it does in Org-mode.
https://www.reddit.com/r/emacs/comments/1hasi1i/comment/m1bevzi/?utm\_source=share&utm\_medium=web3x&utm\_name=web3xcss&utm\_term=1&utm\_content=share\_button
For years, I struggled to find a reliable mobile app for Org-mode, only to be disappointed repeatedly. About five months ago, I made the switch to Markdown-mode, using Obsidian as my mobile solution.markdown-dnd-images
represents a significant step forward in enhancing daily workflow.
At this point, aside from Org-Babel, Markdown has become almost a complete replacement for Org-mode.
https://redd.it/1hbls9u
@r_emacs
Passing data between org source blocks (a practical example)
Someone asked me in Slack, "how do you work with SQL in Emacs", and I said: "I just use Org-mode source blocks..."
Then, I posted this and afterwards I realized - maybe more people will find this helpful?
Exploring data in Org-mode blocks is very nice, because you can "pipe" the data, passing it from one block to another. A trick I learned long ago from the unsung hero of Emacs - Prof. John Kitchin.
Here's a basic example:
#+name: get-data
#+beginsrc sqlite :db ~/.emacs.d/.local/org-roam.db
SELECT * FROM links limit 1;
#+endsrc
#+RESULTS: get-data
| 126 | D1144528-E934-4630-85C4-864DECFE8E43 | 29A15201-1906-4856-8921-9570ABEF8812 | id | (:outline nil) |
#+name: transform-data
#+beginsrc python :python python3 :var data=get-data :results output
import json
print(json.dumps([dict(zip(['id', 'source', 'dest', 'type', 'properties'], row)) for row in data]))
#+endsrc
#+beginsrc bash :var json=transform-data :results output :wrap src json
echo "$json" | jq '.'
#+endsrc
#+RESULTS:
#+beginsrc json
[
{
"id": 126,
"source": "D1144528-E934-4630-85C4-864DECFE8E43",
"dest": "29A15201-1906-4856-8921-9570ABEF8812",
"type": "id",
"properties": "(:outline nil)"
}
]
#+endsrc
- Fist thing queries the db
- Because it's a named block, the var can be referred by that name in the next one (you can have multiple vars in the header)
- The second block takes that tabular data and turns into a json thing
- The third block, using 'jq', formats it nicely
- wrap src json
in the last header is to push it into a syntax-highlighted json block
It looks messy here in Reddit, here's how it looks in Emacs. https://i.imgur.com/GxiPq5m.png
I mean, this entire thing is made up for the sake of demonstration. If the actual goal is to get data in json, you don't even need to do all that - with sqlite you can simply add .mode
at the top of the block, like this:
#+beginsrc sqlite :db ~/.emacs.d/.local/org-roam.db
.mode json
SELECT * FROM links LIMIT 1;
#+endsrc
But let's just imagine we're dealing with something else, not sqlite.
What's crazy is that you can even use elisp vars and function results in :var
s
like for example in this request where token gets grabbed from the environment:
#+beginsrc http :pretty :var token=(shell-command-to-string "echo $MYTOKEN")
GET http://localhost:8000/myapi
Content-Type: application/json
Authorization: Bearer ${token}
#+endsrc
The one limitation I can think of is if it's returning thousands of rows, of course, in that case, Emacs will struggle to render them all in Org-mode - things may get sluggish. But guess what? You can always dump the results into another file, just add :results output file :file ~/foo.json
This is truly great way of dealing with data, you can use different languages, output results into charts, etc.
If you use a language that connects to a REPL, e.g., Clojure - this gets even more fun.
And all your experiments can be part of your notes or a dissertation, you can publish them, export them to various formats, etc..
This shit is just too good to ignore. Try it if you've never done that before. I promise you - all your waltzing in the terminal, http request testings with Postman, messing with sql, talking to k8s pods and Docker containers, etc., all that can be done in a way nicer way with Org-mode.
https://redd.it/1hbi751
@r_emacs
Emacs has never felt so good!
Really pleased with how this is looking. Ef-autumn + spacious-padding by Prot!
https://preview.redd.it/pliskvu9e36e1.png?width=4000&format=png&auto=webp&s=cdd86f5ea8bb4512f8563b8f5b1e33710236a321
https://redd.it/1hbddab
@r_emacs
Org-srs: A feature-rich and flexible spaced repetition system inside Org-mode with FSRS support
https://github.com/bohonghuang/org-srs
https://redd.it/1hb5cnz
@r_emacs
Doom sync on powershell messes up find file option within +notes and +files
I am a new user and for some reason, if I use doom sync on windows powershell, the find file commands in emacs end up giving the error "project--files-in-directory: File listing failed: FIND: Parameter format not correct".
But if I run doom sync on git bash and restart the emacs server and run the daemon (either through powershell or git bash), everything works fine.
This happened around the time i tried to get the org-roam module. I ended up removing everything of it, but this still persists. It also could've just been a coincidence, and I might not have tried using doom sync on powershell before today.
I've tried changing paths and doom sync even rebuilt everything at one point, but nothing changed.
Overall, I can still use the program, but it is definitely odd. Does anyone know what could fix this or cause this?
https://redd.it/1hb127m
@r_emacs
cdlatex in latex-mode
Sorry if this question has answers elsewhere, but I'm having trouble setting up cdlatex-mode for use in latex-mode, on several computers with different versions of Emacs in ubuntu. I would like consistency between computers.
\- on the most recent version of Emacs (29.1), I cannot get the tab key to work to complete a snippet (such as sn). I can set up any other key, including a function key or backtab, but not tab. (I would prefer tab). I have tried several options, including
(use-package cdlatex
:ensure t
:hook (LaTeX-mode . turn-on-cdlatex)
:bind (:map cdlatex-mode-map
("<tab>" . cdlatex-tab)))
\- on the oldest (26.3, I cannot change it), I cannot change the cdlatex-math-modify-prefix. I have tried putting (setq cdlatex-math-modify-prefix ?[f12])
in my .el files, with (require 'cdlatex)
after, also with keys other than [f12\], it is ignored and remains '. This is a problem since I type in French and have regularly 'e or 'i or 'u... I have also tried changing it in the cdlatex customisation menu, but it is ignored also (in the cdlatex menu, the prefix is still ').
\- also, not as important, on 26.3 and 28.1 versions, I cannot get cdlatex-mode to activate automatically, I have tried (require 'cdlatex)
and the code above with use-package, but nothing seems to work.
I am wondering if I am putting these commands in the right place. I have tried in .emacs.d/init.el and in several .el files that I have in .emacs.d/config/ (this path is in my init file).
I would be grateful for any help. I have probably not given enough information, but I am a beginner with cdlatex and emacs modes in general (I have only customised shortcuts that work in latex-mode up to now with global-set-key)
https://redd.it/1haz8mk
@r_emacs
How to improve npm/jest output in compilation buffer?
Hi,
I frequently run unit tests on my repo using jest
. I use the js-pkg-mode to invoke the test
script from package.json
. A compilation buffer is used to display the output. But formatting is a little off. Here's how it looks in the compilation buffer. The lines repeat whenever there's a refresh (it seems like).
https://preview.redd.it/2y41u1dh6x5e1.png?width=713&format=png&auto=webp&s=35d85c39845e06e85bc7453158e5c644a308f298
If I run the same test suite in VSCode or a terminal, I get an output that looks like this.
https://preview.redd.it/n0s8uddw5x5e1.png?width=589&format=png&auto=webp&s=d8f64df9d6dd9d8f13723f19cda701b91043342c
Is there a way to make the test suite output in Emacs compilation buffer look more like the latter?
For context, I'm using Emacs 30 on MacOS.
https://redd.it/1hapnz5
@r_emacs
How apply org-downloads to markdown-mode to drag-drap images
I use Emacs with Org-mode to write articles, and I use the \`org-download\` plugin to insert images. This plugin allows me to drag and drop images directly from Windows File Explorer into the current cursor position in an Org file. My \`org-download\` configuration is as follows:
;;;; Org-Download
(require 'org-download)
(setq org-download-annotate-function (lambda (_link) ""))
(setq org-download-image-html-width 500)
(setq org-download-method 'directory)
(setq org-download-link-format "[[./%s]]\n")
(add-hook 'dired-mode-hook 'org-download-enable)
(add-hook 'org-mode-hook 'org-download-enable)
(setq org-download-screenshot-method "import %s")
This setup works perfectly in \`org-mode\`. When I drag and drop an image, it automatically moves the image to the \`./images/\` directory and inserts a corresponding Org-mode link like \`\[\[./images/example.png\]\]\` at the cursor position.
# Problem
I also work in Markdown files using \`markdown-mode\`, but \`org-download\` does not work there. Even if I try to enable \`org-download\` in \`markdown-mode\` by adding the following code:
(defun my-markdown-drag-image ()
"Enable image dragging in markdown-mode and insert as Markdown format."
(interactive)
(require 'org-download)
;; Set the link format to Markdown syntax
(setq-local org-download-link-format "![Image](./%s)")
;; Enable drag-and-drop functionality
(org-download-enable))
(add-hook 'markdown-mode-hook 'my-markdown-drag-image)
When I drag an image into a Markdown file, instead of inserting a Markdown-formatted link and moving the image to the \`./images/\` folder (as it does in \`org-mode\`), Emacs opens the image in a new buffer, which is completely useless in this context
# Current Workaround
To circumvent this issue, I currently switch to \`org-mode\` whenever I need to insert an image into a Markdown file:
1. I temporarily switch to \`org-mode\` using \`M-x org-mode\`.
2. I drag the image into the file, which works as expected using \`org-download\`.
3. I switch back to \`markdown-mode\` using \`M-x markdown-mode\` and manually edit the inserted link to match Markdown syntax (e.g., \`!\[Image\](./images/example.png)\`).
While this workaround is functional, it is inefficient and disrupts my workflow.
# Desired Solution
I would like to enable seamless drag-and-drop image insertion in \`markdown-mode\`, similar to how \`org-download\` works in \`org-mode\`. Specifically, the solution should:
1. Automatically move the dragged image to the \`./images/\` folder (or a configurable directory).
2. Insert a Markdown-formatted image link like \`!\[Image\](./images/example.png)\` at the cursor position.
3. Avoid opening the image in a new buffer.
Despite my attempts to adapt \`org-download\` for \`markdown-mode\`, I have not been able to achieve this functionality.
Could you help me solve this issue?
https://redd.it/1hasi1i
@r_emacs
new package: org-xopp (org+xournalpp)
https://github.com/mahmoodsh36/org-xopp
https://redd.it/1habnh2
@r_emacs
[video] Using emacs dape-mode to debug software with DAP protocol
https://www.youtube.com/watch?v=wEbHCg6XGRU
https://redd.it/1ha903r
@r_emacs
Package denote-tree: your denotes as a tree
# denote-tree
First of all, hello. Second, no one will able to guess what this thing does.
# Why?
The basic denote's navigation is not bad on a small scale, but as you approach around 100ish notes, seeing the structure is tad difficult. Of course, there is immortal denote-explore, but it lacks interactivity (although the visualization of neighborhood via hierarchy.el is pending on to-do list).
I got pissed off that there is no good way to peek into my notes when I use a terminal, so here it is: denote-tree.
# What?
Explore how a singular entry note (a parent) links itself with it's children notes, visit them, edit your front matter as subtrees nest within subtrees. If also handles cyclical notes and marks them as such.
# How?
Via magick of DFS, of course. It's almost shameful to admit, but denote-tree
recursively checks your notes for any further links and does that until there are no links left. Then, from each note front matter it extracts various matters (for example: title and date) and draws it nicely as a indented little cute star on the screen followed by that title and date.
Your front-matter is customized and uses something like FOO field? And you want it in your node description? No problem, you can add it to stuff denote-tree
recognizes via denote-tree-extend-filetype-with
.
When the buffer is drawn, every line contains few useful props that allow you to explore subtrees, visit notes and teleport around.
# What now?
I really want to link notes from within it hassle free and don't force poor Emacs to do recursion every time I want to draw that tree (since IO is the slowest element anyway and some denote folders can approach \~1600 linked notes maybe a trampoline is possible?). Next big thing would be silo integration, because at the current moment, there is none.
https://redd.it/1h9vonw
@r_emacs
Release 1.1.0: buffer-terminator.el - Safely Terminate Emacs Buffers Automatically
https://www.jamescherti.com/emacs-buffer-terminator/
https://redd.it/1h9pszb
@r_emacs
Turning org tables into Anki flashcards?
I like to use anime to learn languages. I found that org tables are quite nice for organizing my notes. I always have 3 columns: english, target language, and the use/context. I now have org tables with vocab from several series \(one org table per series\), enough to make some pretty nice Anki decks. I have some Python and MATLAB experience but I'm a complete lisp noob. Do you think this would be a good way to learn some elisp? If so, might someone be able to give me some tips/recommendations?
I could, for example, write an elisp function that parses the org file containing the tables and exports the contents to a file with a suitable format for the anki-editor package. I'm using Doom Emacs so I suppose I'd put this function in config.el. Does this plan seem reasonable?
Thanks so much!
https://redd.it/1h9nlbh
@r_emacs