all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* message, can't find basic stuff [Elisp]
@ 2021-02-20  1:12 Emanuel Berg via Users list for the GNU Emacs text editor
  2021-02-20  9:23 ` Philip Kaludercic
  0 siblings, 1 reply; 5+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-02-20  1:12 UTC (permalink / raw)
  To: help-gnu-emacs

I just answered a question on gmane.emacs.gnus.general but had
to write a lot more code than I thought.

Is there really no - argh, just read the code, the questions
are in the comments :)

(require 'message)

;; is there really no function like this already?
(defun message-set-header (hdr val)
  (interactive "sheader: \nsvalue: ")
  ;; check here if there _is_ such a header - how?
  ;; also a must-have, super-simple building-block from the holster
  ;; but can't find it either
  (message-position-on-field hdr)
  (message-beginning-of-line)
  (delete-region (point) (point-at-eol))
  (insert val) )
;; test: 
;; (message-set-header "Subject" "Lara loves YOU")

(defun message-transpose-headers (hdr1 hdr2)
  (interactive "sheader 1: \nsheader 2: ")
  (let ((v1 (message-field-value hdr1))
        (v2 (message-field-value hdr2)))
    (message-set-header hdr1 v2)
    (message-set-header hdr2 v1) ))
;; test:
;; (message-transpose-headers "To" "Subject")

https://dataswamp.org/~incal/emacs-init/gnus/message-incal.el

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-21  4:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-20  1:12 message, can't find basic stuff [Elisp] Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-20  9:23 ` Philip Kaludercic
2021-02-20 18:44   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-20 19:04     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-02-21  4:50       ` Emanuel Berg via Users list for the GNU Emacs text editor

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.