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
226
 
 

I have this type of code in my init.el each loads the features in a directly and it turns out that because the file names contained the - character they were not being loaded, as the regex checks for only alphanumeric filenames which are not hidden.

(let ((default-directory (expand-file-name "wsi/lisp" user-emacs-directory)))
  (normal-top-level-add-to-load-path (directory-files default-directory nil "[^\\.][a-z0-9]*")))

By the way I copied this from someone's init.el and I've suffered from it for ages, an object lesson on how one should not copy init.el files and other Emacs lisp code without fully understanding the code in them.

I'm not sure but it looks like the regex will not even match file names with capitals in them.

I guess the question I want to ask is how to add arbitrary non-alphabetical characters to a regex matching alphanumeric characters, with the proviso that they are acceptable in file names..

227
228
 
 

i don't think i'll need elisp as i'm using emacs distribution

i want to learn basics elisp so that i can understand how to map keys how to send commands etc.

constructs that all beginners require

please don't send a 300 page pdf for elisp as i don't want to learn everything i just want a basic max 10 page rulebook for elisp

my teacher told me to use emacs and i love the experience so far thanks to the support from this community

i have not yet learned how to execute command like

menu-bar--display-line-numbers-mode-relative

i don't know how to

run tab-width command with and set it to 4 after using M-x to open dialogue box to run command

(i think it's called buffer not dialogue box)

so this is the level i'm at not much i know but i hope that emacs gods help me in finding true peace

229
 
 

Hey all,

I've been acquainting myself with Emacs (vanilla) and am currently reading through the tutorial. I'm at the part about creating new frames and, as you can see on the image, the new frame shows up small and squished. This also happens sometimes when opening Emacs regularly. I doubt that is intended. I have not found any topics related to this behaviour (maybe my google-fu is just bad). Anyone encounter this before and have a potential fix? I don't have an init file yet and I'm on Fedora if that helps.

230
 
 
231
 
 

I have been using Magit and Forge for several years, mainly with projects on self-hosted Gitlab instances. The experience has been great!

One of the nice things that Forge did for me was showing the numbers of merge requests (in !123 form) in my magit-log views. Some time ago, however, this stopped working. Actually, this stopped working quite some time ago, maybe a year or more. I was too lazy to report it and too busy to investigate. IIRC it didn't stop working right away for all repos, so I guess it is not related to e.g. upgrading to Emacs 28 (and it was definitely before I upgraded to Emacs 29.1).

To investigate this in more detail, I created new clones of several projects, but that didn't change anything. I also tried a simplified Emacs config in a new home directory to make sure that Forge's database was created from scratch. Same problem persists.

On Forge's Github pages, I found some references to interactions of Forge with bug-reference-mode, so maybe it somehow has to do with that? On the other hand, given that I used a fresh Emacs config + new clones, I guess this isn't the cause of the issue either.

Does anyone know how to get the MR numbers back in Magit's log view?

232
 
 

Here's something I can't figure out: When using dired to manage files, let's say I have a top level directory with a ton of subdirectories, each with a GoPro video inside (unique name/time/date for each file name). How do I move them all at once to that top level directory for easier management/renaming? I don't want to have to go into each directory and move them one at a time with R. Let's say all of the files are MP4 or HEVC.

233
234
 
 

I am a Neovim user, and I am trying out Emacs.

I recently started with doom emacs, it feels pretty good. However, one issue I am facing is that pyright works very slow. I know that it is an issue with pyright, which I faced with Neovim also.

However, I made it faster for my use-case by changing some settings. Neovim allows to have these settings in the setup function for LSP. I was trying to figure out how do I change these settings with doom emacs. Pyright docs suggest to have these settings in pyrightconfig.json.

I think this is more of a pyright issue, but feel like somebody might have already solved it.

235
 
 

Running Doom Emacs.

Plantuml works as expected when generating images, for instance:

:file *.png

The problem is, there is no ASCII generated in results: verbatim mode:

:results verbatim

What could go wrong?

The same problem observed here: https://discourse.doomemacs.org/t/problem-with-plantuml-src-block-results/3603

According to this article:

https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-plantuml.html

there seems to be no reason why this should not work.

236
 
 

Switch buffer in Doom and swiper-all display the selected files as you scroll through the matching files until you select or cancel one.

I use ivy-switch-buffer and its helm counterpart in my vanilla emacs configuration.

Is there some way to get these functions to the same as Doom or swiper-all?

237
 
 

Just started using hyperbole and it works great for following links to files, though when I try to follow a url I get an “Invalid regexp” error. Has anyone else experienced this/found a way around it?

238
 
 

Hello there .
I am using as my OS devuan gnu+linux .
The point is I like philosophy of Unix using like tmux + nvim + mutt .
and I love the vi keybings so much ..

Sometimes I am thinking to switch to gnu emacs .. but I feel that I will find some difficulties
and I am afraid .

Is there a easy way to use emacs ?
can someone help or give me some YT videos to watch to have a good idea about emacs ?

239
 
 

Bear with me here—I'm an avid Emacs user. I love it so much that I want to stay in Emacs wherever possible! I need to collaborate on some notes with a Vim user. It'd be nice if there were some tools in Vim that they could use to navigate Denote-formatted Markdown files as easily as I can. Does anyone know of a Vim plugin that works with Denote?

240
 
 

Hi Everyone.

I'm using emacs and ripgrep to find what I'm looking for in a folder. Ripgrep shows the result of what I'm looking beautifully. Thats great. Every time I open a result, ripgrep buffer disappears.

Does anyone know how to open a temp buffer to view result then I can close it and go back to rg result again, so I don't have to type my search query.

Thanks.

241
242
 
 

I want to be able to use outline-minor-mode to fold my use-package blocks at convenient points. Ideally, I want to be able to fold sections following :config, :init, :custom, etc. as well as definitions inside those blocks. The current value of outline-regexp when in emacs-lisp-mode is:

";;;;* [^ 	\n]\\|(\\|\\(^;;;###\\(\\([-[:alnum:]]+?\\)-\\)?\\(autoload\\)\\)"

I thought appending \\|[[:space:]]*:\\(init|config|custom\\) to this would work, but it doesn't. Any help would be much appreciated.

(I see there's a related post here, but I didn't find anything there that helped me.)

243
 
 

I have been trying to use emacs as a multiplexer with eshell as my go-to shell. Zoxide integration, could be helpful .

244
 
 

Is it possible to never list org agenda files from being shown in buffer lists? I have a few buffer open and I open agenda to check something. Now when (while still being in agenda) I do switch buffer among the options I see are the org agenda files. I don’t want that.

If I ever want to see them I will open them explicitly (not want to see them when they were opened automatically by agenda)

245
 
 

Hi there,

I recently saw that emacs can replace tmux, but I haven't found complete information about it.

246
 
 

When checking the weather for different locations in org-babel, I encountered an issue where the symbol for partly cloudy was not displayed correctly. Here is the code I used:

#+BEGIN_SRC shell :results output
curl 'wttr.in/{Paris,SanJose,Washington}?format=4'
#+END_SRC

#+RESULTS:
: Paris: 🌧   🌡️+10°C 🌬️↗9km/h
: SanJose: ☀️   🌡️+16°C 🌬️↘15km/h
: Washington: ⛅️  🌡️+12°C 🌬️↓4km/h

The symbol of partly-cloudy in washington was not rendered:

https://preview.redd.it/oisno3plx9zb1.png?width=641&format=png&auto=webp&s=54d2246de4877f8c08bdb98fc8504b27ea1b36da

I'm currently using Emacs 29.1 on Windows 10, and have set the symbol fonts as ""Segoe UI Emoji" which does have symbol of partly-cloudy.

(set-fontset-font t 'symbol "Segoe UI Emoji" nil 'prepend)

I alterntively tried "Symbola" font but the issue repeats. How could solve the problem?

247
 
 

It's a feature that I miss from Clion, my current workflow is by using a 3rd party linter after my coding session outside of Emacs. I know that I can use the linter with an after-save-hook, but is there any other solutions with flycheck or lsp integrations? (I tried flycheck-clang-tidy but I didn't get any warrings or indicators, not sure if clang-tidy can detect them though)

