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
401
 
 

Hello and thank you for reading this. I'm starting my journey to study Emacs, and I'm interested in turning Emacs in my IDE (mainly C, C++, JavaScript, Rust, and Python, etc...) and taking notes. Could you please give me your best suggestion on how to accomplish my goals? Thank you once more, and have a wonderful day/night.

:^

View Poll

402
 
 

In elisp, symbols serve as fundamental data structures that are more foundational compared to strings. This distinction often caused confusion for me until my encounter with the read function.

 ~ $ (type-of (read))
 symbol

The fact that the read function yields symbols instead of strings from user-input was a delightful revelation. This discovery convinces me that the fundamental nature of symbols in elisp when compared to strings.

403
 
 

Hey everybody, first time poster here.

I've been using Emacs for a while now, but just recently starting toying with configs, experiencing new packages, learning some elisp so I can customize my emacs experience and overall making it my own.

A while back I noticed I needed some sort of dark mode functionality to change the theme to a darker one when there is less sunlight. After searching for some packages, I found none that really suited me.

So I decided to write my own: https://github.com/pedroangelo/theme-rotation.el

Check it out and tell me what you guys think. I've also included a sort of related work section in the README that discusses similar packages, and why I didn't found them to my taste.

PS: I wrote this package for my personal use. But if more people find it useful, I'd be quite satisfied with myself.

Also, do you think I should work towards getting it published in MELPA? I don't mind the work if it something that potentially many people might enjoy using.

404
 
 

I just tried out eglot today, and I must say that I am very very impressed. However, like all software, the julia language server has a few quirks that need to be worked around. Long story short, I have two folders (not nested or anything):

  • folder1 - A git repository of a large julia project that I cloned. Starting eglot here only works partially. Anything imported from other packages is a missing reference.

  • folder2 - A folder I created with various scripts that I wrote for the project in folder1. It contains a Project.toml detailing the necessary julia environment for those scripts to work. Starting eglot here works flawlessly. Both functions defined in folder1 as well as the other packages folder1 relies upon are referenced correctly.

Is there a way for me to start eglot in folder2 but have it work as if I have started it in folder1?

I believe one potential solution might be to tell Project.el that the git repository in folder1 belongs to the project in folder2, but I couldn't find a command for doing so.

Alternatively, can I tell eglot in folder1 to connect to the language server that was started by eglot in folder2?

edit: Hope the question makes sense, and apologies if not everything is phrased in the correct language. I'm pretty new to both eglot and project.el. Many thanks in advance for any help or hints!

405
 
 

there's a charm to them

406
407
 
 

Hi, Im not sure if this is the right platform to ask on. Long story short, Im stuck at this GIS job, massive computing experience under my belt, but close to 20% experience in GIS. Im playing around with SmallWorld locally and on a cloned repo. But they also have a Development environment on a remote server. Everyone here says theres no way to use your own Emacs version (28) on this one, except Emacs 23. Do you have any comment on this? Talk to me like Im a child. Im not sure if its an SSH setup. A senior told me it isnt (in a very thick accent). He might be bullshitting. (They use a VPN and sometthing called "f5 networks endpoint inspector")

408
 
 

I'm trying to make my Emacs configuration more reproducible, in part by creating variables with paths to packages, directories which depend on what machine I'm on:

(if my/laptop-p
    (progn
      ...
      (defvar my/mu4e-dir            "/usr/share/emacs/site-lisp/mu4e"
  "Location of local `mu4e' files installed by system package manager")
      ...
                ))

 

Here, my/laptop-p tests if (equal (system-name) "my-thinkpad").

This system works well, so that for the relevant example of mu4e (which is apparently quite tricky to set up in straight.el ) I can use:

(use-package mu4e
  :straight
  (:local-repo my/mu4e-dir
               :type built-in)
               ...
               )

 

The package loads and the configuration works fine.

But doing straight-freeze-versions gives:

straight--dir: Wrong type argument: stringp, my/mu4e-dir

This can be fixed by replacing my/mu4e-dir with the string "/usr/share/emacs/site-lisp/mu4e", but I'd like to avoid this if I can.

  Is there a way I can keep using my defined variable my/mu4e-dir instead of the full path name?

409
 
 

While a for-loop is a straightforward construct in other programming languages, the loop macro, despite its power, can present challenges due to its intricacy. I find myself frustrated by its complexity.

However, its conceptual abstractions are intriguing. Take, for example, the following code snippet:

(loop for i below 10 sum i)

The utilization of the term "below" in this context is particularly striking. Contrastingly, in languages like JavaScript, I typically read "i < 10" as "i less than 10," pronouncing the two words "less than" in order to read the "<" symbol.

The act of reading "<" as "less than" momentarily interrupts my cognitive flow between the two words. The loop macro condenses it as a single word, "below," allowing me to pronounce "i < 10" more succinctly and smoothly, without interruption. Another viable alternative could be "under."

Moreover, the expression `1 < i < 10` can be read as "from 1 to 10."

(loop for i from 1 to 10 sum i)

