From 4585b9c2863a219d5493ae8fd0a70b08ac8ba487 Mon Sep 17 00:00:00 2001 From: Jakob L. Kreuze Date: Fri, 4 Dec 2020 21:52:56 -0500 Subject: Emacs-28-vcs compat. --- init.el | 5 +++++ lisp/appearance.el | 3 +++ lisp/documents.el | 40 +++++++++++++++++++--------------------- lisp/jakob.el | 5 ++--- lisp/shell.el | 2 +- lisp/window-manager.el | 6 +++--- 6 files changed, 33 insertions(+), 28 deletions(-) diff --git a/init.el b/init.el index c61dfd3..fa28a21 100644 --- a/init.el +++ b/init.el @@ -58,6 +58,11 @@ +;; There are a few packages I have installed which do not play nicely with +;; native compilation (looking at you org-plus-contrib). Disabling deferred +;; compilation gives me some more control. +(setq comp-deferred-compilation nil) + ;; The traditional dance of calming down the garbage collector during init, ;; as that improves startup times. Taken from Doom Emacs [1]. ;; diff --git a/lisp/appearance.el b/lisp/appearance.el index c0ff65c..004e4d7 100644 --- a/lisp/appearance.el +++ b/lisp/appearance.el @@ -6,6 +6,9 @@ ;;; Configuration for making Emacs look pretty. ;;; +(require 'scroll-bar) +(require 'fringe) + ;; Use soft wrapping instead of "scrolling" when overflowing the width of a frame. diff --git a/lisp/documents.el b/lisp/documents.el index 88d3ba2..55ff72e 100644 --- a/lisp/documents.el +++ b/lisp/documents.el @@ -147,43 +147,41 @@ Visits LINK, or if LINK names a subdirectory of (file-directory-p (concat path "/" subcategory))) contents)) (categories (if category - (map 'list - #'(lambda (subcategory) (concat category "/" subcategory)) - categories) + (mapcar #'(lambda (subcategory) (concat category "/" subcategory)) + categories) categories))) (append (if category - (map 'list #'(lambda (page) (concat category "/" page)) pages) + (mapcar #'(lambda (page) (concat category "/" page)) pages) pages) categories - (apply #'append (map 'list #'notes-hierarchy-paths categories))))) + (apply #'append (mapcar #'notes-hierarchy-paths categories))))) (defun notes-hierarchy () "Returns every page and category in `notes-directory'. The result contains lists of the form (NAME PATH IS-PAGE-P), and does not include files that satisfy the `notes-file-should-ignore' predicate." - (map 'list - #'(lambda (path) (list - (cond ((cl-search "Index.org" path) - (let ((name (cl-subseq path 0 -9))) - (if (string= name "") - "/" - name))) - ((notes-file-is-page path) (cl-subseq path 0 -4)) - (t path)) - (concat notes-directory "/" path) - (notes-file-is-page path))) - (notes-hierarchy-paths))) + (mapcar #'(lambda (path) (list + (cond ((cl-search "Index.org" path) + (let ((name (cl-subseq path 0 -9))) + (if (string= name "") + "/" + name))) + ((notes-file-is-page path) (cl-subseq path 0 -4)) + (t path)) + (concat notes-directory "/" path) + (notes-file-is-page path))) + (notes-hierarchy-paths))) (defun notes-page-goto () "Interactively find a page in `notes-directory'." (interactive) (let* ((hierarchy (notes-hierarchy)) - (hierarchy (cl-remove-if-not #'third hierarchy)) - (name (ivy-read "Find file: " (map 'list #'first hierarchy))) - (item (cl-find-if #'(lambda (item) (string= name (first item))) hierarchy))) + (hierarchy (cl-remove-if-not #'cl-third hierarchy)) + (name (ivy-read "Find file: " (mapcar #'cl-first hierarchy))) + (item (cl-find-if #'(lambda (item) (string= name (cl-first item))) hierarchy))) (if item - (find-file (second item)) + (find-file (cl-second item)) (let ((path (concat notes-directory "/" name ".org"))) (find-file path))))) diff --git a/lisp/jakob.el b/lisp/jakob.el index 9082be2..c39f923 100644 --- a/lisp/jakob.el +++ b/lisp/jakob.el @@ -38,9 +38,8 @@ "Returns the paths of every password managed by `pass'." (let ((prefix-length (1+ (length password-store-directory))) (suffix-length (length ".gpg"))) - (map 'list - #'(lambda (path) (cl-subseq path prefix-length (- suffix-length))) - (directory-files-recursively password-store-directory ".gpg$")))) + (mapcar #'(lambda (path) (cl-subseq path prefix-length (- suffix-length))) + (directory-files-recursively password-store-directory ".gpg$")))) (defun pass () "Prompt for a password and copy it to the clipboard. diff --git a/lisp/shell.el b/lisp/shell.el index fa1ee72..843f51e 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -162,7 +162,7 @@ (interactive) (let ((n (* 2 (1- (line-number-at-pos))))) (goto-char (point-min)) - (while (plusp n) + (while (cl-plusp n) (delete-visual-line) (setq n (1- n))) (end-of-line))) diff --git a/lisp/window-manager.el b/lisp/window-manager.el index 139943e..1db8d46 100644 --- a/lisp/window-manager.el +++ b/lisp/window-manager.el @@ -107,9 +107,9 @@ (when (and exwm-class-name (string= exwm-class-name "Firefox")) (exwm-input-set-local-simulation-keys - (concatenate 'list - exwm-input-simulation-keys - '(([?\C-q] . [?\C-w]))))) + (cl-concatenate 'list + exwm-input-simulation-keys + '(([?\C-q] . [?\C-w]))))) (when (and exwm-class-name (string= exwm-class-name "Alacritty")) (exwm-input-set-local-simulation-keys nil)))) -- cgit v1.3