Emacs

1927 readers
1 users here now

Our infinitely powerful editor.

founded 5 years ago
MODERATORS
1
 
 

I've been using gptel for a couple of days and it is absolutely bonkers. It is Magit-level of thought out. However I enjoyed relying less on the transient menu, and rather focus on writing my own wrapper functions via gptel-request.

Honestly I've been kind of an AI skeptic until very recently, and gptel in addition to this article were what pushed me over.

2
 
 

As a long time Vimmer, I have recently started using Emacs out of sheer curiosity. I chose Doom Emacs as it has evil-mode enabled by default, and do not want to dive down the rabbit hole of configuring the editor from scratch (at least, not yet!).

After installing and enabling libvterm in Emacs, I am having a frustrating experience. I configured ZSH shell to use vi-mode keybindings which interferes with evil-mode whenever I press Esc or C-[.

After having searched a little, I came across a workaround to disable evil-mode when in vterm. But it is still not a smooth experience. For instance, when switching between buffers (C-w C-w).

I would like to know how others in the community tackled this problem. Is there a better solution to this problem? Or have you made peace with the aforementioned workaround? Or have you stopped using vterm entirely?

3
4
 
 

This release brings a host of user-facing refinements to an already stable base, as well as some impressive new features. There is a lot to cover, so take your time reading these notes.

Special thanks to Jean-Philippe Gagné Guay for the numerous refinements to parts of the code base. Some of these are not directly visible to users, but are critical regardless. In the interest of brevity, I will not be covering the most technical parts here. I mention Jean-Philippe’s contributions at the outset for this reason. Though the Git commit log is there for interested parties to study things further.

5
 
 

cross-posted from: https://lemm.ee/post/27699104

From the NEWS file: Emacs 29.3 is an emergency bugfix release intended to fix several security vulnerabilities described below.

  • Arbitrary Lisp code is no longer evaluated as part of turning on Org mode. This is for security reasons, to avoid evaluating malicious Lisp code.

  • New buffer-local variable 'untrusted-content'. When this is non-nil, Lisp programs should treat buffer contents with extra caution.

  • Gnus now treats inline MIME contents as untrusted. To get back previous insecure behavior, 'untrusted-content' should be reset to nil in the buffer.

  • LaTeX preview is now by default disabled for email attachments. To get back previous insecure behavior, set the variable 'org--latex-preview-when-risky' to a non-nil value.

  • Org mode now considers contents of remote files to be untrusted. Remote files are recognized by calling 'file-remote-p'.

6
1
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
 

(Video on Mastodon)

Inspired by a Reddit post some month ago, I wrote two patches:

  1. titlebar-colors.patch for syncing the colors of the titlebar with the rest of the frame. This uses GtkHeaderbar to allow Emacs to control the colors internally. I haven't gotten the foreground color to sync yet. The changes are done to GTK parts of Emacs and should work for both X and Wayland (pgtk) builds.
  2. rounded-corners.patch to make the shape of frames more consistent with other applications. The changes are made to PGTK parts of Emacs, but should be easily applicable to other places. Right now, it forces a 12 px radius. Ideally, it should just respect the shape of the underlying GtkWindow. This would make it more versatile and automatically change to a square shape in fullscreen (which is currently unimplemented).

The Reddit post mentioned got a lot of attention, but the poster did not provide any code. So I thought some people would find at least the first of these patches useful!

They both have their flaws (poor contrast in most dark themes and forcing 12 px radius, also seems to crash Corfu and possibly more), any help to improve them is much appreciated.

7
8
 
 

this update

  • uses dropdown menu widgets everywhere, and
  • fully implements comment folding widgets.

the readme is also updated to explain these features.

holler if you run into any bugs.

9
10
1
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
 

Hey gang!

So I've used gopass for awhile now, and Emacs for longer.

I was wondering if any of you here interact with gopass via Emacs with auth-source or something similar.

The main reason I ask is because I'm wanting to finally use Emacs for other things, such as an IRC client and making more use of Magit, and even writing with 750words.

A lot of my passwords are stored with gopass, and the structure isn't always the same for stores. For instance:

| Forums
|-- Gentoo
|-- Some other forum
|
| Email Host
|--  [email protected]
|---- password
|---- recovery codes
|
| Employer Name
|-- Some program we use at work
|---- [email protected]
|
| Some app
|-- My User Name

Maybe this structure for a password store is a no-no, though it's not a big deal to move things around.

Any tips? I've seen auth-source-gopass, but that doesn't provide any interaction with selection of passwords or creation of passwords, I think.

I've look at that mentioned library some and writing an auth-source backend doesn't seem too involved, but maybe I don't necessarily have to with auth-source.

EDIT:

A potential configuration that others might use:

(require 'consult)
(require 'auth-source-pass)

(use-package pass
  :requires password-store
  :preface
  (defvar consult:pass-source
    `(:name "Passwords"
      :narrow ?<                     ;; maybe you want something else for narrow?
      :face pass-mode-directory-face ;; maybe you want to use a different face?
      :category pass
      :enabled
      ,(lambda ()
         (auth-source-pass-file-name-p auth-source-pass-filename))
      :items ,#'password-store-list)
    "Consult source for passwords with (go)pass.")

  (defun consult:pass (arg pass)
    "Stolen from Doom Emacs.
https://github.com/doomemacs/doomemacs/blob/master/modules/tools/pass/autoload/consult.el"
    (interactive
     (list current-prefix-arg
           (progn
             (require 'consult)
             (consult--read consult:pass-source
                            :prompt "(Go)Pass: "
                            :sort nil
                            :require-match t
                            :category 'pass))))
    (funcall (if arg
                 #'password-store-url
               #'password-store-copy)
             pass))
  :custom
  (password-store-executable (executable-find "gopass"))
  (auth-source-pass-filename
   (or (getenv "PASSWORD_STORE_DIR")
       (expand-file-name "~/.local/share/gopass/stores/root")))
  :config
  (auth-source-pass-enable))
11
1
lem.el update 0.20 (codeberg.org)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
 

added lots of stuff in this update, some of which may be a little green still.

  • commands to navigate comment trees
    • up to top-level comment
    • prev/next same-level comment
  • various commands to selectively fold (hide) comment branches
    • un/fold current comment
    • un/fold current comment + its children
    • un/fold current comment's entire branch
    • un/fold entire buffer
  • added more sorting/listing drop-down widgets to make it easier to see what sorting is in effect (and to change sorting by mouse)
  • fix tab navigation to (hopefully) all links everywhere
  • make default sorting/listing in views better match the web UI
  • fix sorting options in user view
  • various other fixes

one thing to note is that this release switches the S/s bindings, for consistency.

12
13
 
 

I merged a new source for EMMS yesterday (a backend providing commands like 'emms-add-file' and 'emms-play-file') which reads a beets (https://beets.io) library database using Emacs' built-in SQLite support (beets is a command line program which manages your music library and automatically performs operations like tagging and converting music files; it keeps an SQLite database of tracks).

Since beets library databases already contain metadata about the tracks, this source skips running the default track info initialization function (other track init functions do run though).

On my PC (which is fairly powerful), loading ~1500 tracks (my personal library) into the EMMS cache (including their metadata) takes few minutes, during which Emacs is very annoying to use; this process takes under a second using the beets source.

Another nice feature is the ability to interactively filter chosen tracks (by passing a prefix argument to any beets source command). The filtering is done in two steps:

  1. Choose metadata types to filter by (actually columns in the beets database).

  2. For each metadata type (column) chosen, choose between unique values which appear in that column and which don't correspond only to tracks which have already been filtered by a previous choice.

Both steps use 'completing-read-multiple' (and only allow valid choices).

The source should require no configuration (only tested on Linux though) provided you haven't changed the location of the beets library database, and the source commands are autoloaded.

The source should be available in EMMS 19 (the next version, which should be released soon).

14
15
1
lem 0.19 update (codeberg.org)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
 
  • implement overview (mixed comments + posts) for user views
  • implement unified inbox (mixed replies, mentions, private messages)
  • add communities moderated to user view
  • add sort/listing widgets to browse communities for nice sorting feedback
  • add search current user command
  • add search current community command

I thought it might be nice to add drop-down sort/listing widgets to the top of all feed-based views, roughly similar to the web client, but it seems that the emacs widget library doesn't allow placing multiple menu widgets on the same line. :/

EDIT: turns out it's possible, so i'll add them to the main views.

16
 
 

Some Emacs Lisp to help me populate random information into my Campaign Status document. This delves into the org-element-map function and some querying of information to pick the right elements.

17
 
 

additions:

  • pagination for inbox views (replies, mentions, pms)
  • create communities (basic, no images yet)
  • delete communities (completing)
  • fix view-user-at-point
  • display community's restricted/nsfw status
  • fix next/prev on user search results
18
1
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
 

I recently updated lem.el to 0.12.

The release makes encrypted tokens optional for easier use. If you update and find you can't load lem.el, delete ~/.emacs.d/lem.plstore and log in again. If you want your auth tokens to be encrypted, set lem-encrypt-auth-tokens to non-nil. You'll also need to set plstore-encrypt-to to a GPG key of yours.

19
20
 
 

Hi everyone! I'm looking for help and learning opportunity :) I am improving my emacs configuration following some tutorials, and right now I'm missing something important to understand how keybindings in emacs work. I've read Mickey Petersen blog post about this subject (https://www.masteringemacs.org/article/mastering-key-bindings-emacs), but I can't apply it to my situation.

What I want to achieve

I use general, use-package and evil. I want to use evil keybindings in undo-tree-visualizer-mode to jump between nodes and branches using "j", "k", "h", "l" keys in normal state.

My evil and general config

(use-package evil
  :init      ;; tweak evil's configuration before loading it
  (setq evil-want-integration t) ;; This is optional since it's already set to t by default.
  (setq evil-want-keybinding nil)
  (setq evil-vsplit-window-right t)
  (setq evil-split-window-below t)
  (setq evil-want-C-u-scroll t)
  (setq evil-want-C-i-jump nil)
  (setq evil-respect-visual-line-mode t)
  (setq evil-undo-system 'undo-tree)
  (evil-mode))

(use-package general
  :diminish
  :config
  (general-evil-setup)

What I have tried

  1. Defining keybindings with evil
(with-eval-after-load 'evil-maps
(evil-define-key 'normal undo-tree-visualizer-mode-map (kbd "k") 'undo-tree-visulize-undo)
(evil-define-key 'normal undo-tree-visualizer-mode-map (kbd "j") 'undo-tree-visulize-redo)
(evil-define-key 'normal undo-tree-visualizer-mode-map (kbd "h") 'undo-tree-visulize-switch-branch-left)
(evil-define-key 'normal undo-tree-visualizer-mode-map (kbd "l")
  1. use-package :bind
(use-package undo-tree
  :bind(:map undo-tree-visualizer-mode-map
             ("k" . undo-tree-visualize-undo)
             ("j" . undo-tree-visualize-redo)
             ("h" . undo-tree-visualize-switch-branch-left)
             ("l" . undo-tree-visualize-switch-branch-right))
  :init
  (global-undo-tree-mode 1))
  1. hook-mode
(use-package undo-tree     
  :init     (global-undo-tree-mode 1)     
  :config     
  (add-hook 'udno-tree-visualizer-hook
              (lambda()
              (add-to-list 'evil-previous-visual-line 'undo-tree-visualize-redo))))

I don't get any errors with these solutions, but still it doesn't remap keys as I wish to.

What I am missing here? What is the best approach to rebind these keys to undo-tree-visualizer-mode-map?

Will greatly appreciate help in understanding what I am doing wrong :)

21
1
Emacs 29.2 released (lists.gnu.org)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
22
23
 
 

https://protesilaos.com/emacs/ef-themes-pictures

Theme in picture is ef-summer. I love these so much. They're a breath of fresh air among the other techy-cyber-hacker themes, yknow?

24
1
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
 

updated lem.el lemmy client for emacs.

  • added an action/response/update display system for direct feedback upon executing an action (feature, save, delete, like, create, edit item).
  • added a completing-read system
  • added un/block instances, communities, and users functions.
  • various other fixes.
25
1
Emacs Meetup at CCC (graz.social)
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
 

If any of you are at the Chaos Communication Congress, we're having an impromptu Emacs and Org mode meetup today at 16:00 (in 40 minutes).

Maybe see some of you there :)

view more: next ›