/r/emacs

Photograph via snooOG

The extensible, customizable, self-documenting real-time display editor.

A sub-reddit for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Related Subreddits

Useful Emacs configuration files and distributions

Quick pain-saver tip

/r/emacs

70,300 Subscribers

0

A rough idea for an email "client" I had recently (including orgmode)

Maybe you dont like it but that's fine, it is just an idea as of now as someone who is using emacs just for orgmode for years and recently started to use dired. I'm sorry not using it for more than those 2 things, please have mercy with me.

So back to my idea. That email "client", well actually it is just a viewer, the receiving and sending part would have to be done with offlineimap, sendmail and friends:

  • there are different orgmode files, e.g. ~/org/mail/inbox.org, ~/org/mail/sent.org, ~/org/mail/drafts.org and all of them contain headlines which actually are emails, but they are just rendered as headlines.
  • The headline includes the subject, but could also include some state such as READ or SENT
  • The body is the text of the email
  • Attachments? Use org attachment to add them
  • Maybe we could also use properties for recipients or use the tags, I'm unsure about this one
  • a scheduler would iterate over those files every few minutes/hours and actually sends that email (headline)
  • you can archive an email, which would actually just refile it, or you could also move things around like refiling
  • I don't know if you can partially set some parts of the buffer to be read only, I don't know if it would make sense to set all those files to be read only, hmm
  • use org capture templates to write a new email, depending on the cursor position it would either be a reply or new mail
1 Comment
2024/05/02
18:32 UTC

6

What in my config is making my Emacs take so long to initialize

I'm already using `emacs --daemon` + `emacsclient`, but, out of curiosity, my Emacs is taking about 10 seconds to initialize, I think this is too much, this is my configuration: https://github.com/leocavalcante/dotfiles/blob/main/.emacs.d/init.el what in there might make it take so long?

7 Comments
2024/05/02
16:21 UTC

5

Using elfeed to manage YT feeds: How to retrieve the length of the videos

hi, I am using elfeed to watch YT videos from various sources (jazz concerts). The most feeds I have are a mix of full concerts (>45mn.) and smaller programs I would like to filter out.

The question is how to retrieve the length of the videos and exclude the ones I don't want to watch?

1 Comment
2024/05/02
15:26 UTC

4

Emacs v 29.3 on void slow to start this week, could it be treesitter?

Hi all,

Last couple of days emacs is slow to start (close to two minutes) and "tree-sitter-langs: Grammar bundle v0.12.187 was already installed; skipped:" is the message during that wait.

First of all, I have zero treesitter packages installed on my system, nor is it part of my config, grepping my system, I only find treesitter files associated with neovim. Nothing in /usr or ~/.config/emacs

What is happening here ?

I am open for any pointers, or tips, or insights.

thx,

S

4 Comments
2024/05/02
14:39 UTC

1

Can Emacs Org combine Notion's top-down structure Obsidian's bottom-up approach?

I see value in Obsidian's bottom-approach for brainstorming and drafting things. But as things are finalized, I need them to be categorized into specific groupings as part of a comprehensive life operating system.

5 Comments
2024/05/01
23:34 UTC

2

Font size issue with emacsclient and dashboard

When I open emacsclient the agenda section of the dashboard looks like this:

https://preview.redd.it/loo5264fbvxc1.png?width=449&format=png&auto=webp&s=fc8c677aaf9542208dc80742bfa9a38715c99cee

If I use revert-buffer it works normally and looks like this:

https://preview.redd.it/f2godxi5jwxc1.png?width=522&format=png&auto=webp&s=fdbe40861dccc15c674f1ab60db15414183e3ecf

Does anyone know how to fix this so the font is normal instead of tiny?

2 Comments
2024/05/01
19:39 UTC

1

Org-Mode agenda window size

I use Org-Mode and the agenda quite heavily. My agenda is displayed in a horizontal pane.

The default window size increases as I add more stuff to the agenda. I work on a laptop with limited display real estate and, at times, the agenda window consumes virtually the entire Org-Mode view, covering virtually all of the tasks I'm working on.

I manually resize it when I need to. However, it would be better if the agenda consumed no more than 50% of the available Org-Mode real estate.

I've been trying to find a setting to configure to limit the agenda's vertical height to no more than 50% of the available window space. That is, the top half of the Org window would contain my tasks, and the bottom half would contain my agenda.

Is this possible?

1 Comment
2024/05/01
17:24 UTC

1

Any way to search music online dbs with emacs

I am building my own review of jazz albums using org-roam and I'd like to access online databases like Allmusic or discorg...

does anyone allready have such a function in emacs?

I'd love to be shown a direction if you know of such existing tools or attemps...

thanks in advance

3 Comments
2024/05/01
13:50 UTC

4

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.

1 Comment
2024/05/01
12:04 UTC

2

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.

​

6 Comments
2024/05/01
09:16 UTC

5

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.

3 Comments
2024/05/01
08:49 UTC

0

Inhibit backup as directory local

Hi all. I would like to prevent backups within a certain directory for security reasons. I thought I could achieve this with a dir.locals.el file, e.g.,

((nil . ((backup-inhibited . t))
      ))

but when I open emacs it asks me if I want to apply that setting as it is not considered a safe local variable. Is there a safe way to achieve this. I guess I could make backup-inhibited a safe local variable, but I'm concerned whether this will lead to security issues. What's the safest way to disable backups within a directory?

4 Comments
2024/05/01
08:38 UTC

6

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.

1 Comment
2024/05/01
08:15 UTC

6

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.

6 Comments
2024/05/01
04:17 UTC

0

The Persecution of Richard Stallman #emacs

45 Comments
2024/04/30
23:34 UTC

3

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.

2 Comments
2024/04/30
19:58 UTC

4

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.)

5 Comments
2024/04/30
18:48 UTC

0

Package installed but can't be enabled

Hi all,

I'm new to emacs with doom emacs, I have a problem with the melpa package "zig-mode", when I install it, it works and it is present in the menu M-x, but when i restart emacs it is not. (but still marked as installed in package-list)

3 Comments
2024/04/30
14:39 UTC

6

Alternatives in GNU Emacs - File Explorer

9 Comments
2024/04/30
09:47 UTC

8

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?
    1. If you know of any specific guides/learning resources on the topic, please share a link (or name I can search).
    1. 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?
    1. 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.
    1. 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?
16 Comments
2024/04/30
08:07 UTC

0

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?

6 Comments
2024/04/29
19:22 UTC

11

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.

EDIT:

I should probably add that I'm running Emacs 29.3 on an X86-64 machine on GNU/Linux and SwayWM with a 27" 16:9 monitor

17 Comments
2024/04/29
16:57 UTC

0

How do I narrow down possible completion candidates?

I have lots of possible completions. I am at lis and the completions start with lisp, list and lisa. How do I make ivy tell me that all possible completions can be accessed by pressing either p, t or a?

3 Comments
2024/04/29
13:22 UTC

2

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?
13 Comments
2024/04/29
10:55 UTC

7

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?

2 Comments
2024/04/29
09:56 UTC

4

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?

10 Comments
2024/04/29
09:23 UTC

1

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!

1 Comment
2024/04/29
09:02 UTC

0

How to execute upcase-region or downcase-region with multiple cursors

I have this in my .emacs:

(global-set-key (kbd "C-c u") 'upcase-region)
(global-set-key (kbd "C-c l") 'downcase-region)

But it does't work with multiple cursors. Unfortunetlly the project doesn't have any support, the issues are closed.

7 Comments
2024/04/29
08:53 UTC

Back To Top