It enhance code readability mentally and streamline cognitive processing.

410
 
 

Once I saw nil or 'nil from some (setq ..), it usually worried me.

The barely nil appears to be a variable name no more than `foo bar zoo` and there shoud be a value it points to.The quoted 'nil seems to be a data or a value in data mode and there might exist a name it is given.it looks no difference with symbols as 'nilll 'nilllllll or 'nillllllllll as data.

Every time see them, I find myself hesitating, uncertain and disturbing.

This picture tells they are identical and comfort me to get an insight that lisp is much more pragmatic in evovling by patching up.

As a result, I stop worring its theoretical consistency and confidently proceed with using `nil`.

4 disguises of nil

The wizard book SICP states it as:

Lisp was not the product of a concerted design effort. Instead, it evolved informally in an experimental manner in response to users' needs and to pragmatic implementation considerations.

411
 
 

Hi i am a noob and i what to use emacs for writing stories and blogs .... is there any guide you can point me to?

412
 
 

Hi all. I'm a long time Spacemacs user who is just now transferring to a roll my own config. I've been using and loving Magit for years, and I've just discovered Forge while browsing packages to add to my config.

My question is, can you use this for code review? I'd like to be able to view all of the code changes that a Pull Request (my team uses Github) contains and I'd like to be able be able to add comments to changed lines in the PR. I can't figure out how to do that with Magit and Forge. Is this a workflow that's possible and do you have any pointers on how I can achieve this?

413
 
 

If you've used both project.el and Projectile I want to know what are the differences between the two.

I learnt on IRC that Projectile is much older than project.el so there are more plugins for it. But I want to know some specific examples of things that Projectile can do but project.el can't. And specific examples of things that project.el can do but Projectile can't.

Anyone has good experience with both to share this stuff?

414
 
 

I'm exporting an org file with images to html, and using the #+ATTR_HTML attribute to resize the image. That's having no effect, because the Emacs I'm using doesn't have ImageMagick enabled.

Yes, I can rebuild from source and enable it, but presumably the emacs devs disabled it by default for a reason. Furthermore, I'm finding that multiple sources that I might get a prepackaged Emacs from have this feature disabled. Rebuilding from source feels like I'm punching open a hole someone intentionally closed.

Is there a workaround for what I'm trying to do? The best I can come with (other than rebuilding Emacs from source) is to use an external program to resize my image to the size I want it to be. That's fairly cumbersome, and it will clutter my directory with various image sizes as I experiment and figure out what i want. Any suggestions?

415
 
 

I'm having a very strange bug when using emacs remotely. Currently my .emacs file is commented out except the lines defining the theme:

When i start editing a file, i experience a severe display bug that prevents me from reading an edited line until i quit and reload the file, It is difficult to explain, but i've attached a screenshot of a line of text before and after typing the string "bannana bannana bannana bannana" at the start of the line (and pressing no other keys). I can start emacs with the -q flag to avoid this error, but I would prefer not to as I very much like having the theme set. I've also tried enabling a theme after starting with -q (in case there is a typo in my emacs file), and I get the same errant behavior.

Has anyone here encountered a bug like this before?

https://preview.redd.it/elor4c3jwutb1.png?width=681&amp;format=png&amp;auto=webp&amp;s=e6b5673f2c1d0fd365eb38543a607cd01c943cc0

416
 
 

I am using EWW to read articles and I want to capture notes into an exisiting file not part of capture templates. The overall workflow is as follows. Lets say I want to catch up on the GPT agents of generative AI and prompt engineering. I google the topic in EWW and just read with a org file open on the side buffer. I want to take notes and capture quotes into a that org file. when I select text from EWW, and intiate capture I want to insert text into the org file on the side where the point (cursor) is or even at the end of the file. How can I configure org-capture for this?

417
 
 

I am using EWW to read articles and I want to capture notes into an exisiting file not part of capture templates. The overall workflow is as follows. Lets say I want to catch up on the GPT agents of generative AI and prompt engineering. I google the topic in EWW and just read with a org file open on the side buffer. I want to take notes and capture quotes into a that org file. when I select text from EWW, and intiate capture I want to insert text into the org file on the side where the point (cursor) is or even at the end of the file. How can I configure org-capture for this?

EDIT:

Think of it like this. I want to have a org file each reading session and I have have multiple reading sessions in parallel (session don't mean single chunk of time). How can i configure org-capture so that I can create a new org file for each reading session. or org-capture is not the right tool for this? Some other workflow?

418
419
 
 

Seems as if one wants to learn lisp, one has to learn emacs first. That said, I am looking for resources for the absolute beginner to learn emacs, looking for something along the lines of Common lisp A gentle introduction to symbolic computation., but for emacs. Something that assumes you know nothing, starts at the absolute beginningwith lots of exercise and answer to those exercise. Any help will be appreciated.

Thanks

For the record I have been through search, but the signal to noise ratio is pretty high.

420
 
 

I'm interested to know what the future of remove development with emacs might look like. I'm a long time emacs user, and use rust, lsp-mode, magit and projectile heavily. The remote experience with tramp just isn't very good. I've had to work around several bugs that lead to hangs, and even though I'm only ~20millis away from my remote machine performance is pretty bad. I believe I've already done everything I can to make it fast (ssh control master, etc.), and I'm still not happy. On the other hand, VSCode (which I'm not familiar with) or IntelliJ make remote development a breeze. I really like how they hide latency, and handle reconnects well. I've also tried terminal emacs on the remote machine, but I just can't deal with the input lag.

