Change to when-let* and if-let*
This commit is contained in:
@ -100,7 +100,7 @@ languages supported by this interpreter."))
|
||||
(back-to-indentation)
|
||||
(unless (> (point) start)
|
||||
(goto-char start)))
|
||||
(when-let ((thing (treesit-thing-at-point "_" 'nested)))
|
||||
(when-let* ((thing (treesit-thing-at-point "_" 'nested)))
|
||||
(inf-cc--remove-trailing-semicolon (treesit-node-text thing)))))
|
||||
|
||||
(defun inf-cc--java-ts-exp-at-point ()
|
||||
@ -215,24 +215,24 @@ Note that this erases the buffer before doing anything."
|
||||
|
||||
(defun inf-cc--fontify-current-input ()
|
||||
"Function called from `post-command-hook' to fontify the current input."
|
||||
(when-let (((inf-cc-font-lock-mode inf-cc--obj))
|
||||
(proc (get-buffer-process (current-buffer)))
|
||||
(start (process-mark proc))
|
||||
(end (point-max))
|
||||
(input (buffer-substring-no-properties start end))
|
||||
(fontified (inf-cc--with-font-lock-buffer
|
||||
(insert input)
|
||||
(font-lock-ensure)
|
||||
(buffer-string)))
|
||||
(len (length fontified))
|
||||
(i 0))
|
||||
(when-let* (((inf-cc-font-lock-mode inf-cc--obj))
|
||||
(proc (get-buffer-process (current-buffer)))
|
||||
(start (process-mark proc))
|
||||
(end (point-max))
|
||||
(input (buffer-substring-no-properties start end))
|
||||
(fontified (inf-cc--with-font-lock-buffer
|
||||
(insert input)
|
||||
(font-lock-ensure)
|
||||
(buffer-string)))
|
||||
(len (length fontified))
|
||||
(i 0))
|
||||
;; mostly from:
|
||||
;; `python-shell-font-lock-post-command-hook'
|
||||
(while (not (= i len))
|
||||
(let* ((props (text-properties-at i fontified))
|
||||
(change-i (or (next-property-change i fontified)
|
||||
len)))
|
||||
(when-let ((face (plist-get props 'face)))
|
||||
(when-let* ((face (plist-get props 'face)))
|
||||
(setf (plist-get props 'face) nil
|
||||
(plist-get props 'font-lock-face) face))
|
||||
(set-text-properties (+ start i) (+ start change-i) props)
|
||||
@ -328,9 +328,9 @@ You MUST set `inf-cc--obj' before activating this major mode."
|
||||
indent-line-function #'inf-cc--indent-line-function
|
||||
electric-indent-chars '(?\n ?})
|
||||
mode-name (concat "Inferior " (upcase-initials name)))
|
||||
(when-let ((font-lock-mode)
|
||||
(sym (intern-soft (format "%s-syntax-table" font-lock-mode)))
|
||||
(syntax-table (symbol-value sym)))
|
||||
(when-let* ((font-lock-mode)
|
||||
(sym (intern-soft (format "%s-syntax-table" font-lock-mode)))
|
||||
(syntax-table (symbol-value sym)))
|
||||
(set-syntax-table syntax-table)))
|
||||
(add-hook 'comint-preoutput-filter-functions
|
||||
#'inf-cc--preoutput-filter-function
|
||||
|
||||
Reference in New Issue
Block a user