Emacs

311 readers
3 users here now

A community 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

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
326
 
 

Some four years past, my life was simple. I used of vim .. occasionally found refuge with jackbrains IDEs, used a splendid open-source calendar application and notion for note taking. That was life.

But, lo and behold, there arrived a fateful day, when I, in my quest for a PDF viewer capable of illuminating the sacred texts with vibrant cute yellow highlights, did consult the Arch Wiki. And thus, the sacred scripture of the wiki proclaimed it: "GNU Emacs, sire!" From that moment forth, my existence was irrevocably altered, and my life took on new meaning.

Forsooth, as I contemplated, there existed nary a tool that could attain the heights of my own prowess, as witnessed within the hallowed confines of elisp.

Yet, as the days and years flowed onward, a vexing truth did unfurl its troubling wings within the chambers of my soul. A discontent gnawed at the edges of my being, for the enchantment of Emacs held me captive, leaving me bereft of escape. All else that I encountered in the vast expanse of digital tools and systems seemed archaic and disordered when placed in the shadow of Emacs' grandeur.

For while I marveled at its limitless capabilities and intricate wisdom, I remained forever unsatisfied. Each quest for efficiency led me deeper into its labyrinthine depths, where an insatiable hunger for perfection persisted, much like the boundless sea whose depths are never truly plumbed.

A ceaseless longing for a more refined configuration, a more potent package, or a more elegant elisp blocks danced within my thoughts. The very thing that had once set me free, had now become the golden cage in which I resided, unable to break its enchantment and return to a world of simplicity and contentment.

Let it be known, O ye novices who venture into the alluring embrace of Emacs, heed the tale of my journey as a cautionary fable. For, as you traverse the path of this venerable text editor, be mindful of the siren song that sings of boundless power and unparalleled control. The allure of Emacs, with its arcane keybindings and vast sea of extensions, may cast a potent spell upon thy heart.

be wary, for it can ensnare thee in a web of complexity and unending quests for perfection. The very attributes that grant thee mastery may, in turn, become the chains that bind thee in an eternal quest for more. As you delve deeper, the simplicity you once knew may fade into obscurity, and other tools may appear dull and obsolete in comparison.

327
 
 

In a 2 window setup, is there a way to make all temporary popup buffers (help, compile, occur, etc) always open in a specific window?

For example, I have a left and right window. I do most of my work in the left window. When I lookup something in help it opens in the right window which is what I want.

But let's say I'm in the right window already and look up help, it will open in the left window. Is there a way to make it always open in the right?

328
 
 

Hi, I'm new to emacs and trying to get my way through the cc-mode for editing c/c++ files in the manual, it says to activate h cc-mode using the ``c-mode`` symbol and use ``C-M-a`` keybinding to move to beginning of the function, but when I do it, it says ``M-a undefined`` in the mini-buffer. How do I fix it. I have tried look in the manual and net but could get any lead...

329
330
 
 

I have installed the auctex via elpaca but unable to load it. how to do that. please help

331
 
 

In Emacs' Dired, You could conveniently move files from outside into Emacs by simply dragging them there.

Drag files in dired

That is effective.

Emacs has been my faithful companion for over 5 years, and I just stumbled upon this remarkable feature minutes ago.

Typically, I rely on async-shell-commands to open the current buffer directory in Windows 10's File Manager, then move files from folder to folder.

But, now, this seeming-trival discovery has greatly enhanced my workflow, instill in me a strong sence that Emacs not only coexists within the operating system, but rather embodies the operating system itself.

While it is true that Windows does not support dragging files to external locations, I seldom encounter such a requirement in my day-to-day workflows.

Have you ever had such an experience? Discovered an amazing feature after a long time using Emacs?

332
 
 

I love git worktrees. It took me a while to change my workflow and get used to doing things differently, but it is so much better. I never have to think "oh my repo is in inconsistent state, I can't switch my focus and start reviewing this PR, I need to first stash/commit/stage/etc. my stuff..."

I also love how Magit lets me create a worktree from a PR or an Issue (some of that is built-in, some I extended to fit my workflow). One thing is still missing though.

Cloning or starting a new repo in a practical way to be used with worktrees, for me, always requires some manual process.

First, I need to follow the recommendation I borrowed from this blogpost: How to use git worktree and in a clean way. It boils down to:

