diff --git a/modules/init-bde-style.el b/modules/init-bde-style.el index 0d9d4b1b..5d9e5ffc 100644 --- a/modules/init-bde-style.el +++ b/modules/init-bde-style.el @@ -277,8 +277,9 @@ switch(val) { '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80)) ;; Allow tab in Makefile -(add-hook 'makefile-mode-hook #'(lambda () (setq indent-tabs-mode t))) - +(use-package make-mode + :ensure nil + :hook (makefile-mode . indent-tabs-mode)) ;;; Insert class header @@ -532,8 +533,8 @@ first `exordium-bde-search-max-bound' characters." (when from (save-excursion (goto-char from) - (let ((any-of-is-car-of #'(lambda (any-of elem-list) - (cl-member (car elem-list) any-of))) + (let ((any-of-is-car-of (lambda (any-of elem-list) + (cl-member (car elem-list) any-of))) (bound (+ from exordium-bde-search-max-bound)) (candidate nil)) (catch 'pos @@ -563,8 +564,8 @@ Bounds are returned a cons (START . END). Opening and closing parenthesis are included. Return nil when no argument list has been found." (let* ((basic-syntax (c-guess-basic-syntax)) - (any-of-is-car-of #'(lambda (any-of elem-list) - (cl-member (car elem-list) any-of))) + (any-of-is-car-of (lambda (any-of elem-list) + (cl-member (car elem-list) any-of))) (start (or ;; most of the `arglist-*' syntactic elements have the buffer ;; location of opening parenthesis as the third (last) value @@ -588,16 +589,16 @@ been found." t) ;; the `arglist-cont' has only the `arglist-intro' position ;; one extra jump is needed before an extraction - (funcall #'(lambda (pos) - (when pos - (save-excursion - (goto-char pos) - (nth 2 - (car (cl-member '(arglist-intro - arglist-cont-nonempty - arglist-close) - (c-guess-basic-syntax) - :test any-of-is-car-of)))))) + (funcall (lambda (pos) + (when pos + (save-excursion + (goto-char pos) + (nth 2 + (car (cl-member '(arglist-intro + arglist-cont-nonempty + arglist-close) + (c-guess-basic-syntax) + :test any-of-is-car-of)))))) (nth 1 (car (cl-member '(arglist-cont) basic-syntax @@ -727,20 +728,20 @@ declaration or definition." (when args ;; Parse each argument and get the max type length (setq parsed-args - (mapcar #'(lambda (arg) - (let ((parsed-arg (bde-parse-argument arg))) - (setq max-type-length (max max-type-length - (length (car parsed-arg))) - max-stars (max max-stars - (caddr parsed-arg)) - max-var-length (max max-var-length - (- (length (cadr parsed-arg)) - (caddr parsed-arg)))) - parsed-arg)) + (mapcar (lambda (arg) + (let ((parsed-arg (bde-parse-argument arg))) + (setq max-type-length (max max-type-length + (length (car parsed-arg))) + max-stars (max max-stars + (caddr parsed-arg)) + max-var-length (max max-var-length + (- (length (cadr parsed-arg)) + (caddr parsed-arg)))) + parsed-arg)) args)) - (funcall #'(lambda (bounds) - (goto-char (car bounds)) - (delete-region (car bounds) (cdr bounds))) + (funcall (lambda (bounds) + (goto-char (car bounds)) + (delete-region (car bounds) (cdr bounds))) (bounds-of-thing-at-point 'arglist)) (insert (with-temp-buffer @@ -773,8 +774,8 @@ declaration or definition." ;; Reindent (save-restriction (widen) - (funcall #'(lambda (bounds) - (indent-region (car bounds) (cdr bounds))) + (funcall (lambda (bounds) + (indent-region (car bounds) (cdr bounds))) (bounds-of-thing-at-point 'arglist))) ;; If some lines exceed the dreadful 79th column, insert a new line before @@ -782,9 +783,9 @@ declaration or definition." (save-excursion (let* ((bounds (bounds-of-thing-at-point 'arglist)) (start-col 0) - (max-col (funcall #'(lambda (bounds) - (bde-max-column-in-region (car bounds) - (cdr bounds))) + (max-col (funcall (lambda (bounds) + (bde-max-column-in-region (car bounds) + (cdr bounds))) bounds))) (when (> max-col 79) (goto-char (car bounds)) @@ -793,14 +794,14 @@ declaration or definition." (newline) (let ((longest-length (- max-col start-col))) (if (<= longest-length 79) - (funcall #'(lambda (bounds) - (indent-region (car bounds) - (cdr bounds) - (- 79 longest-length))) + (funcall (lambda (bounds) + (indent-region (car bounds) + (cdr bounds) + (- 79 longest-length))) (bounds-of-thing-at-point 'arglist)) ;; We cannot indent correctly, some lines are too long - (funcall #'(lambda (bounds) - (indent-region (car bounds) (cdr bounds))) + (funcall (lambda (bounds) + (indent-region (car bounds) (cdr bounds))) (bounds-of-thing-at-point 'arglist)) (message "Longest line is %d chars" longest-length)))))) ;; Leave the cursor after the closing parenthese instead of on the opening @@ -922,14 +923,14 @@ include semicolons." ;; to the previous element. Also the type must be re-guessed to ;; remove any line starting with // (let ((type-lines (mapcan #'trim (split-string type "\n")))) - (setq type (mapconcat #'(lambda (s) - (if (string-prefix-p "//" s) "" s)) + (setq type (mapconcat (lambda (s) + (if (string-prefix-p "//" s) "" s)) type-lines "") - comment (mapconcat #'(lambda (s) - (if (string-prefix-p "//" s) - (substring s 2) - "")) + comment (mapconcat (lambda (s) + (if (string-prefix-p "//" s) + (substring s 2) + "")) (mapcan #'trim (split-string element "\n")) "")))) ;; Add the comment to the previous element. diff --git a/modules/init-cpp.el b/modules/init-cpp.el index b13bbdba..4d0f6594 100644 --- a/modules/init-cpp.el +++ b/modules/init-cpp.el @@ -63,8 +63,8 @@ ;; same conditions as in init-treesit.el (version< "29" emacs-version) (treesit-available-p)) (progn - (add-hook 'c-ts-mode-hook #'(lambda () (run-hooks 'c-mode-common-hook))) - (add-hook 'c++-ts-mode-hook #'(lambda () (run-hooks 'c-mode-common-hook))) + (add-hook 'c-ts-mode-hook (lambda () (run-hooks 'c-mode-common-hook))) + (add-hook 'c++-ts-mode-hook (lambda () (run-hooks 'c-mode-common-hook))) (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode)) (add-to-list 'major-mode-remap-alist '(c++-mode . c++-ts-mode)) (add-to-list 'major-mode-remap-alist @@ -190,10 +190,10 @@ With argument, switch to the second choice. For example, from a t) "\\>"))) (add-hook 'c++-mode-hook - #'(lambda() - ;; This can be completed with other things later (C++17?) - (font-lock-add-keywords - nil `((,keywords . font-lock-keyword-face)))) + (lambda() + ;; This can be completed with other things later (C++17?) + (font-lock-add-keywords + nil `((,keywords . font-lock-keyword-face)))) t))) (:modern (use-package modern-cpp-font-lock diff --git a/modules/init-flycheck.el b/modules/init-flycheck.el index 76bd5c60..6d7e3d39 100644 --- a/modules/init-flycheck.el +++ b/modules/init-flycheck.el @@ -129,8 +129,8 @@ See URL `http://mypy-lang.org/'." (flycheck-add-next-checker checker '(warning . exordium-python-mypy))) '(python-flake8 python-pylint python-pycompile)) (add-hook 'python-mode-hook - #'(lambda () - (add-to-list 'flycheck-disabled-checkers 'python-mypy))) + (lambda () + (add-to-list 'flycheck-disabled-checkers 'python-mypy))) ;; A custom ruff checker with error explanations diff --git a/modules/init-forge.el b/modules/init-forge.el index 39c9a4a5..886f7c3c 100644 --- a/modules/init-forge.el +++ b/modules/init-forge.el @@ -212,24 +212,24 @@ Each element of TO-DELETE is in the same format as used in (async-start ;; Deletion can be very slow and could block UI. To be executed in a ;; child process. - `(lambda () - (package-initialize) - (require 'forge) - ,(async-inject-variables "\\`\\(to-delete\\|forge-alist\\)\\'") - (let (results) - (dolist (repo to-delete) - (when-let* ((forge-repo (forge-get-repository (cdr repo)))) - (let ((t0 (current-time)) - ;; Timeout is huge (10x what was the default at the - ;; time of writing this) as db ops are long sometimes. - ;; And this is happening in a child process anyway. - (emacsql-global-timeout 300)) - (closql-delete forge-repo) - (setq results - (cons (append (cdr repo) - (list (float-time (time-since t0)))) - results))))) - results)) + (lambda () + (package-initialize) + (require 'forge) + (async-inject-variables "\\`\\(to-delete\\|forge-alist\\)\\'") + (let (results) + (dolist (repo to-delete) + (when-let* ((forge-repo (forge-get-repository (cdr repo)))) + (let ((t0 (current-time)) + ;; Timeout is huge (10x what was the default at the + ;; time of writing this) as db ops are long sometimes. + ;; And this is happening in a child process anyway. + (emacsql-global-timeout 300)) + (closql-delete forge-repo) + (setq results + (cons (append (cdr repo) + (list (float-time (time-since t0)))) + results))))) + results)) (lambda (results) (when results (magit-refresh)) (dolist (repo results) diff --git a/modules/init-git.el b/modules/init-git.el index 4336b7e9..2cce8947 100644 --- a/modules/init-git.el +++ b/modules/init-git.el @@ -325,13 +325,13 @@ http://stackoverflow.com/questions/9656311/conflict-resolution-with-emacs-ediff- (defun exordium--add-copy-both-to-ediff-mode-map () (when ediff-merge-job (define-key ediff-mode-map "A" - #'(lambda () - (interactive) - (exordium-ediff-copy-both-to-C "A" "B"))) + (lambda () + (interactive) + (exordium-ediff-copy-both-to-C "A" "B"))) (define-key ediff-mode-map "B" - #'(lambda () - (interactive) - (exordium-ediff-copy-both-to-C "B" "A"))))) + (lambda () + (interactive) + (exordium-ediff-copy-both-to-C "B" "A"))))) (defconst exordium--ediff-long-help-message-merge " diff --git a/modules/init-iwyu.el b/modules/init-iwyu.el index 8ba2b176..deeea2b3 100644 --- a/modules/init-iwyu.el +++ b/modules/init-iwyu.el @@ -67,11 +67,11 @@ The first word (assumed: the compiler) is skipped. The \\='backslash double quote\\=' sequences of arguments are returned as single element." (let* ((quote-match - #'(lambda (list start) - (cl-position-if - '(lambda (x) (string-match "\\\"" x)) - list - :start start))) + (lambda (list start) + (cl-position-if + (lambda (x) (string-match "\\\"" x)) + list + :start start))) (args (cdr (split-string command))) (start (funcall quote-match args 0)) (end (funcall quote-match args @@ -118,9 +118,9 @@ Such constructed list then is appended to arguments in (iwyu-mode) (substitute-key-definition 'recompile - `(lambda () - (interactive) - (iwyu-start-process-for ',compile-commands-db ',file)) + (lambda () + (interactive) + (iwyu-start-process-for compile-commands-db file)) (current-local-map))) (apply 'start-process @@ -129,7 +129,7 @@ Such constructed list then is appended to arguments in "include-what-you-use" (append exordium-iwyu-extra-args - (cl-remove-if '(lambda (x) (member x exordium-iwyu-filter-args)) + (cl-remove-if (lambda (x) (member x exordium-iwyu-filter-args)) (iwyu-prepare-args (plist-get entry :command))))) (display-buffer buffer-name) (other-window 1) diff --git a/modules/init-linum.el b/modules/init-linum.el index 3492b04c..204676d2 100644 --- a/modules/init-linum.el +++ b/modules/init-linum.el @@ -22,8 +22,8 @@ Otherwise return nil." (or (minibufferp) (and exordium-inhibit-line-numbers-modes - (cl-find-if #'(lambda (mode) - (derived-mode-p mode)) + (cl-find-if (lambda (mode) + (derived-mode-p mode)) exordium-inhibit-line-numbers-modes)) (and exordium-inhibit-line-numbers-star-buffers (eq 0 (string-match "*" (buffer-name)))) diff --git a/modules/init-look-and-feel.el b/modules/init-look-and-feel.el index cdeb0bea..f006c088 100644 --- a/modules/init-look-and-feel.el +++ b/modules/init-look-and-feel.el @@ -156,7 +156,7 @@ Set FONT and SIZE if they are passed as arguments." ;;;(global-visual-line-mode 1) ;; Show only 1 window on startup (useful if you open multiple files) -(add-hook 'emacs-startup-hook #'(lambda () (delete-other-windows)) t) +(add-hook 'emacs-startup-hook #'delete-other-windows t) ;;; Keyboard preferences diff --git a/modules/init-org.el b/modules/init-org.el index 3f82ad43..1cde421f 100644 --- a/modules/init-org.el +++ b/modules/init-org.el @@ -57,9 +57,9 @@ :config (add-hook 'org-src-mode-hook - #'(lambda () - (when (boundp 'flycheck-disabled-checkers) - (add-to-list 'flycheck-disabled-checkers 'emacs-lisp-checkdoc)))) + (lambda () + (when (boundp 'flycheck-disabled-checkers) + (add-to-list 'flycheck-disabled-checkers 'emacs-lisp-checkdoc)))) (add-hook 'org-mode-hook #'turn-on-visual-line-mode) diff --git a/modules/init-treesit.el b/modules/init-treesit.el index 96d716c8..b3b5587e 100644 --- a/modules/init-treesit.el +++ b/modules/init-treesit.el @@ -15,8 +15,8 @@ (hook (intern (concat (symbol-name mode) "-mode-hook"))) ((and (symbolp ts-hook) (symbolp hook)))) (add-hook ts-hook - #'(lambda () - (run-hooks hook))))) + (lambda () + (run-hooks hook))))) (if (and (version< "29" emacs-version) (treesit-available-p)) (progn diff --git a/modules/init-util.el b/modules/init-util.el index 72307568..b9e6513d 100644 --- a/modules/init-util.el +++ b/modules/init-util.el @@ -264,14 +264,14 @@ When called with ARG, do this that many times." ;;; symetrical. C-Left and C-Right are left unchanged (move by words). (define-key global-map [(meta right)] - #'(lambda (arg) + (lambda (arg) (interactive "p") (forward-same-syntax arg))) (define-key global-map [(meta left)] - #'(lambda (arg) - (interactive "p") - (forward-same-syntax (- arg)))) + (lambda (arg) + (interactive "p") + (forward-same-syntax (- arg)))) ;;; FCI: 80-column ruler bound to Ctrl-| @@ -366,7 +366,7 @@ Use a prefix arg to provide LEN. Plain `C-u' (no number) uses (defun kill-all-buffers () "Kill all buffers that are associated with a file." (interactive) - (mapc #'(lambda (buff) + (mapc (lambda (buff) (when (buffer-file-name buff) (kill-buffer buff))) (buffer-list)))