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

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

[nongnu] elpa/nasm-mode 3047d7c 41/67: Add nasm-join-line.


From: ELPA Syncer
Subject: [nongnu] elpa/nasm-mode 3047d7c 41/67: Add nasm-join-line.
Date: Sun, 29 Aug 2021 11:23:49 -0400 (EDT)

branch: elpa/nasm-mode
commit 3047d7c9765a82bb22a35252c6c77aaea1c6ad36
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>

    Add nasm-join-line.
---
 nasm-mode.el | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/nasm-mode.el b/nasm-mode.el
index e90d881..b6d9d74 100644
--- a/nasm-mode.el
+++ b/nasm-mode.el
@@ -663,6 +663,19 @@ With a prefix arg, kill the comment on the current line 
with
      ;; Otherwise insert.
      ((insert ";")))))
 
+(defun nasm-join-line (join-following-p)
+  "Like `join-line', but use a tab when joining with a label."
+  (interactive "*P")
+  (join-line join-following-p)
+  (if (looking-back nasm-label-regexp)
+      (let ((column (current-column)))
+        (cond ((< column 8)
+               (delete-char 1)
+               (insert-char ?\t))
+              ((and (= column 8) (eql ?: (char-before)))
+               (delete-char 1))))
+    (nasm-indent-line)))
+
 ;;;###autoload
 (define-derived-mode nasm-mode prog-mode "NASM"
   "Major mode for editing NASM assembly programs."



reply via email to

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