mkdir my-awesome-project
$ cd my-awesome-project
$ git clone --bare [email protected]:myname:my-awesome-project.git .bare
$ echo "gitdir: ./.bare" > .git

But when I do that, git doesn't see remote branches anymore. So some stuff won't work as normally expected. For that, I have to follow this advice from SO, basically adding to ./bare/config:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*

And now I'm thinking, before I try to automate this. Maybe Magit already does the right thing and I just never knew about it? Or maybe it's much simpler than that and all that manual hocus-pocus is not needed?

How do you use worktrees with Magit? And if you don't use worktreees, why is that? Is there even a better way?

333
 
 

Hi everyone,

u/daviwil had released an excellent video in his System Crafters channel, where he showed how to hack org-roam:

https://systemcrafters.net/build-a-second-brain-in-emacs/5-org-roam-hacks/

I have copied his code into my config (the function that allows to create a TODO in a project file that we select (or create if not existing) is very useful.

I want to create a similar one: I want to create an event in a select customer file and to create this customer file if it does not exist.

The filter of the nodes with the tags "customer" works, but I am stuck with the definition of the content to insert as the event:

- I want the events to be inserted as subheadings of the heading "History" of the customer file (easy)

- I want the events to be saved as a tree structure:

** Year
*** Month
**** day
***** Event 1
***** Event 2....

I am trying to modify his code, but I always have errors

- I have replaced plain with entry in order to get the content as a heading

- I have replaced file+head+olp in the template definition by file+olp+datetree

 (org-roam-capture- :node (org-roam-node-read
                            nil
                            (my/org-roam-filter-by-tag "customer"))
  :templates '(("p" "project" entry "* %<%u>%?/n%i\n%a"
                                   :if-new (file+olp+datetree "%<%Y%m%d%H%M%S>-${slug}.org"
                                                          "#+title: ${title}\n#+category: ${title}\n#+filetags: project"
                                                          ("History"))))))

But still I get the error save-excursion: Wrong type argument: integer-or-marker-p, nil"

What do I get wrong??

334
 
 

I'm finding that defining outline-regexp does not do for me in python-mode what it does for me in other language modes. Someone else on Stack Exchange ran into the same problem, and a suggested answer to their question makes it clear that python-mode preconfigures some definitions for outline-minor-mode. But what those preconfigurations are, and more importantly how to use them, is not documented anywhere I can find.

335
 
 

This is Emma the Unicorn! Her design is based off of Emacs. She's featured in thumbnails on LibrePheonix's Youtube Channel for his Doom Emacs videos.

Emma the Emacs Unicorn

Emma the Emacs Unicorn with glasses

336
 
 

When you search for a string like \(a\)xxx\(b\)yy\(c\) is there some way to create a replacement string where each group can be replaced separately?

If that is not possible the only way I see round it will be to replace better off replacing the whole line with a string splicing the replacements where the groups are.

337
338
 
 

Hi,

I'm quite new to emacs. Using doom-emacs I have the following lines in my config.el:

(after! org
  (custom-set-faces!
    '(org-document-title :height 2.0)
    '(org-level-1 :inherit outline-1 :weight extra-bold :height 1.75)
    '(org-level-2 :inherit outline-2 :weight bold :height 1.5)
    '(org-level-3 :inherit outline-3 :weight bold :height 1.25)
    '(org-level-4 :inherit outline-4 :weight bold :height 1.1)
    '(org-level-5 :inherit outline-5 :weight semi-bold :height 1.06)
    '(org-level-6 :inherit outline-6 :weight semi-bold :height 1.03)
    '(org-level-7 :inherit outline-7 :weight semi-bold)
    '(org-level-8 :inherit outline-8 :weight semi-bold)
    ;; Ensure that anything that should be fixed-pitch in org buffers appears that
    ;; way
    '(org-block nil :foreground nil :inherit 'fixed-pitch)
    '(org-code nil   :inherit '(shadow fixed-pitch))
    '(org-table nil   :inherit '(shadow fixed-pitch))
    '(org-verbatim nil :inherit '(shadow fixed-pitch))
    '(org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
    '(org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
    '(org-checkbox nil :inherit 'fixed-pitch)))

This works fine, but gives me a strange-looking columnview (because many todo-items do have different fontsizes now).

How can I ensure, that - when using columnview - a monospace font with a fixed fontsize is used?

339
 
 

When local repository moved ahead and remote also moved ahead, the remote doesn't allow Push. You have to first Pull. But sometimes pull doesn't work straight forward, you have to specify the merge strategy. This happens when `--ff-only` doesn't work for some reason.

