Subject: Re: bug#12217: [PATCH] Re: 24.2.50; append-to-register: Provide a convenient key binding

From: Jambunathan K <[email-masked]>
Date: Sun, 09 Sep 2012 14:15:32 +0530

Andreas Schwab <[email-masked]> writes:

> Jambunathan K <[email-masked]> writes:
>
>> I have introduced an extra indirection via a `separator-register'
>> (which is nil by default) Now what gets used as a separator - a
>> newline, a double newline, a comma or a tab - is under user control.
>
> Why the extra indirection?  Why not just make it a string and use it
> directly?

In short, Function before form and it is also about some workflows being
less intrusive than others.

Let's look at some use-cases.

Use-case-1 (A concrete one)

    I find myself collecting sexps.  (This is going to happen more as I
    plan to explore more new codebases.)

    When I look at existing code - with an intention to prepare some
    patch - I find myself collecting recipes from 2 or 3 places.  I then
    "insert" it in to target location and put them together.  Since the
    recipes are collected from 2 or 3 places, they need to be visually
    separated.  Going forward I will store "double newline" (read
    paragraph) as separator for these recipe blocks.

    Note: Org exporters are moving to new framework.  Now when I am
    re-implementing some features in my (own) org-e-odt.el, I find
    myself collecting recipes from org-export.el, org-e-latex.el and
    felt sorry that the sexps are not visually separated.

Use-case-2 (Contrived one)

    Now let's say I am a language learner and I am looking at a French
    article from within Emacs.  As I read through the article, I see
    some words that need to be looked up.  Instead of immediate lookup,
    I may store the word or a phrase in a register and later insert in
    to my language notes for further refinement.  In this case, I may
    want to separate them with a newline or even better something like
    an Org-table.

    In that case, in my scratch buffer I will type something like this
    in scratch buffer, C-x r s + it and then collect away.  I can then
    paste that in to my Notes buffer and then re-align it using Org.

    --8<---------------cut here---------------start------------->8---
    |
    |
    --8<---------------cut here---------------end--------------->8---

    This is how the collected table looks like

    ,----
    | Now|
    | |looked|
    | |immediate|
    | |further
    `----

A string or a separator register
================================

It is easy for me to do "C-x r s" a separator rather to do a "M: (setq
separator "")".  There is lesser context switch.  A separator register
"guarantees" that the words are separated.  This frees one from
remembering to store the surrounding separator and just focus on
collection process.

> Andreas.