pkg update and first config fix

org-brain not working, add org-roam
This commit is contained in:
2022-12-19 23:02:34 +01:00
parent 02b3e07185
commit 82f05baffe
885 changed files with 356098 additions and 36993 deletions

View File

@@ -1,6 +1,6 @@
;;; treemacs.el --- A tree style file viewer package -*- lexical-binding: t -*-
;; Copyright (C) 2021 Alexander Miller
;; Copyright (C) 2022 Alexander Miller
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -33,7 +33,6 @@
(require 'treemacs-customization)
(require 'treemacs-workspaces)
(require 'treemacs-persistence)
(require 'treemacs-extensions)
(require 'treemacs-logging)
(eval-when-compile
@@ -122,7 +121,8 @@ them instead."
:on-tag-node-open (treemacs--collapse-tag-node btn arg)
:on-tag-node-closed (treemacs--expand-tag-node btn arg)
:on-tag-node-leaf (progn (other-window 1) (treemacs--goto-tag btn))
:on-nil (treemacs-pulse-on-failure "There is nothing to do here.")))
:on-nil (treemacs-pulse-on-failure "There is nothing to do here.")
:fallback (treemacs-TAB-action)))
(defun treemacs-toggle-node-prefer-tag-visit (&optional arg)
"Same as `treemacs-toggle-node' but will visit a tag node in some conditions.
@@ -133,7 +133,7 @@ conditions:
ends in \" definition*\". This indicates the section is the parent element in
a nested class/function definition and can be moved to.
* Tags belong to a .org file and the tag section element possesses a
'org-imenu-marker text property. This indicates that the section is a
\\='org-imenu-marker text property. This indicates that the section is a
headline with further org elements below it.
The prefix argument ARG is treated the same way as with `treemacs-toggle-node'."
@@ -509,7 +509,8 @@ With a prefix ARG substract the increment value multiple times."
"Path at point is not a file.")
(when (file-directory-p path)
(setf path (treemacs--add-trailing-slash path)))
(-let [copied (-> path (file-relative-name (treemacs-project->path project)) (kill-new))]
(-let [copied (-> path (file-relative-name (treemacs-project->path project)))]
(kill-new copied)
(treemacs-pulse-on-success "Copied relative path: %s" (propertize copied 'face 'font-lock-string-face))))))
(defun treemacs-copy-project-path-at-point ()
@@ -521,7 +522,8 @@ With a prefix ARG substract the increment value multiple times."
"There is nothing to copy here")
(treemacs-error-return-if (not (stringp (treemacs-project->path project)))
"Project at point is not a file.")
(-let [copied (-> project (treemacs-project->path) (kill-new))]
(-let [copied (-> project (treemacs-project->path))]
(kill-new copied)
(treemacs-pulse-on-success "Copied project path: %s" (propertize copied 'face 'font-lock-string-face))))))
(defun treemacs-delete-other-windows ()
@@ -708,7 +710,7 @@ For slower scrolling see `treemacs-previous-line-other-window'"
(treemacs--forget-last-highlight)
;; after renaming, delete and redisplay the project
(goto-char (treemacs-button-end project-btn))
(delete-region (point-at-bol) (point-at-eol))
(delete-region (line-beginning-position) (line-end-position))
(treemacs--add-root-element project)
(when (eq state 'root-node-open)
(treemacs--collapse-root-node (treemacs-project->position project))
@@ -748,7 +750,7 @@ auto-selected name already exists."
(propertize (treemacs-project->path duplicate) 'face 'font-lock-string-face)))
(`(includes-project ,project)
(goto-char (treemacs-project->position project))
(treemacs-pulse-on-failure "Project '%s' is included in '%s'. Projects May not overlap."
(treemacs-pulse-on-failure "Project '%s' is included in '%s'. Projects may not overlap."
(propertize (treemacs-project->name project) 'face 'font-lock-type-face)
(propertize path 'face 'font-lock-string-face)))
(`(duplicate-name ,duplicate)
@@ -872,8 +874,10 @@ workspaces."
(interactive)
(treemacs-unless-let (btn (treemacs-current-button))
(treemacs-log-failure "There is nothing to refresh.")
(treemacs-without-recenter
(treemacs--do-refresh (current-buffer) (treemacs-project-of-node btn)))))
(-let [project (treemacs-project-of-node btn)]
(treemacs-without-recenter
(treemacs--do-refresh (current-buffer) project))
(run-hook-with-args 'treemacs-post-project-refresh-functions project))))
(defun treemacs-collapse-project (&optional arg)
"Close the project at point.
@@ -891,17 +895,19 @@ With a prefix ARG also forget about all the nodes opened in the project."
(defun treemacs-collapse-all-projects (&optional arg)
"Collapses all projects.
With a prefix ARG also forget about all the nodes opened in the projects."
With a prefix ARG remember which nodes were expanded."
(interactive "P")
(save-excursion
(treemacs--forget-last-highlight)
(dolist (project (treemacs-workspace->projects (treemacs-current-workspace)))
(-when-let (pos (treemacs-project->position project))
(when (eq 'root-node-open (treemacs-button-get pos :state))
(goto-char pos)
(treemacs--collapse-root-node pos arg)))))
(treemacs--maybe-recenter 'on-distance)
(treemacs-pulse-on-success "Collapsed all projects"))
(-when-let (buffer (treemacs-get-local-buffer))
(with-current-buffer buffer
(save-excursion
(treemacs--forget-last-highlight)
(dolist (project (treemacs-workspace->projects (treemacs-current-workspace)))
(-when-let (pos (treemacs-project->position project))
(when (eq 'root-node-open (treemacs-button-get pos :state))
(goto-char pos)
(treemacs--collapse-root-node pos (not arg))))))
(treemacs--maybe-recenter 'on-distance)
(treemacs-pulse-on-success "Collapsed all projects"))))
(defun treemacs-collapse-other-projects (&optional arg)
"Collapses all projects except the project at point.
@@ -1074,7 +1080,7 @@ Only works with a single project in the workspace."
treemacs-persist-file
nil :silent)
(treemacs--restore)
(-if-let (ws (treemacs--select-workspace-by-name
(-if-let (ws (treemacs--find-workspace-by-name
(treemacs-workspace->name (treemacs-current-workspace))))
(setf (treemacs-current-workspace) ws)
(treemacs--find-workspace))
@@ -1262,7 +1268,7 @@ visible."
(save-excursion
(goto-char (point-min))
(while (= 0 (forward-line 1))
(-let [new-len (- (point-at-eol) (point-at-bol))]
(-let [new-len (- (line-end-position) (line-beginning-position))]
(when (> new-len longest)
(setf longest new-len
depth (treemacs--prop-at-point :depth))))))