emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112183: Move forward-whitespace, for


From: Ted Zlatanov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112183: Move forward-whitespace, forward-symbol, forward-same-syntax commands to subr.el. Use forward-symbol in supermode.el again.
Date: Fri, 29 Mar 2013 21:32:12 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112183
committer: Ted Zlatanov <address@hidden>
branch nick: quickfixes
timestamp: Fri 2013-03-29 21:32:12 -0400
message:
  Move forward-whitespace, forward-symbol, forward-same-syntax commands to 
subr.el.  Use forward-symbol in supermode.el again.
  
  * subr.el (forward-whitespace, forward-symbol)
  (forward-same-syntax): Move from thingatpt.el.
  
  * progmodes/subword.el: Back to using `forward-symbol'.
modified:
  lisp/ChangeLog
  lisp/progmodes/subword.el
  lisp/subr.el
  lisp/thingatpt.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-03-29 14:53:27 +0000
+++ b/lisp/ChangeLog    2013-03-30 01:32:12 +0000
@@ -1,3 +1,10 @@
+2013-03-30  Teodor Zlatanov  <address@hidden>
+
+       * progmodes/subword.el: Back to using `forward-symbol'.
+
+       * subr.el (forward-whitespace, forward-symbol)
+       (forward-same-syntax): Move from thingatpt.el.
+
 2013-03-29  Leo Liu  <address@hidden>
 
        * kmacro.el (kmacro-to-register): New command.

=== modified file 'lisp/progmodes/subword.el'
--- a/lisp/progmodes/subword.el 2013-03-29 13:24:19 +0000
+++ b/lisp/progmodes/subword.el 2013-03-30 01:32:12 +0000
@@ -309,7 +309,7 @@
 ;;
 (defun subword-forward-internal ()
   (if superword-mode
-      (forward-sexp 1)
+      (forward-symbol 1)
     (if (and
          (save-excursion
            (let ((case-fold-search nil))
@@ -325,7 +325,7 @@
 
 (defun subword-backward-internal ()
   (if superword-mode
-      (forward-sexp -1)
+      (forward-symbol -1)
     (if (save-excursion
           (let ((case-fold-search nil))
             (re-search-backward subword-backward-regexp nil t)))

=== modified file 'lisp/subr.el'
--- a/lisp/subr.el      2013-03-20 18:13:00 +0000
+++ b/lisp/subr.el      2013-03-30 01:32:12 +0000
@@ -3839,6 +3839,58 @@
 If SYNTAX is nil, return nil."
   (and syntax (logand (car syntax) 65535)))
 
+;; Utility motion commands
+
+;;  Whitespace
+
+(defun forward-whitespace (arg)
+  "Move point to the end of the next sequence of whitespace chars.
+Each such sequence may be a single newline, or a sequence of
+consecutive space and/or tab characters.
+With prefix argument ARG, do it ARG times if positive, or move
+backwards ARG times if negative."
+  (interactive "^p")
+  (if (natnump arg)
+      (re-search-forward "[ \t]+\\|\n" nil 'move arg)
+    (while (< arg 0)
+      (if (re-search-backward "[ \t]+\\|\n" nil 'move)
+         (or (eq (char-after (match-beginning 0)) ?\n)
+             (skip-chars-backward " \t")))
+      (setq arg (1+ arg)))))
+
+;;  Symbols
+
+(defun forward-symbol (arg)
+  "Move point to the next position that is the end of a symbol.
+A symbol is any sequence of characters that are in either the
+word constituent or symbol constituent syntax class.
+With prefix argument ARG, do it ARG times if positive, or move
+backwards ARG times if negative."
+  (interactive "^p")
+  (if (natnump arg)
+      (re-search-forward "\\(\\sw\\|\\s_\\)+" nil 'move arg)
+    (while (< arg 0)
+      (if (re-search-backward "\\(\\sw\\|\\s_\\)+" nil 'move)
+         (skip-syntax-backward "w_"))
+      (setq arg (1+ arg)))))
+
+;;  Syntax blocks
+
+(defun forward-same-syntax (&optional arg)
+  "Move point past all characters with the same syntax class.
+With prefix argument ARG, do it ARG times if positive, or move
+backwards ARG times if negative."
+  (interactive "^p")
+  (or arg (setq arg 1))
+  (while (< arg 0)
+    (skip-syntax-backward
+     (char-to-string (char-syntax (char-before))))
+    (setq arg (1+ arg)))
+  (while (> arg 0)
+    (skip-syntax-forward (char-to-string (char-syntax (char-after))))
+    (setq arg (1- arg))))
+
+
 ;;;; Text clones
 
 (defun text-clone-maintain (ol1 after beg end &optional _len)

=== modified file 'lisp/thingatpt.el'
--- a/lisp/thingatpt.el 2013-03-16 22:08:22 +0000
+++ b/lisp/thingatpt.el 2013-03-30 01:32:12 +0000
@@ -529,60 +529,11 @@
              (buffer-substring-no-properties
               (car boundary-pair) (cdr boundary-pair))))))
 
-;;  Whitespace
-
-(defun forward-whitespace (arg)
-  "Move point to the end of the next sequence of whitespace chars.
-Each such sequence may be a single newline, or a sequence of
-consecutive space and/or tab characters.
-With prefix argument ARG, do it ARG times if positive, or move
-backwards ARG times if negative."
-  (interactive "p")
-  (if (natnump arg)
-      (re-search-forward "[ \t]+\\|\n" nil 'move arg)
-    (while (< arg 0)
-      (if (re-search-backward "[ \t]+\\|\n" nil 'move)
-         (or (eq (char-after (match-beginning 0)) ?\n)
-             (skip-chars-backward " \t")))
-      (setq arg (1+ arg)))))
-
 ;;  Buffer
 
 (put 'buffer 'end-op (lambda () (goto-char (point-max))))
 (put 'buffer 'beginning-op (lambda () (goto-char (point-min))))
 
-;;  Symbols
-
-(defun forward-symbol (arg)
-  "Move point to the next position that is the end of a symbol.
-A symbol is any sequence of characters that are in either the
-word constituent or symbol constituent syntax class.
-With prefix argument ARG, do it ARG times if positive, or move
-backwards ARG times if negative."
-  (interactive "p")
-  (if (natnump arg)
-      (re-search-forward "\\(\\sw\\|\\s_\\)+" nil 'move arg)
-    (while (< arg 0)
-      (if (re-search-backward "\\(\\sw\\|\\s_\\)+" nil 'move)
-         (skip-syntax-backward "w_"))
-      (setq arg (1+ arg)))))
-
-;;  Syntax blocks
-
-(defun forward-same-syntax (&optional arg)
-  "Move point past all characters with the same syntax class.
-With prefix argument ARG, do it ARG times if positive, or move
-backwards ARG times if negative."
-  (interactive "p")
-  (or arg (setq arg 1))
-  (while (< arg 0)
-    (skip-syntax-backward
-     (char-to-string (char-syntax (char-before))))
-    (setq arg (1+ arg)))
-  (while (> arg 0)
-    (skip-syntax-forward (char-to-string (char-syntax (char-after))))
-    (setq arg (1- arg))))
-
 ;;  Aliases
 
 (defun word-at-point ()


reply via email to

[Prev in Thread] Current Thread [Next in Thread]