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

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

Re: Replacing huge hidden selection when pasting text


From: Pascal J. Bourguignon
Subject: Re: Replacing huge hidden selection when pasting text
Date: Fri, 25 Dec 2015 02:18:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Alexandre Oberlin <alxobr@gmail.com> writes:

> Hello,
>
> Thanks Drew for your understanding. I don’t think I lost much data this
> time because I automatically perform the awfully outdated rcs (hopefully
> nobody tries to "maintain" rcs to make it behave like a Microsoft
> application!) and also have some backup strategy. This time I simply lost
> about two hours, but I am still under this threat and might have other
> files corrupted without having noticed.
>
>> But if you can describe what you did in more detail it would help.
> No problem:
> C-y
> C-x C-s
> No prompt, no auto-saved copy, no warning whatsoever: farewell!

For example, try it with:

     emacs -q

As I wrote, by default emacs binds C-y to yank: it doesn't even have a
delete-region-and-yank, you have to program it yourself (or one of the
third-party modes you're using).

> What is still worse is that this does not even happen consistently (only
> say 50% of the times). The behavior is affected by repeatedly setting the
> mark (C-space). 

Again, this is clearly explained by customizations you've done, not by
the behavior of emacs which is perfectly safe.  You can test it
yourself: 

    - type something
    - C-@ C-a
    - M-x yank RET

and see how the kill buffer is INSERTED without replacing the text in
the region.


> Just reading the help for such a simple command as
> (set-mark-command ARG) is a mere piece of fun. Don’t Emacs
> developers/maintainers understand that an editor is to be USED by USERS,
> not constantly modified and absurdly complicated by people trying to show
> up their skills?

But try to put yourself in the shoes of programmers who want to be able
to modify their program to their taste and needs!  We need to have
programming documentation of each function in that software to be able
to use them in your modifications and additions!

In any case, you don't get a say about it: we're the programmers.  If
you're not happy with that, you can always write your own software.  (Or
pay Microsoft to do that, and pray they won't use it to spy you).


Oh, I seem to see what's your problem with the documentation of
set-mark-command; this sentence:

    … this is the closest equivalent in
    Emacs to what some editors call the "selection".


It should have been:

    … the closest equivalent in what word processors implemented ten or
    twenty years after emacs was developed, would be the "selection".

Perhaps you should read the emacs user manual instead of the
programmer's documentation; if it's correctly installed, you may access
it by typing C-x C-e after each expressions here:

(info "(emacs) Mark")
(info "(emacs) Killing")

Notably in the Killing section, you have two different subsections for:

    (info "(emacs) Deletion and Killing")
    (info "(emacs) Yanking")

emacs doesn't delete anything when it yanks.


Unless again, you've explicitely asked it by programming the
delete-region-and-yank command I shown you earlier, or you are using a
3rd-party mode or library than installs it for you.

You can verify what command will be executed by your key typing:

    C-h k  <key>


    C-h k  C-y
should give you the help page for yank:
"yank is an interactive compiled Lisp function in `simple.el'. …"

You should take note of the mode the buffer's in when you don't have C-y
bound to yank, and then you can complain about that mode, but not about
emacs.

-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk




reply via email to

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