aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2013-02-15 00:04:11 +0100
committerJoakim Verona2013-02-15 00:04:11 +0100
commit73b3f91cfcc9b42d2851ced24d7ba3d17e4c6d00 (patch)
treedc111557cc7492ec9cd6dbfec4db2772ee4121b9
parent694d759a9dd8fcbd23078bab33f84ff399d58971 (diff)
parent51b3a99c948dc83f3387f440702ab6e175b61e0f (diff)
downloademacs-73b3f91cfcc9b42d2851ced24d7ba3d17e4c6d00.tar.gz
emacs-73b3f91cfcc9b42d2851ced24d7ba3d17e4c6d00.zip
auto upstream
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/NEWS6
-rw-r--r--lisp/ChangeLog34
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/gnus-util.el7
-rw-r--r--lisp/help-fns.el12
-rw-r--r--lisp/info.el2
-rw-r--r--lisp/net/quickurl.el3
-rw-r--r--lisp/net/tramp.el14
-rw-r--r--lisp/progmodes/ruby-mode.el59
-rw-r--r--src/ChangeLog10
-rw-r--r--src/gtkutil.c17
-rw-r--r--src/keyboard.c3
-rw-r--r--test/ChangeLog9
-rw-r--r--test/automated/ruby-mode-tests.el25
15 files changed, 174 insertions, 36 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index d1b5aac955d..48db23a59e2 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12013-02-14 Michael Albinus <michael.albinus@gmx.de>
2
3 * NEWS: Tramp methods "scpc" and "rsyncc" are discontinued.
4
12013-02-11 Michael Albinus <michael.albinus@gmx.de> 52013-02-11 Michael Albinus <michael.albinus@gmx.de>
2 6
3 * NEWS: Add autorevert changes. 7 * NEWS: Add autorevert changes.
diff --git a/etc/NEWS b/etc/NEWS
index 770ebc17ac0..98824220cec 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -186,10 +186,16 @@ space, no spaces, or reverting to the original spacing. Like
186leave different number of spaces. 186leave different number of spaces.
187 187
188** Tramp 188** Tramp
189
189+++ 190+++
190*** New connection method "adb", which allows to access Android 191*** New connection method "adb", which allows to access Android
191devices by the Android Debug Bridge. The variable `tramp-adb-sdk-dir' 192devices by the Android Debug Bridge. The variable `tramp-adb-sdk-dir'
192must be set to the Android SDK installation directory. 193must be set to the Android SDK installation directory.
194
195*** The connection methods "scpc" and "rsyncc" are discontinued. The
196ssh option "ControlMaster=auto" is set automatically in all ssh-based
197methods, when possible.
198
193+++ 199+++
194*** Handlers for `file-acl' and `set-file-acl' for remote machines 200*** Handlers for `file-acl' and `set-file-acl' for remote machines
195which support POSIX ACLs. 201which support POSIX ACLs.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eb3f4f833f5..5a752fe0c3a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,37 @@
12013-02-14 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-debug-message): Add
4 `tramp-condition-case-unless-debug'.
5 (tramp-debug-on-error): New defvar.
6 (tramp-condition-case-unless-debug): New defun.
7 (tramp-file-name-handler): Use it.
8
92013-02-14 Juri Linkov <juri@jurta.org>
10
11 * info.el (Info-isearch-filter): Treat non-nil values of
12 `search-invisible' including its default value `open'
13 like the value `t' to match hidden text. (Bug#13402)
14
152013-02-14 Glenn Morris <rgm@gnu.org>
16
17 * help-fns.el (find-lisp-object-file-name): Give special treatment
18 to all ~/.foo.elc files, not just ~/.emacs. (Bug#9007)
19
202013-02-14 David Biesack <sasdjb@d72933.na.sas.com> (tiny change)
21
22 * net/quickurl.el (quickurl-save-urls):
23 Ensure quickurl-urls is not truncated on printing. (Bug#9276)
24
252013-02-14 Dmitry Gutov <dgutov@yandex.ru>
26
27 * progmodes/ruby-mode.el (ruby-parse-partial): Don't increase
28 depth for unfinished percent literal. Not using it in the caller.
29 (ruby-move-to-block): Jump over multiline literals of all types,
30 ignoring code-looking contents inside them.
31 (ruby-add-log-current-method): Improve performance at the expense
32 of accuracy. `ruby-block-contains-point' is relatively slow, so
33 only use it for method and singleton class blocks.
34
12013-02-13 Michael Albinus <michael.albinus@gmx.de> 352013-02-13 Michael Albinus <michael.albinus@gmx.de>
2 36
3 Use ControlMaster where applicable. (Bug#13677) 37 Use ControlMaster where applicable. (Bug#13677)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 14499a8fafc..b6e8fd976d3 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12013-02-14 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-util.el (gnus-define-keys): Convert [?\S-\ ] to [(shift space)]
4 for XEmacs.
5
12013-02-13 Juri Linkov <juri@jurta.org> 62013-02-13 Juri Linkov <juri@jurta.org>
2 7
3 * gnus-art.el (gnus-article-mode-map): 8 * gnus-art.el (gnus-article-mode-map):
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index df805c6fb26..331f9556710 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -333,6 +333,13 @@ TIME defaults to the current time."
333 333
334(defmacro gnus-define-keys (keymap &rest plist) 334(defmacro gnus-define-keys (keymap &rest plist)
335 "Define all keys in PLIST in KEYMAP." 335 "Define all keys in PLIST in KEYMAP."
336 ;; Convert the key [?\S-\ ] to [(shift space)] for XEmacs.
337 (when (featurep 'xemacs)
338 (let ((bindings plist))
339 (while bindings
340 (when (equal (car bindings) [?\S-\ ])
341 (setcar bindings [(shift space)]))
342 (setq bindings (cddr bindings)))))
336 `(gnus-define-keys-1 (quote ,keymap) (quote ,plist))) 343 `(gnus-define-keys-1 (quote ,keymap) (quote ,plist)))
337 344
338(defmacro gnus-define-keys-safe (keymap &rest plist) 345(defmacro gnus-define-keys-safe (keymap &rest plist)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 178096d1024..bdf86016844 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -336,11 +336,15 @@ suitable file is found, return nil."
336 ;; If we don't have a file-name string by now, we lost. 336 ;; If we don't have a file-name string by now, we lost.
337 nil) 337 nil)
338 ;; Now, `file-name' should have become an absolute file name. 338 ;; Now, `file-name' should have become an absolute file name.
339 ;; For files loaded from ~/.emacs.elc, try ~/.emacs. 339 ;; For files loaded from ~/.foo.elc, try ~/.foo.
340 ;; This applies to config files like ~/.emacs,
341 ;; which people sometimes compile.
340 ((let (fn) 342 ((let (fn)
341 (and (string-equal file-name 343 (and (string-match "\\`\\..*\\.elc\\'"
342 (expand-file-name ".emacs.elc" "~")) 344 (file-name-nondirectory file-name))
343 (file-readable-p (setq fn (expand-file-name ".emacs" "~"))) 345 (string-equal (file-name-directory file-name)
346 (file-name-as-directory (expand-file-name "~")))
347 (file-readable-p (setq fn (file-name-sans-extension file-name)))
344 fn))) 348 fn)))
345 ;; When the Elisp source file can be found in the install 349 ;; When the Elisp source file can be found in the install
346 ;; directory, return the name of that file. 350 ;; directory, return the name of that file.
diff --git a/lisp/info.el b/lisp/info.el
index a6db9f3f4dc..24a7181ff52 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2151,7 +2151,7 @@ and is not in the header line or a tag table."
2151 (let ((backward (< found beg-found))) 2151 (let ((backward (< found beg-found)))
2152 (not 2152 (not
2153 (or 2153 (or
2154 (and (not (eq search-invisible t)) 2154 (and (not search-invisible)
2155 (if backward 2155 (if backward
2156 (or (text-property-not-all found beg-found 'invisible nil) 2156 (or (text-property-not-all found beg-found 'invisible nil)
2157 (text-property-not-all found beg-found 'display nil)) 2157 (text-property-not-all found beg-found 'display nil))
diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el
index ce9ef55f499..1de9feb1341 100644
--- a/lisp/net/quickurl.el
+++ b/lisp/net/quickurl.el
@@ -272,7 +272,8 @@ It also restores point after the `read'."
272(defun quickurl-save-urls () 272(defun quickurl-save-urls ()
273 "Save the contents of `quickurl-urls' to `quickurl-url-file'." 273 "Save the contents of `quickurl-urls' to `quickurl-url-file'."
274 (with-temp-buffer 274 (with-temp-buffer
275 (let ((standard-output (current-buffer))) 275 (let ((standard-output (current-buffer))
276 (print-length nil))
276 (princ quickurl-prefix) 277 (princ quickurl-prefix)
277 (pp quickurl-urls) 278 (pp quickurl-urls)
278 (princ quickurl-postfix) 279 (princ quickurl-postfix)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index a4250f94988..89648b0e9a9 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1399,6 +1399,7 @@ ARGS to actually emit the message (if applicable)."
1399 "tramp-compat-condition-case-unless-debug" 1399 "tramp-compat-condition-case-unless-debug"
1400 "tramp-compat-funcall" 1400 "tramp-compat-funcall"
1401 "tramp-compat-with-temp-message" 1401 "tramp-compat-with-temp-message"
1402 "tramp-condition-case-unless-debug"
1402 "tramp-debug-message" 1403 "tramp-debug-message"
1403 "tramp-error" 1404 "tramp-error"
1404 "tramp-error-with-buffer" 1405 "tramp-error-with-buffer"
@@ -2011,6 +2012,15 @@ ARGS are the arguments OPERATION has been called with."
2011 res (cdr elt)))) 2012 res (cdr elt))))
2012 res)))) 2013 res))))
2013 2014
2015(defvar tramp-debug-on-error nil
2016 "Like `debug-on-error' but used Tramp internal.")
2017
2018(defmacro tramp-condition-case-unless-debug
2019 (var bodyform &rest handlers)
2020 "Like `condition-case-unless-debug' but `tramp-debug-on-error'."
2021 `(let ((debug-on-error tramp-debug-on-error))
2022 (tramp-compat-condition-case-unless-debug ,var ,bodyform ,@handlers)))
2023
2014;; Main function. 2024;; Main function.
2015;;;###autoload 2025;;;###autoload
2016(defun tramp-file-name-handler (operation &rest args) 2026(defun tramp-file-name-handler (operation &rest args)
@@ -2026,7 +2036,7 @@ Falls back to normal file name handler if no Tramp file name handler exists."
2026 (with-parsed-tramp-file-name filename nil 2036 (with-parsed-tramp-file-name filename nil
2027 ;; Call the backend function. 2037 ;; Call the backend function.
2028 (if foreign 2038 (if foreign
2029 (tramp-compat-condition-case-unless-debug err 2039 (tramp-condition-case-unless-debug err
2030 (let ((sf (symbol-function foreign)) 2040 (let ((sf (symbol-function foreign))
2031 result) 2041 result)
2032 ;; Some packages set the default directory to a 2042 ;; Some packages set the default directory to a
@@ -2079,7 +2089,7 @@ Falls back to normal file name handler if no Tramp file name handler exists."
2079 ;; in order to give the user a chance to correct the 2089 ;; in order to give the user a chance to correct the
2080 ;; file name in the minibuffer. 2090 ;; file name in the minibuffer.
2081 ;; In order to get a full backtrace, one could apply 2091 ;; In order to get a full backtrace, one could apply
2082 ;; (setq debug-on-error t debug-on-signal t) 2092 ;; (setq tramp-debug-on-error t)
2083 (error 2093 (error
2084 (cond 2094 (cond
2085 ((and completion (zerop (length localname)) 2095 ((and completion (zerop (length localname))
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index b1017bb6302..9b007c0063a 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -519,12 +519,6 @@ Can be one of `heredoc', `modifier', `expr-qstr', `expr-re'."
519 (concat "[^\\]\\(\\\\\\\\\\)*" w)) 519 (concat "[^\\]\\(\\\\\\\\\\)*" w))
520 end t))) 520 end t)))
521 (setq in-string (point)) 521 (setq in-string (point))
522 (when (eq (char-syntax (string-to-char w)) ?\()
523 ;; The rest of the literal, when parsed separately, will
524 ;; have the depth of -1. So in the rare case when this
525 ;; number is used despite the in-string status, the
526 ;; depths will balance.
527 (setq depth (1+ depth)))
528 (goto-char end))) 522 (goto-char end)))
529 (t 523 (t
530 (goto-char pnt)))) 524 (goto-char pnt))))
@@ -913,10 +907,16 @@ current block, a sibling block, or an outer block. Do that (abs N) times."
913 (re-search-forward "^=end\\>")) 907 (re-search-forward "^=end\\>"))
914 ((and backward (looking-at "^=end\\>")) 908 ((and backward (looking-at "^=end\\>"))
915 (re-search-backward "^=begin\\>")) 909 (re-search-backward "^=begin\\>"))
910 ;; Jump over a multiline literal.
911 ((ruby-in-ppss-context-p 'string)
912 (goto-char (nth 8 (syntax-ppss)))
913 (unless backward
914 (forward-sexp)
915 (when (bolp) (forward-char -1)))) ; After a heredoc.
916 (t 916 (t
917 (incf depth (or (nth 2 (ruby-parse-region (point) 917 (let ((state (ruby-parse-region (point) (line-end-position))))
918 (line-end-position))) 918 (unless (car state) ; Line ends with unfinished string.
919 0)) 919 (setq depth (+ (nth 2 state) depth))))
920 (cond 920 (cond
921 ;; Deeper indentation, we found a block. 921 ;; Deeper indentation, we found a block.
922 ;; FIXME: We can't recognize empty blocks this way. 922 ;; FIXME: We can't recognize empty blocks this way.
@@ -1073,29 +1073,33 @@ For example:
1073See `add-log-current-defun-function'." 1073See `add-log-current-defun-function'."
1074 (condition-case nil 1074 (condition-case nil
1075 (save-excursion 1075 (save-excursion
1076 (let ((indent 0) mname mlist 1076 (let* ((indent 0) mname mlist
1077 (start (point)) 1077 (start (point))
1078 (definition-re 1078 (make-definition-re
1079 (concat "^[ \t]*" ruby-defun-beg-re "[ \t]+" 1079 (lambda (re)
1080 "\\(" 1080 (concat "^[ \t]*" re "[ \t]+"
1081 ;; \\. and :: for class methods 1081 "\\("
1082 "\\([A-Za-z_]" ruby-symbol-re "*\\|\\.\\|::" "\\)" 1082 ;; \\. and :: for class methods
1083 "+\\)"))) 1083 "\\([A-Za-z_]" ruby-symbol-re "*\\|\\.\\|::" "\\)"
1084 "+\\)")))
1085 (definition-re (funcall make-definition-re ruby-defun-beg-re))
1086 (module-re (funcall make-definition-re "\\(class\\|module\\)")))
1084 ;; Get the current method definition (or class/module). 1087 ;; Get the current method definition (or class/module).
1085 (when (re-search-backward definition-re nil t) 1088 (when (re-search-backward definition-re nil t)
1086 (goto-char (match-beginning 1)) 1089 (goto-char (match-beginning 1))
1087 (when (ruby-block-contains-point start) 1090 (if (not (string-equal "def" (match-string 1)))
1088 ;; We're inside the method, class or module. 1091 (setq mlist (list (match-string 2)))
1089 (setq mname (match-string 2)) 1092 ;; We're inside the method. For classes and modules,
1090 (unless (string-equal "def" (match-string 1)) 1093 ;; this check is skipped for performance.
1091 (setq mlist (list mname) mname nil))) 1094 (when (ruby-block-contains-point start)
1095 (setq mname (match-string 2))))
1092 (setq indent (current-column)) 1096 (setq indent (current-column))
1093 (beginning-of-line)) 1097 (beginning-of-line))
1094 ;; Walk up the class/module nesting. 1098 ;; Walk up the class/module nesting.
1095 (while (and (> indent 0) 1099 (while (and (> indent 0)
1096 (re-search-backward definition-re nil t)) 1100 (re-search-backward module-re nil t))
1097 (goto-char (match-beginning 1)) 1101 (goto-char (match-beginning 1))
1098 (when (ruby-block-contains-point start) 1102 (when (< (current-column) indent)
1099 (setq mlist (cons (match-string 2) mlist)) 1103 (setq mlist (cons (match-string 2) mlist))
1100 (setq indent (current-column)) 1104 (setq indent (current-column))
1101 (beginning-of-line))) 1105 (beginning-of-line)))
@@ -1121,6 +1125,13 @@ See `add-log-current-defun-function'."
1121 (let ((in-singleton-class 1125 (let ((in-singleton-class
1122 (when (re-search-forward ruby-singleton-class-re start t) 1126 (when (re-search-forward ruby-singleton-class-re start t)
1123 (goto-char (match-beginning 0)) 1127 (goto-char (match-beginning 0))
1128 ;; FIXME: Optimize it out, too?
1129 ;; This can be slow in a large file, but
1130 ;; unlike class/module declaration
1131 ;; indentations, method definitions can be
1132 ;; intermixed with these, and may or may not
1133 ;; be additionally indented after visibility
1134 ;; keywords.
1124 (ruby-block-contains-point start)))) 1135 (ruby-block-contains-point start))))
1125 (setq mname (concat 1136 (setq mname (concat
1126 (if in-singleton-class "." "#") 1137 (if in-singleton-class "." "#")
diff --git a/src/ChangeLog b/src/ChangeLog
index 82cc8f0f552..8b1c429e406 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (tb_size_cb): New function.
4 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
5
62013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
7
8 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
9 an event.
10
12013-02-13 Stefan Monnier <monnier@iro.umontreal.ca> 112013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2 12
3 * keyboard.c (syms_of_keyboard): Further tweaks of docstring. 13 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 4771d34b4a0..d6e4dcebcd3 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -4353,6 +4353,21 @@ xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos)
4353 x->toolbar_is_packed = true; 4353 x->toolbar_is_packed = true;
4354} 4354}
4355 4355
4356static bool xg_update_tool_bar_sizes (FRAME_PTR f);
4357
4358static void
4359tb_size_cb (GtkWidget *widget,
4360 GdkRectangle *allocation,
4361 gpointer user_data)
4362{
4363 /* When tool bar is created it has one preferred size. But when size is
4364 allocated between widgets, it may get another. So we must update
4365 size hints if tool bar size changes. Seen on Fedora 18 at least. */
4366 FRAME_PTR f = (FRAME_PTR) user_data;
4367 if (xg_update_tool_bar_sizes (f))
4368 x_wm_set_size_hint (f, 0, 0);
4369}
4370
4356/* Create a tool bar for frame F. */ 4371/* Create a tool bar for frame F. */
4357 4372
4358static void 4373static void
@@ -4384,6 +4399,8 @@ xg_create_tool_bar (FRAME_PTR f)
4384 4399
4385 gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS); 4400 gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS);
4386 toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL); 4401 toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL);
4402 g_signal_connect (x->toolbar_widget, "size-allocate",
4403 G_CALLBACK (tb_size_cb), f);
4387#if GTK_CHECK_VERSION (3, 3, 6) 4404#if GTK_CHECK_VERSION (3, 3, 6)
4388 gsty = gtk_widget_get_style_context (x->toolbar_widget); 4405 gsty = gtk_widget_get_style_context (x->toolbar_widget);
4389 gtk_style_context_add_class (gsty, "primary-toolbar"); 4406 gtk_style_context_add_class (gsty, "primary-toolbar");
diff --git a/src/keyboard.c b/src/keyboard.c
index 3e1a6ba3346..5cd7e8473d2 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -8663,7 +8663,8 @@ follow_key (Lisp_Object keymap, Lisp_Object key)
8663static Lisp_Object 8663static Lisp_Object
8664active_maps (Lisp_Object first_event) 8664active_maps (Lisp_Object first_event)
8665{ 8665{
8666 Lisp_Object position = INTEGERP (first_event) ? Qnil : first_event; 8666 Lisp_Object position
8667 = CONSP (first_event) ? CAR_SAFE (XCDR (first_event)) : Qnil;
8667 return Fcons (Qkeymap, Fcurrent_active_maps (Qt, position)); 8668 return Fcons (Qkeymap, Fcurrent_active_maps (Qt, position));
8668} 8669}
8669 8670
diff --git a/test/ChangeLog b/test/ChangeLog
index f508209008e..7fed4f29408 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,12 @@
12013-02-14 Dmitry Gutov <dgutov@yandex.ru>
2
3 * automated/ruby-mode-tests.el
4 (ruby-move-to-block-skips-percent-literal): Add depth-affecting
5 bits inside the examples.
6 (ruby-move-to-block-skips-heredoc): New test.
7 (ruby-add-log-current-method-after-inner-class): Lower
8 expectations: move point inside a method, initially.
9
12013-02-13 Dmitry Gutov <dgutov@yandex.ru> 102013-02-13 Dmitry Gutov <dgutov@yandex.ru>
2 11
3 * automated/ruby-mode-tests.el 12 * automated/ruby-mode-tests.el
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el
index 6798a49d53c..c67f92e6ed9 100644
--- a/test/automated/ruby-mode-tests.el
+++ b/test/automated/ruby-mode-tests.el
@@ -390,11 +390,13 @@ VALUES-PLIST is a list with alternating index and value elements."
390 | class C 390 | class C
391 | class D 391 | class D
392 | end 392 | end
393 | _ 393 | def foo
394 | _
395 | end
394 | end 396 | end
395 |end") 397 |end")
396 (search-backward "_") 398 (search-backward "_")
397 (should (string= (ruby-add-log-current-method) "M::C")))) 399 (should (string= (ruby-add-log-current-method) "M::C#foo"))))
398 400
399(defvar ruby-block-test-example 401(defvar ruby-block-test-example
400 (ruby-test-string 402 (ruby-test-string
@@ -449,20 +451,37 @@ VALUES-PLIST is a list with alternating index and value elements."
449 (dolist (s (list (ruby-test-string 451 (dolist (s (list (ruby-test-string
450 "foo do 452 "foo do
451 | a = %%w( 453 | a = %%w(
454 | def yaa
452 | ) 455 | )
453 |end") 456 |end")
454 (ruby-test-string 457 (ruby-test-string
455 "foo do 458 "foo do
456 | a = %%w| 459 | a = %%w|
460 | end
457 | | 461 | |
458 |end"))) 462 |end")))
459 (ruby-with-temp-buffer s 463 (ruby-with-temp-buffer s
460 (goto-line 1) 464 (goto-line 1)
461 (ruby-end-of-block) 465 (ruby-end-of-block)
462 (should (= 4 (line-number-at-pos))) 466 (should (= 5 (line-number-at-pos)))
463 (ruby-beginning-of-block) 467 (ruby-beginning-of-block)
464 (should (= 1 (line-number-at-pos)))))) 468 (should (= 1 (line-number-at-pos))))))
465 469
470(ert-deftest ruby-move-to-block-skips-heredoc ()
471 (ruby-with-temp-buffer
472 (ruby-test-string
473 "if something_wrong?
474 | ActiveSupport::Deprecation.warn(<<-eowarn)
475 | boo hoo
476 | end
477 | eowarn
478 |end")
479 (goto-line 1)
480 (ruby-end-of-block)
481 (should (= 6 (line-number-at-pos)))
482 (ruby-beginning-of-block)
483 (should (= 1 (line-number-at-pos)))))
484
466(provide 'ruby-mode-tests) 485(provide 'ruby-mode-tests)
467 486
468;;; ruby-mode-tests.el ends here 487;;; ruby-mode-tests.el ends here