当我使用emacs的lisp缩进时,右括号向右移动,留下比必要更大的空间。这是代码的样子, 而且,在我的第二行代码中,它留下了2个字符,在第3行中,它留下了4个字符......在某些地方,它是向后缩进的.....
注意:请不要尝试解密代码,只要看看缩进有多糟糕......
(defun tern-req (port doc c)
(let*
(
(url-mime-charset-string nil) ; Suppress huge, useless header
(url-request-method "POST"
)
(deactivate-mark nil
) ; Prevents json-encode from interfering with shift-selection-mode
(url-request-data
(json-encode doc
)
)
(url-show-status nil)
(url (
url-parse-make-urlobj "http" nil nil tern-server port "/" nil nil nil
)
)
)
(url-http url #'tern-req-finished
(list c)
)
)
)
答案 0 :(得分:3)
Lisp代码格式化战争实际上是不存在的,因为Emacs是公认的标准。不过,你应该把关闭的parens留在同一条线上。关闭paren之前的空格表示它是从前一行开始的更大块。
(defun tern-req (port doc c)
(let* ((url-mime-charset-string nil) ; Suppress huge, useless header
(url-request-method "POST")
;; Prevent json-encode from interfering with shift-selection-mode
(deactivate-mark nil)
(url-request-data
(json-encode doc))
(url-show-status nil)
(url
(url-parse-make-urlobj "http" nil nil tern-server port "/" nil nil nil)) )
(url-http url #'tern-req-finished
(list c)) ))