]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Update Emacs configuration
authorEshel Yaron <me@eshelyaron.com>
Fri, 9 Feb 2024 11:40:08 +0000 (12:40 +0100)
committerEshel Yaron <me@eshelyaron.com>
Fri, 9 Feb 2024 11:40:08 +0000 (12:40 +0100)
.emacs.d/init.el

index 6956fd9590635abac683e9577c9cc71e199efa66..39a97f76fafbdb4371b9594a35aebee5ef80e63d 100644 (file)
 ;;; Install packages
 
 (elpaca org-transclusion)
-(elpaca (sweeprolog
-         :files ("*.org" "*.texi" "sweep.pl"
-                 "sweeprolog-pce-theme.el" "sweeprolog.el")))
+(elpaca sweeprolog)
 (elpaca avy)
 (elpaca (bbdb
          :repo "https://git.savannah.nongnu.org/git/bbdb.git"
@@ -1036,14 +1034,7 @@ as the initial input for completion, and return that directory."
 
 (with-eval-after-load 'tramp
   (tramp-set-completion-function "ssh" '((tramp-parse-netrc "~/.authinfo.gpg")))
-  (add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil))
-  (define-advice completion-file-name-table (:filter-args (args) no-remote-file-name-completion)
-    (let ((string (car args))
-          (pred (cadr args))
-          (action (caddr args)))
-      (if (and (file-remote-p string) (eq pred #'file-exists-p))
-          (list string nil action)
-        (list string pred action)))))
+  (add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil)))
 
 ;;; Configure `proced'
 
@@ -1450,9 +1441,14 @@ as the initial input for completion, and return that directory."
              (all (let ((completion--input completion--input)
                         (completion-lazy-hilit t))
                     (completion-all-sorted-completions beg end))))
+    (setcdr (last all) nil)
     (let (minibuffer-message-timeout)
-      ;; TODO show number of completions and/or use different face when exact.
-      (minibuffer-message (propertize (car all) 'face 'completions-common-part)))))
+      (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)
@@ -1478,8 +1474,11 @@ as the initial input for completion, and return that directory."
   (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 '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 ()