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
101
 
 

Hello fellow Emacs enthusiasts,

I'm reaching out to see if there's anyone here who's successfully integrated a modern development environment within Emacs for Python programming. Specifically, I'm interested in a setup that incorporates eglot, tree-sitter and company.

I've encountered a significant issue: whenever I enable python-ts-mode, Emacs consumes all my system's memory and crashes. While I've managed to use a more basic setup that limits tree-sitter to syntax highlighting only, I can't shake the feeling that I'm missing out on some great functionality.

To help with investigation:

  • I am running on a Mac
  • The bare minimum to reproduce this problem is on the following gist: https://gist.github.com/hnarayanan/a6397d6723fce19e2802d4305071e611
  • I happen to use Emacs from MacPorts, but to double-check, I also attempted to download it from https://emacsformacosx.com and it crashed in the same way
  • This seems to happen independent of the language server used in the backend. I intend on using python-lsp-server, but it fails even if I don't have it installed.

Has anyone faced a similar problem and found a solution? Perhaps I am doing something very wrong with my config? I'm eager to learn from your experiences and would greatly appreciate any advice or tips you can offer.

Thank you!

102
103
104
 
 

Calc'c elisp functions (imho) all have the prefix calcFunc-. So in order to use a calc function like vlen in an org table lisp formula, one could use calcFunc-vlen. That's nice.

What bothers me is the lack of "on-line" documentation (i.e. usable with eldoc or completion frameworks).

All calc functions are nicely documented here: https://www.gnu.org/software/emacs/manual/html_mono/calc.html , thats good.

It is possible to modify a elisp's function documentation. e.g. like so:

