help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: how to insert this?


From: Drew Adams
Subject: RE: how to insert this?
Date: Sat, 24 Nov 2007 12:31:27 -0800

> > Hey, I have see many times lines such as:
> > --8<---------------cut here---------------start------------->8---
> > how to do so?
>
> You can insert it with M-x message-mark-inserted-region RET or
> message-mark-insert-file, are functions in message.el.

If you just want to insert it, then you don't need the message marking done
by `message-*'.

Here are two ways to do what you request:

1. Put the text in a file `cut', then use `C-x i cut' (command
`insert-file').

2. Put the text in a string, then use a command that calls `insert' to
insert it:

(defcustom cut-string
  "--8<---------------cut here---------------start------------->8---\n"
  "My cut string" :type 'string)

(defun insert-cut-string ()
  "Insert `cut-string'." (interactive) (insert cut-string))

If you use this a lot, #2 might be handier. You can bind `insert-cut-string'
to a key.

Learn to fish. Some ways to find out about things like this yourself:

1. Use `C-u C-h a insert RET'. You will see all functions whose names
contain `insert', including `insert-file' and `insert'. To see only names
that begin with `insert', use `C-u C-h a ^insert RET'.

2. Use `C-h f insert TAB TAB'. You will see all functions whose names start
with `insert', including `insert-file' and `insert'. Unlike `C-h a', you
don't see any descriptions, however, and you will not know which are
commands (interactive functions).

3. Use `i' in the Emacs manual (or the Elisp manual), then `insert TAB TAB'.
You will see all index entries related to `insert'. But that is less helpful
in this particular case.







reply via email to

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