Emacs

313 readers
2 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
126
 
 

Hey! I use Cherrytree for journaling, but it has a few things I want to change, and lack a few things that I need. Plus, I'm worry about locking myself in one app, so I'm exploring the possibility of using Neovim or Emacs, but I'm aware there's a learning curve, and before investing time, I wanted to know if I'm using the right tool.

I need to do the following in a quick way:

1- Encrypt a whole folder, and acces it. This folder will keep other folders with pictures and text files.

2- Set a number of columns for the page, like 80 or 100.

3- Have a tree-like explorer on the left, to navigate the files with the entries.

4- Do bold, italics, and different colors.

5- Make an index or a different way to navigate the entries, besides the tree explorer.

6- Export everything in case I want to change the program I use to read my entries.

7- Inserting an image from a folder, like a picture I took. It can be a miniature to click and open the original picture.

Can Emacs do that?

Thanks!

127
 
 

In my config, I have the followings line:

(nerd-icons-install-fonts)

How do I prevent this from happening multiple times? I just need it, when it is not installed.

128
 
 
129
 
 

Hello r/emacs! First-time poster here!

I recently wanted to visualise some data in org-mode using a Python source block to generate an image, which was then rendered directly in the buffer.

It took my a couple of goes to work out how to do it.

Given some data like this:

#+begin_src bash :results output file :file data.njson
echo '{"name": "Spock", "editor": "Emacs"}
{"name": "James Kirk", "editor": "Vim"}
{"name": "Dr McCoy", "editor": "Vim"}
{"name": "Scotty", "editor": "Emacs"}
{"name": "Worf", "editor": "ed"}
{"name": "Geordi LaForge", "editor": "Emacs"}
{"name": "Data", "editor": "Emacs"}
{"name": "Jean-luc Picard", "editor": "VS Code"}
{"name": "Wesley Crusher", "editor": "VS Code"}
{"name": "William Riker", "editor": "Vim"}
'
#+end_src

A visualisation can be rendered as follows:

#+begin_src python :results output file :file usage.png
import pandas as pd
import seaborn as sns
import sys

df = pd.read_json("data.njson", lines=True)
axes = sns.histplot(df, x="editor")
axes.get_figure().savefig(sys.stdout.buffer)
#+end_src

The main trick here is to set the :results output file header argument to write the output to a file, and to save the figure to sys.stdout.buffer from Python.

I've written about this on my blog too, where you can see the [unsurprising] results of the analysis!

130
 
 

From the launch of the first version of Metanote on iOS to now, it's been almost three months, and after several iterations, there have been significant improvements. I believe it's essential to update everyone on the progress of Metanote.

So far, Metanote has comprehensively supported the customization options for Org mode's Agenda view, including settings for tags, properties, subtasks, and most of the major InBufferSettings. I won't list them all here, but you can find detailed documentation.

  1. InBufferSettings
  2. Agenda views
  3. A Simple and Effective GTD Workflow

This weekend (November 24-27), I hosted a promotional event. If Metanote has brought convenience and value to your life and work, this might be a good time to get it.

Upcoming Features:

  1. Custom Capture
  2. Visibility Cycling and Rich Text
  3. Roam Research and Backlinks

Thank you all.

https://preview.redd.it/jq3rdm7otw1c1.png?width=1290&format=png&auto=webp&s=547fae403c96e182000791d9e839c9ea0b62e2f8

https://preview.redd.it/dxrfkiurtw1c1.png?width=1290&format=png&auto=webp&s=8e16d0f1fa8593731495ae8cd5cff9f1a9d3bd05

https://preview.redd.it/1hv6l4zttw1c1.png?width=1290&format=png&auto=webp&s=649fb84d18f29b6d17b37d3a1157bbb6f1b67f0a

131
 
 

tl;dr why do my org links not have a space before them (e.g. check out thisLINK)? I feel I'm missing something very basic here.

I was using org-roam today in doom emacs and forgot how irritating adding a new node is while writing.

It nestles nicely up to the text before it - with no space in between. After posting on r/orgroam a kind soul told me this might be a wider issue - at least related to org itself, and maybe doom.

Does anyone know how to get a leading space before the node name / link? For example; my nodes come out looking like:

something interesting is in thisNODENAME/LINK check it out

For the love of RMS I want a space between this and NODENAME

I'm clearly being dumb, but can't figure this out. Surely enough people use emacs / doom emacs / org mode, and they are not all adding links everywhere with no leading space?

A suggestion on r/orgroam was put a double space before a link - is that it?

132
 
 

When I do package-list-packages and I'm searching for a package, the search is not restricted to the package names, but searches the descriptions as well, and this requires scrolling down before starting the search.

Can the search be restricted to the column with the names?

133
 
 

