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 ms0.migadu.com with LMTPS id mONMACgr9WEPCAAAgWs5BA (envelope-from ) for ; Sat, 29 Jan 2022 12:55:20 +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 mL+RNCcr9WH0eAEAG6o9tA (envelope-from ) for ; Sat, 29 Jan 2022 12:55:19 +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 6A61E2917A for ; Sat, 29 Jan 2022 12:55:19 +0100 (CET) Received: from localhost ([::1]:42700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDmK6-0001s9-Kg for larch@yhetil.org; Sat, 29 Jan 2022 06:55:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDm2D-0003p5-1L for emacs-orgmode@gnu.org; Sat, 29 Jan 2022 06:36:49 -0500 Received: from [2607:f8b0:4864:20::632] (port=33294 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 1nDm2B-0000jt-7E; Sat, 29 Jan 2022 06:36:48 -0500 Received: by mail-pl1-x632.google.com with SMTP id k17so8550695plk.0; Sat, 29 Jan 2022 03:36:46 -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=VSjvHefZROd4/159fyI62CBSpUsMSgv5Zcngoq0T0PM=; b=o+sTIZCbbSgQplcBOlhkwGwQ4wMhaY0aC+Zy3LkItNyt0qOHdYt6rpWFSSuq1g1apJ Xiqu0pP7fNw3ESMo5C414tbO60oc9sW/ToDnNuBcXctmgpHSzlrIjcsNZW3hhcr33LXo iek4IQgpPag6gMq7UDMZ/VFlNWd527qaZ3uwfdjjB3cYys5zRDjoAgT7A1SL8npeJ8uH 8oN1d4xPBaZuXLPLkeNAJo7HfDUMrpUOu01YXz61ANmeymTtb5udRp0wztRGHbmqBp/l yYoIOiFzPdqV0Yrj4um/3GJ7T+hEVg/xSK7EYxOpujCuuwHprVRPd1DEc+LHSL7sifW+ XyOg== 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=VSjvHefZROd4/159fyI62CBSpUsMSgv5Zcngoq0T0PM=; b=10mKTbFoUyPBm8lQ0ZzkbjvQ48WM4tRMgMC3tIXh6Im2jUAoleDbh56CyeZox9meob I5TsZx6SH7mK1jmEWoHX/8WbggYyn1gQgX2oHxiohiNrlp2NjoZ09Egw8oZAG7g9+4vB rbc96YK6eXsc7FipO45FZLT8G28MTbXpLZ+dMIZzIPOi8T0YHGGNkAyylYtN8uQGuqqC LZx4UJxeWsrJeWcxeSSOIfX5lGrfYNesApb0Dnu04HkWlLKSR+VbU4wpiuPCRTug22Uw bHG2kS9qVGVoucc79I8VuyxzRSCvP3mKLOTFGL1yEPpFzMfZMcmajCEymjpo/uwOFjUY kdIA== X-Gm-Message-State: AOAM530EH3/YkI/YlzXjUOd2OV1ZO3HTfG5LENa1HH3xFU/bd0sEaisZ 3rj6Q73QVYidotgeIye3Pb5UKl2OYFeb6H6R X-Google-Smtp-Source: ABdhPJw944zTD5IWIQvuKBydrd3MWLK+e9lrE2JGZJliRZdZavygFsNuRKPAic4f8a77DOg1zCkG2A== X-Received: by 2002:a17:90b:1e05:: with SMTP id pg5mr24568655pjb.86.1643456205436; Sat, 29 Jan 2022 03:36:45 -0800 (PST) Received: from localhost ([209.95.60.92]) by smtp.gmail.com with ESMTPSA id t24sm13617362pfg.92.2022.01.29.03.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jan 2022 03:36:44 -0800 (PST) From: Ihor Radchenko To: Bastien , Kyle Meyer , Nicolas Goaziou , Karl Voit , Christian Heinrich , emacs-orgmode@gnu.org Subject: [PATCH 18/35] Move `org-buffer-list' to org-macs.el Date: Sat, 29 Jan 2022 19:38:10 +0800 Message-Id: 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=1643457319; 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=grG9XLzX32afIcVFPhCh7kcWog6Sb8S7+qB9fAnSWyI=; b=XtBe/Z7XWYz006vw/z+CSyjMhjylCfIbstcfQvgtPlWO1M8AdUUyfQTpJA+8fsV+dtMt4y IFeaDvvwfMWnO8Ycm7JDYYYjPZ3SNaIOKjwMC/Qj9f1ZzIe6LwPUurhQ+fn4RdMZu5MZt3 NY6bCiI6u/RODmxEeFvEBhHD4Y5R2jbw5Mlv5x+DMumTFvpNlQnJqCWwHXrdb5JLeBqtqK ecdqcdo8dFzUG2JxTQV5F21+qh/BiifLI+A94C0Vu+DpKelWz+ZfDG8lE7k9o+0divYWTN SwDglrQrm1HLm4n9q3kS5jCAry8F8n1qJEVUXXBmBYAskLWcCHh5fGh+1UaY5Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643457319; a=rsa-sha256; cv=none; b=TxWFKDx0h2pdfb9k+CcXfPY9TMdrEIplxzCDR50n+Muy/YhIDddSw7AmWd6OkZo9CXRg9G ZKNjXveiK8yJOPIqRk13a4US0QE2hLOjjGvZ3GukW9ORp8TALj+6VVXn9BqrZgzatSOyli 0TNxcMxa4kiuOI6wc1ZgdPxwuwGy4LZaMdiVW6OkA9WITrqaWNZtdwQK8DSMNKhYMBiFUs UFXPZRGryCTJMaQFRN5zMqEkkjy45nvSsTw+9eGiD52wSGAtMDvkCJWRaaVNNs41EuJFOv IW0pAjMtt9c/hIQxEZqbKOXIiKX1Ude28JrXkgb+1a0Y0x674pVV0wpPuZOaWQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=o+sTIZCb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: -1.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=o+sTIZCb; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 6A61E2917A X-Spam-Score: -1.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: PWlfn4+rbZfc 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 | 38 ++++++++++++++++++++++++++++++++++++++ lisp/org.el | 38 -------------------------------------- 2 files changed, 38 insertions(+), 38 deletions(-) --------------2.34.1 Content-Type: text/x-patch; name="0018-Move-org-buffer-list-to-org-macs.el.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0018-Move-org-buffer-list-to-org-macs.el.patch" diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 5494acb3e..0ccf080a3 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -217,6 +217,44 @@ (defun org-fit-window-to-buffer (&optional window max-height min-height (shrink-window-if-larger-than-buffer window))) (or window (selected-window))) +(defun org-buffer-list (&optional predicate exclude-tmp) + "Return a list of Org buffers. +PREDICATE can be `export', `files' or `agenda'. + +export restrict the list to Export buffers. +files restrict the list to buffers visiting Org files. +agenda restrict the list to buffers visiting agenda files. + +If EXCLUDE-TMP is non-nil, ignore temporary buffers." + (let* ((bfn nil) + (agenda-files (and (eq predicate 'agenda) + (mapcar 'file-truename (org-agenda-files t)))) + (filter + (cond + ((eq predicate 'files) + (lambda (b) (with-current-buffer b (derived-mode-p 'org-mode)))) + ((eq predicate 'export) + (lambda (b) (string-match "\\*Org .*Export" (buffer-name b)))) + ((eq predicate 'agenda) + (lambda (b) + (with-current-buffer b + (and (derived-mode-p 'org-mode) + (setq bfn (buffer-file-name b)) + (member (file-truename bfn) agenda-files))))) + (t (lambda (b) (with-current-buffer b + (or (derived-mode-p 'org-mode) + (string-match "\\*Org .*Export" + (buffer-name b))))))))) + (delq nil + (mapcar + (lambda(b) + (if (and (funcall filter b) + (or (not exclude-tmp) + (not (string-match "tmp" (buffer-name b))))) + b + nil)) + (buffer-list))))) + ;;; File diff --git a/lisp/org.el b/lisp/org.el index cbdbf32f1..a9a7b4621 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14736,44 +14736,6 @@ (defun org-switchb (&optional arg) (mapcar #'list (mapcar #'buffer-name blist)) nil t)))) -(defun org-buffer-list (&optional predicate exclude-tmp) - "Return a list of Org buffers. -PREDICATE can be `export', `files' or `agenda'. - -export restrict the list to Export buffers. -files restrict the list to buffers visiting Org files. -agenda restrict the list to buffers visiting agenda files. - -If EXCLUDE-TMP is non-nil, ignore temporary buffers." - (let* ((bfn nil) - (agenda-files (and (eq predicate 'agenda) - (mapcar 'file-truename (org-agenda-files t)))) - (filter - (cond - ((eq predicate 'files) - (lambda (b) (with-current-buffer b (derived-mode-p 'org-mode)))) - ((eq predicate 'export) - (lambda (b) (string-match "\\*Org .*Export" (buffer-name b)))) - ((eq predicate 'agenda) - (lambda (b) - (with-current-buffer b - (and (derived-mode-p 'org-mode) - (setq bfn (buffer-file-name b)) - (member (file-truename bfn) agenda-files))))) - (t (lambda (b) (with-current-buffer b - (or (derived-mode-p 'org-mode) - (string-match "\\*Org .*Export" - (buffer-name b))))))))) - (delq nil - (mapcar - (lambda(b) - (if (and (funcall filter b) - (or (not exclude-tmp) - (not (string-match "tmp" (buffer-name b))))) - b - nil)) - (buffer-list))))) - (defun org-agenda-files (&optional unrestricted archives) "Get the list of agenda files. Optional UNRESTRICTED means return the full list even if a restriction --------------2.34.1--