;;; Set up Elpaca
-(defvar elpaca-installer-version 0.6)
+(defvar elpaca-installer-version 0.7)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
-
;;; Install packages
(elpaca org-transclusion)
"-f" "org-texinfo-export-to-texinfo")
("mv" "README.texi" "pdf-tools.texi"))))
(elpaca ob-prolog)
-(elpaca (query-replace-parallel
- :repo "https://github.com/hokomo/query-replace-parallel.git"))
(elpaca-wait)
"U" #'elpaca-merge-all
"v" #'elpaca-visit
"d" #'elpaca-delete
- "l" #'elpaca-log
+ "l" #'elpaca-log-updates
"i" #'elpaca-info
"t" #'elpaca-try)
+(keymap-unset elpaca-ui-mode-map "p" t)
+(keymap-set elpaca-ui-mode-map "l" #'elpaca-ui-mark-pull)
+
+(defun esy/log-diff (id ref)
+ (require 'diff-mode)
+ (let ((diff-default-read-only t))
+ (elpaca-log-diff id ref)))
+
+(setq elpaca-log-diff-function #'esy/log-diff)
+
+(add-hook 'elpaca-log-mode-hook #'elpaca-log-update-mode)
+(add-hook 'elpaca-log-mode-hook
+ (lambda ()
+ (add-hook 'quit-window-hook
+ (lambda ()
+ (when (get-buffer-window "*elpaca-diff*")
+ (quit-windows-on "*elpaca-diff*")))
+ nil t)))
+
(defalias 'esy/elpaca-prefix-map esy/elpaca-prefix-map)
;;; Set some variables
read-mail-command 'gnus
;; direct Custom definitions to some file and forget about it
custom-file (expand-file-name "custom.el" user-emacs-directory)
- ;; silence native compilation warnings
- native-comp-async-report-warnings-errors 'silent
;; only display the warning buffer if something's really broken
warning-minimum-level :error
;; don't use stale .elc files
display-time-24hr-format t
;; enable recursive minibuffers
enable-recursive-minibuffers t
+ minibuffer-beginning-of-buffer-movement t
bug-reference-url-format "https://debbugs.gnu.org/%s"
;; save bookmarks immediately
bookmark-save-flag 1
remote-file-name-inhibit-auto-save t
;; don't ask me about it either
tramp-allow-unsafe-temporary-files t
+ remote-file-name-inhibit-locks t
;; increase maximum number of recent files Emacs remembers
recentf-max-saved-items 1024
;; increase maximum kill ring size
osm-copyright nil
;; follow links to version-controlled files without confirming
vc-follow-symlinks t
+ vc-handled-backends '(Git)
;; jump from .c to .h files with find-sibling-file
find-sibling-rules '(("\\([^/]+\\)\\.c\\'" "\\1.h")
("nextstep/Emacs.app/Contents/Resources/\\(.*\\)\\'"
read-extended-command-predicate #'command-completion-default-include-p
completions-format 'horizontal
completions-group t
+ completions-sort nil
completions-detailed t
completion-auto-select nil
completion-styles '(substring partial-completion)
completion-category-overrides
'((buffer (styles substring))
- (file (styles basic partial-completion substring))
+ (file (styles basic partial-completion substring)
+ (sort-function . minibuffer-sort-by-history))
(project-file (styles basic partial-completion substring))
(recent-file (styles basic partial-completion substring))
- (command (display-sort-function . minibuffer-sort-by-history)
- (cycle-sort-function . minibuffer-sort-by-history)))
- completion-show-help nil
- ;; completions-header-format nil
+ (command (sort-function . minibuffer-sort-by-history)))
;; completion-auto-help 'visible
completions-max-height 16
completion-auto-wrap t
(add-to-list 'load-path (expand-file-name "lisp/" user-emacs-directory))
(autoload 'some-button "some-button" nil t)
-;; (autoload 'completions-auto-update-mode "completions-auto-update" nil t)
-;; (autoload 'completions-auto-update-global-mode "completions-auto-update" nil t)
(unless (eq system-type 'android)
(add-to-list 'load-path "~/checkouts/esy-publish/")
(with-eval-after-load 'comint
(keymap-set comint-mode-map "C-c C-q" #'esy/log-buffer)
- (add-hook 'comint-mode-hook #'completion-preview-mode))
+ (setq comint-completion-addsuffix nil))
(defun esy/recent-log-summary ()
"Display a summary of my website's most recent access log."
(dolist (mode '(bug-reference-prog-mode
display-fill-column-indicator-mode
display-line-numbers-mode
- flymake-mode
- completion-preview-mode))
+ flymake-mode))
(add-hook 'prog-mode-hook mode))
(add-hook 'lisp-data-mode-hook #'paredit-mode)
;;; Extend standard text mode hooks
(add-hook 'text-mode-hook #'flyspell-mode)
-(add-hook 'text-mode-hook #'completion-preview-mode)
;;; Bind some keys
(list 'sql-password (funcall (plist-get source :secret)))
(list 'sql-server host)
(list 'sql-database db)))))
- (auth-source-search :port 5432 :max 10)))))
+ (auth-source-search :port 5432 :max 100)))))
(esy/update-sql-connection-alist)
(add-hook 'sql-interactive-mode-hook #'toggle-truncate-lines)
(add-hook 'sql-interactive-mode-hook #'abbrev-mode)
;;; Configure minibuffer completions
-(add-to-list 'display-buffer-alist
- '("\\*Completions\\*"
- (display-buffer-reuse-window display-buffer-at-bottom)
- (window-parameters
- ;; (mode-line-format . none)
- (split-window . ignore))))
+;; (add-to-list 'display-buffer-alist
+;; '("\\*Completions\\*"
+;; (display-buffer-reuse-window display-buffer-at-bottom)
+;; (window-parameters
+;; ;; (mode-line-format . none)
+;; (split-window . ignore))))
(add-hook 'completion-list-mode-hook
(lambda ()
(setq-local cursor-in-non-selected-windows nil)))
-(dolist (key-binding '(("C-p" . minibuffer-previous-completion)
- ("C-n" . minibuffer-next-completion)
- ("M-j" . minibuffer-force-complete-and-exit)))
- (keymap-set minibuffer-local-completion-map
- (car key-binding)
- (cdr key-binding)))
-
-;;; Define some custom `completion-at-point-functions'
-
-(defun file-capf ()
- "File completion at point function."
- (pcase (bounds-of-thing-at-point 'filename)
- (`(,beg . ,end)
- (list beg end #'completion-file-name-table
- :annotation-function (lambda (_) " File")
- :exclusive 'no))))
-
-(add-hook 'completion-at-point-functions #'file-capf)
+;; (dolist (key-binding '(("C-p" . minibuffer-previous-completion)
+;; ("C-n" . minibuffer-next-completion)))
+;; (keymap-set minibuffer-local-completion-map
+;; (car key-binding)
+;; (cdr key-binding)))
;;; Configure highlighting of the current line via `lin'
winner-mode
completions-auto-update-mode
mode-face-global-mode
- which-function-mode
+ global-completion-preview-mode
+ ;; tab-bar-mode
))
(funcall mode))
(defvar-keymap esy/emms-map
:doc "My keymap for EMMS commands."
:prefix 'esy/emms-map
- :repeat t
+ :repeat (:hints ((emms-next . "Next")
+ (emms-previous . "Previous")
+ (emms-stop . "Stop")
+ (emms-seek-backward . "backward")
+ (emms-seek-forward . "forward")
+ (emms-seek . "seek")
+ (emms-show . "show")
+ (emms-pause . "pause")
+ (emms-start . "start")
+ (emms-seek-to . "to")))
"N" #'emms-next
"P" #'emms-previous
"S" #'emms-stop
(setq-default prolog-system 'swi)
(add-to-list 'major-mode-remap-alist '(prolog-mode . sweeprolog-mode))
+;; (setq sweeprolog-swipl-path "/Applications/SWI-Prolog.app/Contents/MacOS/swipl")
(with-eval-after-load 'sweeprolog
(setq sweeprolog-top-level-persistent-history
(locate-user-emacs-file ".sweep_history"))
("\\.rb\\'" . ruby-ts-mode)
("\\.rs\\'" . rust-ts-mode)
("\\.go\\'" . go-ts-mode)
- ("\\.plt?\\'" . prolog-mode)
- ("\\.tex\\'" . LaTeX-mode)))
+ ("\\.plt?\\'" . prolog-mode)))
(push cell auto-mode-alist))
;;; Configure Help
(setq
;; read feeds list from a separate file
- elfeed-feeds (esy/feeds)))
+ elfeed-feeds (esy/feeds))
+
+ (with-eval-after-load 'completion-preview
+ (push '(not elfeed-search-mode elfeed-show-mode)
+ global-completion-preview-modes)))
;;; Disable some minor-mode mode-line lighters
;;; Configure TeX
+(add-to-list 'major-mode-remap-alist '(latex-mode . Latex-Mode))
+
(with-eval-after-load 'tex-mode
(require 'tex))
(setq completion-preview-minimum-symbol-length 2)
(keymap-set completion-preview-active-mode-map "M-n" #'completion-preview-next-candidate)
(keymap-set completion-preview-active-mode-map "M-p" #'completion-preview-prev-candidate)
- (keymap-set completion-preview-active-mode-map "M-i" #'completion-preview-insert))
+ ;; (keymap-set completion-preview-active-mode-map "M-i" #'completion-preview-insert)
+ )
(load-file "/Users/eshelyaron/checkouts/agda/src/data/emacs-mode/agda2.el")
(defun esy/read-buffer (prompt &optional def require-match predicate)
(minibuffer-with-setup-hook
- (lambda ()
- (when read-buffer-to-switch-current-buffer
- (read-buffer-to-switch-mode)))
+ (:append
+ (lambda ()
+ (when read-buffer-to-switch-current-buffer
+ (read-buffer-to-switch-mode))))
(let ((read-buffer-function nil))
(read-buffer prompt def require-match predicate))))
(defun esy/kill-buffers (buffers)
(interactive
(list (let ((def (buffer-name)))
- (completing-read-multiple
- (format-prompt "Kill buffers" def)
- #'completion-buffer-name-table nil t nil
- 'buffer-name-history def))))
+ (minibuffer-with-setup-hook
+ (lambda () (setq minibuffer-completion-action
+ (cons (lambda (buf-name)
+ (kill-buffer buf-name)
+ (message "Killed %s" buf-name))
+ "kill")))
+ (completing-read-multiple
+ (format-prompt "Kill buffers" def)
+ (completion-buffer-name-table) nil t nil
+ 'buffer-name-history def)))))
(when buffers
(let ((num (length buffers)))
(while (and buffers (kill-buffer (car buffers)))
(load-file (expand-file-name "admin/cherry.el" source-directory))
-(defvar-local minibuffer-hint-timer nil)
-
-(defvar minibuffer-hint-idle-time 1)
-
-(defun minibuffer-hint ()
- (when-let ((beg-end (minibuffer--completion-boundaries))
- (beg (car beg-end)) (end (cdr beg-end))
- (all (let ((completion--input completion--input)
- (completion-lazy-hilit t))
- (completion-all-sorted-completions beg end))))
- (setcdr (last all) nil)
- (let (minibuffer-message-timeout)
- (minibuffer-message (concat (propertize (car all) 'face 'bold)
- (when (cdr all)
- (concat
- " and "
- (number-to-string (1- (length all)))
- " more")))))))
-
-(defun minibuffer-hint-cancel-timer ()
- (when (timerp minibuffer-hint-timer)
- (cancel-timer minibuffer-hint-timer)
- (setq minibuffer-hint-timer nil)))
-
-(defun minibuffer-hint-fn (buffer)
- (lambda ()
- (when (equal (current-buffer) buffer)
- (minibuffer-hint))
- (when (buffer-live-p buffer)
- (with-current-buffer buffer (minibuffer-hint-cancel-timer)))))
-
-(defun minibuffer-hint-start-timer ()
- (unless (timerp minibuffer-hint-timer)
- (setq minibuffer-hint-timer
- (run-with-idle-timer minibuffer-hint-idle-time
- nil (minibuffer-hint-fn (current-buffer))))))
-
-(define-minor-mode minibuffer-hint-mode
- "Foo."
- :lighter nil
- (if minibuffer-hint-mode
- (progn
- (add-hook 'post-self-insert-hook #'minibuffer-hint-start-timer nil t)
- (add-hook 'minibuffer-exit-hook #'minibuffer-hint-cancel-timer nil t)
- (add-hook 'pre-command-hook #'minibuffer-hint-cancel-timer nil t))
- (remove-hook 'post-self-insert-hook #'minibuffer-hint-start-timer t)
- (remove-hook 'minibuffer-exit-hook #'minibuffer-hint-cancel-timer t)
- (remove-hook 'pre-command-hook #'minibuffer-hint-cancel-timer t)
- (minibuffer-hint-cancel-timer)))
-
-(add-hook 'minibuffer-setup-hook (lambda ()
- (when minibuffer-completion-table
- (minibuffer-hint-mode))))
+(add-hook 'minibuffer-setup-hook #'minibuffer-hint-mode)
(with-eval-after-load 'magit
(with-eval-after-load 'diff-hl