all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Selection region and delete
@ 2012-07-23 12:01 Juha Nieminen
  2012-07-23 15:24 ` Barry Margolin
  0 siblings, 1 reply; 22+ messages in thread
From: Juha Nieminen @ 2012-07-23 12:01 UTC (permalink / raw)
  To: help-gnu-emacs

In older versions of emacs (when running from X) it used to be that if
you had selected a region and pressed the delete key, it removed the
selected region. Now it just works as if no selection had been made
(ie. it just removes the character at the cursor).

I'm too accustomed to the old behavior. How to restore it?


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-23 12:01 Selection region and delete Juha Nieminen
@ 2012-07-23 15:24 ` Barry Margolin
  2012-07-23 15:52   ` Juha Nieminen
  0 siblings, 1 reply; 22+ messages in thread
From: Barry Margolin @ 2012-07-23 15:24 UTC (permalink / raw)
  To: help-gnu-emacs

In article <jujefg$ti$1@speranza.aioe.org>,
 Juha Nieminen <nospam@thanks.invalid> wrote:

> In older versions of emacs (when running from X) it used to be that if
> you had selected a region and pressed the delete key, it removed the
> selected region. Now it just works as if no selection had been made
> (ie. it just removes the character at the cursor).
> 
> I'm too accustomed to the old behavior. How to restore it?

Customize the variable delete-selection-mode.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-23 15:24 ` Barry Margolin
@ 2012-07-23 15:52   ` Juha Nieminen
  2012-07-23 19:59     ` Peter Dyballa
                       ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Juha Nieminen @ 2012-07-23 15:52 UTC (permalink / raw)
  To: help-gnu-emacs

Barry Margolin <barmar@alum.mit.edu> wrote:
> In article <jujefg$ti$1@speranza.aioe.org>,
> Juha Nieminen <nospam@thanks.invalid> wrote:
> 
>> In older versions of emacs (when running from X) it used to be that if
>> you had selected a region and pressed the delete key, it removed the
>> selected region. Now it just works as if no selection had been made
>> (ie. it just removes the character at the cursor).
>> 
>> I'm too accustomed to the old behavior. How to restore it?
> 
> Customize the variable delete-selection-mode.

To what? And how?

There's already a "'(delete-selection-mode t)" under the
"(custom-set-variables" in my .emacs, and it has no effect on this.

If I do a M-x describe-variable delete-selection-mode, it says
"It is void as a variable."

If I add the line "(setq delete-selection-mode t)" to my .emacs,
then describe-variable says "Its value is t", and if I use nil instead
of t it says it's nil. In none of these cases does the delete key
function properly.

If I select the region with the mouse, then the delete key removes the
region. If I select the region with the keyboard (using shift) and press
shift-del, then it removes the region. However, if I select the region
using the keyboard and press just delete, it doesn't work.

The last one of those cases happens to be the most usual way I use to
delete a region, and it used to work.

I have been searching for information on this for over an hour, and I cannot
find the solution. Even gnu's own documentation says that by setting
delete-selection-mode to 1 it should work, but it doesn't.


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-23 15:52   ` Juha Nieminen
@ 2012-07-23 19:59     ` Peter Dyballa
  2012-07-23 20:05     ` jpkotta
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 22+ messages in thread
From: Peter Dyballa @ 2012-07-23 19:59 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org List


Am 23.07.2012 um 17:52 schrieb Juha Nieminen:

> Even gnu's own documentation says that by setting
> delete-selection-mode to 1 it should work, but it doesn't.

For me it works. Did you perform your tests in a GNU Emacs launched with -Q? Either in its *scratch* buffer you can set delete-selection-mode to t or through the customisation interface and make the new setting active for this session.

--
Greetings

 Pete

There are three types of people in this world: those who can count, and those who cannot.




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-23 15:52   ` Juha Nieminen
  2012-07-23 19:59     ` Peter Dyballa
@ 2012-07-23 20:05     ` jpkotta
  2012-07-23 20:17       ` Peter Dyballa
  2012-07-24  7:16       ` Juha Nieminen
       [not found]     ` <mailman.5453.1343073582.855.help-gnu-emacs@gnu.org>
  2012-07-25  6:11     ` Juha Nieminen
  3 siblings, 2 replies; 22+ messages in thread
