From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id o89iK/kr9WG0DwAAgWs5BA (envelope-from ) for ; Sat, 29 Jan 2022 12:58:49 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MNDsJvkr9WH6LQEAauVa8A (envelope-from ) for ; Sat, 29 Jan 2022 12:58:49 +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 5295B2968C for ; Sat, 29 Jan 2022 12:58:49 +0100 (CET) Received: from localhost ([::1]:51806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDmNU-0007zM-Ic for larch@yhetil.org; Sat, 29 Jan 2022 06:58:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDm3a-0004ih-1J for emacs-orgmode@gnu.org; Sat, 29 Jan 2022 06:38:15 -0500 Received: from [2607:f8b0:4864:20::632] (port=34358 helo=mail-pl1-x632.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDm3V-0000wW-PB; Sat, 29 Jan 2022 06:38:13 -0500 Received: by mail-pl1-x632.google.com with SMTP id h14so8502528plf.1; Sat, 29 Jan 2022 03:38:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iM4uXbl9m3tayZw1ye+4DMJZzWsffni5iu+EZl59NMU=; b=pg+vQiEoxYaDqBInJdNjSLBbVsSxmwl3ndRTmvamDTAdm5OAP1yZjKgKKOSSodr4dX X1R/blYQ4c+0wqwH4cGf2b7jxwRI56cvk4rvrglTJdrpNQX2ADIA8kVYJFZcpjL9LI7K BgIxgkUwbEhH7uPAPsCl12iLDjTnr90PdgPUKYjZFrnI88WvkHChyw+qJeBR7yS6+NPA 2Z+e8Ze6rHTEDznu3RMt+zpyBFcFv4uax88oHq6fIBCPFhWDlFUvv12R2AMaehq+SwOK ifJ7cPeguKbHpo8wTYnRBwCb7HWCKdXBt9wiSJG+DRJXiXK/R1N6bpJ5qJNShe9zsg8f nfeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iM4uXbl9m3tayZw1ye+4DMJZzWsffni5iu+EZl59NMU=; b=Zc7Exau4r+JrXEswNkogJswSlyl2ULPkliCD85cUerbU0UTc1Bh/13pbKK/v3qiL8f 1mr0AvzonE9KMwrjQ1vR1roI1J7lZs2Qf9K0lDXXsQp/W3WX+PoZUaOkPsk4CnglY60W 1AUqfC/eDvrJIE64LQN4d159RiaqnGKgq4d0HBJ8oP+g7SA3E61ey1Eedb39m7V2UiNa 7Se7t9wf7ZdRb1p8MJYpznfpkUjUKsgGkPQyXhvECVNQBTmWwWAcoQdPe/+aUc55bl8z zW2eOyT1RGwD4UWbJc5veiHDuGprhEZTIfHdhVa1w4fL5VFDWxr+CbAFbtFwl90vI6/l 18SQ== X-Gm-Message-State: AOAM531BiwTM1e3NiGfUJazufj/zF/mFlb/N3wHpUqlzPxh3Fp73D3U9 8Ep1CFU+B09trplK9tSYqDp9dxprORqDsne4 X-Google-Smtp-Source: ABdhPJzGk2xNm0fdo1Y5bT3vS2YoysgktZp+BqU//Zz7lallmVHjVumU6Q/M0MuIy/5dg2IGhoBLTQ== X-Received: by 2002:a17:903:18b:: with SMTP id z11mr12845006plg.47.1643456280431; Sat, 29 Jan 2022 03:38:00 -0800 (PST) Received: from localhost ([209.95.60.92]) by smtp.gmail.com with ESMTPSA id h6sm12709728pfc.35.2022.01.29.03.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jan 2022 03:37:59 -0800 (PST) From: Ihor Radchenko To: Bastien , Kyle Meyer , Nicolas Goaziou , Karl Voit , Christian Heinrich , emacs-orgmode@gnu.org Subject: [PATCH 28/35] org-string-width: Handle undefined behaviour in older Emacs Date: Sat, 29 Jan 2022 19:38:20 +0800 Message-Id: <3e833302f0300b4f799e6486a8e522764abc2c0a.1643454546.git.yantar92@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: <87y2cvloay.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.34.1" Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::632 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=yantar92@gmail.com; helo=mail-pl1-x632.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Ihor Radchenko Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" 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=1643457529; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=iM4uXbl9m3tayZw1ye+4DMJZzWsffni5iu+EZl59NMU=; b=drWfQbXwU7nRxVumUvQ4g+56IfsH+da3JenhkHVp8GER42e5PkHL7yq3pt9nklCAC6Oe/2 zhLnf/+33/rAPdqn3fNgl1yiIQCyi7NJUey/sbb/uLZ0J/H/+PoUIxtOcl6Ty9772L73uM xp+49Rrhk6AN9PteGfnGQTME8th977qfLzefXlIdsIKy3MfG2v3kbQn+qjA2Dv1ewBkRKH 6gMkWTZX4K4ZpA5/DHxCBx+Dlv4xOvwMIV/fMRqM2TEHNgBpEKMRk7cfII4zEM4VUyRmI8 kcXt3/NIsI2xdsEkA8imuefiCLABULeIkN0kDXisUNbC5SBbSXZfmjD6+ceEcQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643457529; a=rsa-sha256; cv=none; b=J4ZNog/SzsSSKEFgW1zeSRwoukNg5Ytj278pdLYQrxeE/+BNvdrAVVTdBJQGa0arQNtgsg IbT2y+ELWmVgR5P9ByQhO65kKSqV+gM6pX8DSjBispT5GrBReVWlLkWzNCmWA0pseadzvj xiu+wcf5Yc5EuoV+5Q5/vl/vLousieIVIjjnBY5bXOuiz6PP+X2oBIA6XSqJ8Zg5jADTdU ITFC6UwRHTkFm92tg6CB0VKGq62xf/+hZPrD2vo/fwvAB//EutDV0BRQowTj7/8bEeh2Vn WUXv8eMULyzGtSnVZ672QkZ4VhCOjzDwG33DMszmVTfE4MC+V5qCQ9BbKH/oBw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=pg+vQiEo; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Spam-Score: -3.33 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=pg+vQiEo; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Queue-Id: 5295B2968C X-Spam-Score: -3.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: inXavuIysLGU This is a multi-part message in MIME format. --------------2.34.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit * lisp/org-macs.el (org-string-width): Force older Emacs treating invisible text with ellipsis as zero-width. Newer Emacs versions do exactly this. --- lisp/org-macs.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --------------2.34.1 Content-Type: text/x-patch; name="0028-org-string-width-Handle-undefined-behaviour-in-older.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0028-org-string-width-Handle-undefined-behaviour-in-older.patch" diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 0ccf080a3..0a7da0637 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -920,7 +920,16 @@ (defun org-string-width (string &optional pixels) (with-temp-buffer (setq-local display-line-numbers nil) (setq-local buffer-invisibility-spec - current-invisibility-spec) + (if (listp current-invisibility-spec) + (mapcar (lambda (el) + ;; Consider elipsis to have 0 width. + ;; It is what Emacs 28+ does, but we have + ;; to force it in earlier Emacs versions. + (if (and (consp el) (cdr el)) + (list (car el)) + el)) + current-invisibility-spec) + current-invisibility-spec)) (setq-local char-property-alias-alist current-char-property-alias-alist) (let (pixel-width symbol-width) --------------2.34.1--