From 3356c0cb16359aa56d1db8446cff07f16519086d Mon Sep 17 00:00:00 2001
From: Dmitry Gutov <dgutov@yandex.ru>
Date: Sat, 17 Dec 2022 03:13:29 +0200
Subject: [PATCH] Fix end-of-defun in ruby-mode

* lisp/progmodes/ruby-mode.el (ruby-beginning-of-defun):
Return t in case of success.
---
 lisp/progmodes/ruby-mode.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 4ac289d529f..9a557484b58 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1375,9 +1375,10 @@ With ARG, move backward multiple defuns.  Negative ARG means
 move forward."
   (interactive "p")
   (let (case-fold-search)
-    (and (re-search-backward (concat "^\\s *" ruby-defun-beg-re "\\_>")
-                             nil t (or arg 1))
-         (beginning-of-line))))
+    (when (re-search-backward (concat "^\\s *" ruby-defun-beg-re "\\_>")
+                              nil t (or arg 1))
+      (beginning-of-line)
+      t)))
 
 (defun ruby-end-of-defun ()
   "Move point to the end of the current defun.
-- 
2.39.5