diff options
Diffstat (limited to 'basic.el')
-rw-r--r-- | basic.el | 52 |
1 files changed, 52 insertions, 0 deletions
@@ -1,5 +1,11 @@ ;;; -*- lexical-binding: t; -*- +;;; No limit in printing, since I oft want to print the results of +;;; evaluating expressions. + +(set 'eval-expression-print-length nil) ;; A value of nil means no limit. +(set 'eval-expression-print-level nil) ;; A value of nil means no limit. + ;;; Important in order to read passwords (setq epg-pinentry-mode 'loopback) @@ -337,6 +343,52 @@ window horizontally." (define-key global-map (vector ?\s-D) #'dired-other-window) (define-key global-map (vector ?\s-v) #'durand-focus-completion-or-minibuffer) +;; I like to use winner mode now + +(require 'winner) + +(winner-mode 1) + +;;; Escape triggers super + +(define-key input-decode-map (vector 27) nil) +(define-key input-decode-map (vector 27) #'event-apply-control-modifier) +(define-key key-translation-map (vector 27) #'event-apply-control-modifier) + +;;; Don't ask me to confirm! + +;;;###autoload +(defun durand-bookmark-completing-read (prompt &optional default) + "Prompting with PROMPT, read a bookmark name in completion. +PROMPT will get a \": \" stuck on the end no matter what, so you +probably don't want to include one yourself. +Optional arg DEFAULT is a string to return if the user input is empty. +If DEFAULT is nil then return empty string for empty input. + +Don't ask me to confirm my choice. --- Durand" + (bookmark-maybe-load-default-file) ; paranoia + (if (listp last-nonmenu-event) + (bookmark-menu-popup-paned-menu t prompt + (if bookmark-sort-flag + (sort (bookmark-all-names) + 'string-lessp) + (bookmark-all-names))) + (let* ((completion-ignore-case bookmark-completion-ignore-case) + (default (unless (equal "" default) default)) + (prompt (concat prompt (if default + (format " (%s): " default) + ": ")))) + (completing-read prompt + (lambda (string pred action) + (if (eq action 'metadata) + '(metadata (category . bookmark)) + (complete-with-action + action bookmark-alist string pred))) + nil t nil 'bookmark-history default)))) + +(advice-add 'bookmark-completing-read :override #'durand-bookmark-completing-read) + + ;;; Package management ;;;###autoload |