[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to add button to emacs that play a elisp code

From: Alex Kost
Subject: Re: how to add button to emacs that play a elisp code
Date: Tue, 16 Sep 2014 08:55:15 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Emanuel Berg (2014-09-16 02:45 +0400) wrote:

> Alex Kost <address@hidden> writes:
>> A comment to your hint.
>> As you are using Gnus, you may just attach your elisp
>> file (or buffer) to make it be highlighted inline:
>> "C-c RET f" (or "C-c RET b") and choose
>> "application/emacs-lisp" type.
> I'm using Gnus - but I'm not the one reading the post.
> How will that make it look for people not using Gnus?

I don't know (and I don't care actually), but I think attachments should
be recognized by any client.

> I like to have my posts totally client-agnostic. But if
> it doesn't bloat the post with too much
> incomprehensible metadata for the non-Gnuser, I'll
> consider it - why not encourage people to switch to
> Gnus?
> OK - here is the attached Elisp:
> Wait - `C-c RET' is undefined, it says.
> Do you mean I (or any Gnuser reading such messages)
> should use your keystrokes in message-mode to get the
> highlight? But there, `C-c RET' is `gnus-article-mail'!
> What are the names of the commands?

Not in `gnus-article-mode'.

I mean those are the default keybindings for making attachments in
message-mode.  But they are available only if you use additional
functionality provided by Gnus, i.e. with:

  (setq mail-user-agent 'gnus-user-agent)

(Assuming that you use `compose-mail' command for making a new message).
Or you can just try "M-x gnus-msg-mail" instead.

Those commands are: `mml-attach-file' and `mml-attach-file'.

>> Another way is including org source blocks.
> You mean like this:
> #+BEGIN_SRC emacs-lisp
>   (defun org-xor (a b)
>      "Exclusive or."
>      (if a (not b) b))
> Org manual example from:
> I have the same concerns for that method, but let's see
> how that works, as well.

This elisp block is properly highlighted for me.  If org blocks are not
highlighted for you, try:

(setq org-src-fontify-natively t)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]