Fix all warnings related to cl-lib

This commit is contained in:
Benson Chu 2022-06-11 17:20:46 -05:00
parent b45af72449
commit 269010a5ea
11 changed files with 57 additions and 42 deletions

View file

@ -838,6 +838,8 @@
#+end_src
** ivy-posframe
#+begin_src emacs-lisp
(require 'cl)
(unless my-ec/at-ti
(use-package ivy-posframe
:config
@ -869,7 +871,7 @@
(defun disable-ivy-posframe-on-exwm-windows (orig &rest args)
(if (not (eq major-mode 'exwm-mode))
(apply orig args)
(letf (((symbol-function 'display-graphic-p) (lambda (&optional display) nil)))
(cl-letf (((symbol-function 'display-graphic-p) (lambda (&optional display) nil)))
(apply orig args))))
(advice-add #'ivy-posframe--read
@ -913,6 +915,8 @@
#+end_src
** pavucontrol switch speakers headphones
#+begin_src emacs-lisp
(require 'cl)
(defvar laptop-sink-index 0)
(defvar hdmi-pcie-interface nil)
@ -930,7 +934,7 @@
(when hdmi-pcie-interface
(let* ((result (shell-command-to-string "pacmd list-modules"))
(split (cdr (split-string result "index: "))))
(loop for mod in split
(cl-loop for mod in split
while (not
(string-match (format "\\([0-9]+\\)\n.*\n.*name=\"%s\"" hdmi-pcie-interface)
mod))

View file

@ -449,11 +449,12 @@
(define-key emacs-lisp-mode-map (kbd "C-c C-k") #'eval-buffer)
;; Make scratch buffers out of nowhere!
(require 'cl)
(defun scratch-buffer ()
(interactive)
(let ((count 0))
(while (get-buffer (format "*scratch%d*" count))
(incf count))
(cl-incf count))
(switch-to-buffer (get-buffer-create (format "*scratch%d*" count)))
(lisp-interaction-mode)
(insert (substitute-command-keys initial-scratch-message))))

View file

@ -24,6 +24,8 @@
;;; Code:
(require 'mmt)
(require 'cl)
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file 'noerror)
@ -74,7 +76,7 @@
(mapcar #'(lambda (a)
(last a))
ec/my-variables-list))))
(loop for i in ec/my-variables-list
(cl-loop for i in ec/my-variables-list
until (member resp i)
finally
do

View file

@ -23,6 +23,7 @@
;;; Commentary:
;;; Code:
(require 'cl)
(require 'dash)
(require 'exwm-randr)
(require 'exwm-workspace-aux)
@ -67,10 +68,10 @@
(let ((count 1))
(setq exwm-workspace-number (length (my/get-screens)))
(cl-destructuring-bind (primary . secondaries) (my/get-screens)
(loop for secondary in secondaries
(cl-loop for secondary in secondaries
do (when (y-or-n-p (format "Monitor %s detected. Setup? " secondary))
(position-screen secondary primary)
(incf count))))
(cl-incf count))))
(setup-workspace-monitors)
(setup-wallpaper)
(setq exwm-workspace-number count)
@ -93,7 +94,7 @@
(define-minor-mode exwm-presentation-mode
"Make both screen outputs display the same thing"
nil nil nil
:lighter nil
(cond (exwm-presentation-mode
(cl-destructuring-bind (primary . secondary) (my/get-screens)
(shell-command

View file

@ -23,6 +23,7 @@
;;; Commentary:
;;; Code:
(require 'cl)
(require 'exwm)
(require 'exwm-randr)
(require 'dash)
@ -40,7 +41,7 @@
(defun setup-workspace-monitors ()
(setq exwm-randr/current-offset 0)
(setq exwm-randr-workspace-monitor-plist
(loop for m in (my/get-screens)
(cl-loop for m in (my/get-screens)
for i from 0
collect i
collect m)))
@ -62,7 +63,7 @@
#'my/get-next-workspace-number)
(let ((monitors (my/get-screens)))
(setq exwm-randr-workspace-monitor-plist
(loop for i from 0 below exwm-workspace-number
(cl-loop for i from 0 below exwm-workspace-number
for m = (nth (mod (+ i exwm-randr/current-offset)
exwm-workspace-number)
monitors)

View file

@ -23,6 +23,8 @@
;;; Commentary:
;;; Code:
(require 'cl)
(require 'org-protocol)
(require 'my-org-agenda-files)
(require 'org-capture)
@ -322,7 +324,7 @@
(prog1
(concat (number-to-string index)
"-" s)
(incf index)))
(cl-incf index)))
headings)))
(suggested-theme (nth (mod (random) 7) headings))
(match (ivy-completing-read (format "What's the theme for today (Suggested: %s)? "

View file

@ -23,6 +23,7 @@
;;; Commentary:
;;; Code:
(require 'cl)
(defun get-parent-indent-level ()
(save-excursion
@ -30,7 +31,7 @@
(while (and (org-up-heading-safe)
(org-get-todo-state))
(when (not (string= "CAT" (org-get-todo-state)))
(incf levels)))
(cl-incf levels)))
levels)))
(defun my/org-scan-tags (action matcher todo-only &optional start-level)

View file

@ -23,18 +23,18 @@
;;; Commentary:
;;; Code:
(require 'org)
(require 'cl)
(defvar org-dev-current-level 0)
(defun odl/incr ()
(interactive)
(incf org-dev-current-level))
(cl-incf org-dev-current-level))
(defun odl/decr ()
(interactive)
(decf org-dev-current-level))
(cl-decf org-dev-current-level))
(defun odl/reset ()
(interactive)

View file

@ -1,5 +1,6 @@
;; This buffer is for text that is not saved, and for Lisp evaluation.
;; To create a file, visit it with C-x C-f and enter text in its buffer.
(require 'cl)
(defvar self-chat-num 0)
(defvar self-chat-last nil)
@ -77,7 +78,7 @@
(let ((name (car triple))
(key (cadr triple)))
(prog1 `(,key (setq self-chat-num ,num) ,name)
(incf num))))
(cl-incf num))))
list))
("r" (setq self-chat-num (random ,(length list))) "Random"))
,@(let ((num 0))
@ -92,7 +93,7 @@
(defvar ,face-sym ',face-sym)
(add-to-list 'self-chat-highlights
'(,(format "^> %s:.*$" name) . ,face-sym)))
(incf num))))
(cl-incf num))))
list))))
(define-users (("Tau" "t" "turquoise1")

View file

@ -23,6 +23,7 @@
;;; Commentary:
;;; Code:
(require 'cl)
(defvar left-side-window-count -1)
(defvar right-side-window-count -1)
@ -46,19 +47,19 @@
(defun side-left-window ()
(interactive)
(side-window-op 'left (incf left-side-window-count)))
(side-window-op 'left (cl-incf left-side-window-count)))
(defun side-right-window ()
(interactive)
(side-window-op 'right (incf right-side-window-count)))
(side-window-op 'right (cl-incf right-side-window-count)))
(defun side-bottom-window ()
(interactive)
(side-window-op 'bottom (incf bottom-side-window-count)))
(side-window-op 'bottom (cl-incf bottom-side-window-count)))
(defun side-top-window ()
(interactive)
(side-window-op 'top (incf top-side-window-count)))
(side-window-op 'top (cl-incf top-side-window-count)))
(defun side-window-delete-all ()
(interactive)

View file

@ -23,6 +23,7 @@
;;; Commentary:
;;; Code:
(require 'cl)
(setq tab-bar-show nil
tab-bar-close-tab-select 'recent
@ -44,7 +45,7 @@
(let ((tab-index (tab-bar--tab-index-by-name tab-name)))
(if tab-index
(progn
(incf tab-index)
(cl-incf tab-index)
(tab-bar-select-tab tab-index)
tab-index)
(let* ((tabs (funcall tab-bar-tabs-function))