update packages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
;;; treemacs.el --- A tree style file viewer package -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2020 Alexander Miller
|
||||
;; Copyright (C) 2021 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
|
||||
@@ -36,7 +36,8 @@
|
||||
(require 'treemacs-macros)
|
||||
(require 'cl-lib))
|
||||
|
||||
(cl-declaim (optimize (speed 3) (safety 0)))
|
||||
(eval-when-compile
|
||||
(cl-declaim (optimize (speed 3) (safety 0))))
|
||||
|
||||
(treemacs-import-functions-from "treemacs-filewatch-mode"
|
||||
treemacs--stop-filewatch-for-current-buffer)
|
||||
@@ -64,7 +65,7 @@ The car is the name seen in interactive selection. The cdr is the eieio class
|
||||
name.")
|
||||
|
||||
(defvar treemacs--current-scope-type 'treemacs-frame-scope
|
||||
"The general type of objects/items treemacs is curretly scoped to.")
|
||||
"The general type of objects/items treemacs is currently scoped to.")
|
||||
|
||||
(defvar treemacs--scope-storage nil
|
||||
"Alist of all active scopes mapped to their buffers & workspaces.
|
||||
@@ -113,30 +114,38 @@ Can be used with `setf'."
|
||||
(defclass treemacs-scope () () :abstract t)
|
||||
|
||||
(cl-defmethod treemacs-scope->current-scope ((_ (subclass treemacs-scope)))
|
||||
"Get the current scope."
|
||||
(error "Default `current-scope' implementation was called"))
|
||||
|
||||
(cl-defmethod treemacs-scope->current-scope-name ((_ (subclass treemacs-scope)) scope)
|
||||
"Get the name of the given SCOPE."
|
||||
(ignore scope)
|
||||
nil)
|
||||
|
||||
(cl-defmethod treemacs-scope->setup ((_ (subclass treemacs-scope)))
|
||||
"Setup for a scope type."
|
||||
nil)
|
||||
|
||||
(cl-defmethod treemacs-scope->cleanup ((_ (subclass treemacs-scope)))
|
||||
"Tear-down for a scope type."
|
||||
nil)
|
||||
|
||||
(defclass treemacs-frame-scope (treemacs-scope) () :abstract t)
|
||||
|
||||
(cl-defmethod treemacs-scope->current-scope ((_ (subclass treemacs-frame-scope)))
|
||||
"Get the current scope."
|
||||
(selected-frame))
|
||||
|
||||
(cl-defmethod treemacs-scope->current-scope-name ((_ (subclass treemacs-frame-scope)) frame)
|
||||
"Prints the given FRAME."
|
||||
(prin1-to-string frame))
|
||||
|
||||
(cl-defmethod treemacs-scope->setup ((_ (subclass treemacs-frame-scope)))
|
||||
"Frame-scope setup."
|
||||
(add-hook 'delete-frame-functions #'treemacs--on-scope-kill))
|
||||
|
||||
(cl-defmethod treemacs-scope->cleanup ((_ (subclass treemacs-frame-scope)))
|
||||
"Frame-scope tear-down."
|
||||
(remove-hook 'delete-frame-functions #'treemacs--on-scope-kill))
|
||||
|
||||
(defun treemacs-set-scope-type (new-scope-type)
|
||||
@@ -214,7 +223,7 @@ NEW-SCOPE-TYPE: T: treemacs-scope"
|
||||
(treemacs-scope-shelf->buffer)
|
||||
(get-buffer-window)
|
||||
(select-window))
|
||||
(run-hooks 'treemacs-select-hook))
|
||||
(run-hook-with-args 'treemacs-select-functions 'visible))
|
||||
|
||||
(defun treemacs-get-local-buffer ()
|
||||
"Return the treemacs buffer local to the current scope-type.
|
||||
|
||||
Reference in New Issue
Block a user