From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id YAMLD0UJBWREzgAAbAwnHQ (envelope-from ) for ; Sun, 05 Mar 2023 22:27:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id SJsiDkUJBWQVfwAAG6o9tA (envelope-from ) for ; Sun, 05 Mar 2023 22:27:33 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E302F1A340 for ; Sun, 5 Mar 2023 22:27:32 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYvse-0000hf-BP; Sun, 05 Mar 2023 16:26:56 -0500 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 1pYvsd-0000hX-9w for emacs-orgmode@gnu.org; Sun, 05 Mar 2023 16:26:55 -0500 Received: from ci74p00im-qukt09082102.me.com ([17.57.156.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYvsb-0004E4-4U for emacs-orgmode@gnu.org; Sun, 05 Mar 2023 16:26:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1678051610; bh=WR5k4HokCyB1GuyoKJmtafG6ZqsoGEwCAdoZHh2sH+s=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=azw+72R27LqdmAx2+GFiURCmgA3LyternAOEJy5quVCHEn11ZQ3kjS1CE5zPyuYhc yMqAElGO8DyhqwUmHvk1wBqxh6ZLLMzlTtFHvZ1o6HLDcBRixHUCbY3oHMVgSUXSXR 5BDN/d1losqlaMLho+aXPxCBJyoUJUvN/xZXCx39kHlXEMyCzJFapjtTwOy7th1Hny NdTIVaw1/3lwQe8p9E59io5L3dM3EgPQ3NpQqoQmXto5OGCRqNbs40sO89gUJqABvz EicbBwIIUlTXKtAkmbNjnsQYmvq3KO0L1rMOLF//5xDqhI7Z8C7krSIlucNIIFS8o0 o9zgCEsXoVT/g== Received: from Rudolfs-MacBook-Air.local (ci77p00im-dlb-asmtp-mailmevip.me.com [17.57.156.26]) by ci74p00im-qukt09082102.me.com (Postfix) with ESMTPSA id 22F8D19C036C for ; Sun, 5 Mar 2023 21:26:48 +0000 (UTC) From: Rudolf =?utf-8?Q?Adamkovi=C4=8D?= To: emacs-orgmode@gnu.org Subject: Re: [PATCH] org-src: Improve the name of source editing buffers In-Reply-To: <20230302140224.6169-1-salutis@me.com> References: <20230302140224.6169-1-salutis@me.com> Date: Sun, 05 Mar 2023 22:26:47 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Proofpoint-ORIG-GUID: ypHxK4kyjTqYxv2vc57fZlYWYDonAxPX X-Proofpoint-GUID: ypHxK4kyjTqYxv2vc57fZlYWYDonAxPX X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.138,18.0.572,17.11.62.513.0000000_definitions?= =?UTF-8?Q?=3D2020-02-14=5F11:2020-02-14=5F02,2020-02-14=5F11,2021-12-02?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxlogscore=467 suspectscore=0 mlxscore=0 clxscore=1015 malwarescore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2303050187 Received-SPF: pass client-ip=17.57.156.11; envelope-from=salutis@me.com; helo=ci74p00im-qukt09082102.me.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678051652; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=WR5k4HokCyB1GuyoKJmtafG6ZqsoGEwCAdoZHh2sH+s=; b=WiSHOQRqT24UAQRxZnuAyGLgvbSqcW9x8+vzYphsvizbnMrgRywGrVvZdTudZAoKhWW7Vo 8TR7PsPr/1BQeSHdrPQkZYBBT1htFtHyVPYuGe+rMGk6KZlshjDYtP5XzbZg9D8XI4ZWQK Lt6jveJWHcjfoq0zbdHNh3Zd2EV130Hl4yadnLr3ABG7RyaUddHabQH5sfw/MMjAf5R069 roggDu2Hakat3ibqgrGHhn9VDG7wXKLwFjN4bSNZt3r9Xm268EDWJtEJihakPGpggfCNRl k7eBLO9TAR+K8JJl1T3L/rEv+rgiw+mw+kFLq4IfSaxuDTlslqGqsK2bPmzBVQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=azw+72R2; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=me.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678051652; a=rsa-sha256; cv=none; b=l90XVl5cgAJZu4flmcTO+xUqY47BZgLcR69BfpkuATJ8eWRHKCIvtS8BUjDxThNzVEKW+3 /2Oj0mjLIzcchCTrpD9qVhjy4r38zyjadMnaBGhDz4dPQz8dI2FEHhCIhIcYe41+xnGucf MwW6pcnxaHdS3JBLd6rZZbc4YWWGX46ZL5NlmrnhjrLG5BzeJNIJYM1uHJfEmUhnwGqtk6 RedQGz+vM2SG1KBO1rtToMETLGxa/mUO1mrper2hKFAEYXL+1F+DeWw4jI7C1FpnNmqqpQ izltdad+1aPZ72Q0Oypri/5GD94fmJhqSwuy72pWPlzgavZ0VtpFmlsjPMRwDg== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -6.51 X-Spam-Score: -6.51 X-Migadu-Queue-Id: E302F1A340 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=me.com header.s=1a1hai header.b=azw+72R2; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=me.com X-TUID: nPD4ETKFIm0X --=-=-= Content-Type: text/plain I had a little bit of spare time today to refine the patch. Changes: - The patch now comes with a test to avoid regressions. - The patch has a slightly better commit message. Please see the attached file. Thank you! Rudy --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-src-Improve-naming-of-source-editing-buffers.patch >From a831b9014b3aaef16846dca049882a485ebf1dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Sun, 5 Mar 2023 22:21:40 +0100 Subject: [PATCH] org-src: Improve naming of source editing buffers * lisp/org-src.el (org-src--construct-edit-buffer-name): Fix the name given to a source editing buffer. The original format was documented as "ORG-BUFFER-NAME [ LANG ]" but in reality it was "ORG-BUFFER-NAME[ LANG ]", with different spacing. We make the format more standard and more compact, as well as, make the documentation match reality. * testing/lisp/test-org-src.el (test-org-src/buffer-name): Test the buffer name used for 'org-edit-special'. --- lisp/org-src.el | 4 ++-- testing/lisp/test-org-src.el | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lisp/org-src.el b/lisp/org-src.el index 9e4392811..bb894de9c 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -315,8 +315,8 @@ is 0.") (defun org-src--construct-edit-buffer-name (org-buffer-name lang) "Construct the buffer name for a source editing buffer. -Format is \"*Org Src ORG-BUFFER-NAME [ LANG ]*\"." - (concat "*Org Src " org-buffer-name "[ " lang " ]*")) +Format is \"*Org Src ORG-BUFFER-NAME [LANG]*\"." + (concat "*Org Src " org-buffer-name " [" lang "]*")) (defun org-src--edit-buffer (beg end) "Return buffer editing area between BEG and END. diff --git a/testing/lisp/test-org-src.el b/testing/lisp/test-org-src.el index 2a45ba66e..8829ce306 100644 --- a/testing/lisp/test-org-src.el +++ b/testing/lisp/test-org-src.el @@ -491,6 +491,19 @@ This is a tab:\t. (should (equal "#" (org-unescape-code-in-string "#"))) (should (equal "," (org-unescape-code-in-string ",")))) +;;; Other + +(ert-deftest test-org-src/buffer-name () + "Buffer has the correct name." + (org-test-with-temp-text " +#+begin_src emacs-lisp + (message hello) +#+end_src" + (rename-buffer "Buffy") + (org-edit-special) + (should (equal "*Org Src Buffy [emacs-lisp]*" + (buffer-name))) + (org-edit-src-exit))) (provide 'test-org-src) ;;; test-org-src.el ends here -- 2.39.2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 "Be especially critical of any statement following the word 'obviously.'" -- Anna Pell Wheeler, 1883-1966 Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25 84103 Bratislava Slovakia --=-=-=--