refactor(emacs): I've learned about let*

This commit is contained in:
Pavel Korytov 2021-04-17 14:43:06 +03:00
parent f756d6c4fe
commit 9592cad3af
2 changed files with 19 additions and 18 deletions

View file

@ -560,14 +560,14 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(concat "["
(my/shorten-project-name-elem (substring elem 1 (- (length elem) 1)) crop)
"]")
(let ((prefix (car (s-match my/project-title-separators elem))))
(let ((rest
(substring
(if prefix
(substring elem (length prefix))
elem)
0 (if crop 1 nil))))
(concat prefix rest)))))
(let* ((prefix (car (s-match my/project-title-separators elem)))
(rest
(substring
(if prefix
(substring elem (length prefix))
elem)
0 (if crop 1 nil))))
(concat prefix rest))))
(defun my/shorten-project-name (project-name)
(let ((elems (s-slice-at my/project-title-separators project-name)))
@ -1543,8 +1543,8 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq lsp-java-jdt-download-url "https://download.eclipse.org/jdtls/milestones/0.57.0/jdt-language-server-0.57.0-202006172108.tar.gz"))
(add-hook 'java-mode-hook #'smartparens-mode)
(add-hook 'java-mode-hook #'hs-minor-mode)
(my/set-smartparens-indent 'java-mode)
(add-hook 'java-mode-hook #'hs-minor-mode)
(my/set-smartparens-indent 'java-mode)
(use-package clojure-mode
:straight t

View file

@ -1104,14 +1104,14 @@ Prepend tab name with the shortened projectile project title
(concat "["
(my/shorten-project-name-elem (substring elem 1 (- (length elem) 1)) crop)
"]")
(let ((prefix (car (s-match my/project-title-separators elem))))
(let ((rest
(substring
(if prefix
(substring elem (length prefix))
elem)
0 (if crop 1 nil))))
(concat prefix rest)))))
(let* ((prefix (car (s-match my/project-title-separators elem)))
(rest
(substring
(if prefix
(substring elem (length prefix))
elem)
0 (if crop 1 nil))))
(concat prefix rest))))
(defun my/shorten-project-name (project-name)
(let ((elems (s-slice-at my/project-title-separators project-name)))
@ -1129,6 +1129,7 @@ Prepend tab name with the shortened projectile project title
(setq tab-bar-tab-name-function #'my/tab-bar-name-function)
#+end_src
** Modeline
A modeline from Doom Emacs.