[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit f707cce0b8 193/301: Remove the key binding to M-[
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit f707cce0b8 193/301: Remove the key binding to M-[ |
Date: |
Mon, 10 Jan 2022 22:59:02 -0500 (EST) |
branch: elpa/iedit
commit f707cce0b8c98c37b20b3e026f51c36ae8251725
Author: Victor Ren <victor.ren@ericsson.com>
Commit: Victor Ren <victorhge@gmail.com>
Remove the key binding to M-[
Since M-[ is a profix of a key translation in xterm
Rewrite iedit-expand-by-a-line
---
README.org | 4 ++--
iedit-lib.el | 10 +++++-----
iedit.el | 35 ++++++++++++++---------------------
3 files changed, 21 insertions(+), 28 deletions(-)
diff --git a/README.org b/README.org
index eec2121bc1..208518bc61 100644
--- a/README.org
+++ b/README.org
@@ -8,7 +8,7 @@ feedback as you type.
Normal scenario of Iedit mode is like:
- - Highlight certain contents - by press C-;
+ - Highlight certain contents - by press C-; (The default key binding)
All occurrences of a symbol, string or a rectangle in the buffer or a region
may be highlighted corresponding to current mark, point and prefix
argument. Refer to the document of `iedit-mode' for details.
@@ -40,7 +40,7 @@ Renaming refactoring is convinient in Iedit mode
- Restricting the search area to the lines near the current line can
be done by pressing M-{ and M-}. These will expand the search
- region one line at a time from the top and bottom. Add a prefix
+ region one line at a time from the top and bottom. Add a prefix
argument to go the opposite direction.
Iedit-rectangle-mode provides rectangle support with *visible rectangle*
diff --git a/iedit-lib.el b/iedit-lib.el
index d401b7d025..70b34ff869 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2016-05-17 12:40:05 Victor Ren>
+;; Time-stamp: <2016-05-24 10:36:51 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -234,7 +234,7 @@ Return the number of occurrences."
"Create previous occurrence overlay for `occurrence-exp'."
(iedit-add-occurrence-overlay occurrence-exp point nil))
-(defun iedit-add-occurrence-overlay (occurrence-exp point forward)
+(defun iedit-add-occurrence-overlay (occurrence-exp point forward &optional
bound)
"Create next or previous occurrence overlay for `occurrence-exp'.
Return the start position of the new occurrence if successful."
(or point
@@ -244,9 +244,9 @@ Return the start position of the new occurrence if
successful."
(save-excursion
(goto-char point)
(if (not (if forward
- (re-search-forward occurrence-exp nil t)
- (re-search-backward occurrence-exp nil t)))
- (message "No more match.")
+ (re-search-forward occurrence-exp bound t)
+ (re-search-backward occurrence-exp bound t)))
+ (message "No more matches.")
(setq pos (match-beginning 0))
(if (or (iedit-find-overlay-at-point (match-beginning 0)
'iedit-occurrence-overlay-name)
(iedit-find-overlay-at-point (match-end 0)
'iedit-occurrence-overlay-name))
diff --git a/iedit.el b/iedit.el
index 168da1946d..f990d223e1 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2016-05-17 12:25:04 Victor Ren>
+;; Time-stamp: <2016-05-29 14:57:51 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous refactoring
;; Version: 0.97
@@ -33,7 +33,7 @@
;;
;; Normal scenario of iedit-mode is like:
;;
-;; - Highlight certain contents - by press C-; (The default binding)
+;; - Highlight certain contents - by press C-; (The default key binding)
;; All occurrences of a symbol, string in the buffer or a region may be
;; highlighted corresponding to current mark, point and prefix argument.
;; Refer to the document of `iedit-mode' for details.
@@ -220,7 +220,7 @@ This is like `describe-bindings', but displays only Iedit
keys."
;;; Default key bindings:
(when iedit-toggle-key-default
(let ((key-def (lookup-key (current-global-map) iedit-toggle-key-default)))
- (if (and key-def (not (eq key-def 'iedit-mode)))
+ (if key-def
(display-warning 'iedit (format "Iedit default key %S is occupied by
%s."
(key-description
iedit-toggle-key-default)
key-def)
@@ -245,8 +245,8 @@ This is like `describe-bindings', but displays only Iedit
keys."
(define-key map (kbd "M-I") 'iedit-restrict-current-line)
(define-key map (kbd "M-{") 'iedit-expand-up-a-line)
(define-key map (kbd "M-}") 'iedit-expand-down-a-line)
- (define-key map (kbd "M-[") 'iedit-expand-up-to-occurrence)
- (define-key map (kbd "M-]") 'iedit-expand-down-to-occurrence)
+ (define-key map (kbd "M-p") 'iedit-expand-up-to-occurrence)
+ (define-key map (kbd "M-n") 'iedit-expand-down-to-occurrence)
(define-key map (kbd "M-G") 'iedit-apply-global-modification)
(define-key map (kbd "M-C") 'iedit-toggle-case-sensitive)
map)
@@ -553,23 +553,16 @@ lines. The region being acted upon is controlled with
bottom). With a prefix, collapses the top or bottom of the search
region by `amount' lines."
(interactive "P")
- ;; Since iedit-done resets iedit-num-lines-to-expand-{down,up}, we
- ;; have to hang on to them in tmp variables
- (let ((tmp-up iedit-num-lines-to-expand-up)
- (tmp-down iedit-num-lines-to-expand-down)
- ;; we want to call iedit-mode with a universal prefix arg
- (current-prefix-arg '(4)))
- (iedit-done)
- (call-interactively 'iedit-mode)
- (setq iedit-num-lines-to-expand-up tmp-up)
- (setq iedit-num-lines-to-expand-down tmp-down)
+ (let ((occurrence (iedit-current-occurrence-string)))
+ (iedit-cleanup)
(if (eq where 'top)
- (setq iedit-num-lines-to-expand-up (max 0
- (+ amount
iedit-num-lines-to-expand-up)))
- (setq iedit-num-lines-to-expand-down (max 0
- (+ amount
iedit-num-lines-to-expand-down))))
- (iedit-restrict-region (iedit-char-at-bol (- iedit-num-lines-to-expand-up))
- (iedit-char-at-eol iedit-num-lines-to-expand-down))
+ (setq iedit-num-lines-to-expand-up
+ (max 0 (+ amount iedit-num-lines-to-expand-up)))
+ (setq iedit-num-lines-to-expand-down
+ (max 0 (+ amount iedit-num-lines-to-expand-down))))
+ (iedit-start (iedit-regexp-quote occurrence)
+ (iedit-char-at-bol (- iedit-num-lines-to-expand-up))
+ (iedit-char-at-eol iedit-num-lines-to-expand-down))
(message "Now looking -%d/+%d lines around current line, %d match%s."
iedit-num-lines-to-expand-up
iedit-num-lines-to-expand-down
- [nongnu] elpa/iedit 541eab7b6b 108/301: Add document for iedit-rectangle-mode, (continued)
- [nongnu] elpa/iedit 541eab7b6b 108/301: Add document for iedit-rectangle-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4b1416f83f 131/301: refactor out common test code in "test-util", ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit ceb729863b 153/301: Update iedit-lib.el, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b3ebd84769 137/301: Merge pull request #29 from jorgenschaefer/elpa-package, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 27de77eda5 133/301: add test to ensure padding of EOL happens to make up rectangle, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7a35f3bd06 157/301: Add overlay priority option, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c274e6423b 200/301: Quit iedit mode if the number of occurrence is zero, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 8c2316693a 198/301: Fix bug: C-u M-p does not work, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c7abe595b4 159/301: Remove confusing messages "Locate the fist occurrence", ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 2fe78a5ec9 201/301: Remove two confusing options, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f707cce0b8 193/301: Remove the key binding to M-[,
ELPA Syncer <=
- [nongnu] elpa/iedit f9f87a0dd9 212/301: Add key bindings for iedit-quit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b4c7e41049 209/301: More doc for iedit-switch-to-mc-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 18b99c1fb4 169/301: Fix compile warning and test case, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit bd3fd44691 173/301: Added the default value for iedit-replace-occurrences, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b73b977839 204/301: Merge branch 'default-occurrence', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6e6d4bc478 151/301: Merge branch 'master' of https://github.com/mbneedham/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 06bdb68bbf 203/301: Add iedit-switch-to-mc-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b2bffd978c 184/301: Merge pull request #54 from Vifon/iedit-replace-occurences_default-case, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d2f08e8862 163/301: Provide functions to narrow around current-line, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 27dbbdda0b 162/301: Split iedit-occurrence-update into two functions, ELPA Syncer, 2022/01/10