unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Grant Rettke <gcr@wisdomandwonder.com>
To: glyn.millington@gmail.com
Cc: Emacs Help <help-gnu-emacs@gnu.org>
Subject: Re: Email "cut here" code snippets
Date: Fri, 30 Jan 2015 16:01:59 -0600	[thread overview]
Message-ID: <CAAjq1mfP4Fd3wnqTA0iLofNEn5GyhrCzyn0Ca4KUAoNgOtgzew@mail.gmail.com> (raw)
In-Reply-To: <87egqdogsl.fsf@nowhere.org>

Me, too.

(defun gcr/chs ()
  "Insert opening \"cut here start\" snippet."
  (interactive)
  (insert "--8<---------------cut here---------------start------------->8---"))

(defun gcr/che ()
  "Insert closing \"cut here end\" snippet."
  (interactive)
  (insert "--8<---------------cut here---------------end--------------->8---"))

One more person confesses and one of us will turn it into a package.

On Thu, Jan 29, 2015 at 7:30 AM, Glyn Millington
<glyn.millington@gmail.com> wrote:
> torys.anderson@gmail.com (Tory S. Anderson) writes:
>
>> I use GNUs and notice that some people include "---8<-- cut here" type
>> snippets, which are specially formatted in my view. Where can I find
>> this behavior documented, and is there a predefined shortcut for
>> inserting these? I haven't spotted anything on it in the GNUs manual or
>> online searches.
>
> I have had this in my init.el/.emacs for ever!  It's not mine and I can't
> remember where it came from but it works
>
>
>
> ;;;; SCISSORS
> (defvar scissors "8<------"
>   "string to insert in \\[scissors]")
>
> (defun scissors ()
>   "Insert a line of SCISSORS in the buffer"
>   (interactive)
>   (or (bolp) (beginning-of-line 2))
>   (while (<= (current-column) (- (or fill-column 70) (length scissors)))
>     (insert scissors))
>   (newline))
>
> (bind-key "s-s" 'scissors)
>
>
> hth
>
>
> Glyn
>
>



-- 
Grant Rettke
gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson



  reply	other threads:[~2015-01-30 22:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 12:06 Email "cut here" code snippets Tory S. Anderson
2015-01-29 13:26 ` Rainer M Krug
     [not found] ` <mailman.18902.1422538022.1147.help-gnu-emacs@gnu.org>
     [not found]   ` <mailman.18902.1422538022.1147.help-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2015-01-29 13:28     ` Sebastien Vauban
2015-01-29 13:30 ` Glyn Millington
2015-01-30 22:01   ` Grant Rettke [this message]
2015-01-29 13:46 ` Marcin Borkowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAjq1mfP4Fd3wnqTA0iLofNEn5GyhrCzyn0Ca4KUAoNgOtgzew@mail.gmail.com \
    --to=gcr@wisdomandwonder.com \
    --cc=glyn.millington@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).