Skip to content

Commit

Permalink
fix: Correct the command igist-tabulated-list-revert.
Browse files Browse the repository at this point in the history
Fix the setting of `igist-table-list-format` within the `igist-tabulated-list-revert` command.

Also, assign it as the `revert-buffer-function` in `igist-list-mode`.
  • Loading branch information
KarimAziev committed Sep 3, 2023
1 parent 98fba8c commit b8b3813
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions igist.el
Original file line number Diff line number Diff line change
Expand Up @@ -2747,7 +2747,8 @@ used to get the new `tabulated-list-format'."
(defun igist--tabulated-list-revert ()
"Revert the tabulated list to its original format in Igist."
(setq igist-table-list-format
(igist-get-current-list-format-sym))
(or igist-table-list-format
(symbol-value (igist-get-current-list-format-sym))))
(setq tabulated-list-format
(igist-get-tabulated-list-format
igist-table-list-format)
Expand All @@ -2760,8 +2761,7 @@ used to get the new `tabulated-list-format'."
(add-variable-watcher 'igist-explore-format #'igist--revert-tabulated-buffers)

(defun igist-tabulated-list-revert (&rest _ignored)
"The `revert-buffer-function' for `igist-list-mode'.
It runs `tabulated-list-revert-hook', then calls `igist-tabulated-list-print'."
"The `revert-buffer-function' for `igist-list-mode'."
(interactive)
(unless (derived-mode-p 'igist-list-mode)
(error "The current buffer is not in Igist-list-mode"))
Expand Down Expand Up @@ -2829,6 +2829,7 @@ tabulated list, which is used to display data in a table-like format in Emacs."
tabulated-list-padding 2)
(igist-tabulated-list-init-header)
(setq tabulated-list-printer #'igist-tabulated-list-print-entry)
(setq-local revert-buffer-function #'igist-tabulated-list-revert)
(setq-local imenu-prev-index-position-function
#'igist-imenu-prev-index-position)
(setq-local imenu-extract-index-name-function
Expand Down

0 comments on commit b8b3813

Please sign in to comment.