unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jaft <jaft.r@outlook.com>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Possibly Weird Behavior Regarding First Lines Which are Invisible?
Date: Fri, 2 Feb 2024 06:13:24 +0000 (UTC)	[thread overview]
Message-ID: <PH0PR84MB1360E253872F307DBAECC0B999422@PH0PR84MB1360.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: 1623180934.4325548.1706854404633.ref@mail.yahoo.com

So I have a buffer; let's say 9 lines. And I have a function which runs (previous-line) (beginning-of-line 1) and said function is bound to a key (let's say <up>).
So I apply a text-property of 'invisible using (pos-bol) of the first line and (1+ (pos-eol)) in order to get the first line to disappear, like it's not even there.
If I'm on line 3 and M-: my function, it does what I'd expect and (point) will return the (pos-bol) of the second line. But, if I execute my function by pressing <up> from line 3, (point) keeps returning back 1, the point of the beginning of line 1 rather than the point at the beginning of line 2.
Is this expected behavior? I'd be less weirded out if running code through M-: gave back similar results but I get what I'd expect to happen no matter what code I run and only the unexpected behavior when running the exact same code via a key binding.
I'm running version 29.1 (GTK+ version 3.24.37 but through the terminal; I wouldn't expect these to affect anything as much as the Emacs version, though. On Guix).


       reply	other threads:[~2024-02-02  6:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1623180934.4325548.1706854404633.ref@mail.yahoo.com>
2024-02-02  6:13 ` Jaft [this message]
2024-02-04 13:42   ` Possibly Weird Behavior Regarding First Lines Which are Invisible? Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH0PR84MB1360E253872F307DBAECC0B999422@PH0PR84MB1360.NAMPRD84.PROD.OUTLOOK.COM \
    --to=jaft.r@outlook.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).