unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ergus <spacibba@aol.com>
To: emacs-devel@gnu.org
Subject: Uniquify change [PATCH]
Date: Sat, 12 Sep 2020 13:50:07 +0200	[thread overview]
Message-ID: <20200912115007.tze35edwcdo5vdoc@Ergus> (raw)
In-Reply-To: 20200912115007.tze35edwcdo5vdoc.ref@Ergus

[-- Attachment #1: Type: text/plain, Size: 128 bytes --]

Hi:

I want to add this patch to master. Could you give it a look and suggest
where in NEWS I should mention this?

Best, Ergus

[-- Attachment #2: uniquify.patch --]
[-- Type: text/plain, Size: 1446 bytes --]

diff --git a/lisp/uniquify.el b/lisp/uniquify.el
index 70e8ecee74..8439d9d874 100644
--- a/lisp/uniquify.el
+++ b/lisp/uniquify.el
@@ -104,6 +104,13 @@ uniquify-buffer-name-style
   post-forward-angle-brackets   name<bar/mumble>   name<quux/mumble>
   nil                           name               name<2>
 
+The value can be set to a customized function with two mandatory
+arguments.  For example the current implementation for
+post-forward-angle-brackets could be:
+
+(defun my-post-forward-angle-brackets (base extra-string)
+  (concat base \"<\" (mapconcat 'identity extra-string \"/\") \">\"))
+
 The \"mumble\" part may be stripped as well, depending on the
 setting of `uniquify-strip-common-suffix'.  For more options that
 you can set, browse the `uniquify' custom group."
@@ -111,6 +118,7 @@ uniquify-buffer-name-style
 		(const reverse)
 		(const post-forward)
 		(const post-forward-angle-brackets)
+                (function :tag "Other")
 		(const :tag "numeric suffixes" nil))
   :version "24.4"
   :require 'uniquify)
@@ -378,6 +386,8 @@ uniquify-get-proposed-name
      ((eq uniquify-buffer-name-style 'post-forward-angle-brackets)
       (concat base "<" (mapconcat 'identity extra-string "/")
 	      ">"))
+     ((functionp uniquify-buffer-name-style)
+      (funcall uniquify-buffer-name-style base extra-string))
      (t (error "Bad value for uniquify-buffer-name-style: %s"
 	       uniquify-buffer-name-style)))))
 

       reply	other threads:[~2020-09-12 11:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200912115007.tze35edwcdo5vdoc.ref@Ergus>
2020-09-12 11:50 ` Ergus [this message]
2020-09-13 19:02   ` Uniquify change [PATCH] Stefan Monnier
2020-09-15 11:34     ` Ergus

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=20200912115007.tze35edwcdo5vdoc@Ergus \
    --to=spacibba@aol.com \
    --cc=emacs-devel@gnu.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).