From 9abf22126b3a9418a1bcd1d8aeceb95090f37d04 Mon Sep 17 00:00:00 2001 From: rubikitch Date: Sat, 26 Nov 2016 11:25:52 +0900 Subject: [PATCH] anything.el: PRETTY SHORTCUTS! Use left-margin. --- anything.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/anything.el b/anything.el index 88bddec..c118274 100644 --- a/anything.el +++ b/anything.el @@ -1749,6 +1749,7 @@ ANY-KEYMAP ANY-DEFAULT ANY-HISTORY See `anything'." (with-anything-restore-variables (anything-initialize any-resume any-input any-sources) (anything-display-buffer anything-buffer) + (anything-set-margin) (anything-log "show prompt") (unwind-protect (anything-read-pattern-maybe @@ -2113,12 +2114,18 @@ If TEST-MODE is non-nil, clear `anything-candidate-cache'." for overlay = (make-overlay (point-min) (point-min) (get-buffer buffer)) do (overlay-put overlay 'before-string - (format "%s - " (upcase (make-string 1 key)))) - collect overlay)))) + (propertize " " 'display + `((margin left-margin) ,(upcase (make-string 1 key))))) + collect overlay))) + ) (anything-digit-overlays (mapc 'delete-overlay anything-digit-overlays) (setq anything-digit-overlays nil)))) +(defun anything-set-margin () + (when anything-enable-shortcuts + (set-window-margins (get-buffer-window anything-buffer) 1))) + (defun anything-hooks (setup-or-cleanup) "Add or remove hooks according to SETUP-OR-CLEANUP value. if SETUP-OR-CLEANUP value is setup add hooks, any other value -- 2.11.4.GIT