Emacs

333 readers
1 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 2 years ago
MODERATORS
451
 
 

If you would have the power to change any Emacs-default setting, what would that be and why?

What kind of setting do you think would be useful for a lot (or a majority) of Emacs-users?

One of my examples:

(fido-vertical-mode t)

Because seeing a list of candidates as you type and being able to choose from it with meaningful key-bindings is way more convenient and efficient than the tab-completion-system (I think this claim is backed by the way all those external packages work; helm, ivy, vertico). This is especially suited for a default because you can still use the tab-completion-system with it. So nobody needs to change habits.

452
 
 

https://preview.redd.it/3b3y02w548tb1.png?width=571&format=png&auto=webp&s=974ad5d713deaf96eaa6f6011e80841ad2f306bb

The code relevant to the issue on my config is as follows (sorry for my dumb elisp skills, I'm still quite new to the editor). Lots of thanks in advanced and I hope I have provided the necessary snippets of code.

The config of the base org pkg:

(use-package org
  :mode ("\\.txt\\'" . org-mode) ;; Org Mode Everywhere
  :gfhook
  ;; #'org-indent-mode
  #'visual-line-mode
  #'logos-focus-mode
  :general
  (:states 'normal :keymaps 'org-mode-map :prefix ","
           "e" '(org-edit-src-code :which-key "edit org src block")
           "s" '("headings" . consult-org-heading)
           "c" '(:ignore t :which-key "literate calc")
           "cr" '("calc eval line" . literate-calc-eval-line)
           "cb" '("calc eval buffer" . literate-calc-eval-buffer)
           "d" '(:ignore t :which-key "denote")
           "dc" '("open or create note" . denote-open-or-create)
           "dl" '("link or create note" . denote-link-or-create)
           "t" '("tangle file" . org-babel-tangle)
           "i" '(:ignore t :which-key "insert")
           "ih" '("insert heading" . org-insert-heading)
           "il" '("insert link" . org-insert-link))
  (org-src-mode-map
   "C-," '("exit org src editing" . org-edit-src-exit))
  :custom
  (org-return-follows-link t)
  (org-ellipsis " ▾")
  (org-hide-emphasis-markers t)
  (org-pretty-entities t)
  (org-auto-align-tags nil)
  (org-special-ctrl-a/e t)
  (org-catch-invisible-edits 'show-and-error)
  (org-src-preserve-indentation t)
  (org-confirm-babel-evaluate nil)
  (org-startup-with-inline-images t)
  (org-startup-folded t))

The org-modern pkg:

(use-package org-modern
  :config
  (setq org-modern-hide-stars nil
	org-modern-list '((?* . "•")
                          (?+ . "‣")))
  (defun setup/org-correct-src-face ()
    (interactive)
    (dolist (org-src-face '(org-block-begin-line
			    org-block-end-line))
      (set-face-background org-src-face (face-attribute 'mode-line :background)))
    (dolist (org-src-face '(org-block-begin-line
			    org-block-end-line))
      (set-face-attribute org-src-face nil :font oci-variable-pitch-font)))
  (global-org-modern-mode))

(use-package org-modern-indent
  :elpaca '(org-modern-indent :host github :repo "jdtsmith/org-modern-indent")
  :ghook ('org-indent-mode-hook #'org-modern-indent-mode))

(elpaca-wait)

The config of my faces:

(defun setup/org-headings ()
  (interactive)
  (dolist (face '((org-level-1 . 1.2)
		  (org-level-2 . 1.1)
		  (org-level-3 . 1.05)
		  (org-level-4 . 1.0)
		  (org-level-5 . 1.1)
		  (org-level-6 . 1.1)
		  (org-level-7 . 1.1)
		  (org-level-8 . 1.1)
		  (org-document-title . 1.2)))
    (set-face-attribute (car face) nil
			:font oci-heading-font
			:weight 'bold
			:height (cdr face))))

(defface org-checkbox-done-text
  '((t (:strike-through t :inherit 'variable-pitch)))
  "Face for the text part of a checked org-mode checkbox.")

(font-lock-add-keywords
 'org-mode
 `(("^[ \t]*\\(?:[-+*]\\|[0-9]+[).]\\)[ \t]+\\(\\(?:\\[@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?\\[\\(?:X\\|\\([0-9]+\\)/\\2\\)\\][^\n]*\n\\)"
    1 'org-checkbox-done-text prepend))
 'append)
453
454
 
 

Hi there,

I am a big user of GMail's "Scheduled Send" feature. It allows me to reply at my pace and make sure the thread does not become a ping-pong match and replies won't come back earlier than expected.

How to do that "on my own"? I use notmuch + msmtp (within emacs) to handle most of my email but like half of it I have to manage via Gmail's web interface because of the scheduling needs.

I know about msmtp-queue but it is a all or nothing solution. I would love to be able to schedule my emails, either at Emacs level or SMTP level, with some header or something.

Any ideas?

455
456
457
 
 

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?

458
 
 

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.

459
 
 

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!

460
 
 

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.

461
 
 
462
 
 

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)?

463
 
 

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!

464
 
 

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!

465
466
467
 
 
468
 
 
  (use-package marginalia
  :straight t
  :bind (:map minibuffer-local-map
           ("M-A" . marginalia-cycle))
  :init
  (marginalia-mode))

469
 
 

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?

470
471
 
 
472
 
 

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.

473
 
 

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.

474
 
 

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.

475
view more: ‹ prev next ›