From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74200: [PATCH] Add song viewer to 'mpc' Date: Fri, 08 Nov 2024 14:20:20 -0500 Message-ID: References: <874j4n1xxf.fsf@pub.pink> <87y11zznf2.fsf@pub.pink> <86v7x3upyt.fsf@gnu.org> <87ses7xha9.fsf@pub.pink> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29388"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 74200@debbugs.gnu.org To: john muhl Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 08 20:21:22 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t9UXo-0007Nl-O1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Nov 2024 20:21:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9UXa-0007pk-N6; Fri, 08 Nov 2024 14:21:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9UXX-0007pB-O5 for bug-gnu-emacs@gnu.org; Fri, 08 Nov 2024 14:21:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t9UXW-0003P0-VH for bug-gnu-emacs@gnu.org; Fri, 08 Nov 2024 14:21:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=orHLZAiqe1pqprmdOFi3QN3BDODPFcv3FWXpJ3cz9LE=; b=gbir2cOJ33JchNerpV92y3FTbB3dwHmq2eLXhILQEw3bfDFd9Qc4r0URbmA8uuArCRk94uppDGcKK2Sg0xmh9XqiIqcFS+RVo+cReq3Zbf9HjZ1tCIyJAnWeS0dJz+yPOd5Eh+O1MFOYfE6wcM/MdLTNdwrUr+4B84yzOg6w/Ba28dFMgyDmkSck7KNgHMdHSk3s51E/YnXuxoOgHhD6DML5tsp37SEez/idv+xBrFvtFj6pE13yZEBZ5UtUVYyjRJHk6l7rdhM5cv8Q/+1dGrk1BsvE45yr8JtE3/cyKGpB1bBS8yOxiy+dSn32cdDoEEti42+GL++CL4Vt6FZjaQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t9UXV-00060U-Qe for bug-gnu-emacs@gnu.org; Fri, 08 Nov 2024 14:21:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Nov 2024 19:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74200 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74200-submit@debbugs.gnu.org id=B74200.173109363223047 (code B ref 74200); Fri, 08 Nov 2024 19:21:01 +0000 Original-Received: (at 74200) by debbugs.gnu.org; 8 Nov 2024 19:20:32 +0000 Original-Received: from localhost ([127.0.0.1]:52190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9UX2-0005ze-80 for submit@debbugs.gnu.org; Fri, 08 Nov 2024 14:20:32 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:40159) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9UWx-0005zP-UI for 74200@debbugs.gnu.org; Fri, 08 Nov 2024 14:20:30 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 926DE44463C; Fri, 8 Nov 2024 14:20:22 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1731093621; bh=CTxO4EgIXdrHXtX9rbQ7ntHPr/bhZkZsjITyRu0VBGE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=N1soSwxIa+PCtMRwR0A9cnZpioLk6+9GhgZQ8R+rHf44yUGg4PIanSjgic3b8aNBn /i8UHLXLz2z+4nAnTVK99xE00Gs9Vd3N7UTItTnopYZVIfGLjMTSkNVew4lrBjRp6B bGcTqx3jgsXtjj/3hW33lrN8P2eg4hfZouv7iXuzAMie4q2FACSUMhc/A7oHcsQGDX u20GWHyrtxgnwYOmQLP2iK923GGutwSuDtS5vj8Ef+pfcx1TaZwMwnvtCUttJ60uKL YifsKCbCj8JAPu7j9TOhG8xUHopcEnEShZuxtivBJ6+lgKLKgApPlsu8w7c+Sx4op0 +LCEdxDkvHmRg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0320F444639; Fri, 8 Nov 2024 14:20:21 -0500 (EST) Original-Received: from asado (bras-base-mtrlpq0776w-grc-08-184-145-223-228.dsl.bell.ca [184.145.223.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E24A7120489; Fri, 8 Nov 2024 14:20:20 -0500 (EST) In-Reply-To: <87ses7xha9.fsf@pub.pink> (john muhl's message of "Mon, 04 Nov 2024 07:25:18 -0600") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:295084 Archived-At: > + "i" #'mpc-describe-song) What about using "d" (i.e. the "describe" mnemonic instead of the "info" mnemonic)? > +(defconst mpc-song-viewer-tagtypes > + (sort (append '("Bitrate" "Duration" "File" "Format") (mpc-cmd-tagtypes))) > + "Tag types available for use in `mpc-song-viewer-tags'.") Hmm... running `mpc-cmd-tagtypes` when we load the file seems risky: we may not know the `mpc-host` yet, or any other thing may go wrong. > +(defun mpc-describe-song (&optional file) Any reason we can't make the argument mandatory? > + (when tags > + (with-current-buffer (get-buffer-create buffer) > + (special-mode) > + (visual-line-mode) > + (let ((buffer-read-only nil)) This should bind `inhibit-read-only` instead. > + (select-window (display-buffer buffer '((display-buffer-reuse-window > + display-buffer-same-window) > + (reusable-frames . t))))))) Why use `select-window + display-buffer` instead of `pop-to-buffer`? Stefan