From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ELSGBY09z16ZKAAA0tVLHw (envelope-from ) for ; Thu, 28 May 2020 04:26:53 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EM5wAY09z16xaAAAB5/wlQ (envelope-from ) for ; Thu, 28 May 2020 04:26:53 +0000 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 E7C259403EE for ; Thu, 28 May 2020 04:26:51 +0000 (UTC) Received: from localhost ([::1]:51322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeA81-0000ZB-2m for larch@yhetil.org; Thu, 28 May 2020 00:26:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeA7X-0000Z3-Ow for emacs-orgmode@gnu.org; Thu, 28 May 2020 00:26:19 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:59704) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeA7V-00076F-RB for emacs-orgmode@gnu.org; Thu, 28 May 2020 00:26:19 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 39158CEA9F; Thu, 28 May 2020 00:26:13 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=sasl; bh=FjigiSsOIpXB42pbQInYk8cFfAI=; b=tMyfn3 4IoDEPR3detmyYKcK51FeCDoLK+c7IpOaUuCCza7qYZu2NIwKArPJ57DnhqEfdg5 LGxKqrwZDMgC/+3qSdunqF2T2pDKyl7CD8GZWEa3q8BRdlDul0SnR31wPewWE1x+ z8bIFCBy6LAI3U+exax9z1vlaPsLaebCAIf1M= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 30E06CEA9E; Thu, 28 May 2020 00:26:13 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:references:date:message-id:mime-version:content-type; s=mesmtp; bh=2uHOFqbI17Oa+Vr/1ZRo6ptxj1pAuwfrYHUirlkmNR0=; b=2n/+p/RfEh5Pv4+fCcWiKcmjqeg7eNqE9Q8vzgrhpByfMptuEBRXaXIJNyJcjEqsLPAPutg8Q07V0hZrbiw+xFc5ANyICqBP+/v9TMmPYq5Vf26THxhNg9Ox+fmqi3IDNl07Jyf8wIOmExnwvoavoqttYdts7I0LdE9O/xkllYQ= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 5AEABCEA9D; Thu, 28 May 2020 00:26:09 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: Ihor Radchenko Subject: [PATCH] goto: Avoid invoking org-mode for outline navigation In-Reply-To: <87r1v6vwis.fsf@kyleam.com> References: <87tv02vy5r.fsf@kyleam.com> <87mu5u5962.fsf@localhost> <87r1v6vwis.fsf@kyleam.com> Date: Thu, 28 May 2020 04:26:07 +0000 Message-ID: <87d06owuqo.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 5AEA1F1E-A09B-11EA-8B58-8D86F504CC47-24757444!pb-smtp21.pobox.com Received-SPF: pass client-ip=173.228.157.53; envelope-from=kyle@kyleam.com; helo=pb-smtp21.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 00:26:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vladimir Nikishkin , emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=tMyfn3 4; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=2n/+p/Rf; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.21 X-TUID: Q+9+ORtJQhy+ Kyle Meyer writes: > Ihor Radchenko writes: > >> Is there even a need to call the whole (org-mode). The new buffer is >> an indirect buffer. It should already have org-mode activated (at least, >> we can check for it and not call (org-mode) unnecessarily). If we just >> want to reset initial visibility, (org-overview) is already doing the >> job of (org-set-startup-visibility) from (org-mode). > > Hmm, thanks for taking a step back. It does seem like the org-mode call > should be unnecessary. (I haven't tried yet.) Based on light testing, dropping the org-mode call doesn't seem to break anything. I don't use the outline interface to org-goto, so it'd be appreciated if anyone who does could try it out and see if anything feels off. -- >8 -- Subject: [PATCH] goto: Avoid invoking org-mode for outline navigation * lisp/org-goto.el (org-goto-location): Call make-indirect-buffer with a non-nil CLONE to preserve the base buffer's state, avoiding a more expensive call to org-mode. Reported-by: Vladimir Nikishkin Suggested-by: Ihor Radchenko --- lisp/org-goto.el | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lisp/org-goto.el b/lisp/org-goto.el index 6d4c0cbf2..56786696e 100644 --- a/lisp/org-goto.el +++ b/lisp/org-goto.el @@ -234,20 +234,15 @@ (defun org-goto-location (&optional _buf help) (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*")) (pop-to-buffer-same-window (condition-case nil - (make-indirect-buffer (current-buffer) "*org-goto*") - (error (make-indirect-buffer (current-buffer) "*org-goto*")))) + (make-indirect-buffer (current-buffer) "*org-goto*" t) + (error (make-indirect-buffer (current-buffer) "*org-goto*" t)))) (let (temp-buffer-show-function temp-buffer-show-hook) (with-output-to-temp-buffer "*Org Help*" (princ (format help (if org-goto-auto-isearch " Just type for auto-isearch." " n/p/f/b/u to navigate, q to quit."))))) (org-fit-window-to-buffer (get-buffer-window "*Org Help*")) - (setq buffer-read-only nil) - (let ((org-startup-truncated t) - (org-startup-folded nil) - (org-startup-align-all-tables nil)) - (org-mode) - (org-overview)) + (org-overview) (setq buffer-read-only t) (if (and (boundp 'org-goto-start-pos) (integer-or-marker-p org-goto-start-pos)) base-commit: 516c038e5f65911c32de1054925ce9e848c3f2d7 -- 2.26.2