Compare commits

...

4 Commits

Author SHA1 Message Date
20d612c301 define scroll-mode via use-package 2025-06-18 16:18:40 +02:00
97e7d3c881 add dependency for tool-bar 2025-06-18 16:07:31 +02:00
612300aef0 fix mouse-mode for terminals 2025-06-18 16:04:41 +02:00
beb2daaf06 fix tool-bar call 2025-06-18 16:03:47 +02:00
4 changed files with 40 additions and 31 deletions

View File

@@ -38,7 +38,8 @@
;; (add-to-list 'default-frame-alist '(tool-bar-position . left))
;; (add-to-list 'default-frame-alist '(horizontal-scroll-bars . t)) ;; see gui-settings
(menu-bar-mode -1) ;; menu displayed inside `tab-bar' and via `tmm-menubar'
(tool-bar-mode -1)
(when (featurep 'tool-bar)
(tool-bar-mode -1))
;; transparency
(set-frame-parameter (selected-frame) 'alpha '(95 . 95)) ;; VALUE: '(<active> . <inactive>) / <both>

View File

@@ -557,12 +557,17 @@ Version 2016-07-13"
;;
;; Enable mouse support, https://stackoverflow.com/questions/5710334/how-can-i-get-mouse-selection-to-work-in-emacs-and-iterm2-on-mac
(unless (display-graphic-p)
(require 'mouse)
;; (require 'mouse)
(require 'xt-mouse)
(xterm-mouse-mode t)
(global-set-key [mouse-4] (lambda () (interactive) (scroll-down 1)))
(global-set-key [mouse-5] (lambda () (interactive) (scroll-up 1)))
(defun track-mouse (e))
(setq mouse-sel-mode t))
(global-set-key (kbd "<wheel-up>") 'scroll-down-line)
(global-set-key (kbd "<wheel-down>") 'scroll-up-line)
;; still needed?
;; (global-set-key [mouse-4] (lambda () (interactive) (scroll-down 1)))
;; (global-set-key [mouse-5] (lambda () (interactive) (scroll-up 1)))
;; (defun track-mouse (e))
;; (setq mouse-sel-mode t)
)
(global-set-key (kbd "<mouse-8>") (lambda () (interactive) (previous-buffer)))
(global-set-key (kbd "<mouse-9>") (lambda () (interactive) (next-buffer)))
;;; Scrolling

View File

@@ -41,31 +41,7 @@
(help-mode . visual-line-mode)
(messages-buffer-mode . visual-line-mode)
:config
(set-face-attribute 'fill-column-indicator nil :foreground "DarkSlateGray") ;; inherit shadow
;; `scroll-bar-mode' sets for all frames and all windows
;; use `set-window-scroll-bars' for windows only
(scroll-bar-mode 0) ;; 1st deactivate scrolling
(defun my-window-scroll-function (window display-start)
"This function
- is listed in `window-scroll-functions' which is called by
`set-window-buffer' before running `window-configuration-change-hook'
and therefore will be run on every vertical scroll event
- will activate vertical scoll bar if not whole buffer height is
visible
WINDOW: `window' object, its string will look like #<window 3 on gui-settings.el> and
DISPLAY-START: `integer', e.g. 3820"
;; (message "%s" window)
(let ((vertical-type nil)
(horizontal-type nil))
(unless (string-equal (format-mode-line "%p") "All")
(setq vertical-type 'right))
;; `scroll-bar-mode' not used bc/ it's global, therefore:
(set-window-scroll-bars
window nil vertical-type nil horizontal-type nil)))
(add-to-list 'window-scroll-functions #'my-window-scroll-function)
) ;; end of use-package emacs
(set-face-attribute 'fill-column-indicator nil :foreground "DarkSlateGray")) ;; inherit shadow
;; ┌────────────── Frame width ───────────────┐
@@ -103,6 +79,32 @@ DISPLAY-START: `integer', e.g. 3820"
(setq window-divider-default-places 'right-only)
(window-divider-mode 1))
(use-package scroll-bar
:defer t
:config
;; `scroll-bar-mode' sets for all frames and all windows
;; use `set-window-scroll-bars' for windows only
(scroll-bar-mode 0) ;; 1st deactivate scrolling
(defun my-window-scroll-function (window display-start)
"This function
- is listed in `window-scroll-functions' which is called by
`set-window-buffer' before running `window-configuration-change-hook'
and therefore will be run on every vertical scroll event
- will activate vertical scoll bar if not whole buffer height is
visible
WINDOW: `window' object, its string will look like #<window 3 on gui-settings.el> and
DISPLAY-START: `integer', e.g. 3820"
;; (message "%s" window)
(let ((vertical-type nil)
(horizontal-type nil))
(unless (string-equal (format-mode-line "%p") "All")
(setq vertical-type 'right))
;; `scroll-bar-mode' not used bc/ it's global, therefore:
(set-window-scroll-bars
window nil vertical-type nil horizontal-type nil)))
(add-to-list 'window-scroll-functions #'my-window-scroll-function))
(use-package tab-bar
:defer 0.5
:bind ((:map global-map

View File

@@ -121,6 +121,7 @@
;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Tool-Bar.html
;; auto-resize-tool-bars
(use-package tool-bar
:after (image)
:defer t
:config
;; add local icon folder to the image-load-path