It's remarkable how emacs has been able to adapt over the years, and so I'm interested to hear about some ideas to keep emacs relevant for this usecase.

421
 
 

I know this can be done via #+attr_latex: :placement [] over the figure itself, but is there a variable I can set this parameter to always be [H] rather than its default value ([htbp]?

422
 
 

I'm seriously considering buying an M2 MacBook, after over 20 years on Linux. My main concern is whether it will be difficult to set up Emacs after such a long-term investment in my init files. I would love to hear from others who have made the same transition -- was it hard? Do you have tips to make it easier?

Thanks in advance!

423
 
 

Both split responsibilities based between on what is the "real config" or "helpers" with macros/functions, but the thing is doom-like-style puts it all in one folder(example: /ui/modeline/config /ui/modeline/utils) while other split in two (lisp/lisp-modeline.el, modules/my-mod-modeline.el), and would like to know your opinion about this and what worked for you.

Some context: By now all my settings are all in one init file, and it already passed the 2k lines mark and once something break, everything breaks, so this is needed to avoid future headaches

424
 
 

If you hate key chords and do chordless editing... what do you use for it?

My story:

Evil: I came to Emacs after a long time of using Vim. Everyone told me to just use Evil and be done with it. I tried Devil but I dont know what it is about it that it left me dissatisfied. There was this feeling that I need to learn Emacs way of doing things. Because all documentation or tutorials I get have Emacs keys. Virtually none of them tell how to do same things in Evil. Always felt like an outsider. Jokes like C-x M-c M-butterfly made me feel like I am not in on the joke because I use Evil. I wanted to learn the Emacs way.

Pure Emacs: So I uninstalled Evil and went all in to pure Emacs keys. I learnt them quickly but key chords always felt difficult on my fingers. Then I found God mode and Devil mode. Great thing about both is that I don't have to define custom key-bindings or learn new key-bindings. They both work out of box and if I know Emacs bindings that's all I need to know.

God mode: First I used God mode for one month. Then I used Devil mode for one month. Both are similar but different. Similar that I don't have to learn new keys like Evil or Spacemacs. But difference is huge. God mode is modal. You are either in God mode or you are not. If you are in God mode you cannot insert text. Not a big problem when I am writing code. It feels like Vim if I am writing code. But it is a big problem when I am using ERC or Vterm or any sort of REPL. Like in Vterm if I change to God mode I cant insert commands. I have to disable God mode to type commands. The constant enabling and disabling of God mode in Vterm felt like burden.

That's why I never used set -o vi in Bash. Same problem with set -o vi ... you have to keep changing between insert and command mode to type command and edit commands. In full interactive prompts, modeless editing is best. So always set -o emacs for me in Bash. That is what drew me to emacs but that is a different story.

Another big problem with God mode is that it does not work in minibuffer. It works only very little in search mode. I think only s is supported in search mode. The other search mode commands don't work in God mode. I think this was my biggest problem with God mode. I mean a big nice thing about Emacs is that everything is a buffer and minibuffer is a buffer and all editing commands work in minibuffer. But God mode doesn't work in minibuffer. :(

Devil mode: Then I tried Devil mode for one month. I am liking it. It works fully in minibuffers and search mode. I am using it with its default , as devil key which is like the leader key in Devil mode. It doesn't disrupt my normal text editing. I can keep inserting text like usual but I can also run emacs commands by pressing ,mx. Don't have to disable/enable it everytime. I can always leave it enabled. Devil is also clever that when I typing lists like [10, 20, 30] it understands that I am writing normal text and it lets me write that without disrupting my flow. It multiplexes "insert mode" and "command mode" in a way that just works. I don't know they did it but it just works. And some keys that I feared running before like M-w or M-^ are so easy to do with Devil with ,mw or ,m^. Another one I like is ,m&lt; or ,m> to go to the top and bottom. Navigation feels like Vim with things like ,nfpbnnnffbbb. Its just ,bnpf instead of hjkl.

So this is my journey of God, Devil and Evil and my review. Hope it was useful to some people. I think Devil might be it for me. Going to try it for another few months and report back if I find something new about it.

I also want to know from you if don't do key chords about what package you use and what you like or don't like about them?

P.S. The presence of all these modes make me happy that I did the right decision by switching to Emacs for life. So much choices. There is no way anyone will write packages like this which change the fundamental way to type keys in Vim. Is it even possible to change the basic way of handling key inputs in vim? But in Emacs, you can reimplement all key input handling from ground up to create a Vim within Emacs. Wow.

425
view more: ‹ prev next ›