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 KI+rH7RxW1+IQAAA0tVLHw (envelope-from ) for ; Fri, 11 Sep 2020 12:46:44 +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 MA/yGbRxW19PfAAAB5/wlQ (envelope-from ) for ; Fri, 11 Sep 2020 12:46:44 +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 E90739408E7 for ; Fri, 11 Sep 2020 12:46:43 +0000 (UTC) Received: from localhost ([::1]:38456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGiRu-00053O-M7 for larch@yhetil.org; Fri, 11 Sep 2020 08:46:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGiR0-00051o-50 for emacs-orgmode@gnu.org; Fri, 11 Sep 2020 08:45:46 -0400 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]:37447) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGiQx-0002om-1j for emacs-orgmode@gnu.org; Fri, 11 Sep 2020 08:45:45 -0400 Received: by mail-ot1-x335.google.com with SMTP id o8so514989otl.4 for ; Fri, 11 Sep 2020 05:45:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=QVlHxLyaKQ2jI4ZGCw8nZonwGzOqqX7TpKzWdOWpXTk=; b=MXhEu1CtCn3ikY96lpG2ZsscZ9iyw2SfOhSckNbaMPp+/PEvVAerfEwltJ8e6RBOwh KiCk+Z3HBtOAZf9nczp11Rkrw4fDoNumTMqTry7dfvFHxn35AYyVXLMZ4lQ3QtmV164b 0lncwIHG3QL46LIWD3fmePmx3zHdDiPRjPUkeuEMnsr+G5XFLKBImfZEFdo4+V3n084I jQuKpOUHL1Fm0XzK6jN5nIP0hhJhOManIYoWoqkZXIVQiYUEVhRf8rvlg61xMUH8clrU LEMw5Iqm1ZqNQBoJoX8LlV8+mjXwR07qujNwFSbN+L7x2y8ChZNrug6p6Q8zm2IbAiyv bFUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=QVlHxLyaKQ2jI4ZGCw8nZonwGzOqqX7TpKzWdOWpXTk=; b=tUHS5GdF4VhsoHv9x38Z2YHO5JLbSNK1g9M53zA4PGHisnuzrD8nVmHMGDE4b/1IH2 ymDxIFKTTNB710jvWRH8L6c16k1bAos6KC2qRugI3OXXgjvXEz2RbPEGljW6F/eGLP6J eI7BPuLPdz45+kKXSnaKfwfq5km25N8GHRODS2+y8AbLF1aIoxH/HyKJEODPicbikeIV sjTG98L/69G8meys649/wy3J8Dd8ErJ44ZOF1kue+1HYEXYejg/7T1cD/gw5GsVwgHYl L8Lk2n95+cX1k2OMILRvk/OrLVr0WWQiQLeU0ajd9UF3LH5KWpeaLNjy9GwU7BTfWPpf YqCw== X-Gm-Message-State: AOAM533KzZd5Lk80HNxrY34bd7mcXSRP7/wi44KFV70yNK1Nymu56dqg AanWmcgXu2loSSmvK1UOuXsfgKk5TxKb4WQkhqe+J2Y= X-Google-Smtp-Source: ABdhPJxpkY2h7ITmxwEDHvXe5RkUOsziT3DVG5EFmf8SLzUy9FHw9AN5OjDQBmWGlOzbMENsvgEM7zHSbUEMwjWyYZY= X-Received: by 2002:a9d:6e12:: with SMTP id e18mr1122270otr.273.1599828340237; Fri, 11 Sep 2020 05:45:40 -0700 (PDT) MIME-Version: 1.0 From: Marlin Strub Date: Fri, 11 Sep 2020 14:45:29 +0200 Message-ID: Subject: [PATCH] org.el: Adapt org-cycle to work with headlines with hidden stars To: emacs-orgmode@gnu.org Content-Type: multipart/mixed; boundary="000000000000ec09cd05af090f25" Received-SPF: pass client-ip=2607:f8b0:4864:20::335; envelope-from=marlin.strub@gmail.com; helo=mail-ot1-x335.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no 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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=MXhEu1Ct; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 0.09 X-TUID: qDXE6/oKcaRI --000000000000ec09cd05af090f25 Content-Type: multipart/alternative; boundary="000000000000ec09cc05af090f23" --000000000000ec09cc05af090f23 Content-Type: text/plain; charset="UTF-8" Hello everyone, I looked into using text properties to hide all the stars in org headings (with org-starless-mode [1]), and noticed that `org-cycle' didn't reliably cycle the visibility of headings anymore. Trying to find the reason for this, I found that `org-cycle' uses `move-beginning-of-line' in combination with a regexp to detect headings. The problem is that `move-beginning-of-line' ignores invisible text such that the regexp fails to match. The attached patch changes `move-beginning-of-line' to `beginning-of-line', which does not ignore invisible text. This solves the issue with hidden stars, but I have a feeling that I'm missing something. Is there a problem with using `beginning-of-line' instead of `move-beginning-of-line' or could this patch be applied? Thanks a lot for looking into this, Marlin [1] https://github.com/TonCherAmi/org-starless --000000000000ec09cc05af090f23 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello everyone,

I looked into using tex= t properties to hide all the stars in org headings (with org-starless-mode = [1]),
and noticed that `org-cycle' didn't reliably cycle = the visibility of headings anymore.

Trying to find= the reason for this, I found that `org-cycle' uses `move-beginning-of-= line' in combination
with a regexp to detect headings. The pr= oblem is that `move-beginning-of-line' ignores invisible text
such that the regexp fails to match. The attached patch changes `move-begi= nning-of-line' to
`beginning-of-line', which does not ign= ore invisible text.

This solves the issue with=C2= =A0hidden stars, but I have a feeling that I'm missing something. Is th= ere a
problem with using `beginning-of-line' instead of `move= -beginning-of-line' or could this patch be
applied?

Thanks a lot for looking into this,
Marlin
<= div>
--000000000000ec09cc05af090f23-- --000000000000ec09cd05af090f25 Content-Type: application/octet-stream; name="0001-org.el-Adapt-org-cycle-to-work-with-headlines-with-h.patch" Content-Disposition: attachment; filename="0001-org.el-Adapt-org-cycle-to-work-with-headlines-with-h.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_key8ev2m0 RnJvbSA0YmE1MDI2YTk2YzZjZWU0ZjAzMjBmNzBmNDYyNDViNTUxYWYyNjQ3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXJsaW4gU3RydWIgPG1hcmxpbkBNYXJsaW5zLU1hY0Jvb2st UHJvLmx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