Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Electric backspace - hungry delete

Electric backspace - hungry delete

Electric backspace - hungry delete

I'm writing an emacs major mode, and want to implement a hungry-delete feature, much like the one c++-mode has. I've written the handler function, which tells if the previous character is a space/tab or a real character, and acts accordingly.

I'm having problems with deleting a marked region. I'm using pc-selection-mode, and want the function to give priority to deleting a region if one has been marked, before doing a hungry or 1-character deletion.

I've tried teaching it to go to the start of the region and delete it, which actually worked, but then any following backspace when a region wasnt marked acted strangely - as if the region is still marked.

It seems my problem is with telling whether or not the region is active. Unless of course I don't understand my problem - in which case I'd also be glad to be enlightened.

Any help would be greatly appreciated.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close