Completion after dot in Python comments
Is it way to disable behavior which I demonstrated on this short screencast:
https://streamable.com/gcuatt
I am using Emacs 30.0.50 from master branch, I've configured very minimal Python environment using built-in python-mode
, eglot
(pylsp
server) and company-mode
without further adjustments.
https://redd.it/1chkh1v
@r_emacs
consult-imenu and narrowing (Python, C)
Hi,
I just got back into dev mode for a few days for the job and I just noticed that narrowing with consult-imenu does not seem to work on my setup (see below). Tested with a Python code base and a C code base. In other consult cases, the narrowing feature works perfectly (consult-buffer, consult-org, consult-flymake). I don't know since when it does not work for consult-imenu because I discovered the narrowing feature in consult only a few months ago, and only got the opportunity to try the feature on a code base/consult-imenu since yesterday. Anyone else is having this behavior ?
I can open an issue on Github if needed. I didn't do it yet because the code for consult-imenu has not changed for 4 months, and since I could not find any complaint about this, I suspect it might be related to my personal setup. So I wanted to probe the community first before bothering minad.
My setup
Emacs 29.3, compiled by myself
consult version 20240420.929, from Melpa
The steps to reproduce the issue
1. open a Python or C file in Emacs, with a lot of functions and variable
2. hit M-x consult-imenu
3. a nice, searchable, consult prompt shows up with all the functions/modules/variable tagged appropriately
4. hit the narrow key (<
in my case)
Expected result
There should be either a which-key frame showing the next key to type, or, if I'm quick enough, either I should be able to type f
, and according to the consult-imenu code, it should filter on the functions only.
Actual result<
or <f
are taken literally, like a conventional search pattern.
https://redd.it/1chh9yp
@r_emacs
Improving my elisp skills
Hi there,
I have this code (it is an adaptation of gnus-delay.el for working with notmuch) that sets up some timer (like "every 5 minutes") that then chains an idle timer. The attempted result is "every 5 minutes, then when idle for 30 seconds; rinse and repeat".
(defvar notmuch-delay-timer-scheduled nil
"The current timer for the scheduled run.")
(defvar notmuch-delay-timer-idle nil
"The current timer for the idle run.")
(defun notmuch-delay-scheduled-runner ()
(unless (memq notmuch-delay-timer-idle timer-idle-list)
(setq notmuch-delay-timer-idle
(run-with-idle-timer 30 nil #'notmuch-delay-send-queue))))
;;;###autoload
(defun notmuch-delay-initialize ()
(unless (memq notmuch-delay-timer-scheduled timer-list)
(setq notmuch-delay-timer-scheduled
(run-at-time t 300 #'notmuch-delay-scheduled-runner))))
The code works. But I can't remove the feeling that there must be a much nicer way to do this properly or more Lispy.
I would imagine I could use one single var with `car` and `cdr` thus having both timers there; but that's still two timers and two functions.
Any ideas?
Chaining the idle timer after the scheduled one is to make sure that I am not working in Emacs when notmuch-delay-send-queue
is called.
https://redd.it/1ch24po
@r_emacs
Alternatives in GNU Emacs - File Explorer
Custom Tag explorer
Exploring Org-mode as a file explorer.
Demo: **https://youtu.be/eaG7INZ2Kys**
Details: https://lifeofpenguin.blogspot.com/2024/04/alternatives-in-gnu-emacs-file-explorer.html
https://redd.it/1cgowkg
@r_emacs
Emacs on a wide screen
I wondered if any of you have, or need, measures or features to adapt Emacs to a wide screen view?
Packages like olivetti-mode, golden-ratio and the lakes tries to style buffers to make them more pleasantly readable. I have even tried out vertico-posframe, which is a good idea, but haven't worked much in it yet, and I have feeling it will break some workflows, or maybe be obstructive.
Have you tried "center" the minibuffer output, so your eyes don't have to travel to the bottom corner every time you invoke an interactive command?
I know this is very much about ergonomics and work positions too ... but still wondered enough to ask.
https://redd.it/1cg465v
@r_emacs
Struggling to adapt weird vim workflow to emacs
Hi, I have a very weird vim workflow and would love to port it to emacs, org in particular. I had my emacs phase but am a strong vim user for plenty of years.
For less distraction, I use a Windows 7 laptop at home, while I use a modern Linux one for work. I manage all my TODOs and Notes via vim on a server that I can access from both via ssh/mosh.
I have plenty of vim tabs per instance, and several instances. All in a named tmux session that I can attach/unattach everytime I want to read it, so that I never have to actually reopen them. I thus have "built a GUI" by permanently using the same tmux splits.
How would I do this in emacs (tui)?
- I know that remote editing would usually be done via TRAMP, but I really want to keep the window open on the server.
- Emacs within tmux is clunky because of overlapping bindings and nested terminal emulation.
- I am confused on the differences of emacs server vs emacs daemon?
https://redd.it/1cfw5zq
@r_emacs
Loading custom theme ...
I made some small modifications (to the colors) in the theme at https://github.com/aaronjensen/nano-theme/tree/master. I am not sure how to load this theme file though.
I dropped the file in `\~/.emacs.d` but when I invoke `(load-theme 'nano t)` from `init.el`, I get an error ("Unable to find theme file for 'nano' ...").
Any help is immensely appreciated!
https://redd.it/1cfufv2
@r_emacs
vterm buffer point goes to end of buffer when changing window configuration
I'm using evil-mode
in vterm
buffers so when I switch to normal state and go around in buffer and then do any command that alters the vterm window settings (scaling it vertically or horizontal, running vertico switching perspectives etc ) the point goes to the end of buffer. but when I use term
it doesn't do that, the point stays in the same place no matter what I do to the buffer window. I did the tests with no commands running.
can I change that behaviour in vterm ?
https://redd.it/1cfqtfd
@r_emacs
MacOS emacs segfault
My emacs keeps segfaulting upon start-up. It happens about 50% of the time when I type emacs
in the terminal. Looking here:
https://www.gnu.org/software/emacs/manual/html\_node/emacs/Crashing.html
a backtrace of some sort should be generated, but this is all I see:
% emacs .
Fatal error 11: Segmentation fault
zsh: abort /Applications/Emacs.app/Contents/MacOS/Emacs .
I'm running a version off of the 29 stable branch.
https://redd.it/1cfle9z
@r_emacs
Compile function on python files
I have this compile function to open the compile in a smaller size, and if i run again the C-c C-c it closes:
(defun my-compile ()
(interactive)
(let ((current-window (selected-window))
(compile-buffer (get-buffer-create "compilation"))
(compile-buffer-window (get-buffer-window compile-buffer)))
(if compile-buffer-window
(progn
(delete-window compile-buffer-window)
(kill-buffer compile-buffer))
(let ((compile-window-height (/ (window-total-height) 4))
(compile-command (read-from-minibuffer "Compile command: ")))
(select-window (split-window-below (- compile-window-height)))
(switch-to-buffer compile-buffer)
(select-window current-window)
(compile compile-command)))))
(global-set-key (kbd "C-c C-c") 'my-compile)
However, when I'm in a python file, this bind doesn't run correctly:
python-shell-get-process-or-error: Start a Python process first with M-x run-python or ‘C-c C-p’
But if I run the default emacs compile:
M-x compile
It works correctly, why? Is there a way to make this function of mine behave the same way as the native emacs compile? I like how it turned out because it doesn't open a large buffer and it makes it much easier when I want to run a file.
https://redd.it/1cf6kw0
@r_emacs
Some of you saw my quickroam.el two weeks ago - now see the fully grown org-node.el, the bizarro org-roam!
https://github.com/meedstrom/org-node
https://redd.it/1cfbgqi
@r_emacs
char size discrepancy - how would you match the two monospaced fonts?
https://redd.it/1cf2yte
@r_emacs
Adjusting SVG icons and centering text.
I have been trying to get svg to work, but I noticed on my macos it was not rendering the icons properly. For example, I tried to change the background color of the PROJ heading, but it does not seem to change no matter what. I also tried running the svg-lib-demo.org, but it did not change the colors.
;; TODO / DONE
("TODO" . ((lambda (tag) (svg-tag-make "TODO"
:face 'org-todo :inverse t :margin 0))))
("NEXT" . ((lambda (tag) (svg-tag-make "NEXT"
:face 'org-todo :inverse t :margin 0))))
("PROJ" . ((lambda (tag) (svg-tag-make "PROJ"
:inverse t :margin 0
:foreground "#0FF000"
:background "#FF5733"))))
I also noticed that the text in the icons is a little above and not centered. I was wondering if anyone had been able to figure out how to correct this in vanilla emacs.
https://preview.redd.it/hu757x3bw3xc1.png?width=758&format=png&auto=webp&s=f7e7fc806d3834bbed0a4b55fc5e7b8a58c09fc0
https://redd.it/1ces4o2
@r_emacs
using an Lsp server for searching tags.
I have been using lsp-mode with ccls in general.
Now I am looking at a large code base, and I need to go to definitions outside the file I am editting.
It seems functions like xref-find-definitions only works for the function in the headers or the same file fiel I am editting. So too with the other lsp-mode functions I am tried.
Is there some setting I have to set to make it search the whole project? Or some extra p[ackage to install?
If not can someone suggest what the latest present day tags/package is. I am using etags and that seems kind of creaky.
​
https://redd.it/1chhot9
@r_emacs
Weekly Tips, Tricks, &c. Thread
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/1chgsxe
@r_emacs
Python workflow using emacs-jupyter
Hi everyone! I'm a new-ish Emacs user (\~1 year) and I've just started using the emacs-jupyter package for writing Python code. I used to write (too many) jupyter notebooks with VSCode but I find that I can organize my code & notes better with org documents and just simple Python files. I started using emacs-jupyter after reading Martí Bosch's blog on the topic. My current workflow is just opening up a python file (or write a new one), then running `jupyter-run-repl` and then `jupyter-repl-associate-buffer`. Then I do execute a region or execute line-by-line via `jupyter-eval-line-or-region` bound to `C-c C-c`. The thing with this workflow is that the jupyter REPL gets quite long as I'm tweaking little things about the graphs or visualization I'm working on. Is there a better workflow that people use for doing this kind of work? I also can't find a way to clear the jupyter REPL that I'm working on.
https://redd.it/1chd3r5
@r_emacs
Etiquette for Emacs-related mailing lists
I would like to participate more in Emacs-related mailing lists, occasionally without subscribing to them. I have recently sent an email to help-gnu-emacs, which I am not subscribed to, and received replies judging by the mailing list archive but those replies never landed in my inbox. Is the mailing list etiquette not to reply to the person specifically but only to the mailing list? This makes little sense to me since non-subscribing users would miss emails in this case, but I have also checked that I am able to receive emails at the address that I used. Now I would like to reply back, and I am thinking of replying using the mailing list archive. Is there something I should do to ensure that I receive the replies in my inbox? (I am still not subscribed to help-gnu-emacs.)
https://redd.it/1ch0g44
@r_emacs
Terminology/learning about using emacs as a software application interface
The whole concept of "emacs as an operating system", i.e. building applications like org-mode inside the editor, and using regular editor text buffers as the software interface is super interesting to me.
I think this might be the direction I want to go in for a lot of custom personal software that I build for myself.
So I'd like to learn a little more about the subject, but I'm struggling to find the right terminology to search the web for.
I'm not an emacs user currently, I only ever tinkered with it for a few hours to try out org-mode many many years ago. So this probably doesn't help.
Some questions:
1) Are there any commonly used concise terms around this whole "editor as an application interface" concept in general?
...it could be either specific to emacs, or more broadly for other editors too.
e.g. We have some pretty common terms like "CLI, TUI, GUI, desktop-app, web-based, mobile-app" etc that are used to quite clearly denote the all the common interfaces...
So I'm hoping there's some easily-Google-searchable short term for this stuff too?
2) If you know of any specific guides/learning resources on the topic, please share a link (or name I can search).
3) I'm guessing that emacs is the #1 GOAT when it comes to how well it can do this stuff? But curious what other editors can also do this, and how they compare in abilities?
4) Amongst the variants of emacs, which is best for this? For my use case it needs to work just as well on Windows as Linux.
5) Also feel free to share any personal anecdotes on what discovering this paradigm meant to you personally.
Including where you've seen big improvements in usability/efficiency etc
And maybe also were there any specific use cases where you over-estimated how useful it would be? And you went back to the mainstream types of interface for something?
https://redd.it/1cgnhcv
@r_emacs
Mapping F10 under KDE 6
After updating to Fedora 40 and KDE 6, F10 in emacs is triggering the file menu, ignoring my definition. This seems to be emacs doing it because disabling F10 as a shortcut at the OS level doesn't help. The only way I've found to get F10 back is to disable menu-bar-mode. Is there a less drastic fix?
https://redd.it/1cg7tm3
@r_emacs
Omit hierarchy from org clock table
After getting some useful tips about using clock tables for my time reporting needs I've setup everything and basically it works pretty fine. My only problem is that the table shows the full hierarchy to a task.
so if I have something like this:
Administration
Meetings
Weekly meetings
:LOGBOOK:
Specification
WIP
Tasks
Task 1
:LOGBOOK:
Task 2
:LOGBOOK:
When I now create a clock table It would look like this (this is the compact view):
| Headline | Time |
|-------------------------------+--------|
| Total time | 3:20 |
|-------------------------------+--------|
| Administration | 0:32 |
| _ Meetings | 0:32 |
| _ Weekly Meetings | 0:32 |
| Specification | 2:48 |
| _ WIP | 2:48 |
| _ Tasks | 2:48 |
| _ Task 1 | 1:35 |
| _ Task 2 | 1:13 |
What I would prefer is something like this
| Headline | Time |
|-------------------------------+--------|
| Total time | 3:20 |
|-------------------------------+--------|
| Weekly Meetings | 0:32 |
| Task 1 | 1:35 |
| Task 2 | 1:13 |
How could I do that?
https://redd.it/1cfur4o
@r_emacs
Tipps on gnus summary Formatting?
I'm currently testing gnus over mu4e for my mail needs in emacs and am liking it a lot so far. One thing i'm trying to work out though, is how i can make the article summary a bit easier to parse. Two things i'm looking for:
There seem to be three "Date" options. "%D" as the date from the header, "%d" as an Article Date with only Month and day, and "%o" as the article Date in a long unseparated format. Is there any option to get a custom date format in there? %D is super verbose, including also timezone and such. "%o" is hard to parse as a non-separated string. "%d" is not enough granularity
Can individual parts of the summary line be bolded or italizised? I'm looking to have the From Adress in Bold to better find it. If that's not possible, i guess i have to work with fixed width "blocks" to make it somewhat into a table.
Any other great tips for a gnus "newcomer" that you found to be valuable?
https://redd.it/1cfv84p
@r_emacs
Why do we use save-excursion inside the copy-to-buffer function?
I am going through the Emacs Lisp Intro manual to consolidate my Elisp knowledge. In the "More Complex" section, the function "copy-to-buffer" is suggested as a case study. I will include it here for your reference:
(defun copy-to-buffer (buffer start end)
"Copy to specified BUFFER the text of the region."
(interactive "BCopy to buffer: \nr")
(let ((oldbuf (current-buffer)))
(with-current-buffer (get-buffer-create buffer)
(barf-if-buffer-read-only)
(erase-buffer)
(save-excursion
(insert-buffer-substring oldbuf start end)))))
Perhaps I do not understand well how the save-excursion works. But, since we are setting temporarily the current buffer to the "buffer" argument by using the "with-current-buffer", and we are erasing its contents with "erase-buffer", why do we use "save-excursion"?
After we use "erase-buffer" don't we get point, point-min and point-max set to 1?
It seems to me that it is just redundant to save the excursion inside the empty buffer when all the points have the value 1. Then why do we do that?
Thank you very much.
https://redd.it/1cfshwf
@r_emacs
Org Mode Fundamentals Volume 9: Hyperlinks and Internal Links
https://youtube.com/watch?v=im5VmuV0WNI&si=67ABnYaZ7b85Ddfc
https://redd.it/1cfkhwy
@r_emacs
Emacs, tree-sitter, and lsp-mode with Java
Hi,
Previously I had Java working with lsp-mode. Experimenting with tree-sitter recently has caused this to break.
I'm using Emacs 29.2 on a Mac.
My lsp-mode config is very basic:
(use-package lsp-mode
:ensure t
:hook (lsp-mode . lsp-lens-mode)
(lsp-mode . lsp-enable-which-key-integration)
:config
(setq lsp-prefer-flymake nil
lsp-client-packages '(lsp-clients lsp-metals)))
And lsp-java:
(use-package lsp-java
:ensure t
:init
:config
(add-hook 'java-mode-hook 'lsp)
(add-hook 'java-ts-mode-hook 'lsp)
(add-to-list 'lsp-language-id-configuration '(java-ts-mode . "java")))
However, when I open a Java file I get:
> LSP :: There are no language servers supporting current mode java-ts-mode' registered with
lsp-mode'.
Clearly the major mode is different with tree-sitter, it's now 'java-ts-mode'. Looking in lsp-java.el though, I do see this in the 'lsp-register-client' function:
:major-modes '(java-mode java-ts-mode jdee-mode)
There is obviously something else I'm missing. Any help is appreciated.
https://redd.it/1cfd1ft
@r_emacs
pdf tools night mode NOT inverting image
View PDF with intact image, but want dark mode(text and background inverted)
This is possible in some pdf reader like acrobat
aim : pdf tools night mode NOT inverting image
trouble shoot : 3 options were availiable by tweaking variables
1st : no night mode
2nd : night mode, invert image(chromatic image)
3rd : night mode, invert image(monotnous image)
since 2nd 3rd option's difference is only on images
It may be possible to not invert image.
thank for reply
https://redd.it/1cf5lrh
@r_emacs
Disabling keybinding in eshell not working
Hello,
I am using a eshell as primary shell (for years…). But suddenly one thing starts to irritate me, that when pressing up
or down
, it lists the history of commands. I want to disable it (and use arrows for moving in the buffer), so I tried:
(define-key eshell-mode-map (kbd "<up>") nil)
But somehow it's not working. The original behavior remains....
What is the trick then?
https://redd.it/1cez2je
@r_emacs
Org-capture: "Capture abort: %s" "Symbol’s function definition is void: nil"
The full debug backtrace of the error I get:
Debugger entered--Lisp error: (error "Capture abort: Symbol’s function definition is voi...")
error("Capture abort: %s" "Symbol’s function definition is void: nil")
org-capture(nil)
funcall-interactively(org-capture nil)
command-execute(org-capture record)
execute-extended-command(nil "org-capture" nil)
funcall-interactively(execute-extended-command nil "org-capture" nil)
command-execute(execute-extended-command)
I was trying to create my own templates but I was getting this error. I deleted my templates and tried to use the built in ones and still get this error.
https://redd.it/1ceq17g
@r_emacs