GNU bug report logs - #77157
[PATCH] 'uniquify' user option setters and automatic buffer refresh

Previous Next

Package: emacs;

Reported by: Ship Mints <shipmints <at> gmail.com>

Date: Fri, 21 Mar 2025 18:12:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ship Mints <shipmints <at> gmail.com>
To: 77157 <at> debbugs.gnu.org
Subject: bug#77157: [PATCH] 'uniquify' user option setters and automatic buffer refresh
Date: Fri, 21 Mar 2025 14:11:01 -0400
[Message part 1 (text/plain, inline)]
Okay, here's a fun one that's been on my list for a while that other people
might find useful.  When I have a lot of buffers open, I occasionally want
to increase or decrease uniquify-min-dir-content to make it easier to
discern, with higher precision, one buffer from another with the same name,
and without reloading buffers...

Changing uniquify user options refreshes buffer names.

Use customize interactively, or setopt in Elisp, to refresh buffer names
when changing 'uniquify' user options.  Previously, reloading or renaming
your buffers (or an Emacs restart) was required.

e.g., (setopt uniquify-min-dir-content 2)

In my init file, I have the following which makes this convenient:

  (defun my/uniquify-dir-content-cycle ()
    (interactive)
    (if uniquify-buffer-name-style
        (progn
          (pcase uniquify-min-dir-content
            (0 (setopt uniquify-min-dir-content 1))
            (1 (setopt uniquify-min-dir-content 2))
            (2 (setopt uniquify-min-dir-content 0)))
          (setopt uniquify-strip-common-suffix (= 0
uniquify-min-dir-content))
          (when (< emacs-major-version 31) ; Hopefully deprecated!
            (my/uniquify-refresh)))
      (message "No `uniquify-buffer-name-style' defined")))

-Stephane
[Message part 2 (text/html, inline)]
[0001-uniquify-user-option-setters-and-automatic-buffer-re.patch (application/octet-stream, attachment)]

This bug report was last modified 55 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.