Minor, general refactors

This commit is contained in:
Henrik Lissner 2019-10-23 03:57:48 -04:00
parent a3765aca32
commit e1622142ed
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 11 additions and 21 deletions

View file

@ -156,7 +156,7 @@ possible."
"Auto revert current buffer, if necessary." "Auto revert current buffer, if necessary."
(unless (or auto-revert-mode (active-minibuffer-window)) (unless (or auto-revert-mode (active-minibuffer-window))
;; Only prompts for confirmation when buffer is unsaved. ;; Only prompts for confirmation when buffer is unsaved.
(let ((revert-without-query (list "."))) (let ((revert-without-query (list "")))
(auto-revert-handler)))) (auto-revert-handler))))
(defun doom-auto-revert-buffers-h () (defun doom-auto-revert-buffers-h ()
@ -172,6 +172,13 @@ possible."
:after-call after-find-file :after-call after-find-file
:commands recentf-open-files :commands recentf-open-files
:config :config
(defun doom--recent-file-truename (file)
(if (or (file-remote-p file nil t)
(not (file-remote-p file)))
(file-truename file)
file))
(setq recentf-filename-handlers '(doom--recent-file-truename abbreviate-file-name))
(setq recentf-save-file (concat doom-cache-dir "recentf") (setq recentf-save-file (concat doom-cache-dir "recentf")
recentf-auto-cleanup 'never recentf-auto-cleanup 'never
recentf-max-menu-items 0 recentf-max-menu-items 0
@ -180,15 +187,7 @@ possible."
(list "\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\)$" "^/tmp/" "^/ssh:" (list "\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\)$" "^/tmp/" "^/ssh:"
"\\.?ido\\.last$" "\\.revive$" "/TAGS$" "^/var/folders/.+$" "\\.?ido\\.last$" "\\.revive$" "/TAGS$" "^/var/folders/.+$"
;; ignore private DOOM temp files ;; ignore private DOOM temp files
(lambda (path) (concat "^" (recentf-apply-filename-handlers doom-local-dir))))
(ignore-errors (file-in-directory-p path doom-local-dir)))))
(defun doom--recent-file-truename (file)
(if (or (file-remote-p file nil t)
(not (file-remote-p file)))
(file-truename file)
file))
(setq recentf-filename-handlers '(doom--recent-file-truename abbreviate-file-name))
(add-hook! '(doom-switch-window-hook write-file-functions) (add-hook! '(doom-switch-window-hook write-file-functions)
(defun doom--recentf-touch-buffer-h () (defun doom--recentf-touch-buffer-h ()

View file

@ -3,7 +3,7 @@
(require 'cl-lib) (require 'cl-lib)
(require 'subr-x) (require 'subr-x)
;; Polyfills ;; DEPRECATED Polyfills
(unless EMACS26+ (unless EMACS26+
(with-no-warnings (with-no-warnings
;; `kill-current-buffer' was introduced in Emacs 26 ;; `kill-current-buffer' was introduced in Emacs 26

View file

@ -115,16 +115,6 @@
(delq! 'b alist 'assq) (delq! 'b alist 'assq)
(expect alist :to-equal '((a 1) (c 3)))))) (expect alist :to-equal '((a 1) (c 3))))))
(describe "delete!"
(it "delete's a string from a list"
(let ((list '("a" "b" "c")))
(delete! "b" list)
(expect list :to-equal '("a" "c"))))
(it "delete's an element from an alist by key"
(let ((alist '(("a" 1) ("b" 2) ("c" 3))))
(delete! (assoc "b" alist) alist)
(expect alist :to-equal '(("a" 1) ("c" 3))))))
(describe "hooks" (describe "hooks"
(describe "add-hook!" (describe "add-hook!"
:var (fake-mode-hook other-mode-hook some-mode-hook) :var (fake-mode-hook other-mode-hook some-mode-hook)

View file

@ -25,6 +25,7 @@
haskell-cabal-mode haskell-cabal-mode
literate-haskell-mode) literate-haskell-mode)
#'+haskell/open-repl) #'+haskell/open-repl)
;; Prevent the 'Kill the whole session (y or n)?' prompt caused by the popup ;; Prevent the 'Kill the whole session (y or n)?' prompt caused by the popup
;; manager auto-killing haskell-interactive-mode's popup buffer (and process) ;; manager auto-killing haskell-interactive-mode's popup buffer (and process)
;; by settings :ttl to nil. ;; by settings :ttl to nil.