(put 'calcFunc-vlen 'function-documentation
     "Computes the length of a vector.
The length of a non-vector is considered to be zero.
Note that matrices are just vectors of vectors for the purposes of this command.")

Now calcFunc-vlen would have a nice "on-line" documentation, usable with C-h f, autocompletion and eldoc.

Has anyone already bothered to gather some of those strings from the manual, in a more machine processable form? So I could save some work to create "on-line" documentation of the calc functions?

105
 
 

Hi all,

I am using native Emacs build for Android.

Is there a way to send notification from my Emacs app to Android using some package?

Has anyone found a way or a workaround?

106
 
 

Im looking at the org babel WORG webpage on running shell code and it says there that we can run shell command asynchronously. However, when I try some of the examples in my machine, the async is completely ignored. Am I supposed to install something else?

107
108
 
 

I talked to someone about the extensibility of emacs, but the person I was speaking to assumed that any IDE is just as extensible by using Plug Ins.

Without turning the conversation into a university style lecture, what is one or two simple actions I can do in emacs to show someone what separates it from other IDES.

109
 
 

Hi,

I am not sure if many people are using alerts for the appointments, I do, I like the behavior where it brings Emacs to the front and shows a message in the mini buffer. However, when I am quickly writing in another application I sometimes end up writing in the active buffer. I am contemplating creating a function which puts the buffer in read only mode before showing switching to Emacs, if it was not already Read Only, and restores it when the reminder disappears. That should be enough to avoid accidental writing.

Before I embark in that task I would like to know if anybody has done anything like that, or any other creative ideas to avoid contaminating the current buffer.

Thanks!

110
111
112
 
 
113
114
 
 
115
 
 
116
 
 

Hi, I’ve been banging my head against something and I figured I’d ask for help.

I open files over tramp and use a remote login machine to do that. Said login machine is shared by many people and thus I can’t run a language server on it. I’d like to use eglot but don’t want to run the language server on it.

I’ve been trying to either run the language server on a computer machine (another remote one) or on my local Mac (Mac would be preferable).

Has anyone managed to point a language server running on a local Mac to files over ssh?

117
 
 

Just as C-x C-e evaluates ELisp code, this ±10min Youtube video shows how C-x C-j evaluates inline Java code to build a gallery app.

This is done with Emacs slurping text from any buffer and barfing it into the standard Java repl, run in a background process. These phases are glued together using the repl-driven-development.el package.

118
 
 

A "I just want no input lag no matter how many packages I install. Its a frigging editor after all!! Is that too much to ask??"

B "Yes. (it's an OS btw)"

A "Sigh."

119
 
 

I would like to share a code snippet designed to simplify the task of opening Vertico/Consult/Embark or Ivy/Counsel candidates in a new Emacs tab.

The generic function that opens candidates in a new tab

This function below, tab-new-func-buffer-from-other-window, is designed to open the buffer generated by a specified function (func) in the other window and subsequently create a new tab. It also ensures that the state of the original window and tab is preserved.

;; License: MIT
;; Author: James Cherti
;; Latest version: https://www.jamescherti.com/emacs-open-vertico-consult-ivy-counsel-candidate-new-tab/

(defun tab-new-func-buffer-from-other-window (func)
  "Open the buffer created by the FUNC function in the other window in a new tab."
  (let* ((original-tab-index (1+ (tab-bar--current-tab-index)))
         (original-window (selected-window)))
    ;; Save the state of the other window
    (other-window 1)
    (let* ((other-window (selected-window))
           (other-window-buf (current-buffer))
           (other-window-point (point))
           (other-window-view (window-start)))
      ;; Move back to the original window
      (other-window -1)

      ;; Call the specified function (e.g., embark-dwim, ivy-call...)
      (funcall func)

      ;; Switch back to the other window
      (other-window 1)
      (unless (eq (selected-window) original-window)
        (let* ((preview-buf (current-buffer)))
          ;; Create a new tab and switch to the preview buffer
          (tab-bar-new-tab)
          (switch-to-buffer preview-buf)

          ;; Go back to the original tab
          (tab-bar-select-tab original-tab-index)

          ;; Restore the state of the other window
          (select-window other-window)
          (switch-to-buffer other-window-buf)
          (goto-char other-window-point)
          (set-window-start nil other-window-view)

          ;; Switch to the original window
          (select-window original-window))))))

Option 1: Open Vertico, Consult, and Embark candidate in a new tab (embark-dwim)

For users of Vertico/Consult/Embark, the following function utilizes the generic function tab-new-func-buffer-from-other-window to open the default Embark action buffer in a new tab:

(defun tab-new-embark-dwim ()
  "Open embark-dwim in a new tab."
  (interactive)
  (tab-new-func-buffer-from-other-window #'embark-dwim))

You can add the following key mapping to Vertico:

(keymap-set vertico-map "C-t" #'tab-new-embark-dwim)

For Emacs Evil users, you can also add the following mappings:

(evil-define-key '(insert normal) vertico-map (kbd "C-t") 'tab-new-embark-dwim)

Option 2: Open Ivy, Counsel candidates in a new tab (ivy-call)

For users of Counsel/Ivy, the following function utilizes the generic function tab-new-func-buffer-from-other-window to open the buffer opened by ivy-call in a new tab:

(defun tab-new-ivy-call ()
  "Open ivy-call in a new tab."
  (interactive)
  (tab-new-func-buffer-from-other-window #'ivy-call))

You can add the following key mapping to ivy-minibuffer-map:

(keymap-set ivy-minibuffer-map "C-t" #'tab-new-ivy-call)

For Emacs Evil users, you can also add the following mappings:

(evil-define-key '(insert normal) ivy-minibuffer-map (kbd "C-t") 'tab-new-ivy-call)

Links

120
 
 

I am trying to install ement.el with the following config

#+begin_src emacs-lisp
  (use-package ement
    :elpaca (:host github :repo "alphapapa/ement.el"))
#+end_src

When the config is loaded I get the error as follows. There are no network issues.

ement [GNU-devel ELPA|GNU ELPA]
Matrix client

source: GNU-devel ELPA
url:    https://elpa.gnu.org/packages/ement.html
menu item:
( :package   "ement"
  :repo      "https://github.com/alphapapa/ement.el.git"
  :local-repo "ement"
  :files    
  (:defaults "*" (:exclude ".git")))
recipe:
( :package   "ement"
  :host      github
  :repo      "alphapapa/ement.el"
  :local-repo "ement"
  :files    
  (:defaults "*" (:exclude ".git"))
  :protocol  https
  :inherit   t
  :depth     nil)
dependencies: ?
dependents: ?
commit:  
statuses:
  (failed cloning reclone cloning queued)

121
 
 

I see theres an android version of gui emacs as of version 30.1, but would I be able to run it within the quest 3? Which limitations would I run into? Could I run pdf tools and the latex preview feature in auctex? Would i be able to download stuff from melpa?

122
 
 

0

hi all,

I installed emacs using

  • brew install --cask emacs

when I launch Emacs from the terminal with

  • emacs

None of the keystrokes respond in emacs and all show up in the terminal window.

I'm running:

  • Macbook pro m3 max
  • Sonoma 14.1 (23B2073)

Never had this problem when emacs was previously installed on my macs. Any ideas on what the issue might be?

thank you

123
 
 

I'm running into an issue where Emacs (Spacemacs if relevant) would complain about invalid UTF-8 characters in the temp file buffer that was generated when saving a file I was editing with EPA. Telling me to select a fallback coding system.

These default coding systems were tried to encode the following problematic characters in the buffer ‘ *temp file*’:

  Coding System           Pos  Codepoint  Char

  utf-8                     1  #x3FFF84   �  
...

I don't think this makes sense, obviously the encrypted file would have bad UTF-8 characters but why would Emacs complain about this? This file is an org-mode file that was encrypted with GPG. The warning pops up reliably a few seconds after I save, and sporadically when I'm editing. It is making it unusable because it pops up even after I select an option.

Any suggestion on where I could even begin to try fixing this?

124
 
 

The Commit Mono font has a feature that it calls "smart kerning". Monaspace has a similar feature that it calls "texture healing." Characters are moved around slightly, or swapped out for a slightly larger or smaller character to even out the spacing, for example, when a wide character like an 'm' is followed by a narrow character like an 'l'.

The effect looks nice on their web sites. It worked in VSCode, but not in Emacs. The "smart kerning" / "texture healing" features did not seem to be activated when I tried the fonts in Emacs.

How would I get this to work in Emacs? The Monaspace docs say you have to add "'calt'" to "editor.ligatures" in the VSCode Settings. Commit Mono just worked without changing the settings.

I might end up hating the moving around, but I'd have to try it for a few hours to see. I'm just not sure how to set that up in Emacs, or if Emacs supports that sort of thing.

125
view more: ‹ prev next ›