[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 2fe78a5ec9 201/301: Remove two confusing options
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 2fe78a5ec9 201/301: Remove two confusing options |
Date: |
Mon, 10 Jan 2022 22:59:02 -0500 (EST) |
branch: elpa/iedit
commit 2fe78a5ec9855682c5b98058f833fb412cd87180
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Remove two confusing options
iedit-current-symbol-default and iedit-only-at-symbol-boundaries
They are true always. But the behavior of iedit-current-symbol can be
configured for some modes.
---
iedit.el | 43 +++++++++++++------------------------------
1 file changed, 13 insertions(+), 30 deletions(-)
diff --git a/iedit.el b/iedit.el
index 1051596b14..573b903345 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2016-06-10 22:29:42 Victor Ren>
+;; Time-stamp: <2016-06-11 00:39:47 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous refactoring
;; Version: 0.97
@@ -81,20 +81,6 @@
(eval-when-compile (require 'cl))
(require 'iedit-lib)
-(defcustom iedit-current-symbol-default t
- "If no-nil, use current symbol by default for the occurrence.
-Otherwise you have to activate a region to start iedit mode."
- :type 'boolean
- :group 'iedit)
-
-(defcustom iedit-only-at-symbol-boundaries t
- "If no-nil, matches have to start and end at symbol boundaries.
-For example, when invoking command `iedit-mode' on the \"in\" in the
- sentence \"The king in the castle...\", the \"king\" is not
- edited."
- :type 'boolean
- :group 'iedit)
-
(defcustom iedit-toggle-key-default (kbd "C-;")
"If no-nil, the key is inserted into global-map,
isearch-mode-map, esc-map and help-map."
@@ -109,11 +95,11 @@ isearch-mode-map, esc-map and help-map."
(defvar iedit-mode nil) ;; Name of the minor mode
-(defvar iedit-only-complete-symbol-local nil
+(defvar iedit-only-complete-symbol-local t
"This is buffer local variable which indicates the occurrence
only matches complete symbol.")
-(defvar iedit-only-complete-symbol-global nil
+(defvar iedit-only-complete-symbol-global t
"This is global variable which indicates the last global occurrence
only matches complete symbol.")
@@ -148,9 +134,9 @@ This local buffer varialbe can be configured in some modes.
An example of how to use this variable:
(add-hook 'perl-mode-hook
'(lambda ()
- (setq iedit-only-at-symbol-boundaries nil)
(setq iedit-current-symbol
'(lambda ()
+ (setq iedit-only-complete-symbol-local nil)
(let* ((bound (bounds-of-thing-at-point 'symbol))
(prefix-char (char-after (1- (car bound)))))
(if (memq prefix-char '(?$ ?% ?@ ?*))
@@ -349,30 +335,28 @@ Keymap used within overlays:
(setq iedit-only-complete-symbol-global
iedit-only-complete-symbol-local))
(iedit-barf-if-lib-active)
(let (occurrence
- complete-symbol
(beg (if (eq major-mode 'occur-edit-mode) ; skip the first occurrence
(next-single-char-property-change 1 'read-only)
(point-min)))
(end (point-max)))
- ;; Get the occurrence
+ ;; Get the occurrence and iedit-only-complete-symbol-local
(cond ((and arg
(= 4 (prefix-numeric-value arg))
iedit-last-occurrence-local)
- (setq occurrence iedit-last-occurrence-local)
- (setq complete-symbol iedit-only-complete-symbol-local))
+ (setq occurrence iedit-last-occurrence-local))
((and arg
(= 16 (prefix-numeric-value arg))
iedit-last-initial-string-global)
(setq occurrence iedit-last-initial-string-global)
- (setq complete-symbol iedit-only-complete-symbol-global))
+ (setq iedit-only-complete-symbol-local
iedit-only-complete-symbol-global))
((iedit-region-active)
(setq occurrence (buffer-substring-no-properties
- (mark) (point))))
- ((and iedit-current-symbol-default
- (setq occurrence (funcall iedit-current-symbol)))
- (when iedit-only-at-symbol-boundaries
- (setq complete-symbol t)))
- (t (error "No candidate of the occurrence, cannot enable Iedit
mode")))
+ (mark) (point)))
+ (setq iedit-only-complete-symbol-local nil))
+ (t (setq iedit-only-complete-symbol-local t)
+ (setq occurrence (funcall iedit-current-symbol))
+ (unless occurrence
+ (error "No candidate of the occurrence, cannot enable Iedit
mode"))))
;; Get the scope
(when arg
(cond ((= 0 (prefix-numeric-value arg))
@@ -388,7 +372,6 @@ Keymap used within overlays:
((iedit-region-active)
(setq beg (region-beginning))
(setq end (region-end)))))
- (setq iedit-only-complete-symbol-local complete-symbol)
(setq mark-active nil)
(run-hooks 'deactivate-mark-hook)
(setq iedit-initial-string-local occurrence)
- [nongnu] elpa/iedit 66ca4f9595 125/301: Merge pull request #21 from lewang/fix-overlay-at-eob, (continued)
- [nongnu] elpa/iedit 66ca4f9595 125/301: Merge pull request #21 from lewang/fix-overlay-at-eob, ELPA Syncer, 2022/01/10
- [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 <=
- [nongnu] elpa/iedit f707cce0b8 193/301: Remove the key binding to M-[, ELPA Syncer, 2022/01/10
- [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