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

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

[nongnu] elpa/nasm-mode 7131afb 63/67: Change nasm-use-tabs to nasm-afte


From: ELPA Syncer
Subject: [nongnu] elpa/nasm-mode 7131afb 63/67: Change nasm-use-tabs to nasm-after-mnemonic-whitespace
Date: Sun, 29 Aug 2021 11:23:53 -0400 (EDT)

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

    Change nasm-use-tabs to nasm-after-mnemonic-whitespace
    
    Instead of nil and t, it accepts :tab, :space, or nil.
---
 nasm-mode.el | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/nasm-mode.el b/nasm-mode.el
index 91515e1..66a0938 100644
--- a/nasm-mode.el
+++ b/nasm-mode.el
@@ -51,9 +51,10 @@
   "Indentation level for `nasm-mode'."
   :group 'nasm-mode)
 
-; NOTE (sonictk) Allow for customizing behaviour of inserting tabs/spaces
-(defcustom nasm-use-tabs (default-value 't)
-  "Indentation for `nasm-mode' to use tabs/spaces. Set to ``nil`` to use 
spaces and ``t`` to use tabs."
+(defcustom nasm-after-mnemonic-whitespace :tab
+  "In `nasm-mode', determines the whitespace to use after mnemonics.
+This can be :tab, :space, or nil (do nothing)."
+  :type '(choice (const :tab) (const :space) (const nil))
   :group 'nasm-mode)
 
 (defface nasm-registers
@@ -626,12 +627,10 @@ is not immediately after a mnemonic; otherwise, we insert 
a tab."
                  (bti (progn (back-to-indentation) (point))))
              (buffer-substring-no-properties bti point)))))
     (if (string-match nasm-full-instruction-regexp before)
-        (if (equal nasm-use-tabs t)
-            ;; We are immediately after an instruction, just insert a tab
-            (insert "\t")
-            ; If tabs are not set in prefs, use the default instead
-            (insert-char ?\s nasm-basic-offset)
-        )
+        ;; We are immediately after a mnemonic
+        (cl-case nasm-after-mnemonic-whitespace
+          (:tab   (insert "\t"))
+          (:space (insert-char ?\s nasm-basic-offset)))
       ;; We're literally anywhere else, indent the whole line
       (let ((orig (- (point-max) (point))))
         (back-to-indentation)



reply via email to

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