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 ms5.migadu.com with LMTPS id AEJmAnJP8mIsBgEAbAwnHQ (envelope-from ) for ; Tue, 09 Aug 2022 14:13:38 +0200 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 wC15AnJP8mJvTgAAauVa8A (envelope-from ) for ; Tue, 09 Aug 2022 14:13:38 +0200 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 BBC983FBBB for ; Tue, 9 Aug 2022 14:13:37 +0200 (CEST) Received: from localhost ([::1]:44338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLO76-0006NX-DY for larch@yhetil.org; Tue, 09 Aug 2022 08:13:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLO68-0006NN-Ta for emacs-orgmode@gnu.org; Tue, 09 Aug 2022 08:12:36 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:46615) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oLO67-0003XT-6R for emacs-orgmode@gnu.org; Tue, 09 Aug 2022 08:12:36 -0400 Received: by mail-pf1-x436.google.com with SMTP id 130so10571374pfv.13 for ; Tue, 09 Aug 2022 05:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=41xgMrVpI/JMB261BxYeNbEGzN4Njy6lFPs1daEKoaU=; b=XReWyaITBcSXaTqZtKpmDHJ7OgajKy8kY23CEXFSF1wMGpIMXSLbGEDQXA/ErH+nU0 At8N/f2IM9u8PbumL5bjaiALfluXOsH1uTCZYdl0nzAeaaYwOBAtKJNVPUl2rr6zYBhH oAEKcCzJEBdpy+KvciQCS00VwdUOuQWHT/1iOpxdcxJ+PVPO1iNYNgan2YRlPdipV72s bEWzjxdL6I9OJE0F+T6GNemuGsPXWQygatMQ/99OA676BrI6PFfB0tAFUApTROxjAIMq 7fIzx7XjnQS7OqFV9sZ6ZW89GbvrHduTqbGSBlxDQM50M+ayktHTE3iv90vbrNSoWUVM wwgw== 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:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=41xgMrVpI/JMB261BxYeNbEGzN4Njy6lFPs1daEKoaU=; b=e0Uhnlssd1TJ3W+n/pTzxaKZcXRsmmAJoKrO5KjVq/6vcdi+OokGVLCXV2tnXW4aw7 GLpaNZGpWw7q8gYddCMI7cUwCUUoT/t/Ybt0Xg/OSKGjNnfOHZkvMNbp2R/7TCJIg2D6 gmuwAXo+NDwWuIgSNHT+MDY63qQKf0ltgPRwSilgYq6cnWCvOULf3srDT0CPkARtrVT6 VIGoOYEkDkGsQu8Fy3r+7Q+3ajN1qIFpA1bbMdhoBSZJ3vC5qZ4ObHeYLrPsR/yAACAw X6H2QeIz1VTh3NLD5ee3uvWcogchQIwNn/Mp8ckX6eO+qeDoxF8Mji5YJM1u3vqGEp2Y e79Q== X-Gm-Message-State: ACgBeo3RbU8+PbpvEk3C3BSwTLXcnPwd8iGY84eH4wUpk30sYFtzz/p6 hA+5VZIrWdUxc4E8xs8an3L9IYFXD6w= X-Google-Smtp-Source: AA6agR5TElB68mJKkZiL9EI445RSP5zd6KW0nqaekbMj5ZTWJtuPPVkLgr3whXBY3OaIiDfpFFDaJA== X-Received: by 2002:a05:6a00:1d9e:b0:52d:aa13:67fc with SMTP id z30-20020a056a001d9e00b0052daa1367fcmr22752294pfw.73.1660047153914; Tue, 09 Aug 2022 05:12:33 -0700 (PDT) Received: from localhost ([2409:8a70:2bf:80b0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id w185-20020a6230c2000000b0052f0a404fa7sm6454940pfw.146.2022.08.09.05.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Aug 2022 05:12:33 -0700 (PDT) From: Ihor Radchenko To: Tom Gillespie Cc: emacs-orgmode Subject: Re: [PATCH] ol-man.el (org-man-open): Set window point not buffer point In-Reply-To: References: <87zggskqc9.fsf@localhost> Date: Tue, 09 Aug 2022 20:13:35 +0800 Message-ID: <87lerx4ntc.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=yantar92@gmail.com; helo=mail-pf1-x436.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660047217; 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=41xgMrVpI/JMB261BxYeNbEGzN4Njy6lFPs1daEKoaU=; b=RFdC1mwWpq/gHfASuAnJG+KVN5sOEM1xBw/qQVBWc6nccZ9k+QaCWTqxr8kJ7/OLTWClsa YhzRyByffSrfoGbG2ixcGaax1ZmoPYDjHxLxVGL0wXDhuQsiT+XrAD4KtaVwFjOjxL2KuL /2ttc3/I551urKXypG2PilKrJY1PUycAGamctQxhUm1xBHygcpa+vgy0JQbnqd0Udz3Cb0 01McpniaRe/Z1slQ7znWv8d0QwsABg5PeAwtTeyzeaWJx4MVryUx0tUiF1yMBPDBf0RWUW Fmppf/Ixc8fLK18/2JsdmvJIW7X2eLQeluba1WNziJHdFg1pY0eVkSgVIMIrzw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660047217; a=rsa-sha256; cv=none; b=BOCj2TQfIBmlJVCWVhw1KzP0D4O+sWSi3z3Qz7FL58Erols1iZnuU27A9LsGn1rcEDTG3s djKhFhCkIOvBstfWhG6+3cNvQSUuGTrnjELDA4bpUIWDz5Dtdqp1DlB99a63rJLCbtOltF mRlOEtjPOx2cyIritt5PP5bA9iqhjxSbfDi2kzXjPCOEqRKQrXo5QGutJILBPOWrjeJwkj Y4k9CdVOKkKQgPm5muwAMWnGQ1X/OVvKzkTnCSyDAhmFoO0dOvZL2e8H3lMih8dmzdxITR M2iI8GT5XTsPebfyQnsJNmnj3KLqZL/agg9Dbu/9kdgFk6PF18o5rhmQZRP1uQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=XReWyaIT; 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: -4.69 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=XReWyaIT; 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: BBC983FBBB X-Spam-Score: -4.69 X-Migadu-Scanner: scn0.migadu.com X-TUID: iXChS/V0iZQr Tom Gillespie writes: > Hi Ihor, > Here is an updated patch. We can't use accept-process-output > because it doesn't seem to block in the way we need, or it blocks > exactly long enough for the process to finish but then continues > immediately to search instead of allowing the function that fills > the buffer to complete. Instead I use sleep-for a shorter time and > process-live-p which gives better results. I think I got the commit > message formats right this time. Best! Why not=20 (while (process-live-p process) (accept-process-output process))) then? sleep-for is using similar machinery under the hood, but accept-process-output does not require magic constants and in addition handles various edge cases. Also, compiling the patch yields In org-man-open: ol-man.el:54:16: Warning: =E2=80=98previous-line=E2=80=99 is for interactiv= e use only; use =E2=80=98forward-line=E2=80=99 with negative argument instead. > * lisp/ol-man.el (org-man-open): Set window point not buffer point > When passed man:path::SEARCH org-man-open tries to use search-forward > to jump to the location of e.g. a heading. Prior to this fix it only > used search-forward, which will not change the point of the cursor in > the window, meaning that even if there is a match it will not appear. > Uses process-live-p and sleep-for to wait until the manpage finishes > rendering before searching the buffer so that there will be something > to find. Please use double space " " between sentences and quote `org-man-open' and similar Elisp symbols. --=20 Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92