Skip to content

Commit

Permalink
fix: Compile warnings in Emacs 31
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Nov 20, 2024
1 parent 875ebc5 commit aba9098
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion company-box-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ just grab the first candidate and press forward."

(defun company-box-doc--delete-frame ()
"Delete the child frame if it exists."
(-when-let (frame (frame-local-getq company-box-doc-frame))
(-when-let* (frame (frame-local-getq company-box-doc-frame))
(and (frame-live-p frame)
(delete-frame frame))
(frame-local-setq company-box-doc-frame nil)))
Expand Down
6 changes: 3 additions & 3 deletions company-box-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,16 @@
(defmacro company-box--with-selected-frame (frame &rest body)
"Execute BODY inside a selected frame."
(declare (indent 1) (debug t))
`(when-let (((frame-live-p ,frame))) (with-selected-frame ,frame ,@body)))
`(when-let* (((frame-live-p ,frame))) (with-selected-frame ,frame ,@body)))

(defun company-box--kill-delay (buffer)
(when (buffer-live-p buffer) (kill-buffer buffer)))

(defun company-box--kill-timer (timer)
"Kill TIMER the safe way."
(when (timerp timer) (cancel-timer timer))
(when-let (((symbolp timer))
(val (ignore-errors (symbol-value timer))))
(when-let* (((symbolp timer))
(val (ignore-errors (symbol-value timer))))
(cancel-timer val)))

(defun company-box--frame-show (show frame timer)
Expand Down
4 changes: 2 additions & 2 deletions company-box.el
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ It doesn't nothing if a font icon is used."
(defun company-box-show (&optional on-update)
"Show the completion window."
(unless on-update
(when-let ((frame (company-box--get-frame)))
(when-let* ((frame (company-box--get-frame)))
(make-frame-invisible frame))
(setq company-box--parent-start (window-start))
(add-hook 'window-scroll-functions 'company-box--handle-scroll-parent nil t))
Expand Down Expand Up @@ -1087,7 +1087,7 @@ COMMAND: See `company-frontends'."

(defun company-box--delete-frame ()
"Delete the child frame if it exists."
(-when-let (frame (company-box--get-frame))
(-when-let* (frame (company-box--get-frame))
(and (frame-live-p frame)
(delete-frame frame))
(company-box--set-frame nil)))
Expand Down

0 comments on commit aba9098

Please sign in to comment.