[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/taxy ac9bc63 16/42: WIP: elispy changes
From: |
ELPA Syncer |
Subject: |
[elpa] externals/taxy ac9bc63 16/42: WIP: elispy changes |
Date: |
Wed, 15 Sep 2021 12:57:28 -0400 (EDT) |
branch: externals/taxy
commit ac9bc63e15a4662a31eaa8b79cdc232594377677
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
WIP: elispy changes
---
examples/elispy.el | 53 ++++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 40 insertions(+), 13 deletions(-)
diff --git a/examples/elispy.el b/examples/elispy.el
index 704f82c..f2e74c0 100644
--- a/examples/elispy.el
+++ b/examples/elispy.el
@@ -103,8 +103,12 @@
(defvar-local elispy-files nil
"Files shown in the current Elispy buffer.")
+(defvar-local elispy-display-buffer-action nil
+ "Last-used display-buffer-action in the current Elispy buffer.")
+
;;;; Commands
+;;;###autoload
(cl-defun elispy (&key (project (or (project-current)
(cons 'transient default-directory)))
(keys elispy-taxy-default-keys)
@@ -127,13 +131,14 @@ buffer."
(cl-labels (;; (heading-face
;; (depth) (list :inherit (list 'bufler-group
(bufler-level-face depth))))
(elisp-file-p (file) (string-match-p (rx ".el" (optional ".gz")
eos) file))
- (file-visible-p (file) (not (string-match-p (rx bos ".") file)))
+ (file-visible-p
+ (file) (not (string-match-p (rx bos ".")
(file-name-nondirectory file))))
(format-item (item) (gethash item format-table))
(make-fn (&rest args)
(apply #'make-taxy-magit-section
:make #'make-fn
:format-fn #'format-item
- :heading-indent elispy-taxy-level-indent
+ :heading-indent elispy-level-indent
:visibility-fn visibility-fn
;; :heading-face-fn #'heading-face
args))
@@ -146,6 +151,7 @@ buffer."
(setq-local elispy-taxy-default-keys keys
elispy-directory (project-root project)
elispy-files files
+ elispy-display-buffer-action display-buffer-action
default-directory elispy-directory)
(setf files (cl-reduce #'cl-remove-if-not (list #'elisp-file-p
#'file-visible-p)
:initial-value (or files (project-files project))
@@ -165,32 +171,53 @@ buffer."
(taxy-sort* #'string< #'taxy-name)
(taxy-sort #'string< #'form-name)))
(taxy-magit-section-insert-indent-items nil)
+ (inhibit-read-only t)
format-cons)
(setf format-cons (taxy-magit-section-format-items
elispy-columns elispy-column-formatters taxy)
format-table (car format-cons)
column-sizes (cdr format-cons)
- ;; NOTE: The first column is handled differently.
- header-line-format (taxy-magit-section-format-header
column-sizes elispy-column-formatters))
- (let ((inhibit-read-only t))
- (save-excursion
- (taxy-magit-section-insert taxy :items 'last
- ;; :initial-depth bufler-taxy-initial-depth
- ;; :blank-between-depth bufler-taxy-blank-between-depth
- )))))
+ header-line-format (taxy-magit-section-format-header
+ column-sizes elispy-column-formatters))
+ (save-excursion
+ (taxy-magit-section-insert taxy :items 'last
+ ;; :blank-between-depth bufler-taxy-blank-between-depth
+ :initial-depth bufler-taxy-initial-depth))))
(pop-to-buffer buffer-name display-buffer-action))))
+;;;###autoload
+(cl-defun elispy-buffer (&optional (buffer (current-buffer))
+ &key (display-buffer-action
+ (when current-prefix-arg
+ '(display-buffer-in-side-window
+ (side . right)
+ (window-parameters
+ (window-side . right)
+ (no-delete-other-windows . t))))))
+ "Show an Elispy view for BUFFER.
+Interactively, with prefix, display in dedicated side window."
+ (interactive)
+ (elispy :files (list (buffer-file-name buffer))
+ :keys (remove 'file elispy-taxy-default-keys)
+ :display-buffer-action display-buffer-action))
+
(defun elispy-revert (_ignore-auto _noconfirm)
"Revert current Elispy buffer."
(interactive)
- (elispy :display-buffer-action '((display-buffer-same-window))))
+ (elispy :display-buffer-action (or elispy-display-buffer-action
+ '((display-buffer-same-window)))))
(defun elispy-goto-form ()
"Go to form at point."
(interactive)
(pcase-let* (((map :file :pos) (oref (magit-current-section) value)))
- (pop-to-buffer (or (find-buffer-visiting file)
- (find-file-noselect file)))
+ (pop-to-buffer
+ (or (find-buffer-visiting file)
+ (find-file-noselect file))
+ ;; FIXME: Uncomment this when
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=50576> is fixed.
+ ;; `(display-buffer-in-previous-window
+ ;; (previous-window . ,(previous-window)))
+ )
(goto-char pos)
(backward-sexp 1)))
- [elpa] externals/taxy 2430282 20/42: Tidy: Indentation, (continued)
- [elpa] externals/taxy 2430282 20/42: Tidy: Indentation, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy b37dd39 17/42: WIP: Tidy, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 43b8504 36/42: Docs: Update changelog, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 16d4e50 23/42: Fix/Tidy: (deffy-buffer), ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 45372f6 27/42: Fix: (taxy-magit-section-format-items) Width, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 956efdd 37/42: Comment: Update TODO, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy ade9a02 42/42: Merge branch 'wip/magit-section-column-formatting', ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 5227980 40/42: Docs: (taxy-magit-section-define-column-definer) Add docstring, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 4fd9565 30/42: Fix: (deffy) Bookmarking deffy-files, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 45cdf29 41/42: Docs: Mention deffy in changelog, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy ac9bc63 16/42: WIP: elispy changes,
ELPA Syncer <=
- [elpa] externals/taxy ae7456f 11/42: Add: (taxy-magit-section-define-column-definer) Indentation/align, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 01b9cac 12/42: Change/Fix: (taxy-magit-section-define-column-definer) Variables, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 8757b52 10/42: Add: (taxy-magit-section-format-header), ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 5589f50 03/42: Comment: Add note, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy a14fa15 04/42: Change: (taxy-magit-section) format-fn = #'prin1-to-string, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 421cfbf 26/42: Add: (deffy-project), ELPA Syncer, 2021/09/15
- [elpa] externals/taxy f8558ab 28/42: Fix: (deffy-project) Arguments, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy a1f9081 29/42: Comment: Add TODOs, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy a672c8e 32/42: Fix: (taxy-make-take-function) Allow symbol args to functions, ELPA Syncer, 2021/09/15
- [elpa] externals/taxy 5a16dd0 39/42: Comment: Add TODO, ELPA Syncer, 2021/09/15