From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Bruno =?utf-8?Q?F=C3=A9lix?= Rezende Ribeiro Newsgroups: gmane.emacs.devel Subject: info-rename-buffer-mode global minor mode Date: Sat, 17 Aug 2019 15:58:04 -0300 Message-ID: <87o90naabn.fsf@oitofelix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="215659"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 17 20:58:50 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hz3uc-000txh-Cx for ged-emacs-devel@m.gmane.org; Sat, 17 Aug 2019 20:58:50 +0200 Original-Received: from localhost ([::1]:37688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hz3ua-0008Pe-Em for ged-emacs-devel@m.gmane.org; Sat, 17 Aug 2019 14:58:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52241) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hz3tw-0008PN-Ru for emacs-devel@gnu.org; Sat, 17 Aug 2019 14:58:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hz3tw-0005jm-MS for emacs-devel@gnu.org; Sat, 17 Aug 2019 14:58:08 -0400 Original-Received: from [189.15.96.93] (port=40122 helo=felix-laptop) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1hz3tv-0002Ip-Ii for emacs-devel@gnu.org; Sat, 17 Aug 2019 14:58:08 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:239418 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Emacs developers, Attached is an implementation of =E2=80=98info-rename-buffer-mode=E2=80=99 = a global minor-mode which automatically renames Info buffers to match their visiting manual. That=E2=80=99s a feature I find useful when consulting several Info manuals simultaneously, because it frees me from the burden of renaming Info buffers to descriptive names manually whenever I open a new manual or change the current one, while avoiding the accidental change of the current visited node while opening a new Info buffer. I=E2=80=99d like to know if people like this feature and would like to have= it included in the default distribution. In any case, I=E2=80=99d like to get feedback on the correct (or canonical) way of implementing such simple feature, in case my implementation is not optimal for whatever reason. I=E2=80=99m new as a potential Emacs contributor[1] and would like to learn= the most effective procedures to have features or bug-fixes reviewed, accepted or declined, as I=E2=80=99m collecting a few features I have implemented over the course of using Emacs as my main system[2] and possibly generalizing them as more useful standalone modules I plan on submitting. Grateful for your time, Bruno Footnotes:=20 [1] Having only contributed the =E2=80=98emms-volume-mixerctl.el=E2=80=99 m= odule to EMMS yet (whose copyright assignment process is underway). [2] I use Emacs as my main and only =E2=80=9Ccomputing environment=E2=80=9D= at home and work, across several OSes: GNU/Linux, OpenBSD, NetBSD, ReactOS and FreeDOS. That means that all those systems boot directly onto full-screen Emacs (most graphically), and all my user initialization code is inside my =E2=80=98.emacs=E2=80=99 (rather than .xsession, .xinitrc= , .profile or .bashrc) -- so all helper sub-processes are managed by Emacs, my window manager is EXWM (wherever possible), and I use Emacs for everything feasible, the only exception being to resort to a javascript capable web-browser for sites requiring it and whose job can=E2=80=99t be performed within Emacs. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=info-rename-buffer.el Content-Transfer-Encoding: quoted-printable Content-Description: info-rename-buffer-mode.el ;;; info-rename-buffer.el --- Rename Info buffers to match manuals -*- lex= ical-binding:t -*- ;; Copyright (C) 2019 Bruno F=C3=A9lix Rezende Ribeiro ;; Maintainer: Bruno F=C3=A9lix Rezende Ribeiro ;; Keywords: help ;; This program is free software: you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as ;; published by the Free Software Foundation, either version 3 of the ;; License, or (at your option) any later version. ;; This program is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see ;; . ;;; Commentary: ;;; =E2=80=98info-rename-buffer-mode=E2=80=99 is a global minor-mode that ;;; automatically renames Info buffers to match their visiting manual. ;;; Code: ;;;###autoload; (define-minor-mode info-rename-buffer-mode "Toggle Info-Rename-Buffer mode on or off. With a prefix argument ARG, enable Info-Rename-Buffer mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil, and toggle it if ARG is =E2=80=98toggle=E2=80=99. When Info-Rename-Buffer is enabled, Info buffer's name is automatically changed to include its currently visiting manual's name. See the command \\[info-rename-buffer]." :group 'info :init-value nil :global t :require 'info-rename-buffer (if info-rename-buffer-mode (add-hook 'Info-selection-hook #'info-rename-buffer) (remove-hook 'Info-selection-hook #'info-rename-buffer))) (defun info-rename-buffer () "Rename current Info buffer to match its visiting manual." (interactive) (unless (ignore-errors (rename-buffer (format "*info %s*" (file-name-base Info-current-file)) 'unique)) (user-error "%s" "This is not an Info buffer."))) (provide 'info-rename-buffer) ;;; info-rename-buffer.el ends here --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 88888 FFFFF Bruno F=C3=A9lix Rezende Ribeiro (oitofelix) [0x28D618AF] 8 8 F http://oitofelix.freeshell.org/ 88888 FFFF mailto:oitofelix@gnu.org 8 8 F irc://chat.freenode.org/oitofelix 88888 F xmpp://oitofelix@riseup.net --=-=-=--