aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTassilo Horn2009-11-20 18:09:29 +0000
committerTassilo Horn2009-11-20 18:09:29 +0000
commita9b76eec39a74a626f12a64522e2e8743fe0701b (patch)
tree03b270412a6cf0d90fceaf11c95751c697d53769
parent1e7d4475115b5090a01f8aca09ec613ce039b2eb (diff)
downloademacs-a9b76eec39a74a626f12a64522e2e8743fe0701b.tar.gz
emacs-a9b76eec39a74a626f12a64522e2e8743fe0701b.zip
* progmodes/cc-cmds.el (c-forward-into-nomenclature)
(c-backward-into-nomenclature): Adapt to subword renaming. * subword.el (subword-forward, subword-backward, subword-mark) (subword-kill, subword-backward-kill, subword-transpose) (subword-downcase, subword-upcase, subword-capitalize) (subword-forward-internal, subword-backward-internal): Renamed from forward-subword, backward-subword, mark-subword kill-subword, backward-kill-subword, transpose-subwords, downcase-subword, upcase-subword, capitalize-subword forward-subword-internal, backward-subword-internal.
-rw-r--r--lisp/ChangeLog18
-rw-r--r--lisp/progmodes/cc-cmds.el12
-rw-r--r--lisp/subword.el68
3 files changed, 56 insertions, 42 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 575f121852e..cbddccc3ba0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,21 @@
12009-11-20 Tassilo Horn <tassilo@member.fsf.org>
2
3 * progmodes/cc-cmds.el (c-forward-into-nomenclature)
4 (c-backward-into-nomenclature): Adapt to subword renaming.
5
6 * subword.el (subword-forward, subword-backward, subword-mark)
7 (subword-kill, subword-backward-kill, subword-transpose)
8 (subword-downcase, subword-upcase, subword-capitalize)
9 (subword-forward-internal, subword-backward-internal): Renamed
10 from forward-subword, backward-subword, mark-subword kill-subword,
11 backward-kill-subword, transpose-subwords, downcase-subword,
12 upcase-subword, capitalize-subword forward-subword-internal,
13 backward-subword-internal.
14
12009-11-20 Thierry Volpiatto <thierry.volpiatto@gmail.com> 152009-11-20 Thierry Volpiatto <thierry.volpiatto@gmail.com>
2 16
3 * bookmark.el (bookmark-search-delay, bookmark-search-prompt): 17 * bookmark.el (bookmark-search-delay, bookmark-search-prompt): New
4 New options. 18 options.
5 (bookmark-search-pattern, bookmark-search-timer, bookmark-quit-flag): 19 (bookmark-search-pattern, bookmark-search-timer, bookmark-quit-flag):
6 New vars. 20 New vars.
7 (bookmark-read-search-input, bookmark-filtered-alist-by-regexp-only) 21 (bookmark-read-search-input, bookmark-filtered-alist-by-regexp-only)
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index d5393c4bdb7..0b217537edd 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1323,23 +1323,23 @@ keyword on the line, the keyword is not inserted inside a literal, and
1323 1323
1324 1324
1325 1325
1326(declare-function forward-subword "subword" (&optional arg)) 1326(declare-function subword-forward "subword" (&optional arg))
1327(declare-function backward-subword "subword" (&optional arg)) 1327(declare-function subword-backward "subword" (&optional arg))
1328 1328
1329;; "nomenclature" functions + c-scope-operator. 1329;; "nomenclature" functions + c-scope-operator.
1330(defun c-forward-into-nomenclature (&optional arg) 1330(defun c-forward-into-nomenclature (&optional arg)
1331 "Compatibility alias for `c-forward-subword'." 1331 "Compatibility alias for `c-forward-subword'."
1332 (interactive "p") 1332 (interactive "p")
1333 (require 'subword) 1333 (require 'subword)
1334 (forward-subword arg)) 1334 (subword-forward arg))
1335(make-obsolete 'c-forward-into-nomenclature 'forward-subword "23.2") 1335(make-obsolete 'c-forward-into-nomenclature 'subword-forward "23.2")
1336 1336
1337(defun c-backward-into-nomenclature (&optional arg) 1337(defun c-backward-into-nomenclature (&optional arg)
1338 "Compatibility alias for `c-backward-subword'." 1338 "Compatibility alias for `c-backward-subword'."
1339 (interactive "p") 1339 (interactive "p")
1340 (require 'subword) 1340 (require 'subword)
1341 (backward-subword arg)) 1341 (subword-backward arg))
1342(make-obsolete 'c-backward-into-nomenclature 'backward-subword "23.2") 1342(make-obsolete 'c-backward-into-nomenclature 'subword-backward "23.2")
1343 1343
1344(defun c-scope-operator () 1344(defun c-scope-operator ()
1345 "Insert a double colon scope operator at point. 1345 "Insert a double colon scope operator at point.
diff --git a/lisp/subword.el b/lisp/subword.el
index 0b22c135701..655d08f9884 100644
--- a/lisp/subword.el
+++ b/lisp/subword.el
@@ -50,15 +50,15 @@
50 50
51;; Key Word oriented command Subword oriented command 51;; Key Word oriented command Subword oriented command
52;; ============================================================ 52;; ============================================================
53;; M-f `forward-word' `forward-subword' 53;; M-f `forward-word' `subword-forward'
54;; M-b `backward-word' `backward-subword' 54;; M-b `backward-word' `subword-backward'
55;; M-@ `mark-word' `mark-subword' 55;; M-@ `mark-word' `subword-mark'
56;; M-d `kill-word' `kill-subword' 56;; M-d `kill-word' `subword-kill'
57;; M-DEL `backward-kill-word' `backward-kill-subword' 57;; M-DEL `backward-kill-word' `subword-backward-kill'
58;; M-t `transpose-words' `transpose-subwords' 58;; M-t `transpose-words' `subword-transpose'
59;; M-c `capitalize-word' `capitalize-subword' 59;; M-c `capitalize-word' `subword-capitalize'
60;; M-u `upcase-word' `upcase-subword' 60;; M-u `upcase-word' `subword-upcase'
61;; M-l `downcase-word' `downcase-subword' 61;; M-l `downcase-word' `subword-downcase'
62;; 62;;
63;; Note: If you have changed the key bindings for the word oriented 63;; Note: If you have changed the key bindings for the word oriented
64;; commands in your .emacs or a similar place, the keys you've changed 64;; commands in your .emacs or a similar place, the keys you've changed
@@ -125,7 +125,7 @@ as words.
125(define-global-minor-mode global-subword-mode subword-mode 125(define-global-minor-mode global-subword-mode subword-mode
126 (lambda () (subword-mode 1))) 126 (lambda () (subword-mode 1)))
127 127
128(defun forward-subword (&optional arg) 128(defun subword-forward (&optional arg)
129 "Do the same as `forward-word' but on subwords. 129 "Do the same as `forward-word' but on subwords.
130See the command `subword-mode' for a description of subwords. 130See the command `subword-mode' for a description of subwords.
131Optional argument ARG is the same as for `forward-word'." 131Optional argument ARG is the same as for `forward-word'."
@@ -134,23 +134,23 @@ Optional argument ARG is the same as for `forward-word'."
134 (cond 134 (cond
135 ((< 0 arg) 135 ((< 0 arg)
136 (dotimes (i arg (point)) 136 (dotimes (i arg (point))
137 (forward-subword-internal))) 137 (subword-forward-internal)))
138 ((> 0 arg) 138 ((> 0 arg)
139 (dotimes (i (- arg) (point)) 139 (dotimes (i (- arg) (point))
140 (backward-subword-internal))) 140 (subword-backward-internal)))
141 (t 141 (t
142 (point)))) 142 (point))))
143 143
144(put 'forward-subword 'CUA 'move) 144(put 'subword-forward 'CUA 'move)
145 145
146(defun backward-subword (&optional arg) 146(defun subword-backward (&optional arg)
147 "Do the same as `backward-word' but on subwords. 147 "Do the same as `backward-word' but on subwords.
148See the command `subword-mode' for a description of subwords. 148See the command `subword-mode' for a description of subwords.
149Optional argument ARG is the same as for `backward-word'." 149Optional argument ARG is the same as for `backward-word'."
150 (interactive "p") 150 (interactive "p")
151 (forward-subword (- (or arg 1)))) 151 (subword-forward (- (or arg 1))))
152 152
153(defun mark-subword (arg) 153(defun subword-mark (arg)
154 "Do the same as `mark-word' but on subwords. 154 "Do the same as `mark-word' but on subwords.
155See the command `subword-mode' for a description of subwords. 155See the command `subword-mode' for a description of subwords.
156Optional argument ARG is the same as for `mark-word'." 156Optional argument ARG is the same as for `mark-word'."
@@ -160,59 +160,59 @@ Optional argument ARG is the same as for `mark-word'."
160 (set-mark 160 (set-mark
161 (save-excursion 161 (save-excursion
162 (goto-char (mark)) 162 (goto-char (mark))
163 (forward-subword arg) 163 (subword-forward arg)
164 (point)))) 164 (point))))
165 (t 165 (t
166 (push-mark 166 (push-mark
167 (save-excursion 167 (save-excursion
168 (forward-subword arg) 168 (subword-forward arg)
169 (point)) 169 (point))
170 nil t)))) 170 nil t))))
171 171
172(put 'backward-subword 'CUA 'move) 172(put 'subword-backward 'CUA 'move)
173 173
174(defun kill-subword (arg) 174(defun subword-kill (arg)
175 "Do the same as `kill-word' but on subwords. 175 "Do the same as `kill-word' but on subwords.
176See the command `subword-mode' for a description of subwords. 176See the command `subword-mode' for a description of subwords.
177Optional argument ARG is the same as for `kill-word'." 177Optional argument ARG is the same as for `kill-word'."
178 (interactive "p") 178 (interactive "p")
179 (kill-region (point) (forward-subword arg))) 179 (kill-region (point) (subword-forward arg)))
180 180
181(defun backward-kill-subword (arg) 181(defun subword-backward-kill (arg)
182 "Do the same as `backward-kill-word' but on subwords. 182 "Do the same as `backward-kill-word' but on subwords.
183See the command `subword-mode' for a description of subwords. 183See the command `subword-mode' for a description of subwords.
184Optional argument ARG is the same as for `backward-kill-word'." 184Optional argument ARG is the same as for `backward-kill-word'."
185 (interactive "p") 185 (interactive "p")
186 (kill-subword (- arg))) 186 (subword-kill (- arg)))
187 187
188(defun transpose-subwords (arg) 188(defun subword-transpose (arg)
189 "Do the same as `transpose-words' but on subwords. 189 "Do the same as `transpose-words' but on subwords.
190See the command `subword-mode' for a description of subwords. 190See the command `subword-mode' for a description of subwords.
191Optional argument ARG is the same as for `transpose-words'." 191Optional argument ARG is the same as for `transpose-words'."
192 (interactive "*p") 192 (interactive "*p")
193 (transpose-subr 'forward-subword arg)) 193 (transpose-subr 'subword-forward arg))
194 194
195(defun downcase-subword (arg) 195(defun subword-downcase (arg)
196 "Do the same as `downcase-word' but on subwords. 196 "Do the same as `downcase-word' but on subwords.
197See the command `subword-mode' for a description of subwords. 197See the command `subword-mode' for a description of subwords.
198Optional argument ARG is the same as for `downcase-word'." 198Optional argument ARG is the same as for `downcase-word'."
199 (interactive "p") 199 (interactive "p")
200 (let ((start (point))) 200 (let ((start (point)))
201 (downcase-region (point) (forward-subword arg)) 201 (downcase-region (point) (subword-forward arg))
202 (when (< arg 0) 202 (when (< arg 0)
203 (goto-char start)))) 203 (goto-char start))))
204 204
205(defun upcase-subword (arg) 205(defun subword-upcase (arg)
206 "Do the same as `upcase-word' but on subwords. 206 "Do the same as `upcase-word' but on subwords.
207See the command `subword-mode' for a description of subwords. 207See the command `subword-mode' for a description of subwords.
208Optional argument ARG is the same as for `upcase-word'." 208Optional argument ARG is the same as for `upcase-word'."
209 (interactive "p") 209 (interactive "p")
210 (let ((start (point))) 210 (let ((start (point)))
211 (upcase-region (point) (forward-subword arg)) 211 (upcase-region (point) (subword-forward arg))
212 (when (< arg 0) 212 (when (< arg 0)
213 (goto-char start)))) 213 (goto-char start))))
214 214
215(defun capitalize-subword (arg) 215(defun subword-capitalize (arg)
216 "Do the same as `capitalize-word' but on subwords. 216 "Do the same as `capitalize-word' but on subwords.
217See the command `subword-mode' for a description of subwords. 217See the command `subword-mode' for a description of subwords.
218Optional argument ARG is the same as for `capitalize-word'." 218Optional argument ARG is the same as for `capitalize-word'."
@@ -226,10 +226,10 @@ Optional argument ARG is the same as for `capitalize-word'."
226 (concat "[[:alpha:]]") 226 (concat "[[:alpha:]]")
227 nil t) 227 nil t)
228 (goto-char (match-beginning 0))) 228 (goto-char (match-beginning 0)))
229 (backward-subword)) 229 (subword-backward))
230 (let* ((p (point)) 230 (let* ((p (point))
231 (pp (1+ p)) 231 (pp (1+ p))
232 (np (forward-subword))) 232 (np (subword-forward)))
233 (upcase-region p pp) 233 (upcase-region p pp)
234 (downcase-region pp np) 234 (downcase-region pp np)
235 (goto-char (if advance np p)))) 235 (goto-char (if advance np p))))
@@ -241,7 +241,7 @@ Optional argument ARG is the same as for `capitalize-word'."
241;; 241;;
242;; Internal functions 242;; Internal functions
243;; 243;;
244(defun forward-subword-internal () 244(defun subword-forward-internal ()
245 (if (and 245 (if (and
246 (save-excursion 246 (save-excursion
247 (let ((case-fold-search nil)) 247 (let ((case-fold-search nil))
@@ -258,7 +258,7 @@ Optional argument ARG is the same as for `capitalize-word'."
258 (forward-word 1))) 258 (forward-word 1)))
259 259
260 260
261(defun backward-subword-internal () 261(defun subword-backward-internal ()
262 (if (save-excursion 262 (if (save-excursion
263 (let ((case-fold-search nil)) 263 (let ((case-fold-search nil))
264 (re-search-backward 264 (re-search-backward