Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Emacs crash when activating rectangle mode and region is not rectangular. #31

Closed
wants to merge 2 commits into from

3 participants

@thierryvolpiatto

No description provided.

@thierryvolpiatto

Also when trying to deactivate mode, rectangle mode is called with nil args (both for beg and end) and raise an error.

@lewang
Collaborator

@thierryvolpiatto Can you add repro steps in a test-case? Also have you filed a Emacs bug? It shouldn't crash no matter what, right?

@lewang
Collaborator

@thierryvolpiatto I forgot to say my Emacs crashed while using iedit a few days ago as well, so I'm glad you found the possible reason!

@thierryvolpiatto
@lewang
Collaborator
@thierryvolpiatto
@victorhge
Owner

Superceded by Pull request 34

@victorhge victorhge closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 10 deletions.
  1. +12 −10 iedit-rect.el
View
22 iedit-rect.el
@@ -90,17 +90,19 @@ Iedit mechanism.
Commands:
\\{iedit-rect-keymap}"
- (interactive (when (iedit-region-active)
- (list (region-beginning)
- (region-end))))
- (if iedit-rectangle-mode
+ (interactive "r")
+ (let (column-beg column-end)
+ (save-excursion
+ (goto-char beg) (setq column-beg (current-column))
+ (goto-char end) (setq column-end (current-column)))
+ (if iedit-rectangle-mode
(iedit-rectangle-done)
- (iedit-barf-if-lib-active)
- (if (and beg end)
- (progn (setq mark-active nil)
- (run-hooks 'deactivate-mark-hook)
- (iedit-rectangle-start beg end))
- (error "no region available."))))
+ (iedit-barf-if-lib-active)
+ (if (and beg end (not (eq column-beg column-end)))
+ (progn (setq mark-active nil)
+ (run-hooks 'deactivate-mark-hook)
+ (iedit-rectangle-start beg end))
+ (error "no rectangular region available.")))))
(defun iedit-rectangle-start (beg end)
"Start Iedit mode for the region as a rectangle."
Something went wrong with that request. Please try again.