all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* elisp question - hungry backspaces
@ 2008-05-23 18:41 Clemenceau
  2008-05-24  4:11 ` David Hansen
  0 siblings, 1 reply; 2+ messages in thread
From: Clemenceau @ 2008-05-23 18:41 UTC (permalink / raw)
  To: Help-gnu-emacs


Hello,
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.

However... 
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 my function 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 first region was 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. 
-- 
View this message in context: http://www.nabble.com/elisp-question---hungry-backspaces-tp17432649p17432649.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





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

* Re: elisp question - hungry backspaces
  2008-05-23 18:41 elisp question - hungry backspaces Clemenceau
@ 2008-05-24  4:11 ` David Hansen
  0 siblings, 0 replies; 2+ messages in thread
From: David Hansen @ 2008-05-24  4:11 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, 23 May 2008 11:41:50 -0700 (PDT) Clemenceau wrote:

> 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.
>
> However... 
> 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. 

Why do you want to overwrite emacs standard behavior in the first place?

There already is:

  `backward-delete-char-untabify-method'
  `delete-selection-mode'

David





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

end of thread, other threads:[~2008-05-24  4:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-23 18:41 elisp question - hungry backspaces Clemenceau
2008-05-24  4:11 ` David Hansen

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.