From f492670a1873a87ea77b7f787bb3a5a3a237809d Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Wed, 5 Oct 2022 22:54:31 -0400 Subject: [PATCH] Improve the situation with helm-margins --- global.org | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/global.org b/global.org index 5807785..33681d4 100644 --- a/global.org +++ b/global.org @@ -137,7 +137,9 @@ Try to get along with large margins #+begin_src emacs-lisp (setq-default left-margin-width 3 - right-margin-width 3) + right-margin-width 3 + helm-left-margin-width left-margin-width + helm-buffers-left-margin-width left-margin-width) (fringe-mode 10) ;(set-window-buffer nil (current-buffer)) #+end_src @@ -2358,6 +2360,89 @@ '(([C-c DEL] . helm-ff-run-toggle-auto-update)) nil 'helm-ff-delete-char-backward--exit-fn) (add-hook 'helm-after-initialize-hook 'fix-helm-margins) + + (overlay-put helm-selection-overlay 'before-string + (propertize "." 'display + `((margin left-margin) ,(propertize "▶ " 'face 'default)))) + #+end_src + Fix helm margins the bad way + #+begin_src emacs-lisp + (defun helm-display-mode-line (source &optional force) + "Set up mode-line and header-line for `helm-buffer'. + + SOURCE is a Helm source object. + + Optional argument FORCE forces redisplay of the Helm buffer's + mode and header lines." + (set (make-local-variable 'helm-mode-line-string) + (helm-interpret-value (or (and (listp source) ; Check if source is empty. + (assoc-default 'mode-line source)) + (default-value 'helm-mode-line-string)) + source)) + (let ((follow (and (or (helm-follow-mode-p source) + (and helm-follow-mode-persistent + (member (assoc-default 'name source) + helm-source-names-using-follow))) + " (HF)")) + (marked (and helm-marked-candidates + (cl-loop with cur-name = (assoc-default 'name source) + for c in helm-marked-candidates + for name = (assoc-default 'name (car c)) + when (string= name cur-name) + collect c)))) + ;; Setup mode-line. + (if helm-mode-line-string + (setq mode-line-format + `(:propertize + ("╺═╸ " mode-line-buffer-identification " " + (:eval (format "L%-3d" (helm-candidate-number-at-point))) + ,follow + " " + (:eval ,(and marked + (propertize + (format "M%d" (length marked)) + 'face 'helm-visible-mark))) + (:eval (when ,helm--mode-line-display-prefarg + (let ((arg (prefix-numeric-value + (or prefix-arg current-prefix-arg)))) + (unless (= arg 1) + (propertize (format " [prefarg:%s]" arg) + 'face 'helm-prefarg))))) + " " + (:eval (with-helm-buffer + (helm-show-candidate-number + (car-safe helm-mode-line-string)))) + " " helm--mode-line-string-real " " + (:eval (make-string (window-width) ? ))) + keymap (keymap (mode-line keymap + (mouse-1 . ignore) + (down-mouse-1 . ignore) + (drag-mouse-1 . ignore) + (mouse-2 . ignore) + (down-mouse-2 . ignore) + (drag-mouse-2 . ignore) + (mouse-3 . ignore) + (down-mouse-3 . ignore) + (drag-mouse-3 . ignore)))) + helm--mode-line-string-real + (substitute-command-keys (if (listp helm-mode-line-string) + (cadr helm-mode-line-string) + helm-mode-line-string))) + (setq mode-line-format (default-value 'mode-line-format))) + ;; Setup header-line. + (cond (helm-echo-input-in-header-line + (setq force t) + (helm--set-header-line)) + (helm-display-header-line + (let ((hlstr (helm-interpret-value + (and (listp source) + (assoc-default 'header-line source)) + source)) + (endstr (make-string (window-width) ? ))) + (setq header-line-format + (propertize (concat " " hlstr endstr) + 'face 'helm-header)))))) + (when force (force-mode-line-update))) #+end_src ** multiple-cursors #+begin_src emacs-lisp