Commits

Juri Pakaste committed f1bb47f

Removed all the delete logic. Preventing the user from deleting parens doesn't really make sense in the context of semibalanced.

  • Participants
  • Parent commits 1625ce9

Comments (0)

Files changed (1)

     character (not necessarily matching the key typed).  
   * Meta-``open'' and ``close'' are rebound to simply insert the
     corresponding character.
-  * ``delete-left''-type keys skip over ``close parenthesis''-type
-    characters and only delete them when they can delete a matching
-    ``open parenthesis''-type character (a delete can be forced by
-    giving the ``delete-left''-type key an argument -- i.e. with
-    ctrl-u or something).
 
 If the ``open parenthesis''-type keys are given a numeric argument,
 they will wrap their open and close around that many items.  For
     (when (not already-seen)
       (let* ((acc '())
              (localmap (current-local-map))
-             (backs 
-              (append 
-               (where-is-internal 'backward-delete-char-untabify localmap)
-               (where-is-internal 'backward-delete-char localmap)
-               (where-is-internal 'delete-backward-char localmap)))
              (index 0))
         (while (< index 256)
           (let ((syn (char-syntax index)))
                             (cons (list metakey metakeyb)
                                   acc))))))
           (setq index (+ index 1)))
-        (for-each 
-         (function
-          (lambda (key)
-            (let ((keyb (local-key-binding key)))
-              (local-set-key key 'semibalanced-delete-char)
-              (setq acc (cons (list key keyb) acc)))))
-         backs)
         (setq semibalanced-modes
               (cons (cons major-mode acc) semibalanced-modes))))))
 
       (error (insert last-input-event)))
     (blink-matching-open)))
 
-(defun semibalanced-delete-char (arg)
-  "Delete a paren pair if we're in the right place, else error.
-With an argument, don't error, just delete the paren."
-  (interactive "P")
-  (cond (arg
-	 (backward-delete-char-untabify 1))
-	((= (char-syntax (preceding-char)) ?\()
-	 (if (not (= (char-syntax (following-char)) ?\)))
-	     (error "Can't touch this")
-	   (backward-char 1)
-	   (delete-char 2)))
-	((= (char-syntax (preceding-char)) ?\))
-	 (backward-char 1))
-	(t (backward-delete-char-untabify 1))))
-
 ;; ---- end semibalanced.el