Commit c2de5588 authored by Dima Kogan's avatar Dima Kogan Committed by Stefan Monnier
Browse files

* lisp/progmodes/subword.el (subword-capitalize): Be careful when

the search for [[:alpha:]] fails.

Fixes: debbugs:15580
parent 279066b2
2013-10-14 Dima Kogan <dima@secretsauce.net> (tiny change)
* progmodes/subword.el (subword-capitalize): Be careful when
the search for [[:alpha:]] fails (bug#15580).
2013-10-14 Eli Zaretskii <eliz@gnu.org> 2013-10-14 Eli Zaretskii <eliz@gnu.org>
* menu-bar.el (tty-menu-navigation-map): Bind shifted mouse clicks * menu-bar.el (tty-menu-navigation-map): Bind shifted mouse clicks
...@@ -5,8 +10,8 @@ ...@@ -5,8 +10,8 @@
2013-10-14 Dmitry Gutov <dgutov@yandex.ru> 2013-10-14 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-smie--args-separator-p): Handle * progmodes/ruby-mode.el (ruby-smie--args-separator-p):
methods ending with `?' and `!'. Handle methods ending with `?' and `!'.
2013-10-14 Akinori MUSHA <knu@iDaemons.org> 2013-10-14 Akinori MUSHA <knu@iDaemons.org>
...@@ -41,8 +46,8 @@ ...@@ -41,8 +46,8 @@
Fix indentation/fontification of Java enum with Fix indentation/fontification of Java enum with
"implements"/generic. "implements"/generic.
* progmodes/cc-engine.el (c-backward-over-enum-header): Extracted * progmodes/cc-engine.el (c-backward-over-enum-header):
from the three other places and enhanced to handle generics. Extracted from the three other places and enhanced to handle generics.
(c-inside-bracelist-p): Uses new function above. (c-inside-bracelist-p): Uses new function above.
* progmodes/cc-fonts.el (c-font-lock-declarations): Uses new * progmodes/cc-fonts.el (c-font-lock-declarations): Uses new
function above. function above.
...@@ -230,8 +235,8 @@ ...@@ -230,8 +235,8 @@
* tooltip.el (tooltip-mode): Don't error out on TTYs. * tooltip.el (tooltip-mode): Don't error out on TTYs.
* menu-bar.el (popup-menu, popup-menu-normalize-position): Moved * menu-bar.el (popup-menu, popup-menu-normalize-position):
here from mouse.el. Move here from mouse.el.
(popup-menu): Support menu-bar navigation on TTYs using C-f/C-b (popup-menu): Support menu-bar navigation on TTYs using C-f/C-b
and arrow keys. and arrow keys.
(tty-menu-navigation-map): New map for TTY menu navigation. (tty-menu-navigation-map): New map for TTY menu navigation.
......
...@@ -257,24 +257,25 @@ Optional argument ARG is the same as for `upcase-word'." ...@@ -257,24 +257,25 @@ Optional argument ARG is the same as for `upcase-word'."
See the command `subword-mode' for a description of subwords. See the command `subword-mode' for a description of subwords.
Optional argument ARG is the same as for `capitalize-word'." Optional argument ARG is the same as for `capitalize-word'."
(interactive "p") (interactive "p")
(let ((count (abs arg)) (catch 'search-failed
(start (point)) (let ((count (abs arg))
(advance (if (< arg 0) nil t))) (start (point))
(dotimes (i count) (advance (>= arg 0)))
(if advance
(progn (re-search-forward (dotimes (i count)
(concat "[[:alpha:]]") (if advance
nil t) (progn
(goto-char (match-beginning 0))) (search-forward "[[:alpha:]]")
(subword-backward)) (goto-char (match-beginning 0)))
(let* ((p (point)) (subword-backward))
(pp (1+ p)) (let* ((p (point))
(np (subword-forward))) (pp (1+ p))
(upcase-region p pp) (np (subword-forward)))
(downcase-region pp np) (upcase-region p pp)
(goto-char (if advance np p)))) (downcase-region pp np)
(unless advance (goto-char (if advance np p))))
(goto-char start)))) (unless advance
(goto-char start)))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment