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

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

Custom backspace delete in mini-buffer


From: TheLonelyStar
Subject: Custom backspace delete in mini-buffer
Date: Thu, 7 Aug 2008 16:14:51 -0700 (PDT)

Hi,

I have defined a custom backspace delete function:
(defun delete-with-closing-bracket-back (arg)
  (interactive "*p")
  ;;Check if point is not the minimum
  (if (not (= (point) (point-min)))
          (progn
                (backward-char)
                (if
                        (looking-at "\\({[\n \t]*}\\|\\[[\n \t]*\\]\\|\([\n 
\t]*\)\\|\"[\n
\t]*\"\\)")
                        (delete-region (match-beginning 0) (match-end 0))
                  ;;else
                  (forward-char)
                  (c-hungry-delete-backwards)
                ))
        ;;else
        (delete-backward-char 1)
        ))
(define-key global-map [(backspace)] 'delete-with-closing-bracket-back)

It works fine, but there is a problem. When I am in i-search mode, pressing
backspace deletes the last character in the window, not in the i-search
mini-buffer.

I do not know much about elisp. The function above I just "stole" together.
What can I do?

Thanks!
Nathan
-- 
View this message in context: 
http://www.nabble.com/Custom-backspace-delete-in-mini-buffer-tp18881785p18881785.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





reply via email to

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