2010-12-25

emacs delete-selection property

2010-12-25

http://groups.google.com/group/gnu.emacs.help/browse_frm/thread/cd99a3244258f58e#

> > Hope this helps, Ilya
>
> Hope it helped you.  I have my doubts that it helped anyone else.

lol. funny. I see a flamewar brewing, and am getting into the fray here by participating.

I think both Drew and Llya or even me adds good points in the discussion.

The way i see this is a bug is in the sense that the purpose of delete-selection property seems to be thwarted by specific way how emacs works. Namely, the final effect is that it makes a distinction on whether the command is invoked by M-x or by a hotkey.

so, i tend to see this is not a desired behavior (call it “bug” or “feature” or “design” or whatnot).

but overall i guess this is trivial? It would be fruitful if someone do a survey on how many functions actually use the delete-selection property, or if some emacs oldbie can tell us that property's history. Am guessing, these days, if elisp programer want the behavior of deleting existing text selection in commands they write, a reliable and easy and explicit way is simply to put in the code

  (when (region-active-p)
    (delete-region (region-beginning) (region-end) )
    )

instead of relying on delete-region property. I think elisp function property is rather esoteric (e.g. it is not a feature in most langs, and i don't think it is that much widely known or used in elisp) I think i learned about it when diddling with cua-mode around 2007. The fact i learned it i think introduced more trouble, because otherwise i'd put the explicit code above and i wouldn't have posted this or the bug report. (does anyone know a list of all built-in lisp properties? (havn't spend any effort to search the manual...))

i think a good question is: from a core emacs developer's point of view (such as Richard Stallman, or perhaps Drew Adamns and Llya Z. who designed the system or know the core system well), would you advice to actually make use of the delete-selection proprety or just use the explicit code above?

Xah

No comments:

Post a Comment