From 43afe6c5db55704f787aaee4cedd7f4c69206b8b Mon Sep 17 00:00:00 2001 From: JSDurand Date: Wed, 27 Jan 2021 18:34:52 +0800 Subject: Further configurations * basic.el (eval-expression-print-length): (eval-expression-print-level): Now echo are will print without limits. (winner): Enable winner-mode at start up. (input-decode-map): (key-translation-map): Translate ESC to make the following key modified by control. (bookmark-completing-read): (durand-bookmark-completing-read): Now it won't ask me for confirmation about my choices. * init.el ("durand-chercher-pdf"): Further enhance the convenience of viewing PDFs. ("embark-conf.el"): Now I don't use embark anymore. * view-conf.el (durand-view-map): Add my own way of viewing things. (durand-open-targets): These are the things I can open. (durand-open-object): Open things quickly. --- basic.el | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'basic.el') diff --git a/basic.el b/basic.el index b6fd4bf..fc1740e 100644 --- a/basic.el +++ b/basic.el @@ -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 -- cgit v1.2.3-18-g5258