diff options
| author | Stephen Leake | 2019-03-22 16:14:50 -0700 |
|---|---|---|
| committer | Stephen Leake | 2019-03-22 16:14:50 -0700 |
| commit | b515edb98521cf489c81457fa22e6efe78bb042d (patch) | |
| tree | 091144df9a7ad8facda14cd03a1f8f1815856ae6 /lisp | |
| parent | c1b63af4458e92bad33da0def2b15c206656e2fa (diff) | |
| download | emacs-b515edb98521cf489c81457fa22e6efe78bb042d.tar.gz emacs-b515edb98521cf489c81457fa22e6efe78bb042d.zip | |
Fix bug in delete-indentation when region is inactive
* test/lisp/simple-tests.el: Add tests for delete-indentation.
(simple-delete-indentation-no-region): Works with no region.
(simple-delete-indentation-inactive-region): Was broken with inactive
region; now fixed.
* lisp/simple.el (delete-indentation): Check (use-region-p) before using BEG.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/simple.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index f52bd95bf84..f76f31ad146 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -617,7 +617,8 @@ region is ignored if prefix argument is given.)" | |||
| 617 | (+ (point) (length fill-prefix))))) | 617 | (+ (point) (length fill-prefix))))) |
| 618 | (delete-region (point) (+ (point) (length fill-prefix)))) | 618 | (delete-region (point) (+ (point) (length fill-prefix)))) |
| 619 | (fixup-whitespace) | 619 | (fixup-whitespace) |
| 620 | (if (and beg | 620 | (if (and (use-region-p) |
| 621 | beg | ||
| 621 | (not arg) | 622 | (not arg) |
| 622 | (< beg (point-at-bol))) | 623 | (< beg (point-at-bol))) |
| 623 | (beginning-of-line))))) | 624 | (beginning-of-line))))) |