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 WB0pByYq9WH5cQEAgWs5BA (envelope-from ) for ; Sat, 29 Jan 2022 12:51:02 +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 OLhWOyUq9WH0eAEAG6o9tA (envelope-from ) for ; Sat, 29 Jan 2022 12:51:01 +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 8809629484 for ; Sat, 29 Jan 2022 12:51:01 +0100 (CET) Received: from localhost ([::1]:60454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDmFw-000397-O3 for larch@yhetil.org; Sat, 29 Jan 2022 06:51:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDm20-0003Of-HC for emacs-orgmode@gnu.org; Sat, 29 Jan 2022 06:36:36 -0500 Received: from [2607:f8b0:4864:20::102b] (port=40454 helo=mail-pj1-x102b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDm1y-0000gw-Ed; Sat, 29 Jan 2022 06:36:35 -0500 Received: by mail-pj1-x102b.google.com with SMTP id z10-20020a17090acb0a00b001b520826011so13416959pjt.5; Sat, 29 Jan 2022 03:36:33 -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=xT9Ii2TeRiknVrJlcLQHLx+aXHSi8lquviufvoZ/418=; b=VDADYnwu0BXTxgVgiv+NoCHmPqPvyNYhsFpGaGp9sfWfBPfhZhgIJOGaAkbXNF6Eys eVaChS28ygo9H68pWKsfLBHPIq9QWDuh90ALHPqI2NIB9gZMHry8q1cqgGHOS6wbRP7N EwpkU965QeStAKgmvedOONjOOxrkwIMWUP6XmyFL9HlIq6Mp16kP7dswuWnrZmoIP+nC HaYbOK8kxtOQr/LWYodfSoDvB0zqzHgbXS6q61OI/k3gY1OaJ4O4iQ3TS/34fw8XxbMG HwotJWoEqzWfRI88fwI0NNzMjSsKJSIsA2leIKWJ2PtI8xpDeGmISE95BE2Ckzoumxd2 6Mxg== 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=xT9Ii2TeRiknVrJlcLQHLx+aXHSi8lquviufvoZ/418=; b=2EXQ2nt4fWwPaltrm9OuzQ198jpno+fS0GMK+/21L4oew1q9LvFg+/1al0SJ/NAvL+ ybWHSM8OV5uI4AZZ+5clrOWTj1HJw70AHeyX5pmURR6iM2glXAoFPb+1hq5Q1NJyGr/Z pLQVXX9I2fPgZEMc9gaog8kRCWkhYAq/tQx7eiZsChD0y3Y9n1mv0/JGH0eWTFmoNctQ A5/dQ15blDrPaKVc5ihWJHupqTVlgFMRf1fR3UIQhKC3doldTN/NX09cckjyv4AVTJHI C6RkkoEGsXI4Sn8jQdNgcgtnx3UlCYTxBe4l4loHK8KKBuNH+c13LHusQEvMVX6pHDhZ 7zgw== X-Gm-Message-State: AOAM530hlcYuobR8ZrvxXq6bfL5IghKYmhF/2sv0QuPiCHT7qC/PUBL3 ClZyDVe0KYjdOIn2fz+j35/tkzSt+FZiVNvD X-Google-Smtp-Source: ABdhPJwaz60kN/M9A4GUaeNajs8cu5RT6FureI6fro6rJZGt/3YlvE58Eb3LvX3J9Ko5leUSkaSQlQ== X-Received: by 2002:a17:902:ecd2:: with SMTP id a18mr12709418plh.84.1643456192706; Sat, 29 Jan 2022 03:36:32 -0800 (PST) Received: from localhost ([209.95.60.92]) by smtp.gmail.com with ESMTPSA id a17sm23862130pgh.9.2022.01.29.03.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jan 2022 03:36:32 -0800 (PST) From: Ihor Radchenko To: Bastien , Kyle Meyer , Nicolas Goaziou , Karl Voit , Christian Heinrich , emacs-orgmode@gnu.org Subject: [PATCH 17/35] org-compat: Work around some third-party packages using outline-* functions Date: Sat, 29 Jan 2022 19:38:09 +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::102b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102b.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=1643457061; 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=xT9Ii2TeRiknVrJlcLQHLx+aXHSi8lquviufvoZ/418=; b=s7hpDwYzPCOtK3vTs9QXKU+m0hHjE/koyZnUjqTu+fENMaJpaluuA9HMSEQy2Ksa2G3yUx j/ft+C8Vj1Akxb4M1BnPpRhlbMABmJdguSFjxlqN+6uKcuuixmtaXLYW5uh4icN2QkmTPb 0QHZakZjfhRTO4ZITKQwVpj86o0BV8KpIsvYs9s25F5GFnJfuZQ0FQ+elXiTGzP5YIAujK s8vgbdw9RyKrmjSTmzmYPEGJ9Z34UcEG4ZX7I3Kyas7MlUvmZftY6UQzppcPcwpjbeC9Nr uvqDNREoFh1qmTnkVKKUOqOGu0S/Fd3rfu7L2uWaufeu0aNEyrTpGz54ffuDfA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643457061; a=rsa-sha256; cv=none; b=K2rDh0zjU0a0UquX/8sVU3TKmd9U92jNYekhW2QlnolVJkayfnkl+XIy2uK3Mbt3B7a2xb kBEsarO1pekRjF4vVvTeR3QCQWgVs9s2ezWY2JM62+dX2mTO7AxmNhDs1MbgYzsULsCU/i aP6Cv61RgZ3MikQfoNB9Qf6gFqN0wRC1fgWnvBtfVLpfHxUqpOX4t3lmZdtbT4N0wFlJXx r1lDEDYPVYd9pGbd4jAIOWa/zqsaAtDF1+gRDQ24n3MCM/RIOzirNKwS80axEnKEgIMh+O uk/V9XoDFyubjVhdtByzTIzs2K+fuqClimWhRtz0VWD1t4JwmmtD9377CdsNaQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=VDADYnwu; 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=VDADYnwu; 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: 8809629484 X-Spam-Score: -3.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: Gl01RvzDuvWn 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-compat.el | 72 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-) --------------2.34.1 Content-Type: text/x-patch; name="0017-org-compat-Work-around-some-third-party-packages-usi.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0017-org-compat-Work-around-some-third-party-packages-usi.patch" diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 14afb4600..05efeca11 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -1311,11 +1311,81 @@ (defvar session-globals-exclude) (eval-after-load 'session '(add-to-list 'session-globals-exclude 'org-mark-ring)) +;;;; outline-mode + +;; Folding in outline-mode is not compatible with org-mode folding +;; anymore. Working around to avoid breakage of external packages +;; assuming the compatibility. +(defadvice outline-flag-region (around outline-flag-region@fix-for-org-fold (from to flag) activate) + "Run `org-fold-region' when in org-mode." + (if (eq major-mode 'org-mode) + (setq ad-return-value (org-fold-region (max from (point-min)) (min to (point-max)) flag 'headline)) + ad-do-it)) + +(defadvice outline-next-visible-heading (around outline-next-visible-heading@fix-for-org-fold (arg) activate) + "Run `org-next-visible-heading' when in org-mode." + (interactive "p") + (if (eq major-mode 'org-mode) + (setq ad-return-value (org-next-visible-heading arg)) + ad-do-it)) + +(defadvice outline-back-to-heading (around outline-back-to-heading@fix-for-org-fold (&optional invisible-ok) activate) + "Run `org-back-to-heading' when in org-mode." + (if (eq major-mode 'org-mode) + (setq ad-return-value + (progn + (beginning-of-line) + (or (org-at-heading-p (not invisible-ok)) + (let (found) + (save-excursion + (while (not found) + (or (re-search-backward (concat "^\\(?:" outline-regexp "\\)") + nil t) + (signal 'outline-before-first-heading nil)) + (setq found (and (or invisible-ok (not (org-fold-folded-p))) + (point))))) + (goto-char found) + found)))) + ad-do-it)) + +(defadvice outline-on-heading-p (around outline-on-heading-p@fix-for-org-fold (&optional invisible-ok) activate) + "Run `org-at-heading-p' when in org-mode." + (if (eq major-mode 'org-mode) + (setq ad-return-value (org-at-heading-p (not invisible-ok))) + ad-do-it)) + +(defadvice outline-hide-sublevels (around outline-hide-sublevels@fix-for-org-fold (levels) activate) + "Run `org-fold-hide-sublevels' when in org-mode." + (interactive (list + (cond + (current-prefix-arg (prefix-numeric-value current-prefix-arg)) + ((save-excursion (beginning-of-line) + (looking-at outline-regexp)) + (funcall outline-level)) + (t 1)))) + (if (eq major-mode 'org-mode) + (setq ad-return-value (org-fold-hide-sublevels levels)) + ad-do-it)) + +(defadvice outline-toggle-children (around outline-toggle-children@fix-for-org-fold () activate) + "Run `org-fold-hide-sublevels' when in org-mode." + (interactive) + (if (eq major-mode 'org-mode) + (setq ad-return-value + (save-excursion + (org-back-to-heading) + (if (not (org-fold-folded-p (line-end-position))) + (org-fold-hide-subtree) + (org-fold-show-children) + (org-fold-show-entry)))) + ad-do-it)) + +;; TODO: outline-headers-as-kill + ;;;; Speed commands (make-obsolete-variable 'org-speed-commands-user "configure `org-speed-commands' instead." "9.5") - (provide 'org-compat) ;; Local variables: --------------2.34.1--