In such a scenario, I normally use `--no-rebase` option. It creates a new commit with the merge. I can use `--rebase` also. But that is my personal preference. I want to keep the history of changes as is.

I couldn't find `--no-rebase` option in the Magit interface. Any idea, how to do that using Magit?

ChatGPT suggests that instead of direct Pull i.e. `F u`, I should first fetch and then merge i.e. `f u` followed by merging aka `m m`. Although, I haven't tried it yet. But just wanted to ask, if there is a direct way to achieve `--no-rebase` in Pull.

340
 
 

I know it is possible to set local variables for a mode through dir-locals.el. But what could I do if I want to run a command such as:

(shell-command "sass --watch style.sass "static/css/style.css")

or activating a virtual env using:

(pyvenv-activate "env/")

341
 
 

Half out of curiosity and half out of real interest I'd like to know what is the smallest (portable) device with a reasonable quality keyboard that could run an appropriate Linux distro and emacs and people have tested for actual long-term usability.

I'm looking at UMPCs and various 7-inch mini laptops you see on eBay.

Thanks!

342
 
 

Can somebody please help me solve this. i tired everything i can. i am runnin xQuartz 2.85, Emacs 28.2, Server is linux based. i get this over ssh. Emacs works fine without ssh.

libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast Connection lost to X server 'localhost:10.0' When compiled with GTK, Emacs cannot recover from X disconnects. This is a GTK bug: https://gitlab.gnome.org/GNOME/gtk/issues/221 For details, see etc/PROBLEMS. Fatal error 6: Aborted Backtrace: emacs[0x5194a2] emacs[0x4febb1] emacs[0x519559] emacs[0x4cab03] emacs[0x4cac1c] /usr/lib/x86_64-linux-gnu/libX11.so.6(_XIOError+0x52)[0x7f6dc1716492] /usr/lib/x86_64-linux-gnu/libX11.so.6(_XEventsQueued+0x7d)[0x7f6dc1713b4d] /usr/lib/x86_64-linux-gnu/libX11.so.6(XPending+0x61)[0x7f6dc1705341] /usr/lib/x86_64-linux-gnu/libgdk-3.so.0(+0x701ff)[0x7f6dc1db21ff] /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_prepare+0x19f)[0x7f6dc188c8ef] /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x5229b)[0x7f6dc188d29b] /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_main_context_pending+0x2c)[0x7f6dc188d43c] /usr/lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_events_pending+0x12)[0x7f6dc20971b2] emacs[0x4cb38d] emacs[0x505f82] emacs[0x506625] emacs[0x5be02d] emacs[0x428ca1] emacs[0x50ad97] emacs[0x50c440] emacs[0x50db54] emacs[0x576c46] emacs[0x4fef74] emacs[0x576bb5] emacs[0x4fef13] emacs[0x504127] emacs[0x504488] emacs[0x41ef32] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f6dbfa5f083] emacs[0x41fc0e] Aborted (core dumped)

343
 
 

With every start of Emacs 29, native comp starts compiling the files cl-loaddefs.el and tramp-loaddefs.el, but I can't find corresponding *.eln files in (all) native-lisp directories. (Native compiling other (internal & extra) packages works, it is not an issue with access rights.)

What is the use of that behavior?

I could disable that native jit compiling, by putting following line in my early-init.el

(setq native-comp-jit-compilation-deny-list '(".*-loaddefs.el.gz"))

Would that break some facilities within Emacs, if I do so?

344
 
 

I installed neotree but the icons are not appearing in doom emacs do i have to install something else for the icons?

345
346
347
348
 
 

Hi,

I was using my search engine to look for available Emacs integrations for the open (and local) https://gpt4all.io/ when I realized that I could not find a single one.

Is there somebody who's using GPT4All with Emacs already and did not publish his/her integration?

349
 
 

When editing common lisp with slime and emacs, I'd like a speedbar listing, alternately, top level definitions in the file I'm editing, and top level definitions in the package I'm looking at (which may be a superset of definitions in the file). Preferably sorted by type of definition (function, macro, constant, etc) and/or alphabetically.

Is there some emacs tooling for this? I haven't found it.

350
 
 

Command doom not found even after i added path to my zshrc file(zsh is my default shell) I also used source .zshrc

view more: ‹ prev next ›