emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/inf-ruby 9bfbce42be 241/265: Untabify and reformat the new


From: ELPA Syncer
Subject: [nongnu] elpa/inf-ruby 9bfbce42be 241/265: Untabify and reformat the new code a little
Date: Sat, 9 Jul 2022 21:59:29 -0400 (EDT)

branch: elpa/inf-ruby
commit 9bfbce42be5fd3dbd8386687efd60450388f6978
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    Untabify and reformat the new code a little
---
 inf-ruby.el | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/inf-ruby.el b/inf-ruby.el
index de63949014..fb5c26b724 100755
--- a/inf-ruby.el
+++ b/inf-ruby.el
@@ -509,23 +509,25 @@ Must not contain ruby meta characters.")
   (interactive)
   (save-excursion
     (let ((orig-start (point))
-         (adjust-lineno 0)
-         prefix suffix defun-start)
+          (adjust-lineno 0)
+          prefix suffix defun-start)
       (save-excursion
-       (end-of-line)
-       (ruby-beginning-of-defun)
-       (setq defun-start (point))
-       (unless (ruby-block-contains-point orig-start)
-         (error "point is not within a definition"))
-       (while (and (ignore-errors (backward-up-list) t)
-                   (looking-at "\\s-*\\(class\\|module\\)\\s-"))
-         (let ((line (buffer-substring-no-properties 
(line-beginning-position)(1+ (line-end-position)))))
-           (if prefix
-               (setq prefix (concat line prefix)
-                     suffix (concat suffix "end\n"))
-             (setq prefix line
-                   suffix "end\n"))
-           (setq adjust-lineno (1- adjust-lineno)))))
+        (end-of-line)
+        (ruby-beginning-of-defun)
+        (setq defun-start (point))
+        (unless (ruby-block-contains-point orig-start)
+          (error "Point is not within a definition"))
+        (while (and (ignore-errors (backward-up-list) t)
+                    (looking-at "\\s-*\\(class\\|module\\)\\s-"))
+          (let ((line (buffer-substring-no-properties
+                       (line-beginning-position)
+                       (1+ (line-end-position)))))
+            (if prefix
+                (setq prefix (concat line prefix)
+                      suffix (concat suffix "end\n"))
+              (setq prefix line
+                    suffix "end\n"))
+            (setq adjust-lineno (1- adjust-lineno)))))
       (end-of-defun)
       (ruby-send-region defun-start (point) nil prefix suffix adjust-lineno))))
 



reply via email to

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