bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69305: outline-minor-mode for tabulated-list-mode


From: Juri Linkov
Subject: bug#69305: outline-minor-mode for tabulated-list-mode
Date: Wed, 06 Mar 2024 19:37:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

> (defvar buffery-taxy
>   (cl-labels ((directory (buffer)
>                 (buffer-local-value 'default-directory buffer))
>               (mode (buffer)
>                 (prin1-to-string (buffer-local-value 'major-mode buffer)))
>               (project (buffer)
>                 (with-current-buffer buffer
>                   (when-let ((project (project-current)))
>                     (project-root project))))
>               (specialp (buffer)
>                 (when (not (buffer-file-name buffer))
>                   "*special*"))
>               (make-fn (&rest args)
>                 (apply #'make-taxy-magit-section
>                        :make #'make-fn
>                        :format-fn #'buffer-name
>                        args)))
>     (make-fn
>      :name "Buffers"
>      :take (apply-partially #'taxy-take-keyed
>                             (list (list #'project)
>                                   (list #'specialp)
>                                   #'directory #'mode)))))

Thanks for the good example.  This is how the same
is achieved with 'Buffer-menu-group-by':

#+begin_src emacs-lisp
(setq Buffer-menu-group-by
      (lambda (b)
        (concat "* "
         (or
          (with-current-buffer (car b)
            (when-let ((project (project-current)))
              (project-root project)))
          (when (not (buffer-file-name (car b)))
            "*special*")
          (buffer-local-value 'default-directory (car b))
          (aref (cadr b) 5)))))
#+end_src





reply via email to

[Prev in Thread] Current Thread [Next in Thread]