From: jpkotta @ 2012-07-23 20:05 UTC (permalink / raw)
  To: help-gnu-emacs

On Monday, July 23, 2012 10:52:47 AM UTC-5, Juha Nieminen wrote:
> Barry Margolin &lt;barmar@alum.mit.edu&gt; wrote:
> &gt; In article &lt;jujefg$ti$1@speranza.aioe.org&gt;,
> &gt; Juha Nieminen &lt;nospam@thanks.invalid&gt; wrote:
> &gt; 
> &gt;&gt; In older versions of emacs (when running from X) it used to be that if
> &gt;&gt; you had selected a region and pressed the delete key, it removed the
> &gt;&gt; selected region. Now it just works as if no selection had been made
> &gt;&gt; (ie. it just removes the character at the cursor).
> &gt;&gt; 
> &gt;&gt; I&#39;m too accustomed to the old behavior. How to restore it?
> &gt; 
> &gt; Customize the variable delete-selection-mode.
> 
> To what? And how?
> 
> There&#39;s already a &quot;&#39;(delete-selection-mode t)&quot; under the
> &quot;(custom-set-variables&quot; in my .emacs, and it has no effect on this.
> 
> If I do a M-x describe-variable delete-selection-mode, it says
> &quot;It is void as a variable.&quot;
> 
> If I add the line &quot;(setq delete-selection-mode t)&quot; to my .emacs,
> then describe-variable says &quot;Its value is t&quot;, and if I use nil instead
> of t it says it&#39;s nil. In none of these cases does the delete key
> function properly.
> 
> If I select the region with the mouse, then the delete key removes the
> region. If I select the region with the keyboard (using shift) and press
> shift-del, then it removes the region. However, if I select the region
> using the keyboard and press just delete, it doesn&#39;t work.
> 
> The last one of those cases happens to be the most usual way I use to
> delete a region, and it used to work.
> 
> I have been searching for information on this for over an hour, and I cannot
> find the solution. Even gnu&#39;s own documentation says that by setting
> delete-selection-mode to 1 it should work, but it doesn&#39;t.

<delete> is bound to delete-forward-char by default.  The help for that command mentions the delete-active-region variable.  It only has an effect if transient mark mode is enabled, and it sounds like you want it set to t (t is the default).  I couldn't see the difference between activating and deactivating delete-selection-mode either.


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-23 20:05     ` jpkotta
@ 2012-07-23 20:17       ` Peter Dyballa
  2012-07-24  7:16       ` Juha Nieminen
  1 sibling, 0 replies; 22+ messages in thread
From: Peter Dyballa @ 2012-07-23 20:17 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org List


Am 23.07.2012 um 22:05 schrieb jpkotta:

> It only has an effect if transient mark mode is enabled, and it sounds like you want it set to t (t is the default).

Indeed, that's necessary. Without having this mode switched on the selection cannot be deleted. And I think this was mentioned earlier here.

--
Greetings

  Pete

Think of XML as Lisp for COBOL programmers.
				- Tony-A (some guy on /.)




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-23 20:05     ` jpkotta
  2012-07-23 20:17       ` Peter Dyballa
@ 2012-07-24  7:16       ` Juha Nieminen
  1 sibling, 0 replies; 22+ messages in thread
From: Juha Nieminen @ 2012-07-24  7:16 UTC (permalink / raw)
  To: help-gnu-emacs

jpkotta <jpkotta@gmail.com> wrote:
> <delete> is bound to delete-forward-char by default.  The help for
> that command mentions the delete-active-region variable.  It only
> has an effect if transient mark mode is enabled, and it sounds like
> you want it set to t (t is the default).  I couldn't see the
> difference between activating and deactivating delete-selection-mode
> either.

When I try to do a describe-variable on delete-active-region, it says
"no match" (and likewise while writing the name of said variable if I try
to autocomplete it with the tab key, it doesn't find it).

If I add a "(setq delete-active-region t)" to my .emacs file, it has no
effect. (Now describe-variable says that its value is t, but has no
documentation on it.)

Btw, I notice that I failed to mention the version of emacs in my original
post. It's full version is listed as

GNU Emacs 23.3.1 (x86_64-suse-linux-gnu, GTK+ Version 2.24.7)
 of 2011-10-30 on build17

I have been fighting with this problem for two days now. If I can't find
a solution, I think the only solution left is to get and build an older
version of emacs. It would be nicer if I had not to do that (because I would
have to bypass OpenSuse's package management) and if the problem were fixable
with just a magic line in .emacs.


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
       [not found]     ` <mailman.5453.1343073582.855.help-gnu-emacs@gnu.org>
@ 2012-07-24  7:23       ` Juha Nieminen
  2012-07-24  8:39         ` Peter Dyballa
                           ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Juha Nieminen @ 2012-07-24  7:23 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@web.de> wrote:
> 
> Am 23.07.2012 um 17:52 schrieb Juha Nieminen:
> 
>> Even gnu's own documentation says that by setting
>> delete-selection-mode to 1 it should work, but it doesn't.
> 
> For me it works. Did you perform your tests in a GNU Emacs launched
> with -Q? Either in its *scratch* buffer you can set
> delete-selection-mode to t or through the customisation interface
> and make the new setting active for this session.

I don't know how to set said variable from the buffer. If I type
M-x set-variable (enter) delete-selection-mode, it won't let me.
(It just says "[No match]".)

Setting it in the .emacs file with "(setq delete-selection-mode 1)"
has no effect. (describe-variable confirms that its value is 1.)


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-24  7:23       ` Juha Nieminen
@ 2012-07-24  8:39         ` Peter Dyballa
  2012-07-24 11:11         ` Andreas Röhler
       [not found]         ` <mailman.5487.1343128324.855.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 22+ messages in thread
From: Peter Dyballa @ 2012-07-24  8:39 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org List


Am 24.07.2012 um 09:23 schrieb Juha Nieminen:

> I don't know how to set said variable from the buffer. If I type
> M-x set-variable (enter) delete-selection-mode, it won't let me.
> (It just says "[No match]".)

Help from my GNU Emacsen 23.3 and 23.4:

	delete-selection-mode is a variable defined in `delsel.el'.
	Its value is t
	
	Documentation:
	Non-nil if Delete-Selection mode is enabled.
	See the command `delete-selection-mode' for a description of this minor mode.
	Setting this variable directly does not take effect;
	either customize it (see the info node `Easy Customization')
	or call the function `delete-selection-mode'.
	
	You can customize this variable.

Have you tried to build it yourself? Maybe Novell/Suse have decided to distribute something castrated that vaguely resembles GNU Emacs. Does delsel.el or delsel.elc exist in your system?

Are you performing your tests without init files loaded?


I actually don't remember that I ever erased selected regions with delete. I am using often delete-region, which does not put useless text into the kill-ring. And also do not have anything set in my init files containing the strings "delete" or "select" that can be related to selected regions and deleting them. Cua-mode is interfering. Although I have other reasons to switch it off.

--
Greetings

  Pete

Hard Disk, n.:
	A device that allows users to delete vast quantities of data with simple mnemonic commands.




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-24  7:23       ` Juha Nieminen
  2012-07-24  8:39         ` Peter Dyballa
@ 2012-07-24 11:11         ` Andreas Röhler
       [not found]         ` <mailman.5487.1343128324.855.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 22+ messages in thread
From: Andreas Röhler @ 2012-07-24 11:11 UTC (permalink / raw)
  To: help-gnu-emacs

Am 24.07.2012 09:23, schrieb Juha Nieminen:
> Peter Dyballa <Peter_Dyballa@web.de> wrote:
>>
>> Am 23.07.2012 um 17:52 schrieb Juha Nieminen:
>>
>>> Even gnu's own documentation says that by setting
>>> delete-selection-mode to 1 it should work, but it doesn't.
>>
>> For me it works. Did you perform your tests in a GNU Emacs launched
>> with -Q? Either in its *scratch* buffer you can set
>> delete-selection-mode to t or through the customisation interface
>> and make the new setting active for this session.
>
> I don't know how to set said variable from the buffer. If I type
> M-x set-variable (enter) delete-selection-mode, it won't let me.
> (It just says "[No match]".)
>
> Setting it in the .emacs file with "(setq delete-selection-mode 1)"
> has no effect. (describe-variable confirms that its value is 1.)
>

M-x customize-variable RET delete-selection-mode RET

having it to nil, saved accordingly, should do it




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
       [not found]         ` <mailman.5487.1343128324.855.help-gnu-emacs@gnu.org>
@ 2012-07-25  5:42           ` Juha Nieminen
  0 siblings, 0 replies; 22+ messages in thread
From: Juha Nieminen @ 2012-07-25  5:42 UTC (permalink / raw)
  To: help-gnu-emacs

Andreas Röhler <andreas.roehler@easy-emacs.de> wrote:
> Am 24.07.2012 09:23, schrieb Juha Nieminen:
>> Peter Dyballa <Peter_Dyballa@web.de> wrote:
>>>
>>> Am 23.07.2012 um 17:52 schrieb Juha Nieminen:
>>>
>>>> Even gnu's own documentation says that by setting
>>>> delete-selection-mode to 1 it should work, but it doesn't.
>>>
>>> For me it works. Did you perform your tests in a GNU Emacs launched
>>> with -Q? Either in its *scratch* buffer you can set
>>> delete-selection-mode to t or through the customisation interface
>>> and make the new setting active for this session.
>>
>> I don't know how to set said variable from the buffer. If I type
>> M-x set-variable (enter) delete-selection-mode, it won't let me.
>> (It just says "[No match]".)
>>
>> Setting it in the .emacs file with "(setq delete-selection-mode 1)"
>> has no effect. (describe-variable confirms that its value is 1.)
>>
> 
> M-x customize-variable RET delete-selection-mode RET

[No match]


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-23 15:52   ` Juha Nieminen
                       ` (2 preceding siblings ...)
       [not found]     ` <mailman.5453.1343073582.855.help-gnu-emacs@gnu.org>
@ 2012-07-25  6:11     ` Juha Nieminen
  2012-07-25  9:52       ` Peter Dyballa
       [not found]       ` <mailman.5554.1343209950.855.help-gnu-emacs@gnu.org>
  3 siblings, 2 replies; 22+ messages in thread
From: Juha Nieminen @ 2012-07-25  6:11 UTC (permalink / raw)
  To: help-gnu-emacs

Juha Nieminen <nospam@thanks.invalid> wrote:
> If I select the region with the mouse, then the delete key removes the
> region.

The documentation at
http://www.gnu.org/software/emacs/manual/html_node/emacs/Shift-Selection.html
says this:

"A mark set via mouse commands behaves the same as a mark set via
shift-selection"

This doesn't seem to be true. As said, if I select the region with the
mouse and then hit the delete key, it deletes the region. However, if I
select the region with shift+cursors and then hit the delete key, it does
not delete the region.

What is the difference?


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-25  6:11     ` Juha Nieminen
@ 2012-07-25  9:52       ` Peter Dyballa
       [not found]       ` <mailman.5554.1343209950.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 22+ messages in thread
From: Peter Dyballa @ 2012-07-25  9:52 UTC (permalink / raw)
  To: help-gnu-emacs List


Am 25.07.2012 um 08:11 schrieb Juha Nieminen:

> What is the difference?

Maybe the meaning of the delete key:

	DEL (translated from <backspace>) runs the command
	delete-backward-char, which is an interactive compiled Lisp function
	in `simple.el'.

Maybe your customisation or maybe the Suse variant of GNU Emacs (it could identify itself as whatever the builder set).

--
Greetings

 Pete

Hard Disk, n.:
	A device that allows users to delete vast quantities of data with simple mnemonic commands.




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
       [not found]       ` <mailman.5554.1343209950.855.help-gnu-emacs@gnu.org>
@ 2012-07-25  9:57         ` Juha Nieminen
  2012-07-25 10:06           ` Peter Dyballa
       [not found]           ` <mailman.5555.1343210807.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 22+ messages in thread
From: Juha Nieminen @ 2012-07-25  9:57 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@web.de> wrote:
> 
> Am 25.07.2012 um 08:11 schrieb Juha Nieminen:
> 
>> What is the difference?
> 
> Maybe the meaning of the delete key:
> 
>        DEL (translated from <backspace>) runs the command
>        delete-backward-char, which is an interactive compiled Lisp function
>        in `simple.el'.
> 
> Maybe your customisation or maybe the Suse variant of GNU Emacs (it could identify itself as whatever the builder set).

I didn't understand the answer. (Btw, I'm talking about the delete key,
not the backspace key.)

And, how do I fix this?


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-25  9:57         ` Juha Nieminen
@ 2012-07-25 10:06           ` Peter Dyballa
       [not found]           ` <mailman.5555.1343210807.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 22+ messages in thread
From: Peter Dyballa @ 2012-07-25 10:06 UTC (permalink / raw)
  To: help-gnu-emacs List


Am 25.07.2012 um 11:57 schrieb Juha Nieminen:

> I didn't understand the answer. (Btw, I'm talking about the delete key,
> not the backspace key.)

Is C-h k <delete key> producing the same description?

--
Greetings

  Pete

"Klingons do not believe in indentation - except perhaps in the skulls of their project managers."




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
       [not found]           ` <mailman.5555.1343210807.855.help-gnu-emacs@gnu.org>
@ 2012-07-25 11:58             ` Juha Nieminen
  2012-07-25 13:16               ` Peter Dyballa
  2012-07-25 14:23             ` Juha Nieminen
  1 sibling, 1 reply; 22+ messages in thread
From: Juha Nieminen @ 2012-07-25 11:58 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@web.de> wrote:
> 
> Am 25.07.2012 um 11:57 schrieb Juha Nieminen:
> 
>> I didn't understand the answer. (Btw, I'm talking about the delete key,
>> not the backspace key.)
> 
> Is C-h k <delete key> producing the same description?

The same description as what?


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-25 11:58             ` Juha Nieminen
@ 2012-07-25 13:16               ` Peter Dyballa
  0 siblings, 0 replies; 22+ messages in thread
From: Peter Dyballa @ 2012-07-25 13:16 UTC (permalink / raw)
  To: help-gnu-emacs List


Am 25.07.2012 um 13:58 schrieb Juha Nieminen:

> The same description as what?

As that of my delete key.

--
Greetings

  Pete

"By filing this bug report you have challenged the honor of my family. Prepare to die!"




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
       [not found]           ` <mailman.5555.1343210807.855.help-gnu-emacs@gnu.org>
  2012-07-25 11:58             ` Juha Nieminen
@ 2012-07-25 14:23             ` Juha Nieminen
  2012-07-25 20:25               ` Peter Dyballa
       [not found]               ` <mailman.5606.1343247908.855.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 22+ messages in thread
From: Juha Nieminen @ 2012-07-25 14:23 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@web.de> wrote:
> 
> Am 25.07.2012 um 11:57 schrieb Juha Nieminen:
> 
>> I didn't understand the answer. (Btw, I'm talking about the delete key,
>> not the backspace key.)
> 
> Is C-h k <delete key> producing the same description?

C-d (translated from <delete>) runs the command delete-char, which is
an interactive built-in function in `C source code'.

It is bound to C-d, <deletechar>.

(delete-char N &optional KILLFLAG)

Delete the following N characters (previous if N is negative).
Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
Interactively, N is the prefix arg, and KILLFLAG is set if
N was explicitly specified.


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-25 14:23             ` Juha Nieminen
@ 2012-07-25 20:25               ` Peter Dyballa
       [not found]               ` <mailman.5606.1343247908.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 22+ messages in thread
From: Peter Dyballa @ 2012-07-25 20:25 UTC (permalink / raw)
  To: help-gnu-emacs List


Am 25.07.2012 um 16:23 schrieb Juha Nieminen:

>> Is C-h k <delete key> producing the same description?
> 
> C-d (translated from <delete>) runs the command delete-char, which is
> an interactive built-in function in `C source code'.

OK, you've chosen C-d instead of BS. It should not make a difference, because when Delete Selection mode and Transient Mark mode are enabled *any* character produced by pressing some key should substitute the selected region with this character (or nothing in case of BS or C-d). The text report also makes certain that you are using GNU Emacs 23.x.

In an earlier eMail you mentioned:

>> If I add the line "(setq delete-selection-mode t)" to my .emacs,
>> then describe-variable says "Its value is t", and if I use nil instead
>> of t it says it's nil. In none of these cases does the delete key
>> function properly.

So you are making your tests with all your customisations active. This is real dirty work. Why can't you do yourself a big favour and launch GNU Emacs with -Q? On most Linux systems (those that I know) you can launch more than one Emacs. In X(11). In some terminal emulation it might be necessary to put the recent Emacs in the background – or just launch a second terminal with 'emacs -Q' in it! In that original and uncustomised version you then can use the *scratch* buffer to execute Elisp commands. For example one or two from your init files.

The first command is – well, actually you just could mark some text in *scratch* buffer! Start with doing so with the mouse. Now press some key! What happened to the selected region? Ohh-kay! You can undo, and then select again with the mouse. Now press BS (backspace) or C-d. What happened to the selected region?

Second test: mark a region with the keyboard (C-SPACE presumingly) and the press some key! What happened to the selected region? OK, again, you can undo and mark again a region with the keyboard. Now press BS or C-d. What happened to the selected region?

Aha, I see…

So just insert

	(delete-selection-mode t)

into the *scratch* buffer. Position the text cursor (point) into the word "delete-selection-mode". You can then type C-h v RET and also C-h f RET. The last step is to go to the end of the line, right of the closing parenthesis. And then press C-j – and nothing else!

(If you want you can check with C-h v the value of the variable delete-selection-mode.) Now perform the two test sets from above again (marking with mouse and marking with keyboard and then typing some character or BS or C-d with optional undoing in-between)! What happened? Did you write a log of what you performed and what happened when delete-selection-mode was the default (nil) and when it was enabled? Are the results different?

When they are not different, you have a very good reason to open a bug report at Suse. Or compile GNU Emacs 23.4 from source yourself – without need to install it anywhere – and perform the tests again. When they are still not different you have even more reason for a bug report at Suse/Novell. (Because it cannot be that GNU Emacs, *the* software, can behave so deviously.)

--
Greetings

  Pete

Theory and practice are the same, in theory, but, in practice, they are different.




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
       [not found]               ` <mailman.5606.1343247908.855.help-gnu-emacs@gnu.org>
@ 2012-07-25 21:03                 ` Juha Nieminen
  2012-07-25 21:27                   ` Peter Dyballa
       [not found]                   ` <mailman.5611.1343251677.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 22+ messages in thread
From: Juha Nieminen @ 2012-07-25 21:03 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@web.de> wrote:

I really appreciate your efforts to help me.

> In an earlier eMail you mentioned:
> 
>>> If I add the line "(setq delete-selection-mode t)" to my .emacs,
>>> then describe-variable says "Its value is t", and if I use nil instead
>>> of t it says it's nil. In none of these cases does the delete key
>>> function properly.
> 
> So you are making your tests with all your customisations
> active. This is real dirty work. Why can't you do yourself a big
> favour and launch GNU Emacs with -Q?

I have done that, but it doesn't make any difference. (I mean with respect
to this problem. Of course all the settings are defaults, but the behavior
with respect to this precise thing doesn't change.)

But just to follow your instructions to the letter, I started Emacs
with -Q and:

> The first command is ??? well, actually you just could mark some text
> in *scratch* buffer! Start with doing so with the mouse. Now press
> some key! What happened to the selected region?

If I select some text with the mouse, then pressing different keys have
different effects:

- Pressing the delete key removes the selected text.
- Pressing the backspace key also removes the selected text.
- Pressing a character key, such as 'a', does *not* replace the selected
  text with 'a', but instead unselects and just adds the 'a' where the
  cursor was, without removing anything.

> Second test: mark a region with the keyboard (C-SPACE presumingly)
> and the press some key! What happened to the selected region? OK,
> again, you can undo and mark again a region with the keyboard. Now
> press BS or C-d. What happened to the selected region?

It makes no difference whether I select text using ctrl-space and then
pressing cursor keys, or just pressing cursor keys with shift. The text
gets selected, but then if I press delete, it just unselects and removes
the character at the cursor (instead of removing the selected text, like
when the region was selected with the mouse). Likewise if I press backspace
it just unselects and then removes the character at the left of the cursor.
In other words, it behaves like no text was selected at all.

I do not understand why selecting a region with the mouse is different from
selecting with the keyboard (either with ctrl-space or shift+cursors).

> So just insert
> 
>        (delete-selection-mode t)
> 
> into the *scratch* buffer. Position the text cursor (point) into the
> word "delete-selection-mode". You can then type C-h v RET and also
> C-h f RET.

If I follow those instructions precisely, it just says "You did not specify
a variable". (If I write "delete-selection-mode" after pressing C-h v then
it gives the help text I mentioned in the earlier post.)

> The last step is to go to the end of the line, right of
> the closing parenthesis. And then press C-j ??? and nothing else!

When I do that, it gives me this:

Debugger entered--Lisp error: (void-function delete-selection-mode)
  (delete-selection-mode t)
  eval((delete-selection-mode t))
  eval-last-sexp-1(t)
  eval-last-sexp(t)
  eval-print-last-sexp()
  call-interactively(eval-print-last-sexp nil nil)

> Or compile GNU Emacs 23.4 from source yourself

I might need to do that...


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
  2012-07-25 21:03                 ` Juha Nieminen
@ 2012-07-25 21:27                   ` Peter Dyballa
       [not found]                   ` <mailman.5611.1343251677.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 22+ messages in thread
From: Peter Dyballa @ 2012-07-25 21:27 UTC (permalink / raw)
  To: help-gnu-emacs List


Am 25.07.2012 um 23:03 schrieb Juha Nieminen:

>> Or compile GNU Emacs 23.4 from source yourself
> 
> I might need to do that...

(Tests with yanking something were not mentioned…) What you described is exactly what happens when Delete Selection mode is not enabled. So it's all OK until here. That the variable and function delete-selection-mode are unknown means that delsel.el is not loaded or dumped from temacs into emacs at Emacs build time. The Elisp file can be here:

	/usr/local/share/emacs/23.3/lisp/delsel.el.gz
	/usr/local/share/emacs/23.3/lisp/delsel.elc
	/usr/local/share/emacs/23.4/lisp/delsel.el.gz
	/usr/local/share/emacs/23.4/lisp/delsel.elc

Does it exist? IMO this, that it exists but is not loaded, can only mean that you have some "unconventional" Emacs. In case delsel.el exists in your system, you can try to load it with

	(require 'delsel) 

because the Elisp file has at its end

	(provide 'delsel)

Then the variable and function delete-selection-mode should be known… and working!

--
Greetings

  Pete

For some reason, this fortune reminds everyone of Marvin Zelkowitz.




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: Selection region and delete
       [not found]                   ` <mailman.5611.1343251677.855.help-gnu-emacs@gnu.org>
@ 2012-07-26  5:30                     ` Juha Nieminen
  0 siblings, 0 replies; 22+ messages in thread
From: Juha Nieminen @ 2012-07-26  5:30 UTC (permalink / raw)
  To: help-gnu-emacs

Peter Dyballa <Peter_Dyballa@web.de> wrote:
> (Tests with yanking something were not mentioned???) What you
> described is exactly what happens when Delete Selection mode is not
> enabled. So it's all OK until here. That the variable and function
> delete-selection-mode are unknown means that delsel.el is not loaded
> or dumped from temacs into emacs at Emacs build time. The Elisp file
> can be here:
> 
>        /usr/local/share/emacs/23.3/lisp/delsel.el.gz
>        /usr/local/share/emacs/23.3/lisp/delsel.elc
>        /usr/local/share/emacs/23.4/lisp/delsel.el.gz
>        /usr/local/share/emacs/23.4/lisp/delsel.elc

My /usr/local/share directory is empty, but there is a
/usr/share/emacs/23.3/lisp/delsel.elc file in my system.

> Does it exist? IMO this, that it exists but is not loaded, can only
> mean that you have some "unconventional" Emacs. In case delsel.el
> exists in your system, you can try to load it with
> 
>        (require 'delsel)

I added that magic line at the beginning of my .emacs file, and now it's
working correctly!

This solved the problem. Many thanks.


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-07-26  5:30 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-23 12:01 Selection region and delete Juha Nieminen
2012-07-23 15:24 ` Barry Margolin
2012-07-23 15:52   ` Juha Nieminen
2012-07-23 19:59     ` Peter Dyballa
2012-07-23 20:05     ` jpkotta
2012-07-23 20:17       ` Peter Dyballa
2012-07-24  7:16       ` Juha Nieminen
     [not found]     ` <mailman.5453.1343073582.855.help-gnu-emacs@gnu.org>
2012-07-24  7:23       ` Juha Nieminen
2012-07-24  8:39         ` Peter Dyballa
2012-07-24 11:11         ` Andreas Röhler
     [not found]         ` <mailman.5487.1343128324.855.help-gnu-emacs@gnu.org>
2012-07-25  5:42           ` Juha Nieminen
2012-07-25  6:11     ` Juha Nieminen
2012-07-25  9:52       ` Peter Dyballa
     [not found]       ` <mailman.5554.1343209950.855.help-gnu-emacs@gnu.org>
2012-07-25  9:57         ` Juha Nieminen
2012-07-25 10:06           ` Peter Dyballa
     [not found]           ` <mailman.5555.1343210807.855.help-gnu-emacs@gnu.org>
2012-07-25 11:58             ` Juha Nieminen
2012-07-25 13:16               ` Peter Dyballa
2012-07-25 14:23             ` Juha Nieminen
2012-07-25 20:25               ` Peter Dyballa
     [not found]               ` <mailman.5606.1343247908.855.help-gnu-emacs@gnu.org>
2012-07-25 21:03                 ` Juha Nieminen
2012-07-25 21:27                   ` Peter Dyballa
     [not found]                   ` <mailman.5611.1343251677.855.help-gnu-emacs@gnu.org>
2012-07-26  5:30                     ` Juha Nieminen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.