Merge branch 'pkgs-update'

update packages, including org-roam
This commit is contained in:
2022-12-20 20:19:22 +01:00
885 changed files with 356103 additions and 36993 deletions

View File

@@ -65,7 +65,9 @@
:after ivy
:bind (("M-x" . counsel-M-x)
("M-y" . counsel-yank-pop)
("C-x b" . counsel-switch-buffer)
;; ("C-x b" . counsel-switch-buffer)
;; ("C-x b" . counsel-ibuffer)
("C-x b" . counsel-buffer-or-recentf)
("C-x C-f" . counsel-find-file)
("C-x C-r" . counsel-recentf)
;; ("<f1> f" . describe-function) ;; counsel-describe-function, not set bc of helpful.el

View File

@@ -590,7 +590,7 @@ Version 2016-07-13"
(easy-menu-define my-menu nil "My Menu"
'("My"))
(easy-menu-define my-major-menu nil "My Major Menu"
'("Major Modes"
(list "Major Modes"
["Unknown" (progn ()) :style radio :selected major-mode :active nil
:label (concat "Current: " (prin1-to-string major-mode))]
["Deft" (progn (deft)) :style radio :selected (eq major-mode 'deft-mode) :help "deft"]

View File

@@ -191,111 +191,75 @@ DISPLAY-START: `integer', e.g. 3820"
(use-package dashboard
:delight (dashboard-mode "Db") ;; "\u01F153
:config
(require 'linum) ;; TODO: (delete after dashboard fixed it) bc/ dashboard.el sets (linum-mode -1) in `dashboard-mode'
;; because we use `use-package' include `use-package-statistics' if computed
(defun my-dashboard-init-info ()
(let ((package-count 0) (time (emacs-init-time)))
(when (bound-and-true-p package-alist)
(setq package-count (length package-activated-list)))
(when (boundp 'straight--profile-cache)
(setq package-count (+ (hash-table-size straight--profile-cache) package-count)))
;; added case
(when use-package-compute-statistics
(setq package-count (+ (hash-table-size use-package-statistics) package-count)))
(if (zerop package-count)
(format "Emacs started in %s" time)
(format "%d packages loaded in %s" package-count time))))
(setq dashboard-init-info (my-dashboard-init-info))
;; overwrite bc/ to recompute `dashboard-init-info' on refresh
(defun dashboard-insert-init-info ()
"Insert init info when `dashboard-set-init-info' is t."
(when dashboard-set-init-info
(setq dashboard-init-info (my-dashboard-init-info)) ;; ADDED
(dashboard-center-line dashboard-init-info)
(insert (propertize dashboard-init-info 'face 'font-lock-comment-face))))
"Init info with packages loaded and init time."
(setq dashboard-startup-banner 'logo)
;; see `dashboad-widget'
(setq dashboard-page-separator "\n\f\n")
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
(setq dashboard-set-navigator t)
(setq dashboard-page-separator "\n\f\n") ;; \f requires page-break-lines-mode
;; (setq dashboard-navigator-buttons ;; Format: "(icon title help action face prefix suffix)"
;; (list (list ;; line1
;; ;; "☆" "Star" "Show stars" (lambda (&rest _) (show-stars)) warning "[" "]")
;; (list "?" "" "?/h" (lambda (&rest _) (describe-mode)) nil "<" ">") ;;#'show-help
;; )))
(require 'all-the-icons)
(defun dashboard-navigator-buttons-func ()
;; Format: "(icon title help action face prefix suffix)"
`(
;; line: custom views
(("" "Custom Views:" "custom views" nil default "" "")
(,(all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1)
"ELisp" "my-view-elisp" (lambda (&rest _) (my-tab-view-elisp)))
(,(all-the-icons-alltheicon "python" :height 1.0 :v-adjust 0.0)
"Python" "my-view-python" (lambda (&rest _) (my-tab-view-python)))
(,(all-the-icons-alltheicon "script" :height 1.0 :v-adjust 0.0)
"Shell" "my-view-shell" (lambda (&rest _) (my-tab-view-shell)))
(,(all-the-icons-octicon "file-media" :height 1.0 :v-adjust 0.0)
"Gnuplot" "my-view-gnuplot" (lambda (&rest _) (my-tab-view-gnuplot)))
(,(all-the-icons-octicon "file-pdf" :height 1.0 :v-adjust 0.0)
"Org PDF" "my-view-org-pdf" (lambda (&rest _) (my-tab-view-org-pdf))))
;; line: major modes 1st
(("" "Major Modes:" "major modes" nil default "" "")
("" "Deft" "deft" (lambda (&rest _) (deft)))
("" "EShell" "eshell-mode" (lambda (&rest _) (eshell)))
("" "Magit" "magit" (lambda (&rest _) (magit)))
(,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0)
"Mu4e" "mu4e" (lambda (&rest _) (mu4e)))
(,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0)
"Notmuch" "notmuch" (lambda (&rest _) (notmuch)))
("" "Org-Brain" "org-brain-visualize" (lambda (&rest _) (call-interactively 'org-brain-visualize))))
;; line: major modes 2nd
(("" "Org-Drill" "org-drill" (lambda (&rest _) (org-drill)))
("" "Powershell" "powershell" (lambda (&rest _) (powershell)))
("" "Shell" "shell" (lambda (&rest _) (shell)))
("" "Treemacs" "treemacs" (lambda (&rest _) (treemacs))))
;; last line
(;; "☆" "Star" "Show stars" (lambda (&rest _) (show-stars)) warning "[" "]")
(,(all-the-icons-material "help_outline" :height 1.1 :v-adjust -0.15) ;; all-the-icons-octicon "question"
"Help" "?/h" (lambda (&rest _) (describe-mode)) nil) ;; #'show-help
(,(all-the-icons-material "refresh" :height 1.1 :v-adjust -0.15) ;; all-the-icons-octicon "sync"
"Restart" "restart-emacs" (lambda (&rest _) (restart-emacs)) nil))))
(setq dashboard-navigator-buttons (dashboard-navigator-buttons-func))
(setq dashboard-items '((recents . 10)
(setq dashboard-startup-banner 'logo)
(setq dashboard-navigator-buttons
;; list of lines having list of elements
;; element: (icon title help action face prefix suffix)
`(;; 1st line custom views
(("" "Custom Views:" "custom views" nil default "" "")
(,(all-the-icons-fileicon "elisp" :height 1.0 :v-adjust -0.1) "ELisp" "my-view-elisp" (lambda (&rest _) (my-tab-view-elisp)) )
(,(all-the-icons-alltheicon "python" :height 1.0 :v-adjust 0.0) "Python" "my-view-python" (lambda (&rest _) (my-tab-view-python)) )
(,(all-the-icons-alltheicon "script" :height 1.0 :v-adjust 0.0) "Shell" "my-view-shell" (lambda (&rest _) (my-tab-view-shell)) )
(,(all-the-icons-octicon "file-media" :height 1.0 :v-adjust 0.0) "Gnuplot" "my-view-gnuplot" (lambda (&rest _) (my-tab-view-gnuplot)) )
(,(all-the-icons-octicon "file-pdf" :height 1.0 :v-adjust 0.0) "Org PDF" "my-view-org-pdf" (lambda (&rest _) (my-tab-view-org-pdf)) ))
;; 2nd line major modes 1st part
(("" "Major Modes:" "major modes" nil default "" "")
("" "Deft" "deft" (lambda (&rest _) (deft)) )
("" "EShell" "eshell-mode" (lambda (&rest _) (eshell)) )
("" "Magit" "magit" (lambda (&rest _) (magit)) )
(,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0) "Mu4e" "mu4e" (lambda (&rest _) (mu4e)) )
(,(all-the-icons-octicon "mail" :height 1.0 :v-adjust 0.0) "Notmuch" "notmuch" (lambda (&rest _) (notmuch)) )
("" "Org-Brain" "org-brain-visualize" (lambda (&rest _) (call-interactively 'org-brain-visualize)) ))
;; 3rd line major modes 2nd part
(("" "Org-Drill" "org-drill" (lambda (&rest _) (org-drill)) )
("" "Powershell" "powershell" (lambda (&rest _) (powershell)) )
("" "Shell" "shell" (lambda (&rest _) (shell)) )
("" "Treemacs" "treemacs" (lambda (&rest _) (treemacs)) ))
;; 4th line infos
((,(all-the-icons-material "help_outline" :height 1.1 :v-adjust -0.15) "Help" "?/h" (lambda (&rest _) (describe-mode)) nil)
(,(all-the-icons-material "refresh" :height 1.1 :v-adjust -0.15) "Restart" "restart-emacs" (lambda (&rest _) (restart-emacs)) nil))))
(setq dashboard-items '((recents . 10)
(bookmarks . 5)
;;(projects . 5)
;;(agenda . 5)
(registers . 5)))
;; (projects . 5)
(agenda . 5)
(registers . 5)
(custom . 5)))
(setq dashboard-item-shortcuts
'((recents . "r")
(bookmarks . "m")
(projects . "p")
(agenda . "a")
(registers . "e")
(custom . "b")))
;; because we use `use-package' include `use-package-statistics' if
;; computed
(setq dashboard-init-info
(lambda ()
(let ((package-count 0) (time (emacs-init-time)))
(when (bound-and-true-p package-alist)
(setq package-count (length package-activated-list)))
(when (boundp 'straight--profile-cache)
(setq package-count (+ (hash-table-count straight--profile-cache) package-count)))
(when (fboundp 'elpaca--queued)
(setq package-count (length (elpaca--queued))))
;; added case
(when use-package-compute-statistics
(setq package-count (+ (hash-table-size use-package-statistics) package-count)))
(if (zerop package-count)
(format "Emacs started in %s" time)
(format "%d packages loaded in %s" package-count time)))))
;; `clean-buffer-list'
(defun my-buffer-name-list (&optional special internal)
"If SPECIAL non-nil then include special buffers.
If INTERNAL non-nil then include internal buffers."
(let ((b-list (mapcar (function buffer-name) (buffer-list)))
new-list head)
(while b-list
(setq head (car b-list))
(when (or internal ;; check if no space is in the fron
(not (string= " " (substring head 0 1))))
(when (or special ;; check if no star are in the front and back
(and (not (string= "*" (substring head 0 1)))
(not (string= "*" (cl-subseq head -1)))))
(push head new-list)))
(setq b-list (cdr b-list)))
(nreverse new-list)))
(defun my-buffer-name-list-special ()
"List special buffers."
(let ((b-list (mapcar (function buffer-name) (buffer-list)))
new-list head)
(while b-list
(setq head (car b-list))
(when (and (string= "*" (substring head 0 1))
(string= "*" (cl-subseq head -1)))
(push head new-list))
(setq b-list (cdr b-list)))
(nreverse new-list)))
;; overwrite with addition parameter to supress the logic to insert
;; a pre-defined heading icon. This is used to include own icon.
(defun dashboard-insert-heading (heading &optional shortcut suppress-icon)
;; custom section
;; overwrite to supress an inserted whitespace if a pre-defined
;; heading is not found. This is used to include own icon, e.g. in
;; front of executing `dashboard-insert-section'.
(defun dashboard-insert-heading (heading &optional shortcut)
"Insert a widget HEADING in dashboard buffer, adding SHORTCUT if provided."
(when (and (display-graphic-p) dashboard-set-heading-icons)
;; Try loading `all-the-icons'
@@ -303,7 +267,6 @@ If INTERNAL non-nil then include internal buffers."
(require 'all-the-icons nil 'noerror))
(error "Package `all-the-icons' isn't installed"))
(unless suppress-icon ;; ADDED
(insert (cond
((string-equal heading "Recent Files:")
(all-the-icons-octicon (cdr (assoc 'recents dashboard-heading-icons))
@@ -321,8 +284,8 @@ If INTERNAL non-nil then include internal buffers."
((string-equal heading "Projects:")
(all-the-icons-octicon (cdr (assoc 'projects dashboard-heading-icons))
:height 1.2 :v-adjust 0.0 :face 'dashboard-heading))
(t " ")))
) ;; ADDED
;; (t " "))) ;; REMOVED
(t ""))) ;; ADDED
(insert " "))
(insert (propertize heading 'face 'dashboard-heading))
@@ -337,52 +300,57 @@ If INTERNAL non-nil then include internal buffers."
(overlay-put ov 'display (or (cdr (assoc heading dashboard-item-names)) heading))
(overlay-put ov 'face 'dashboard-heading))
(when shortcut (insert (format " (%s)" shortcut))))
;; overwrite to supress the logic to insert a pre-defined heading
;; icon. This is used to include own icon.
(defmacro my-dashboard-insert-section (section-name list list-size shortcut action &rest widget-params)
"Add a section with SECTION-NAME and LIST of LIST-SIZE items to the dashboard.
SHORTCUT is the keyboard shortcut used to access the section.
ACTION is theaction taken when the user activates the widget button.
WIDGET-PARAMS are passed to the \"widget-create\" function."
`(progn
(dashboard-insert-heading ,section-name
(if (and ,list ,shortcut dashboard-show-shortcuts) ,shortcut)
t) ;; ADDED for the overwritten version, see above
(if ,list
(when (and (dashboard-insert-section-list
,section-name
(dashboard-subseq ,list ,list-size)
,action
,@widget-params)
,shortcut)
(dashboard-insert-shortcut ,shortcut ,section-name))
(insert (propertize "\n --- No items ---" 'face 'dashboard-no-items-face)))))
(defun dashboard-insert-buffers (list-size)
;;; define functions for the section
;; `clean-buffer-list'
(defun my-buffer-name-list (&optional special internal)
"If SPECIAL non-nil then include special buffers.
If INTERNAL non-nil then include internal buffers."
(let ((b-list (mapcar (function buffer-name) (buffer-list)))
new-list head)
(while b-list
(setq head (car b-list))
(when (or internal ;; check if no space is in the fron
(not (string= " " (substring head 0 1))))
(when (or special ;; check if no star are in the front and back
(and (not (string= "*" (substring head 0 1)))
(not (string= "*" (cl-subseq head -1)))))
(push head new-list)))
(setq b-list (cdr b-list)))
(nreverse new-list)))
(defun my-buffer-name-list-special-only ()
"List only special buffers *...*."
(let ((b-list (mapcar (function buffer-name) (buffer-list)))
new-list head)
(while b-list
(setq head (car b-list))
(when (and (string= "*" (substring head 0 1))
(string= "*" (cl-subseq head -1)))
(push head new-list))
(setq b-list (cdr b-list)))
(nreverse new-list)))
;;; define section function
(defun dashboard-insert-custom (list-size)
"Add the list of LIST-SIZE items from buffers list.
Example `dashboard-insert-recent'.
See also `dashboard-insert-section' for the sequence of elements."
;; insert icon
(when (display-graphic-p)
(insert (all-the-icons-octicon
"versions"
:height 1.2 :v-adjust 0.0 :face 'dashboard-heading)))
(my-dashboard-insert-section
(dashboard-insert-section
"Special Buffers:"
;;(my-buffer-name-list)
(my-buffer-name-list-special)
(my-buffer-name-list-special-only) ;; (my-buffer-name-list t)
list-size
"b"
`(lambda (&rest ignore) (switch-to-buffer ,el))
'custom
(dashboard-get-shortcut 'custom)
`(lambda (&rest _) (switch-to-buffer ,el))
(abbreviate-file-name el)))
(add-to-list 'dashboard-item-generators '(buffers . dashboard-insert-buffers) t)
;; see below add-to-list to dashboard-items
(add-to-list 'dashboard-items '(buffers . 5) t)
;; (add-to-list 'dashboard-items '(custom) t)
;; needs package all-the-icons
(setq dashboard-set-heading-icons t)
(setq dashboard-set-file-icons t)
(add-to-list 'dashboard-item-generators '(custom . dashboard-insert-custom))
;; activate `dashboard'
(dashboard-setup-startup-hook))
(use-package indent-guide

View File

@@ -529,6 +529,51 @@ Suggest the URL title as a description for resource."
(setq org-num-skip-tags '("ignore"))
(setq org-num-skip-unnumbered t))
(use-package org-roam
;; builds SQLite db and requires gcc or clang, check `org-roam--sqlite-available-p'
;; create roam directory beforehand
;; do not sync the db file, only the org files.
;; to sync manually run `org-roam-db-sync' from a file within a roam directory
;; to greate a node inside an org file, on a header execute `org-id-get-create'
:bind (("C-c r l" . org-roam-buffer-toggle)
("C-c r L" . org-roam-buffer-display-dedicated)
("C-c r f" . org-roam-node-find)
("C-c r n" . org-roam-node-random)
("C-c r c" . org-roam-capture)
(:map org-mode-map
(("C-c r i" . org-roam-node-insert)
("C-c r a" . org-roam-alias-add)
("C-c r A" . org-roam-alias-remove)
("C-c r d" . org-id-get-create) ;; create id for file or header
("C-c r t" . org-roam-tag-add)
("C-c r T" . org-roam-tag-remove)
("C-c r r" . org-roam-ref-add)
("C-c r R" . org-roam-ref-remove)))
;; Dailies
("C-c r j" . org-roam-dailies-capture-today))
:init
(setq org-roam-v2-ack t) ;; no migration warning
(setq org-roam-directory (expand-file-name "~/Sync/workspace/emacs/org-roam")) ;; check if folder exists
(setq org-roam-db-location (concat user-cache-directory "org-roam.db"))
;; (setq org-roam-graph-viewer nil)
:config
(org-roam-db-autosync-mode) ;; sync on file change
;;(org-roam-setup)
)
(use-package org-roam-graph
:bind (("C-c r g" . org-roam-graph)))
(use-package org-roam-ui
:after (org-roam)
:commands (org-roam-ui-mode)
:config
(setq org-roam-ui-sync-theme t)
(setq org-roam-ui-follow t)
(setq org-roam-ui-update-on-save t)
;;(setq org-roam-ui-open-on-start t)
)
(use-package org-sticky-header
:after (org org-table-sticky-header) ;; org-table-sticky-header-mode must be set before
:hook (org-mode . org-sticky-header-mode)

View File

@@ -42,7 +42,7 @@
))))
(use-package dialog
:defer 2
:defer t
:config
(defun my-org-export-dialog-html-fun ()
"Ask."