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
451
452
 
 

Hi,

Is there a point of using tide-mode for typescript development (with focus on react)? I have been using tide for couple of years but I'm wondering if I should be good with just ts-typescript-mode, some mode for tsx, treesitter, and lsp?

What's recommended setup for TS and React now?

453
 
 

Has anyone been able to get xwidget-webkit to work under Wayland? I saw that support for pgtk was added a couple of years ago so I decided to give it a whirl. Compiled emacs 29.1 on Linux x86_64 with webkit2gtk-2.42.1 and the configure options `--with-xwidgets` and `--with-pgtk`. I tried opening a url with `xwidget-webkit-browse-url`, but emacs crashed with the error:

"ERROR **: 12:43:15.326: GDK is not able to create a GL context: The current backend does not support OpenGL."

which is weird, because `eglinfo` does not report anything out of the ordinary.

xwidgets has always been finicky for me and there's very little information available on the internet so I'd be interested in knowing if others have got it to work and it's just a problem with my setup.

454
 
 

I am writing a small major mode in Emacs, and I want to add some support for when electrc-*-modes are enabled.

In particular, I need the following functionality:

  1. Automatic newline when | is typed; and
  2. Indent and newline when [ is typed.

I have been looking into different ways of doing this, and I have come up with the following:

  1. Using electric-layout-mode, e.g. (add-to-list 'electric-layout-rules '(?| . before)); and
  2. Using electric-indent-mode, e.g. (setq-local electric-indent-chars (append electric-indent-chars '(?\[))).

I have also read about the electric-pairs-mode which might be more appropriate for the latter. There are also more manual ways of doing this, with hooks (post self insert hooks?).

However, I am struggling to find any documentation on any electric functions, and different other major modes do these kind of things in different ways. My question is: what is the best way to do what I am after? If there is one function that I can bundle both of these features in, then that might be better. But maybe it's best that I keep these separate in case the user wants to enable, for example, layout mode but not pairs mode.

I'd love to hear from developers of major modes with experience implementing such a feature!

455
 
 

I’m using a monospace font that supports variable weights. In some applications you can specify the weight as a number between 1 - 1000, similar to CSS. For example, iAWriter supports this.

Is there a way to set a custom weight in emacs? I’d like more fine grained control than light, regular, medium, etc.

456
 
 
457
 
 

Typst is a very young but very promising markup language with use-cases similar to LaTeX. One big objective advantage of typst over LaTeX is compilation speed.

For that reason alone, it would be nice to be able to export org to PDF through typst.

Does anyone have a fledgling ox-typst implementation (open to contributions)?

458
 
 

I know that here was the same question. Which one should i use if i want to forget all vim keys and use only emacs features(no evil mode), i want to use only emacs, no vim anymore!

459
 
 

When i use ‘switch-buffer’ i’d like it to also show the path if the file so i can filter by parts of the path as well. I’m using Vertico and want to avoid any more libraries like ‘ivy-rich’ etc.

Any suggestions would be much appreciated!

460
461
462
 
 
463
 
 
  (use-package marginalia
  :straight t
  :bind (:map minibuffer-local-map
           ("M-A" . marginalia-cycle))
  :init
  (marginalia-mode))

464
 
 

I want to disable the fortification of things like a_b and a^b while letting things like a^{b} and a_{b} get fontified in org mode. Is there a good way to do this?

465
466
 
 
467
 
 

OK, first of all, I've tried the orgmode and I think it's awesome. I like a lot of the advantages that emacs provides not being restricted to being a terminal app. However, despite it's huge potential, I don't know how people use it productively, I mean afaik it's as potent as an OS so you can do crazy things like "making a script to get code from anywhere" so... Basically I want to ask you about the features that you like the most. I'm not a guy who is going to use just ONE editor tho, I have to use VSCode for several stuff, I use orgmode for... well documenting, organizing (I should use the code features that it provides, which blew my mind) and oc I use nvim. I want to know what are the things that people do that boosted their productivity in emacs vs other editors, I think each one has their strengths and weaknesses. Ty in advance.

468
 
 

I can fold functions/methods/classes but not code blocks (e.g. for, if, ...) or doc strings.

How can I achieve the latter? Which component is responsible? Which doc I should read?

I do use Emacs 27 and 29 with eglot and evil-mode.

469
 
 

Another OrgMeetup will be scheduled on the second Wednesday of October, next week.

Previous meetup notes: https://list.orgmode.org/orgmode/878r97bzs4.fsf@localhost/

URL: https://bbb.emacsverse.org/b/iho-h7r-qg8-led Time & Date: <2023-10-11 Wed 19:00-21:00 @+03,Europe/Istanbul> The room will be open half an hour before the official start.

During the meetup, we can:

  • Give advice to new users
  • Showcase Org configs or workflows
  • Demo/discuss interesting packages
  • Troubleshoot each-other's issues
  • Discuss "Org mode" section of Emacs news (https://sachachua.com/blog/)
  • Discuss anything else Org-related

Everyone is free to join the discussion/chat or lurk around silently, listening.

We will not do any recording by default.

In addition, feel free to propose topics to discuss in the replies. We can select a couple of topics and discuss them at the beginning of the meetup, followed by the usual flow with topics appearing in the process.

470
471
 
 

Having difficulty while setting lsp with tailwind css

when i open any tailwind css related files it doesnt give an explanation

is there something am missing?

i followed this site https://github.com/merrickluo/lsp-tailwindcss instructed me to do but i couldn't get it work. my project is next js project if that helps. i also chaged the variable default lsp-tailwindcss-major-modes to js-jsx-mode if there is somthing that i am missing pls let me know am also new comer to emacs and stupid things may confuse me

(set-face-attribute 'default nil :font "JetBrains Mono" :height 128)

(setq package-archives '(("melpa" . "https://melpa.org/packages/")
			 ("org" . "https://orgmode.org/elpa")
			 ("elpa" . "https://elpa.gnu.org/packages/")))

(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))

(unless (package-installed-p 'use-package)
  (package-install 'use-package))

(setq use-package-always-ensure t)
(use-package json-mode)


(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-selected-packages
   '(json-mode lsp-treemacs lsp-ivy lsp-tailwindcss lsp-mode gcmh company company-mode evil evil-mode use-package)))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )


(use-package evil
:config (evil-mode 1)
  )


(use-package company
  :config (global-company-mode t)
  )


(use-package gcmh
  :config (gcmh-mode 1)
  )

lsp mode is here

(use-package lsp-mode)
(use-package lsp-tailwindcss
  :init
  (setq lsp-tailwindcss-add-on-mode t)
)
 (load-theme 'tango-dark)


(use-package lsp-ivy :commands lsp-ivy-workspace-symbol)
(use-package lsp-treemacs :commands lsp-treemacs-errors-list)

(setq lsp-log-io nil)
(setq read-process-output-max (* 1024 1024)) ;; 1mb
(setq create-lockfiles nil)
(fset #'jsonrpc--log-event #'ignore)


(advice-add 'jsonrpc--log-event :override #'ignore)

(use-package rjsx-mode)

(use-package lsp-tailwindcss
  :init
  (setq lsp-tailwindcss-add-on-mode t)
)
 (load-theme 'tango-dark)


(use-package lsp-ivy :commands lsp-ivy-workspace-symbol)
(use-package lsp-treemacs :commands lsp-treemacs-errors-list)

(setq lsp-log-io nil)
(setq read-process-output-max (* 1024 1024)) ;; 1mb
(setq create-lockfiles nil)
(fset #'jsonrpc--log-event #'ignore)


(advice-add 'jsonrpc--log-event :override #'ignore)
472
 
 

Having just updated all the packages of my emacs config via Elapca package manager the (elpaca-use-package) function call is now failing at start-up because a recipe for URL cannot be found. No new packages were added to the fully functional config prior to the update. OK. So how do I find out which of the packages I have installed is the culprit? Using 'emacs --debug-init' is about as useful as a chocolate fireplace. Although I would not consider using any editor other than emacs the paucity of useful information in the package managers' error messaging really p***es me off. JEEZ! The least it should do be able to do is provide information as to WHICH package is failing. Any help on how to go about debugging this would be appreciated. Thx. in advance...

473
 
 

I'm on Emacs 29.1 but would like to use the latest dev version of Eglot rather than the version that is included with Emacs. Can anyone offer any help on how to do this with Elpaca with use-package integration?

474
 
 

Specifically, I want := to show up as ≔ in my buffer, and export as such.

If I do...

(add-to-list 'org-entities-user
             '(":=" "\\coloneq" t "≔" ":=" ":=" "≔"))

I need to add a backslash before the symbol. Is there a way to achieve what I want?

475
 
 

Often times I find doing various commands in org-mode adds/removes whitespace around headings. This can lead to inconsistent whitespace throughout the file. Kind of annoying.

Are there any tools to manage this? Like an auto formatter or something?

view more: ‹ prev next ›