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

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

Re: Another Emacs incompatibilty


From: Emanuel Berg
Subject: Re: Another Emacs incompatibilty
Date: Tue, 25 Aug 2020 06:30:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Drew Adams wrote:

>>>> Is it currently possible, if d-s-m is active, to
>>>> easily retrieve the deleted/replaced item?
>>>
>>> Yes, on a per-command basis.
>> 
>> OK, I have an idea for a rule guys, whenever
>> someone asks if something is possible, please do
>> not just answer "yes" whenever it is, also show
>> how one is suppose to actually do it :)
>
> FWIW, I didn't only offer that one-liner in
> that msg.

One-liners are enough (preferable, even) if they show
how to do it.

> (put 'insert-char 'delete-selection t)

OK, so that's the syntax. This must be a very arcane
way of configuration. I did use `put' but only to
enable and disable, as in

  (put 'help-for-help 'disabled t)

But, what are properties and how do I know what
properties a function has?

And how do I write a function with properties? (I
don't think I want to, in general, but I always want
to do things I didn't do, at least once...)

> Or if you instead want `insert-char' to kill the
> selected text (so you can later yank it) instead of
> just deleting it, add this to your init file, to
> override the default behavior:
>
>   (put 'insert-char 'delete-selection 'kill)

`insert-char'? Sure, that's ONE way to insert, but
there are many other ways to insert things, and not
just a single char, and then (if you desire this
functionality to begin with, that is) then you
_always_ want the selection to be killed, I think is
the objective here?

Anyway, I don't get it to work:

  (delete-selection-mode) ; t
  (put 'insert-char 'delete-selection 'kill) ; kill
  I type this
  set-mark-command
  beginning-of-line
  set-mark-command
  s ("I type this" disappears, the letter s appears)
  yank
  "I type this" does NOT appear

?

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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