Tabs, menu entry suppression, and small section reorg.

Commit
54fbf6576cf2dd94ef5af332a6075723a9dfa8b3
Author
Blendoit <blendoit@gmail.com>
Author date
Committer
Blendoit <blendoit@gmail.com>
Committer date
Changed files
blendoit-theme.el
index c23144c8..1196e4fb 100644..100644
@@ -77,7 +77,7 @@
77 77 '(mode-line-inactive ((t (:inherit mode-line :background "gainsboro" :weight light))))
78 78 '(isearch ((t (:stipple nil :background "yellow" :foreground "black" :weight bold))))
79 79 '(isearch-fail ((t (:background "RosyBrown1"))))
80 Removed: '(lazy-highlight ((t (:weight "medium" :inherit isearch))))
80 Added: '(lazy-highlight ((t (:inherit isearch))))
81 81 '(match ((t (:background "light yellow"))))
82 82 '(next-error ((t (:inherit (region)))))
83 83 '(query-replace ((t (:inherit isearch))))
blendoit/init-blendoit.org
index 28962e24..2a78126a 100644..100644
@@ -129,6 +129,7 @@
129 129 (global-set-key (kbd "C-b") 'ibuffer-sidebar-toggle-sidebar)
130 130 (global-set-key (kbd "C-o") 'menu-find-file-existing)
131 131 (global-set-key (kbd "C-r") 'counsel-recentf)
132 Added: (global-set-key (kbd "C-n") 'make-frame)
132 133 #+END_SRC
133 134
134 135 The following bindings lead to more natural exit behaviors.
@@ -502,17 +503,6 @@
502 503 :config (pdf-loader-install))
503 504 #+END_SRC
504 505
505 Removed: ** rainbow
506 Removed:
507 Removed: This highlights hexadecimal numbers which look like colors, in that same color.
508 Removed:
509 Removed: #+BEGIN_SRC emacs-lisp
510 Removed: (use-package rainbow-mode
511 Removed: :ensure t
512 Removed: :init
513 Removed: (add-hook 'prog-mode-hook 'rainbow-mode))
514 Removed: #+END_SRC
515 Removed:
516 506 ** Dashboard
517 507
518 508 We replace the standard welcome screen with our own.
@@ -528,6 +518,17 @@
528 518 (setq dashboard-banner-logo-title "The editor for the 2nd millenium."))
529 519 #+END_SRC
530 520
521 Added: ** rainbow
522 Added:
523 Added: This highlights hexadecimal numbers which look like colors, in that same color.
524 Added:
525 Added: #+BEGIN_SRC emacs-lisp
526 Added: (use-package rainbow-mode
527 Added: :ensure t
528 Added: :init
529 Added: (add-hook 'prog-mode-hook 'rainbow-mode))
530 Added: #+END_SRC
531 Added:
531 532 ** Projectile
532 533
533 534 This enables us to better manage our =.git= projects.
@@ -539,6 +540,20 @@
539 540 (setq projectile-completion-system 'ivy))
540 541 #+END_SRC
541 542
543 Added: ** Better parentheses
544 Added:
545 Added: #+BEGIN_SRC emacs-lisp
546 Added: (show-paren-mode 1)
547 Added:
548 Added: (use-package smartparens
549 Added: :config
550 Added: (add-hook 'prog-mode-hook #'smartparens-mode))
551 Added:
552 Added: (use-package rainbow-delimiters
553 Added: :config
554 Added: (add-hook 'prog-mode-hook #'rainbow-delimiters-mode))
555 Added: #+END_SRC
556 Added:
542 557 * Cosmetics
543 558
544 559 ** Faces & cursors
@@ -627,6 +642,100 @@
627 642 ; (set-window-scroll-bars (ibuffer-sidebar-window) nil nil)
628 643 #+END_SRC
629 644
645 Added: ** Clean up menus
646 Added:
647 Added: We reduce the burden on the user by reducing total amount of entries in GUI
648 Added: menus.
649 Added:
650 Added: *** File
651 Added:
652 Added: #+BEGIN_SRC emacs-lisp
653 Added: (define-key menu-bar-file-menu [dired] nil)
654 Added: (define-key menu-bar-file-menu [print-buffer] nil)
655 Added: (define-key menu-bar-file-menu [print-region] nil)
656 Added: (define-key menu-bar-file-menu [ps-print-buffer-faces] nil)
657 Added: (define-key menu-bar-file-menu [ps-print-region-faces] nil)
658 Added: (define-key menu-bar-file-menu [ps-print-buffer] nil)
659 Added: (define-key menu-bar-file-menu [ps-print-region] nil)
660 Added: (define-key menu-bar-file-menu [split-window-below] nil)
661 Added: (define-key menu-bar-file-menu [split-window-right] nil)
662 Added: (define-key menu-bar-file-menu [dired] nil)
663 Added: #+END_SRC
664 Added:
665 Added: *** Edit
666 Added:
667 Added: #+BEGIN_SRC emacs-lisp
668 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
669 Added: (define-key menu-bar-file-menu [dired] nil)
670 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
671 Added: #+END_SRC
672 Added:
673 Added: *** Options
674 Added:
675 Added: #+BEGIN_SRC emacs-lisp
676 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
677 Added: (define-key menu-bar-file-menu [dired] nil)
678 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
679 Added: #+END_SRC
680 Added:
681 Added: *** Buffers
682 Added:
683 Added: #+BEGIN_SRC emacs-lisp
684 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
685 Added: (define-key menu-bar-file-menu [dired] nil)
686 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
687 Added: #+END_SRC
688 Added:
689 Added: *** Tools
690 Added:
691 Added: #+BEGIN_SRC emacs-lisp
692 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
693 Added: (define-key menu-bar-file-menu [dired] nil)
694 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
695 Added: #+END_SRC
696 Added:
697 Added: *** Org
698 Added:
699 Added: #+BEGIN_SRC emacs-lisp
700 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
701 Added: (define-key menu-bar-file-menu [dired] nil)
702 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
703 Added: #+END_SRC
704 Added:
705 Added: *** Tbl
706 Added:
707 Added: #+BEGIN_SRC emacs-lisp
708 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
709 Added: (define-key menu-bar-file-menu [dired] nil)
710 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
711 Added: #+END_SRC
712 Added:
713 Added: *** Text
714 Added:
715 Added: #+BEGIN_SRC emacs-lisp
716 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
717 Added: (define-key menu-bar-file-menu [dired] nil)
718 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
719 Added: #+END_SRC
720 Added:
721 Added: *** Projectile
722 Added:
723 Added: #+BEGIN_SRC emacs-lisp
724 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
725 Added: (define-key menu-bar-file-menu [dired] nil)
726 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
727 Added: #+END_SRC
728 Added:
729 Added: *** Help
730 Added:
731 Added: #+BEGIN_SRC emacs-lisp
732 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
733 Added: (define-key menu-bar-file-menu [dired] nil)
734 Added: (define-key menu-bar-help-menu [emacs-psychotherapist] nil)
735 Added: #+END_SRC
736 Added:
737 Added: ** Coding standards
738 Added:
630 739 This is just a better default.
631 740
632 741 #+BEGIN_SRC emacs-lisp
@@ -634,6 +743,203 @@
634 743 c-basic-offset 4)
635 744 #+END_SRC
636 745
746 Added: ** Tabs
747 Added:
748 Added: #+BEGIN_SRC emacs-lisp
749 Added: (use-package tabbar)
750 Added: #+END_SRC
751 Added:
752 Added: Thank you
753 Added: https://andreyorst.gitlab.io/posts/2020-05-10-making-emacs-tabs-look-like-in-atom/
754 Added:
755 Added: #+BEGIN_SRC emacs-lisp
756 Added: (when (and window-system
757 Added: (not (version< emacs-version "27")))
758 Added: (use-package tab-line
759 Added: :hook (after-init . global-tab-line-mode)
760 Added: :config
761 Added: (defun tab-line-close-tab (&optional e)
762 Added: "Close the selected tab.
763 Added:
764 Added: If tab is presented in another window, close the tab by using
765 Added: `bury-buffer` function. If tab is unique to all existing
766 Added: windows, kill the buffer with `kill-buffer` function. Lastly, if
767 Added: no tabs left in the window, it is deleted with `delete-window`
768 Added: function."
769 Added: (interactive "e")
770 Added: (let* ((posnp (event-start e))
771 Added: (window (posn-window posnp))
772 Added: (buffer (get-pos-property 1 'tab (car (posn-string posnp)))))
773 Added: (with-selected-window window
774 Added: (let ((tab-list (tab-line-tabs-window-buffers))
775 Added: (buffer-list (flatten-list
776 Added: (seq-reduce (lambda (list window)
777 Added: (select-window window t)
778 Added: (cons (tab-line-tabs-window-buffers) list))
779 Added: (window-list) nil))))
780 Added: (select-window window)
781 Added: (if (> (seq-count (lambda (b) (eq b buffer)) buffer-list) 1)
782 Added: (progn
783 Added: (if (eq buffer (current-buffer))
784 Added: (bury-buffer)
785 Added: (set-window-prev-buffers window (assq-delete-all buffer (window-prev-buffers)))
786 Added: (set-window-next-buffers window (delq buffer (window-next-buffers))))
787 Added: (unless (cdr tab-list)
788 Added: (ignore-errors (delete-window window))))
789 Added: (and (kill-buffer buffer)
790 Added: (unless (cdr tab-list)
791 Added: (ignore-errors (delete-window window)))))))))
792 Added:
793 Added:
794 Added: (defcustom tab-line-tab-min-width 10
795 Added: "Minimum width of a tab in characters."
796 Added: :type 'integer
797 Added: :group 'tab-line)
798 Added:
799 Added:
800 Added: (defcustom tab-line-tab-max-width 30
801 Added: "Maximum width of a tab in characters."
802 Added: :type 'integer
803 Added: :group 'tab-line)
804 Added:
805 Added: (defcustom tab-line-ellipsis-string "…"
806 Added: "String for indicating truncated names"
807 Added: :type 'string
808 Added: :group 'tab-line)
809 Added:
810 Added: (defun aorst/tab-line--tab-width (window-width tab-amount)
811 Added: "Calculate width of single tab dividing WINDOW-WIDTH by TAB-AMOUNT."
812 Added: (let* ((close-button-size
813 Added: (if tab-line-close-button-show
814 Added: (length (substring-no-properties tab-line-close-button)) 0))
815 Added: (tab-width (/ window-width tab-amount)))
816 Added: (- (cond ((< window-width 0)
817 Added: tab-line-tab-min-width)
818 Added: ((>= tab-width tab-line-tab-max-width)
819 Added: tab-line-tab-max-width)
820 Added: ((< tab-width tab-line-tab-min-width)
821 Added: tab-line-tab-min-width)
822 Added: (t tab-width))
823 Added: close-button-size)))
824 Added:
825 Added: (defun aorst/tab-line--max-width (window)
826 Added: "Calculate free width of the WINDOW.
827 Added:
828 Added: Free width means amount of space we can use to display tabs
829 Added: without truncation."
830 Added: (- (window-width window)
831 Added: (length (substring-no-properties tab-line-left-button))
832 Added: (length (substring-no-properties tab-line-right-button))
833 Added: (if tab-line-new-button-show
834 Added: (length (substring-no-properties tab-line-new-button))
835 Added: 0)))
836 Added:
837 Added:
838 Added: (defun aorst/tab-line--make-pad (tab-width name-width)
839 Added: "Generate padding string based on TAB-WIDTH and NAME-WIDTH."
840 Added: (let* ((width (- tab-width name-width))
841 Added: (padding (/ (if (oddp width) (+ width 1) width) 2)))
842 Added: (make-string padding ?\s)))
843 Added:
844 Added:
845 Added: (defun aorst/tab-line-name-buffer (buffer &rest _buffers)
846 Added: "Create name for tab with padding and truncation.
847 Added:
848 Added: If buffer name is shorter than `tab-line-tab-max-width' it gets
849 Added: centered with spaces, otherwise it is truncated, to preserve
850 Added: equal width for all tabs. This function also tries to fit as
851 Added: many tabs in window as possible, so if there are no room for tabs
852 Added: with maximum width, it calculates new width for each tab and
853 Added: truncates text if needed. Minimal width can be set with
854 Added: `tab-line-tab-min-width' variable."
855 Added: (with-current-buffer buffer
856 Added: (let* ((amount (length (tab-line-tabs-window-buffers)))
857 Added: (width (aorst/tab-line--tab-width
858 Added: (aorst/tab-line--max-width (get-buffer-window buffer))
859 Added: amount))
860 Added: (buffer (string-trim (buffer-name)))
861 Added: (name-width (length buffer))
862 Added: (right-pad (if tab-line-close-button-show "" " "))
863 Added: (truncate-width (- width
864 Added: (length tab-line-ellipsis-string)
865 Added: (length right-pad))))
866 Added: (if (>= name-width truncate-width)
867 Added: (concat " " (truncate-string-to-width buffer truncate-width) tab-line-ellipsis-string right-pad)
868 Added: (let* ((padding (aorst/tab-line--make-pad width name-width))
869 Added: (tab-text (concat padding buffer))
870 Added: (text-width (length tab-text)))
871 Added: (concat tab-text (make-string (- width text-width) ?\s)))))))
872 Added:
873 Added:
874 Added: (setq tab-line-close-button-show t
875 Added: tab-line-new-button-show nil
876 Added: tab-line-separator ""
877 Added: tab-line-tab-name-function #'aorst/tab-line-name-buffer
878 Added: tab-line-right-button (propertize (if (char-displayable-p ?▶) " ▶ " " > ")
879 Added: 'keymap tab-line-right-map
880 Added: 'mouse-face 'tab-line-highlight
881 Added: 'help-echo "Click to scroll right")
882 Added: tab-line-left-button (propertize (if (char-displayable-p ?◀) " ◀ " " < ")
883 Added: 'keymap tab-line-left-map
884 Added: 'mouse-face 'tab-line-highlight
885 Added: 'help-echo "Click to scroll left")
886 Added: tab-line-close-button (propertize (if (char-displayable-p ?×) " × " " x ")
887 Added: 'keymap tab-line-tab-close-map
888 Added: 'mouse-face 'tab-line-close-highlight
889 Added: 'help-echo "Click to close tab"))
890 Added:
891 Added:
892 Added: (let ((bg (if (facep 'solaire-default-face)
893 Added: (face-attribute 'solaire-default-face :background)
894 Added: (face-attribute 'default :background)))
895 Added: (fg (face-attribute 'default :foreground))
896 Added: (base (if (facep 'solaire-default-face)
897 Added: (face-attribute 'default :background)
898 Added: (face-attribute 'mode-line :background)))
899 Added: (box-width (/ (line-pixel-height) 2)))
900 Added: (when (and (color-defined-p bg)
901 Added: (color-defined-p fg)
902 Added: (color-defined-p base)
903 Added: (numberp box-width))
904 Added: (set-face-attribute 'tab-line nil
905 Added: :background base
906 Added: :foreground fg
907 Added: :height 1.0
908 Added: :inherit nil
909 Added: :box (list :line-width -1 :color base))
910 Added: (set-face-attribute 'tab-line-tab nil
911 Added: :foreground fg
912 Added: :background bg
913 Added: :weight 'normal
914 Added: :inherit nil
915 Added: :box (list :line-width box-width :color bg))
916 Added: (set-face-attribute 'tab-line-tab-inactive nil
917 Added: :foreground fg
918 Added: :background base
919 Added: :weight 'normal
920 Added: :inherit nil
921 Added: :box (list :line-width box-width :color base))
922 Added: (set-face-attribute 'tab-line-tab-current nil
923 Added: :foreground fg
924 Added: :background bg
925 Added: :weight 'normal
926 Added: :inherit nil
927 Added: :box (list :line-width box-width :color bg))))
928 Added: (setq tab-line-exclude-modes '())
929 Added: (dolist (mode '(ediff-mode
930 Added: process-menu-mode
931 Added: term-mode
932 Added: vterm-mode))
933 Added: (add-to-list 'tab-line-exclude-modes mode))
934 Added:
935 Added: (defun aorst/tab-line-drop-caches ()
936 Added: "Drops `tab-line' cache in every window."
937 Added: (dolist (window (window-list))
938 Added: (set-window-parameter window 'tab-line-cache nil)))
939 Added:
940 Added: (add-hook 'window-configuration-change-hook #'aorst/tab-line-drop-caches)))
941 Added: #+END_SRC
942 Added:
637 943 ** auto fill
638 944
639 945 Automatically break lines longer than =fill-column=.
@@ -649,18 +955,6 @@
649 955 (setq recentf-max-menu-items 25)
650 956 (setq recentf-max-saved-items 25)
651 957 (run-at-time nil (* 5 60) 'recentf-save-list)
652 Removed: #+END_SRC
653 Removed:
654 Removed: ** Better parentheses
655 Removed:
656 Removed: #+BEGIN_SRC emacs-lisp
657 Removed: (use-package smartparens
658 Removed: :config
659 Removed: (add-hook 'prog-mode-hook #'smartparens-mode))
660 Removed:
661 Removed: (use-package rainbow-delimiters
662 Removed: :config
663 Removed: (add-hook 'prog-mode-hook #'rainbow-delimiters-mode))
664 958 #+END_SRC
665 959
666 960 * Profiling --- stop
init-custom.el
index a714f508..755c2e1a 100644..100644
@@ -17,8 +17,9 @@
17 17 '(custom-enabled-themes nil)
18 18 '(custom-safe-themes
19 19 (quote
20 Removed: ("429c077679e0586d1b6a9f22586129bb4e0793e70b414ff93f023fcfa654b08a" "9893c7f1274df4d4df0573da1ee4dfe32f73f71cdf45bba7596a09e6c637d990" "e274c4d17ef47311855ce93dcc34c512bb285e3a01e9b3b1b735e059a865e48d" "59b58e2d0b77f0e8dc305bba18dc0913ae11ebc1ea91165911f5f3bd46910470" "2946f0682172ff16ffe531ce59ea26044f949e8a51b2d4ab14d74e21fa8f2b67" "de4fe3532d51a731d313e588531e32a26f9824e216fff1306ca270487f833045" "096bb91c8fd17ff6f2f51ddaf51897c9710da5486fbbb2d370e3ff3b209ff446" "700f0a38b888fb3fe656b9d8647d71fa99b3684641cf9e02106a3e3a1ca1d87a" "5cbf5345c2af35887f1518c35c9a62409304b20006f2455ef1313507e0552b1f" default)))
20 Added: ("50fa2844d84cecfa718f92122e095ecc1243fdf004bb1348e9cee856707c6f3d" "429c077679e0586d1b6a9f22586129bb4e0793e70b414ff93f023fcfa654b08a" "9893c7f1274df4d4df0573da1ee4dfe32f73f71cdf45bba7596a09e6c637d990" "e274c4d17ef47311855ce93dcc34c512bb285e3a01e9b3b1b735e059a865e48d" "59b58e2d0b77f0e8dc305bba18dc0913ae11ebc1ea91165911f5f3bd46910470" "2946f0682172ff16ffe531ce59ea26044f949e8a51b2d4ab14d74e21fa8f2b67" "de4fe3532d51a731d313e588531e32a26f9824e216fff1306ca270487f833045" "096bb91c8fd17ff6f2f51ddaf51897c9710da5486fbbb2d370e3ff3b209ff446" "700f0a38b888fb3fe656b9d8647d71fa99b3684641cf9e02106a3e3a1ca1d87a" "5cbf5345c2af35887f1518c35c9a62409304b20006f2455ef1313507e0552b1f" default)))
21 21 '(fci-rule-color "#383838")
22 Added: '(fill-column 79)
22 23 '(ibuffer-sidebar-display-column-titles t)
23 24 '(ibuffer-sidebar-display-summary t)
24 25 '(ibuffer-sidebar-width 18)
@@ -101,7 +102,7 @@
101 102 '(org-time-stamp-custom-formats (quote ("%d %b, %Y (%a)" . "%d %b, %Y (%a), at %H:%M")))
102 103 '(package-selected-packages
103 104 (quote
104 Removed: (linum-relative dumb-jump csv-mode rainbow-mode org-mouse projectile minimap gnuplot ledger-mode company-mode wombat-theme wombar-theme which-key srefactor-lisp srefactor all-the-icons flycheck ibuffer-sidebar pdf-tools magit rainbow-delimiters smartparens mixed-pitch org-bullets use-package tabbar powerline ivy-hydra flatui-theme evil counsel company benchmark-init)))
105 Added: (tabbar-ruler tabbar-mode linum-relative dumb-jump csv-mode rainbow-mode org-mouse projectile minimap gnuplot ledger-mode company-mode wombat-theme wombar-theme which-key srefactor-lisp srefactor all-the-icons flycheck ibuffer-sidebar pdf-tools magit rainbow-delimiters smartparens mixed-pitch org-bullets use-package tabbar powerline ivy-hydra flatui-theme evil counsel company benchmark-init)))
105 106 '(pdf-view-midnight-colors (quote ("#DCDCCC" . "#383838")))
106 107 '(save-place-mode t)
107 108 '(send-mail-function (quote smtpmail-send-it))
@@ -135,7 +136,6 @@
135 136 ;; If you edit it by hand, you could mess it up, so be careful.
136 137 ;; Your init file should contain only one such instance.
137 138 ;; If there is more than one, they won't work right.
138 Removed: '(default ((t (:family "Hermit" :foundry "UKWN" :slant normal :weight normal :height 122 :width normal))))
139 139 '(cursor ((t (:background "red"))))
140 140 '(fixed-pitch ((t (:family "Hermit"))))
141 141 '(highlight ((t (:background "#454545" :foreground "#ffffff" :underline nil))))