248
 
 

I have set agenda files to refile captures, which codes show as below

(setq org-agenda-files (list "~/org/))

Also, include refile codes

(setq org-refile-targets '((nil :maxlevel . 2) (org-agenda-files :maxlevel . 2)))

(setq org-outline-path-complete-in-steps nil)

(setq org-refile-use-outline-path 'file)

The main problem is I can not find files I set in the org-agenda-files when I want to refile my capture in completions

249
 
 

Hi there,

I'm a newbie in emacs.

I want to use doom emacs w/o evil-mode, but all I find that vim bindings (https://github.com/niyumard/Doom-Emacs-Cheat-Sheet)

250
 
 

Hello, I have a problem where I want to configure the org-roam-dailes-capture-templates to include in the options the ability to automatically insert \n:t. But due to syntaxical purpose that is read as if I want to have a line break in the template itself. Is there any other way to enable that option without using "/n:t" ?

My current org-roam-dailies-capture-templates look as such:

(setq org-roam-dailies-capture-templates
      '(("d" "default" entry
	 "* %?"
	 :target (file+head "%<%Y-%m-%d>.org"
			    "#+title: %<%d-%m-%Y>\n#+options: author:nil, date:nil, toc:nil, num:5, H:5, \n:t, html-postamble:nil\n"))))

What it ends up doing is the following:

#+title: %currentdate
#+options: author:nil, date:nil, toc:nil, num:5, H:5,
:t, html-postamble:nil

What I want it to do is the following:

#+title: %currentdate
#+options: author:nil, date:nil, toc:nil, num:5, H:5, \n:t, html-postamble:nil

2nd Question: How to also make sure that the #+options line is also included when I open a new node and not only in the dailies page? I am very new to Emacs in general, so thank you for your patience if my question is dead simple and I am unable to figure out very simple things. Appreciate any help.

view more: ‹ prev next ›