Voice recognition with Emacs
https://simonsafar.com/2024/whisper/
https://redd.it/1cajii7
@r_emacs
dap-mode stopped working
I had dap-mode working with python using the lsp-mode dap-mode settings on the LSP-mode website. I didn't use it for a while and now I've come back to this. I recently moved to emacs 30 from 29.3. Could this be a byproduct of using the development branch and something I'll have to live with or is this error something else?
error in process sentinel: dap--buffers-w-breakpoints: Wrong type argument: markerp, nil
error in process sentinel: Wrong type argument: markerp, nil
error in process filter: dap--buffers-w-breakpoints: Wrong type argument: markerp, nil
error in process filter: Wrong type argument: markerp, nil
​
https://redd.it/1cabgyf
@r_emacs
org-mode
: SCHEDULED and ranges
I have read in the manual that SCHEDULED is supposed to be the start time when one will start working on a meeting. However, it's pretty convenient to use a time range (using the commands that org-mode supports to manipulate the SCHEDULED timestamp is very convenient). Also, query languages like org-mode's internal language and org-ql support querying the SCHEDULED time specifically.
Using ranges with SCHEDULED is widespread.
Would it make sense to change SCHEDULED to mean the time when one will work on a task? (either start working on it, if it's not a range, or spend working on it, if it's a range).
https://redd.it/1c9nbn9
@r_emacs
In MacOS, is it possible to change the name of the (Emacs) application?
In OS X, I would like to run two instances of emacs. MacOS uses the name of application to display all info about it (e.g. when switching apps, the first string in the menu bar). I would like one instance to have a different name. Furthermore, hammerspoon uses the app name in several of its internal functions to keep track of the app windows.
I have tried to rename the application in the Info.plist file.
I have been successful changing the CFBundleIdentifier. But when I change the CFBundleName, this change does not take effect. Does anybody know how I can change the name of the running Emacs (even if it involves recompilation of the binary)?
Thank you,
https://redd.it/1c8xy6l
@r_emacs
Synchronize LaTeX environment variable names in begin{} and end{} with Eglot or AucTeX
Hi, suppose I have an enumerate
env as follows
\begin{enumerate}
...
\end{enumerate}
Now, I would like to change this itemize such that that if I edit enumerate
to itemize
in \begin{}
it should automatically change the environment variable to itemize
in \end{}
.Eglot-rename
does not seem to work with this. I don't know if there is a way in AucTeX, other than maybe writing a customized function. I am trying to avoid that since it is an in-built function in Vim or TexStudio.
Any help would be useful. Thanks a lot.
PS: I am using texlab
as LSP server for LaTeX with eglot
.
https://redd.it/1c98sqm
@r_emacs
How to print from emacs
If I do from command line it works ok, my-file
gets printer on my-printer
lp -d my-printer my-file
(setq lpr-command "lp")
(setq lpr-switches '("-d my-printer"))
print-buffer
does not print anything.lpstat -p -d
I get this error, not sure if that's the issuelpstat: No destinations added.
no system default destination
How to generate a backquote inside a backquote with a value from the outside?
I want to write a macro that defines a function which uses a backquote. For concreteness, let's say that for any given symbol x I want to define a function:
(defun bar (y)
`(x ,y))
My first try would be
(defmacro foo (x)
`(defun bar (y)
`(,,x ,y)))
But this does not work. I can do it by writing instead:
(defmacro foo (x)
(let ((form `(backquote (,x ,',y))))
`(defun bar (y)
,form)))
But this seems very hackish. What is the most idiomatic way to implement this functionality?
https://redd.it/1c8tc6i
@r_emacs
Migrating Win key shortcuts
For reasons beyond my control, I am forced to use Windows 11 at work. Luckily, I can still use Emacs.
My emacs config shared with pure Linux machines works and Emacs on WSL is reasonable. But I have problems with Win key shortcuts. Over the years I have added more that 20 shortcuts where. So I need to migrate those shortcuts somewhere else.
Have you been in a similar situation? What is the best solution?
​
https://redd.it/1c8oaas
@r_emacs
BEGINNER Desperately need help with customising Org
I'm going to keep this short and simple - I've been using Doom Emacs for quite sometime. Its bloody good package, but I don't need 99% of what comes with it ( which now I realize I really miss :'( ). I am making my config from scratch and I really need some help with making org-mode work the way i want.
1. This is my primary issue (Image) . Notice how the text in lists wraps right under the its number. I want it to align with the text block (marked in red).
2. In Doom Emacs whenever my cursor was on a list item that entire item would be highlighted. How do I replicate this?
3. Where can I find all the commands I can use to customize org-mode? I did not find this in the manual, or am I not looking hard enough?
I am using emacs 29 (the crafted emacs config) on Mac OS.
PS - Indent mode and other relevant options are enabled
Thank you.
https://redd.it/1c8jhjw
@r_emacs
Help configuring emacs for the first time.
Hello, I've been trying to setup emacs for the first time and it's been pretty easy and straightforward apart from a couple issues. I'm setting it up on a NixOS Virtual Machine using home-manager: I have two files a default.nix where I say which packages to install and a config.el where I write the configs. Here are the relevant parts from the files:
default.nix:
{ pkgs , ... }
{
programs.emacs = {
enable = true;
package = pkgs.emacs;
extraConfig = builtins.readFile ./config.el;
extraPackages = epkgs:
with epkgs;
evil
evil-collection
treesit-auto
;
};
}
config.el:
(setq evil-want-keybinding nil)
(require 'evil)
(require 'evil-collection)
(evil-collection-init)
(evil-mode 1)
(require 'treesit-auto)
(global-treesit-auto-mode)
The issues are:
When I run home-manager switch
I get two issues. The first one is assignment to free variable 'evil-want-keybinding'
followed by a reminder to set evil-want-keybinding to nil before loading evil and evil collection (even if I am doing it).
The second one is that it gives the error cannot open load file: no such file or directory, treesit
.
I've tested and the issues are disconnected from one another. I've been googling around for a day now and I wasn't able to find a fix to either. If any of you may know how to fix I'd be grateful.
EDIT: Regarding the treesitter problem, I'm just a moron. The default pkgs.emacs is version 28. Changing it to pkgs.emacs29 it works. It does compile and works, but it does still give me issues about evil-want-keybinding.
https://redd.it/1c7whz4
@r_emacs
How do I access Elfeed's database?
I'm trying to write some functions that will do some statistics on the content of an Elfeed entry, which as word count etc. I'm not sure how, in elfeed-search-mode
, I can access the contents of the entry at point or all the entries in the search view. (I can see how to do it in elfeed-show-mode
).
https://redd.it/1c7w0po
@r_emacs
Writing Better Elisp Docstrings
http://yummymelon.com/devnull/writing-better-elisp-docstrings.html
https://redd.it/1c7ngki
@r_emacs
New version of exwm-edit v0.0.3
The latest version of exwm-edit
can be downloaded from MELPA (git repo)exwm-edit
augments EXWM by letting you edit text in X windows in an Emacs buffer. For an example GIF of its usage, please see the project README.
New changes in v0.0.3
include:
- Autoload exwm-edit--compose
and exwm-edit--compose-minibuffer
,
so it's not necessary to require
the package in your init.el
.
- Just loading exwm-edit
no longer binds any keys.
- Window display now uses standard display-buffer
actions. Customize exwm-edit-display-buffer-action
instead of exwm-edit-split
.
- Require Emacs 27.1 or later
- Bug fixes
https://redd.it/1c7juq2
@r_emacs
Create a file to run commands in eshell
Hey guys!
I need to run some commands over and over again, but they are basically the same. I'd like to write a script to run them under eshell, but I have no experience with that. The commands are rclone commands.
Any thoughts?
Thanks in advance.
https://redd.it/1c7h53x
@r_emacs
GNU Hyperbole now available from Melpa plus hyrolo.py script
The latest pre-release of Hyperbole, based on the git master tip, has now been available on melpa for a few weeks, for those who use melpa rather than the elpa-devel package archive.
One new feature is the single hyrolo.py script which you can install for shell command-line record-level access to your Org, Markdown and Emacs Outline files. You give the search string and files to search on the command-line and it highlights the match in the lowest-level records that match. You can then pipe that into any other program. Not quite as powerful as the Emacs version of HyRolo but useful in other contexts.
Enjoy.
https://redd.it/1c72quf
@r_emacs
How do I create an Info mode manual
I like to write an Info mode manual for my packages, but I can't seem to find a manual that explains how to write a manual. Anyone knows where I can get help?
https://redd.it/1ca82rg
@r_emacs
Invalid Font: Verdana
I'm on OpenBSD 7.5, amd64 snapshots, running GNU Emacs 29.3 (build 1, x86_64-unknown-openbsd, GTK+ Version 2.24.33, cairo version 1.18.0) of 2024-04-14.
I tried to set Verdana as the font for org-mode headings as follows:
(use-package org-modern
:hook
(org-mode . global-org-modern-mode)
:custom
(org-modern-keyword nil)
(org-modern-checkbox nil)
(org-modern-table nil))
(setq org-hide-emphasis-markers t)
;; Set faces for heading levels
(dolist (face '((org-level-1 . 1.4)
(org-level-2 . 1.3)
(org-level-3 . 1.2)
(org-level-4 . 1.1)
(org-level-5 . 1.0)
(org-level-6 . 1.0)
(org-level-7 . 1.0)
(org-level-8 . 1.0)))
(set-face-attribute (car face) nil :family "Verdana" :weight 'regular :height (cdr face)))
Following advice on StackOverflow I changed nil :font to nil :family and reloaded my .emacs using M-x load-file. No error and the font looked good, different sizes and all. Verdana appears in the dialogue to set the default font as well BTW. Upon restarting Emacs the next day I got the same error I had got earlier:
Debugger entered--Lisp error: (error "Invalid face" org-level-1)
internal-set-lisp-face-attribute(org-level-1 :family "Verdana" 0)
set-face-attribute(org-level-1 nil :family "Verdana" :weight regular :height 1.4)
(let ((face (car tail))) (set-face-attribute (car face) nil :family "Verdana" :weight 'regular :height (cdr face)) (setq tail (cdr tail)))
(while tail (let ((face (car tail))) (set-face-attribute (car face) nil :family "Verdana" :weight 'regular :height (cdr face)) (setq tail (cdr tail))))
(let ((tail '((org-level-1 . 1.4) (org-level-2 . 1.3) (org-level-3 . 1.2) (org-level-4 . 1.1) (org-level-5 . 1.0) (org-level-6 . 1.0) (org-level-7 . 1.0) (org-level-8 . 1.0)))) (while tail (let ((face (car tail))) (set-face-attribute (car face) nil :family "Verdana" :weight 'regular :height (cdr face)) (setq tail (cdr tail)))))
eval-buffer(#<buffer *load*> nil "/home/john/.emacs" nil t) ; Reading at buffer position 6510
load-with-code-conversion("/home/john/.emacs" "/home/john/.emacs" t t)
load("~/.emacs" noerror nomessage)
startup--load-user-init-file(#f(compiled-function () #<bytecode 0x559591a41c859d>) #f(compiled-function () #<bytecode -0x1f3c61addc0a1eb5>) t)
command-line()
normal-top-level()
Any pointers will be appreciated:)
https://redd.it/1ca6y9f
@r_emacs
Emacs Pinkie? Not a problem! Dvorak Improved layout (Linux, Windows)
* Convenient work in Vim, thanks to moving `Esc`
and `;`
* This layout removes the “Emacs pinkie” and allows you to work comfortably, since the Modifiers are located as in the original source.
* Low distance travel, top row (gray buttons on image) are kept only for gaming
* Excellent for most types of programming languages and numeric input
* Excellent for every genre and type of text
[https://github.com/neuromagus/dvorak-improved](https://github.com/neuromagus/dvorak-improved)
https://preview.redd.it/11aplocowuvc1.png?width=1243&format=png&auto=webp&s=7eae4fd65ba2ee92dceaa298bf500947c406b03d
https://redd.it/1c9lpz9
@r_emacs
Help needed customizing Isearch keybindings
I am trying to change how isearch works. What I want is to be able to type in my search string, hit "RET", and then be able use abbreviated characters for different behavior, such as "n" for isearch-repeat-foreward
, "p" for isearch-repeat-backwards
, "o" for isearch-occur
, etc. I want to also be able to switch back to normal isearch with something like "i" so I can modify my search string. What I tried was to create a custom minor mode that would change the keybindings to what I want. From my understanding, since this mode is more recently added to minor-mode-alist
and minor-mode-map-alist
, the bindings in my-isearch-mode-map
should take higher precedence than isearch-mode-map
. However, when I define it and activate it, isearch bindings still function like the default.
Here is the link to my code. Be warned, it is not pretty as this is my first time writing a minor mode.
What am I missing? Is there a better way to do this? I want to avoid hacky solutions to the best of my ability and I don't want to have to go down to route of trying (and probably failing) to remake isearch just to get this one thing to work.
I am open to suggestions on other packages as well. Currently I am using swiper primarily for search, however I want to start using isearch because of its integration with other emacs functionality like occur-mode. It is also built into emacs which is also a plus.
Any help is appreciated, thank you in advance.
https://redd.it/1c99yya
@r_emacs
Running a command each time I save a file
Hi all,
This is probably a basic question on this sub but I was wondering what kind of lisp magic I would need to do to run an emacs-command in certain major modes each time I save a file.
For example, I would like to run delete-trailing-whitespace
every time I save a file.
Thanks in advance!
https://redd.it/1c92zd0
@r_emacs
Desktop Save Mode: how to restore org agenda buffers?
Been using Desktop Save Mode after coming across a post about it--it works great but it doesn't seem to restore Org Agenda buffers (not org agenda files which restore as you would expect, but e.g. org-agenda-list
. In place of what should have been a buffer for org-agenda-list
is a seemingly random buffer.
Apparently desktop-buffer-mode-handlers
can add support for Org Agenda buffers but I don't see an e.g. org-agenda-restore-buffer
so I guess on would need to use a custom function? I don't know much programming so hoping someone has found a solution for this.
I also looked into activities.el but it looks like each "activity" is a frame/tab, but for my workflow with a tiling window manager I find it more suitable to liberally create and destroy frames from my window manager's workspaces and for now at least am just looking for a way to restore all buffers/frames/window configuration without the need to create and switch projects. Actually activities.el might be suitable if an activity includes a set a frames. I prefer dealing with frames than Emac's window management because I often work with at least a browser alongside in a window manager workspace and it's just less cognitive overhead to treat each buffer as a frame when the rest of your applications are also managed by the window manager.
https://redd.it/1c8wsct
@r_emacs
What do you read git log in Emacs with?
Any specialized view app? I am just using terminal thus far.
https://redd.it/1c8r84m
@r_emacs
Using ChromeOS input methods
https://www.reddit.com/r/Crostini/wiki/enable-chrome-shortcuts-in-linux-apps/ with the addition of <Control>space
allows me to use the native ChromeOS input method to type Chinese, into all Linux programs except emacs. Yes, I undefined CTRL+Space in emacs. Currently the best I can do is just use "emacs -nw". Yes, there are lots of other ways to type Chinese in emacs, several bundled with emacs itself. But I want to use the native ChromeOS way.
https://redd.it/1c8mjct
@r_emacs
How to make eglot show's the snippet completions for typescript??
Hello everyone. I'm fairly new to emacs I'm using emacs 29.1, I do web development with typescript and react,so I configure emacs for that purpose, first I've only use the treesiter modes for typescript and tsx (typescript-ts-mode and tsx-ts-mode) until a friend introduce to lsp and tell me to use eglot since is builtin into emacs.
So I did my research and find about autocompletion with company-mode and that is another mode called lsp-mode, so I decided to try both eglot and lsp-mode. first I use eglot and everything work well until I came across this tutorial -> https://emacs-lsp.github.io/lsp-mode/tutorials/reactjs-tutorial/ then I decided to give a try to lsp-mode
Later on working normaly with lsp y decided to switch back to do a comparision with eglot and realize that in lsp you can autocomplete snippets but then switching to eglot that same thing don't happen. but accordingly to the eglot page you can autocomplete snippets using yasnippet (which I'm already using with lsp-mode) but for some reason this is not working and searching across internet I didn't find any solution. So maybe I'm missing something?
If I didn't explain my self maybe these gif help.
emacs with lsp-mode and company for typescript:
https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExcGJkNTJic3gxNDcyeDcydWdpdjd3dHhnbDFzcWo4NHd2b3h0eThvciZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/2QMirA93ixSA16Da0J/giphy.gif
emacs with eglot and company for typescript:
https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdXZ0NHM2eWhvN3ZyYTc3dHJzeGVyOGE0ZW9wODl6bWc5a2V0aDg5NSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/qxlzkHoY15sHi5FZxk/giphy.gif
note: I tried eglot and company with another languages (c-ts-mode, c++-ts-mode) and there works perfectly, only with typescript and javascript buffers don't work.
https://redd.it/1c898xg
@r_emacs
Replacing the EMacs logo with a custom svg image
I was wondering if the can be done, I am not using Doom just plain emacs on my Mac
Anything I could put in my ini.el?
https://redd.it/1c81cy5
@r_emacs
Data Visualization with GNU Emacs - Bubble Graph
​
https://preview.redd.it/8bdnxs61nevc1.png?width=762&format=png&auto=webp&s=288ae6f00131f576f0bca9d872c8bb0344f0aa64
Bubble graph using SVG.
Details: https://lifeofpenguin.blogspot.com/2024/04/circle-packing-animation-in-gnu-emacs.html#bubble-graph
https://redd.it/1c7sl7e
@r_emacs
Dynamic :file tags for org source block results
It’s a minor thing, but is there a way I can evaluate an elisp function (timestamp, incrementing number, etc.) in the header of an org source block so that I can dynamically name the filename of the image that is created by the block?
I do a lot of data exploration in org, similar to what one would do in a Jupyter notebook, and it’s a bit of a pain to come up with a unique filename for each one. I’d much prefer just to be able to kill/yank the header and reuse it for each code chunk.
EDIT: Just realized I can create a yasnippet that inserts the timestamp right into the header. That should solve my problem.
https://redd.it/1c7jtjo
@r_emacs
Announcing consult-web: A package to get web and omni search results directly in emacs minibuffer!
https://redd.it/1c7jsk1
@r_emacs
Emacs Terminal Keys on MacOS
Hi, I'm new to MacOS. I've been experimenting with using the Command key on the Mac keyboard as the Emacs Ctrl key via
(setq mac-command-modifier 'ctrl).
This works in the GUI. However, when I'm running -nw in the MacOS Terminal, either the system or terminal app is hijacking the Command shortcuts. So, for example, Command-n creates a new terminal window and Command-p opens the print dialog. How do I disable all of the Command shortcuts of the terminal?
https://redd.it/1c77hvn
@r_emacs
Emacs successors?
Emacs is the best singular computer-interaction framework I’ve encountered so far, but we can all agree it has its flaws. Single-threaded performance characteristics, limited to text (rather than some more flexible core abstraction, perhaps one which would better allow making full use of the screen as a 2D canvas), Elisp (which while decent isn’t on par with the specialized Lisps like CL), and other more minor problems.
Are there any promising projects going on to make a replacement or successor for Emacs? The only ones I’m aware of are Lem and Project Mage; the former only solves 2 of the above major issues, and the latter is literally a one-person effort right now.
https://redd.it/1c70qez
@r_emacs