As in topic, emacs normally open files in instant, but when autosave (#filename#) exists, it takes about 1 sec to open file.

Any idea how to fix this without disabling autosaves? It doesn't seem to be config problem since same happens with -Q flag.

134
 
 

I'm a new emacs user and I've been using doom emacs for a while now and i'm willing to learn Elisp, but found out that it might not be as easy as it might seem at first, because as i found out, lisp is quite different from other programming languages that i'm used to, especially knowing that i'm not a programmer by any means and my programming knowledge is very little, not mentioning that elisp is pretty old so the learning resources might not be as much as other more popular programming languages

so my question is, Is it worth it?

like what is the level of mastery do i need to achieve to start implementing custom elisp in my configs to enhance my emacs experience?

and how exactly can i improve my emacs experience if i learned elisp?

in other words, how rewarding it would be

135
 
 

Helm-mini enables acting on the file list by using Ctrl-Space to pick those required, though I don't know if that is the only action to be done on the selection.

Is that behaviour unique to helm's completing read implementation, or do other such functions exist?

I need to create an SQL command from a selection from a long list of databases and need something that can pick them individually with highlighting, so once I press Enter, the selection is passed to a function.

The default completing-read-multiple of typing a match and adding a comma is not suitable for this.

UPDATE

After some more searching I've come across this Embark discussion which may help me in what I need. I just need that kind of functionality in a completing-read command, basically something which lets me mark a list of items from a list and apply some arbitrary action to them.

136
 
 

I use ripgrep for searching in a project and I want to save the ripgrep buffer with the links.

Simply saving the buffer just removes the links and leaves only plain text.

(The reason for this is, I want to go through several parts of the code which I found with ripgrep. This will take some days, and I want to be able to keep track of my progress by going through the search results and delete the ones I already worked on.)

137
 
 

I'll try to explain what i'm looking for: Let's say i'm working on a work project, on my emacs configuration and my org notes. All of those i'll use throughout the day but don't do simultaneosly. I'm trying to set it up so i can save the current state for buffers and open project for work, switch to my org notes, do something there, and switch back with all buffers in place and files open where they where.

Things like desktop-save-mode seem to handle restoring the last buffers, but aren't working for multiple sessions. So what's my best bet to have multiple separated "setups" depending on what i'm working on at the moment?

138
 
 

To manage packages conveniently, I set new load-path by (add-to-list 'load-path "c:/emacs/.emacs.d/lisp")

After that I checked load-path lists through C-h v load-path, which confirms "c:/emacs/.emacs.d/lisp" had been added into load-path lists successfully. Then I run (use-pakage xxx) inside my custom init.el, but a warning occurred said

Error (use-package): Cannot load xxx

I rechecked load-path lists and move packages to another one directory mentioned in load-path lists, which is loacted in Emacs installtion directory named site-lisp. THEN (use-pakage xxx) returned to normal and didn't rose a warning.

It's so weird, and I just want to set a custom packages load-path. Does anyone know what goes wrong?

139
 
 

I can grab links to specific messages in the desktop version of Apple Mail. I use Logseq to open my org files and I see the links which do open the mail app. But the message is not opened.

If I open them on a different desktop machine they do open the same message, just not on iOS.

Is there a way to do this? Maybe using a different program? I am open to anything.

140
141
142
 
 

hi all,

i have a pretty vanilla vertico configuration

  (use-package vertico
:ensure t
:config
(vertico-mode))

in a directory, i have sub-directories organized like so:

   .
   |-- dot-emacs.git
   |-- doomemacs
   `-- vanilla.config

now, a C-x C-f in the above directory does not display the 'dot-emacs.git' directory at all.

how do i fix it ?

-- thank you !

143
 
 

Today Emacs Elisp post and video - episode 14 - turning the emoji replacement code into a minor mode:

https://cestlaz.github.io/post/learning-elisp-14/

144
 
 

Today Emacs Elisp post and video - episode 14 - turning the emoji replacement code into a minor mode:

https://cestlaz.github.io/post/learning-elisp-14/

145
 
 

When debugging some code, I learned that if you call pop-to-buffer and pop-to-buffer-same-window inside save-excursion or save-current-buffer, the original buffer will not be restored at the end of the save-. You can get around this by using save-window-excursion; however, I still feel like save-excursion ought to work. Does anyone know why it doesn't?

(You can check this by eval-ing the following in any buffer other than *Messages*: (save-excursion (pop-to-buffer-same-window "*Messages*")).

146
 
 

When debugging some code, I learned that if you call pop-to-buffer and pop-to-buffer-same-window inside save-excursion or save-current-buffer, the original buffer will not be restored at the end of the save-. You can get around this by using save-window-excursion; however, I still feel like save-excursion ought to work. Does anyone know why it doesn't?

(You can check this by eval-ing the following in any buffer other than *Messages*: (save-excursion (pop-to-buffer-same-window "*Messages*")).

147
 
 

I have been a user of emacs for more than a decade. I am not a pro, but my config has swollen little by little. What really got me into emacs was the interaction with the python repl. It was amazing. Only Jupyter notebooks did something similar for me. Lately I have been using VScode, as the notebook experience for data science is very good and emacs cannot really compete here as notebooks are web based since the beggining, and vscode is an electron app. Packages like ein was just an ok replacement. Also I have been using logseq instead of org-mode, as the android app is very good and allow me to add stuff from the camera and using the pen with the whiteboard. I am mainly using org-mode to define large project files and leaving logseq for note taking.

The later but the hype with neovim and in much smaller scale with helix got me interest, as I have been using less emacs lately. So I decided to try them. And for the first time I feel I was in the presence of real competitors. Emacs has always been about text editing + poweful ide like tools added using plugins made by the community using a scripting language, in emacs case elisp. I liked VSCode despite the bloat because it was similar in spirit, a editor that can customize and make tools for using a scripting language, javascript. I never like vi/vim. Modal typing is nice for using command without modifier keys. But you could only use those commands on vi /vim, so I did not see the point in learning a typing system for some type saving. I always laugh with the emacs pinky meme, when in practice most vim users used screen and tmux and use ctrl all the time. And alt+tab for geeting to the browser. Plugins were not really enough for my coding and they were awful in comparison with the emacs ecosystem. And you can get evil mode in emacs. But neovim is a different beast. The change from the old vimscript to Lua and how the community embraced the change turn it into an editor very close to emacs. I installed the lazyvim distro, and my experience was very similar to doom emacs. Actually I found a bit better to update all the packages installed by default. And the interaction python was also closer to emacs thanks to iron.nvim. I could installed in a remote machine that I have issue installing a new version of emacs due to lack of permissions. So very nice experience.

Helix is a monolitic editor that comes with "battery include", and it doesn't have a plugin system yet (although the devs might add a scheme like scripting in the future). But the editor is much more feature complete than neovim without plugins. It lacks a repl interaction, so I cannot really use but it looks nice and might have a interesting future.

My conclusion is that editors of all kinds are becoming more and more like emacs, a core with a plugin system. Emacs is a very tiny core and the rest is elisp so you can change everything, but most people never get close to try to do that. Neovim+Lua is a good example that a you don't need so much flexibilty and you don't even need a powerful scripting language. Lua point is to be simple enough without losing too much power. Vscode+JS is a similar story. We are witnessing carcinisation for editors.

148
 
 

I have been a user of emacs for more than a decade. I am not a pro, but my config has swollen little by little. What really got me into emacs was the interaction with the python repl. It was amazing. Only Jupyter notebooks did something similar for me. Lately I have been using VScode, as the notebook experience for data science is very good and emacs cannot really compete here as notebooks are web based since the beggining, and vscode is an electron app. Packages like ein was just an ok replacement. Also I have been using logseq instead of org-mode, as the android app is very good and allow me to add stuff from the camera and using the pen with the whiteboard. I am mainly using org-mode to define large project files and leaving logseq for note taking.

The later but the hype with neovim and in much smaller scale with helix got me interest, as I have been using less emacs lately. So I decided to try them. And for the first time I feel I was in the presence of real competitors. Emacs has always been about text editing + poweful ide like tools added using plugins made by the community using a scripting language, in emacs case elisp. I liked VSCode despite the bloat because it was similar in spirit, a editor that can customize and make tools for using a scripting language, javascript. I never like vi/vim. Modal typing is nice for using command without modifier keys. But you could only use those commands on vi /vim, so I did not see the point in learning a typing system for some type saving. I always laugh with the emacs pinky meme, when in practice most vim users used screen and tmux and use ctrl all the time. And alt+tab for geeting to the browser. Plugins were not really enough for my coding and they were awful in comparison with the emacs ecosystem. And you can get evil mode in emacs. But neovim is a different beast. The change from the old vimscript to Lua and how the community embraced the change turn it into an editor very close to emacs. I installed the lazyvim distro, and my experience was very similar to doom emacs. Actually I found a bit better to update all the packages installed by default. And the interaction python was also closer to emacs thanks to iron.nvim. I could installed in a remote machine that I have issue installing a new version of emacs due to lack of permissions. So very nice experience.

Helix is a monolitic editor that comes with "battery include", and it doesn't have a plugin system yet (although the devs might add a scheme like scripting in the future). But the editor is much more feature complete than neovim without plugins. It lacks a repl interaction, so I cannot really use but it looks nice and might have a interesting future.

My conclusion is that editors of all kinds are becoming more and more like emacs, a core with a plugin system. Emacs is a very tiny core and the rest is elisp so you can change everything, but most people never get close to try to do that. Neovim+Lua is a good example that a you don't need so much flexibilty and you don't even need a powerful scripting language. Lua point is to be simple enough without losing too much power. Vscode+JS is a similar story. We are witnessing carcinisation for editors.

149
150
 
 

Have been using emacs for a while now with doom and have a question to the community:

When you have a project inside of docker with packages instead by pip, how to you have your eMacs and LSP resolve the import statements?

I have heard of TRAMP but this seems like a solution for jacking into a docker container that is running to just modify files.

Thanks, Aaron

view more: ‹ prev next ›