From: Manuel Uberti via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 54100@debbugs.gnu.org
Subject: bug#54100: 29.0.50; Allow project-buffers to ignore some buffers
Date: Tue, 22 Feb 2022 09:27:12 +0100 [thread overview]
Message-ID: <c5e70373-685a-60e4-a991-48c6ecd7b9f1@inventati.org> (raw)
Hi,
currently I am redifining `project-buffers' to ensure 'C-x p b'
(`project-switch-to-buffer') ignores some buffers I never want to switch to with
that command:
(defvar mu-ignored-buffers
'("\\` " "^\\*Async" "^\\*Completions" "^\\*Flymake" "^\\*Help"
"^\\*Messages" "^\\*eldoc" "^\\*envrc" "\\*tramp" "^\\*vc" "^\\*xref")
"A list of predicates for buffers to ignore.")
(cl-defmethod project-buffers ((project (head vc)))
(let* ((root (expand-file-name (file-name-as-directory (project-root project))))
(modules (unless (or (project--vc-merge-submodules-p root)
(project--submodule-p root))
(mapcar
(lambda (m) (format "%s%s/" root m))
(project--git-submodules))))
dd
bufs)
(dolist (buf (buffer-list))
(setq dd (expand-file-name (buffer-local-value 'default-directory buf)))
(when (and (string-prefix-p root dd)
(not (cl-find-if (lambda (module) (string-prefix-p module dd))
modules))
(not (seq-contains-p
mu-ignored-buffers (buffer-name buf) #'string-match-p)))
(push buf bufs)))
(nreverse bufs)))
I am not sure this is the best approach, though.
Would it be possible to add a defcustom to specify a predicate for the project
buffers to be shown in `project-switch-to-buffer'?
In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.18, cairo
version 1.16.0)
of 2022-02-22 built on hathaway
Repository revision: 8d02624c0ec029ee99e0b1e410429c440bcc4499
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04 LTS
Configured using:
'configure --with-harfbuzz --with-native-compilation'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB
Important settings:
value of $LC_MONETARY: it_IT.UTF-8
value of $LC_NUMERIC: it_IT.UTF-8
value of $LC_TIME: it_IT.UTF-8
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: ELisp/l
Minor modes in effect:
electric-pair-mode: t
flymake-mode: t
windmove-mode: t
savehist-mode: t
global-so-long-mode: t
global-subword-mode: t
subword-mode: t
winner-mode: t
envrc-global-mode: t
envrc-mode: t
mct-region-mode: t
mct-minibuffer-mode: t
pixel-scroll-precision-mode: t
minibuffer-electric-default-mode: t
minibuffer-depth-indicate-mode: t
delete-selection-mode: t
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
window-divider-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message yank-media rmc puny dired-x
dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-fns radix-tree misearch multi-isearch
time-date noutline outline checkdoc lisp-mnt elec-pair flymake-proc
flymake thingatpt compile text-property-search comint vc-dir ewoc vc-git
diff-mode easy-mmode vc vc-dispatcher cursor-sensor project server
modus-operandi-theme modus-themes pcase windmove delight comp comp-cstr
warnings cl-extra help-mode savehist so-long cap-words superword subword
winner envrc inheritenv ansi-color mct pixel-scroll ring minibuf-eldef
mb-depth ibuf-macs rx delsel info tex-site package browse-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json map url-vars
seq gv subr-x byte-opt bytecomp byte-compile cconv cl-loaddefs cl-lib
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget keymap hashtable-print-readable backquote threads
dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process native-compile emacs)
Memory information:
((conses 16 241664 84480)
(symbols 48 15348 1)
(strings 32 46778 3597)
(string-bytes 1 1497114)
(vectors 16 28407)
(vector-slots 8 833744 120150)
(floats 8 139 444)
(intervals 56 1087 217)
(buffers 992 18))
--
Manuel Uberti
www.manueluberti.eu
next reply other threads:[~2022-02-22 8:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 8:27 Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-02-22 9:41 ` bug#54100: 29.0.50; Allow project-buffers to ignore some buffers Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-22 14:23 ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-23 2:49 ` Dmitry Gutov
2022-02-23 6:56 ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-23 9:48 ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-23 9:55 ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-23 15:00 ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-24 7:18 ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-25 2:33 ` Dmitry Gutov
2022-02-25 6:44 ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-26 1:50 ` Dmitry Gutov
2022-02-26 6:32 ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-27 3:27 ` Dmitry Gutov
2022-02-27 7:09 ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-27 7:41 ` Eli Zaretskii
2022-02-27 7:43 ` Manuel Uberti via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c5e70373-685a-60e4-a991-48c6ecd7b9f1@inventati.org \
--to=bug-gnu-emacs@gnu.org \
--cc=54100@debbugs.gnu.org \
--cc=manuel.uberti@inventati.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).