alphapapa / alphapapa/ement.el

[Feature Request] Command to copy message body

Abierto
#171 3 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement good first issue help wanted
Lenguaje dominante
Emacs Lisp
Estrellas
604
Forks
54
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

As discused in #ement.el:matrix.org, it would be nice to have a command to copy a message's body to the kill-ring. e.g.

```emacs-lisp
(defun ement-room-copy-message (pos &optional formatted)
"Copy message at POS to `kill-ring'. POS Defaults to point.
If FORMATTED is non-nil, when called with a prefix argument, retain body formatting.
Otherwise, the plain text message body is copied."
(interactive (list (point) current-prefix-arg))
(or (derived-mode-p 'ement-room-mode) (user-error "Not in an ement room"))
(if-let ((event (ewoc-data (ewoc-locate ement-ewoc pos)))
((equal (ement-event-type event) "m.room.message"))
(content (ement-event-content event))
(body (or (and formatted (alist-get 'formatted_body content))
(alist-get 'body content))))
(ignore (kill-new body))
(user-error "No message at point")))
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.