From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 25 19:22:00 2024 Received: (at submit) by debbugs.gnu.org; 26 Feb 2024 00:22:00 +0000 Received: from localhost ([127.0.0.1]:35883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reOkp-0004Re-Qj for submit@debbugs.gnu.org; Sun, 25 Feb 2024 19:22:00 -0500 Received: from lists.gnu.org ([209.51.188.17]:50176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1reOkn-0004RN-OF for submit@debbugs.gnu.org; Sun, 25 Feb 2024 19:21:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reOkN-0006tW-Fm for bug-auctex@gnu.org; Sun, 25 Feb 2024 19:21:31 -0500 Received: from mail-yw1-x1130.google.com ([2607:f8b0:4864:20::1130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1reOkL-0006uV-VG for bug-auctex@gnu.org; Sun, 25 Feb 2024 19:21:31 -0500 Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-607bfa4c913so25155177b3.3 for ; Sun, 25 Feb 2024 16:21:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708906888; x=1709511688; darn=gnu.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=emECZv1oDF42Fr9gheRXscriBHbNLHUUS6Pp5iO0pYA=; b=HgodM+lgJGv1lOo0p2wjuJMGg+Zs4kYnCjW0yioi1XFfaXSFyAwlmfo+HYX6N5zJKw Tp898x34NvNVZZauLFIuMFlgyvc0ioUwv3CKJhzJ/R/jDKhZ+BxAIvOLRO3zGEZgv4s0 43fQZkX38eVzqge79Qp54vhj/sLwCNACxaLfslOz3iFhd0cgPWlLmFuLutIG2MrR8lM/ UpRZkSQZ/bkE3+IIztMDjvxMUk4iKkt5AO6/6mHUoNqqA+RcvyDJll6SJ3tsncClKq9l 95tf7K6nh09/Hfmij1m38C1j3wKZDEstq5j7NjwlmPx+LvOYwsq+8X8xC2SuVNs5YnfD 68kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708906888; x=1709511688; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=emECZv1oDF42Fr9gheRXscriBHbNLHUUS6Pp5iO0pYA=; b=Z227he3R51UuQ/JT37gwVFVs2M08mHaqMwASS7FTuwLzXmYEyG0c0TmBM822BNKwpJ 2q5l4hdnNxBUbb/CmeerO9Sbo6TwZ1qRAf7eFkpU1mRkGBG/lmwhEYeJoHYDwwFeNta/ BLFtKr2PxTiDnWezrux+h8vMMKp63RMx/WBbB0kzI+kQd8+1db6lOqJu35ht6rhUU4M7 kR2WLe1/otu+wGzZyojKYQcBqqe0tJQvvX7tNpW58EODec8PvEAJe+WdltaCm1yOiiIn qpcoUSBSJ59Wp/mVEzIJiY7VDnvc5HI2nq8WSKEJJkt4QFut+1M4t5egzkuAPsazqwY/ 913Q== X-Gm-Message-State: AOJu0Yx/CnmqjdL97zatAUSyjadpYCQgs2RlEYfB6VgChtPzmiTCnygY VIxKxsEZBLcTxTEKWkeS6qbP0ticqaoRq9+JGgmKZkYYfbt0o3OkbYu6oapg X-Google-Smtp-Source: AGHT+IH2eJ3Uf2ia3HWOqUCCfmo1GPoGeGVK5ilscL3TIZhNITjwK1q0GYu80Ey/IKFo/LNfI5FgAQ== X-Received: by 2002:a81:4f87:0:b0:608:edec:e76b with SMTP id d129-20020a814f87000000b00608edece76bmr1519459ywb.33.1708906888062; Sun, 25 Feb 2024 16:21:28 -0800 (PST) Received: from smtpclient.apple (pool-108-50-194-31.nwrknj.fios.verizon.net. [108.50.194.31]) by smtp.gmail.com with ESMTPSA id j5-20020a37ef05000000b007877add9363sm1923410qkk.103.2024.02.25.16.21.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Feb 2024 16:21:27 -0800 (PST) From: Ruiyang Wu Content-Type: multipart/alternative; boundary="Apple-Mail=_26661220-EACC-42A0-AFF3-70D54361BDBC" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.400.31\)) Subject: `LaTeX-fill-paragraph` behavior within indented environments Message-Id: <6505E1F5-8641-49AD-AEF7-58D1622D27C6@gmail.com> Date: Sun, 25 Feb 2024 19:21:17 -0500 To: bug-auctex@gnu.org X-Mailer: Apple Mail (2.3774.400.31) Received-SPF: pass client-ip=2607:f8b0:4864:20::1130; envelope-from=ywwry66@gmail.com; helo=mail-yw1-x1130.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, HTML_MESSAGE=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-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) --Apple-Mail=_26661220-EACC-42A0-AFF3-70D54361BDBC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi there, When the point is on the first letter of a line inside an indented = environment (e.g., itemize, proof, etc.), running `LaTeX-fill-paragraph` = will move the point to the beginning of the line. Here is a MWE: \documentclass{article} \begin{document} \begin{itemize} \item In indented environments, when the point is at the first letter of a line, running ``LaTeX-fill-paragraph'' will move the point to the beginning of the line. Ideally, it should stay with the letter. \end{itemize} \end{document} 1. If the point is on the first =E2=80=9Co=E2=80=9D in the line = immediately after =E2=80=9C\item=E2=80=9D, running = `LaTeX-fill-paragraph` moves the point to column 0, while =E2=80=9Co=E2=80= =9D is moved to column 2 because of the filling operation. 2. If the point is on the first =E2=80=9Cf=E2=80=9D in the same line as = above, the point stays on =E2=80=9Cf=E2=80=9D after running = `LaTeX-fill-paragraph` (both moved to column 3). I think it is better to have consistent point behavior as in scenario 2, = because users probably want to continue editing after running `M-q=E2=80=99= , and it is much more efficient if the point stays on the same letter = before and after filling. Best, Ruiyang --Apple-Mail=_26661220-EACC-42A0-AFF3-70D54361BDBC Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = there,

When the point is on the first letter of a line = inside an indented environment (e.g., itemize, proof, = etc.), running `LaTeX-fill-paragraph` will move the = point to the beginning of the line. Here is a = MWE:

\documentclass{article}

<= /div>
\begin{document}
\begin{itemize}
\item In = indented environments, when the point is at the first = letter
    of a line, running = ``LaTeX-fill-paragraph'' will move the point to
  the = beginning of the line. Ideally, it should stay with the = letter.
\end{itemize}
\end{document}
<= br>
1. If the point is on the first =E2=80=9Co=E2=80=9D in the = line immediately after =E2=80=9C\item=E2=80=9D, running `LaTeX-fill-paragraph` moves the point to column 0, = while =E2=80=9Co=E2=80=9D is moved to column 2 because of the filling = operation.
2. If the point is = on the first =E2=80=9Cf=E2=80=9D in the same line as above, the point = stays on =E2=80=9Cf=E2=80=9D after running `LaTeX-fill-paragraph` (both moved to column = 3).

I think it = is better to have consistent point behavior as in scenario 2, because = users probably want to continue editing after running `M-q=E2=80=99, and = it is much more efficient if the point stays on the same letter before = and after filling.

Best,
Ruiyang

= --Apple-Mail=_26661220-EACC-42A0-AFF3-70D54361BDBC-- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 03 03:42:41 2024 Received: (at 69398) by debbugs.gnu.org; 3 Mar 2024 08:42:41 +0000 Received: from localhost ([127.0.0.1]:39744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rghQf-000196-4q for submit@debbugs.gnu.org; Sun, 03 Mar 2024 03:42:41 -0500 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:38750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rghQa-00018t-JZ for 69398@debbugs.gnu.org; Sun, 03 Mar 2024 03:42:39 -0500 Received: from localhost (42-144-34-11.rev.home.ne.jp [42.144.34.11]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 135C25C; Sun, 3 Mar 2024 17:42:04 +0900 (JST) From: Ikumi Keita To: Ruiyang Wu Subject: Re: bug#69398: `LaTeX-fill-paragraph` behavior within indented environments In-reply-to: <6505E1F5-8641-49AD-AEF7-58D1622D27C6@gmail.com> References: <6505E1F5-8641-49AD-AEF7-58D1622D27C6@gmail.com> Comments: In-reply-to Ruiyang Wu message dated "Sun, 25 Feb 2024 19:21:17 -0500." X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 29.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Date: Sun, 03 Mar 2024 17:41:53 +0900 Message-ID: <3371.1709455313@localhost> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69398 Cc: 69398@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ruiyang, >>>>> Ruiyang Wu writes: > Hi there, > When the point is on the first letter of a line inside an indented environment (e.g., itemize, proof, etc.), running `LaTeX-fill-paragraph` will move the point to the beginning of the line. Here is a MWE: > \documentclass{article} > \begin{document} > \begin{itemize} > \item In indented environments, when the point is at the first letter > of a line, running ``LaTeX-fill-paragraph'' will move the point to > the beginning of the line. Ideally, it should stay with the letter. > \end{itemize} > \end{document} > 1. If the point is on the first “o” in the line immediately after “\item”, running `LaTeX-fill-paragraph` moves the point to column 0, while “o” is moved to column 2 because of the filling operation. > 2. If the point is on the first “f” in the same line as above, the point stays on “f” after running `LaTeX-fill-paragraph` (both moved to column 3). > I think it is better to have consistent point behavior as in scenario 2, because users probably want to continue editing after running `M-q’, and it is much more efficient if the point stays on the same letter before and after filling. Sorry for late response. I confirmed what you reported (with fill-column being 70) and had brief look at the relevant code. Unfortunately, the code uses `save-excursion' to preserve the point, so it seems that something very exceptional is happening. I'll try to figure out the origin and fix it, but it can take a non trivial span of time. :-( Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 03 09:45:59 2024 Received: (at 69398) by debbugs.gnu.org; 3 Mar 2024 14:45:59 +0000 Received: from localhost ([127.0.0.1]:39954 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rgn6F-0005E7-Cv for submit@debbugs.gnu.org; Sun, 03 Mar 2024 09:45:59 -0500 Received: from mail-qk1-f182.google.com ([209.85.222.182]:53729) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rgn6D-0005Dr-MU for 69398@debbugs.gnu.org; Sun, 03 Mar 2024 09:45:58 -0500 Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-787ac94bbabso173660885a.3 for <69398@debbugs.gnu.org>; Sun, 03 Mar 2024 06:45:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709477063; x=1710081863; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=HfP8ebsu4z2UgAZfdxoyvLEt/ym7LgakBhgcY8FBhBg=; b=Z7SuiLcxjteQ+4Cp3P8zDWDQHTCoiuXWPCx+Eox8ezIRFfgwuJsaPn/cGdXVrG9LSn nTCi2cojYgTKK8Qleign04Ey2tTo8pFVRGFDhI8tYNUMfRF7veZjbi78A3MrmTNnNN8U gu4qTAHUeW5aHSj4hYqYM+/zmsLWn6QkGmWWB+1TxjhvPkjTBM6+SUu8PmrwtyxpmSnm 61GdKxBTQ8AtNvf77+NPyT1r80lBfrPvM+Bnk0TohtPQVSYSKwlTvTBISg5KaE5T8h7U Uaow5qaLqXNxYXhEujE1rLiIcn9h3ui6mc87WKGVp6NqXCZBtWQ6ioa7/E8GuzDkDjLR 5lTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709477063; x=1710081863; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HfP8ebsu4z2UgAZfdxoyvLEt/ym7LgakBhgcY8FBhBg=; b=Nmo6q5HTRfUr3450Sa347EsfNAC4W6TUle1wOAog06hMWyuyDQL5BMAeUJfobwgj2K ksa5ViD0EfMziSc0BDC3FM+A+YpYMExmb0EeJoBN36P1IgSWVxxQSrjeIy0yZf0c5eqV 7JJfnJt88yRUpxT4LXFVCHOHCjZG4QwZz5eXnO+ObcqQAWTjjNq/O9YJv8GkYELuNq/b paEOLBAuKqdVKZ63m+1ubwR/kqBY2zDBkQZQB3KVC/uDPc4BZsDeGyLHWv0pmkXgvaPT hluPjKLn+fPfhgpIB7rMNQbg8e0Bltv+9JYWjHYRCc9wYn28zA3u32jynJ8wSKJKlLuC UgTg== X-Gm-Message-State: AOJu0YxC36cmb8WfXBN2iqY1ng1bfpev7jXYxJY/wMRlc+Lao4isj0V3 2Z+U7DV9rhqv8UpoRsC6Wm2CtK7hMEabihWxo+r4J/ndkKdWMdmdescxjVpY X-Google-Smtp-Source: AGHT+IFtD3duBQDsB6uaOFHCyGwSvrA1X0tqdE0hJo3Ny6n6uHoE9LNPuVxjyPJPba9PAy4pKkEoPQ== X-Received: by 2002:a05:620a:2982:b0:788:2195:20e8 with SMTP id r2-20020a05620a298200b00788219520e8mr3592228qkp.68.1709477062847; Sun, 03 Mar 2024 06:44:22 -0800 (PST) Received: from smtpclient.apple (pool-108-50-194-31.nwrknj.fios.verizon.net. [108.50.194.31]) by smtp.gmail.com with ESMTPSA id ov2-20020a05620a628200b007881a7753e2sm1409673qkn.46.2024.03.03.06.44.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Mar 2024 06:44:22 -0800 (PST) From: Ruiyang Wu Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_39F91935-F901-43D8-9E53-A0CA9F4B5703" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.400.31\)) Subject: Re: bug#69398: `LaTeX-fill-paragraph` behavior within indented environments Date: Sun, 3 Mar 2024 09:44:12 -0500 In-Reply-To: <3371.1709455313@localhost> To: Ikumi Keita References: <6505E1F5-8641-49AD-AEF7-58D1622D27C6@gmail.com> <3371.1709455313@localhost> X-Mailer: Apple Mail (2.3774.400.31) X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 69398 Cc: 69398@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) --Apple-Mail=_39F91935-F901-43D8-9E53-A0CA9F4B5703 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Ikumi, Thanks for the reply and please take your time. Best, Ruiyang > On Mar 3, 2024, at 3:41=E2=80=AFAM, Ikumi Keita = wrote: >=20 > Hi Ruiyang, >=20 > Sorry for late response. I confirmed what you reported (with = fill-column > being 70) and had brief look at the relevant code. Unfortunately, the > code uses `save-excursion' to preserve the point, so it seems that > something very exceptional is happening. I'll try to figure out the > origin and fix it, but it can take a non trivial span of time. :-( >=20 > Regards, > Ikumi Keita > #StandWithUkraine #StopWarInUkraine > #Gaza #StopMassiveKilling #CeasefireNOW --Apple-Mail=_39F91935-F901-43D8-9E53-A0CA9F4B5703 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = Ikumi,

Thanks for the reply and please take your = time.

Best,
Ruiyang

On Mar 3, 2024, at 3:41=E2=80=AFAM= , Ikumi Keita <ikumi@ikumi.que.jp> wrote:

Hi Ruiyang,

Sorry for late response. I confirmed what = you reported (with fill-column
being = 70) and had brief look at the relevant code. Unfortunately, = the
code uses = `save-excursion' to preserve the point, so it seems that
something very exceptional is happening. = I'll try to figure out the
origin = and fix it, but it can take a non trivial span of time. :-(

Regards,
Ikumi = Keita
#StandWithUkraine = #StopWarInUkraine
#Gaza = #StopMassiveKilling = #CeasefireNOW

= --Apple-Mail=_39F91935-F901-43D8-9E53-A0CA9F4B5703-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 06 10:49:08 2024 Received: (at 69398) by debbugs.gnu.org; 6 Mar 2024 15:49:08 +0000 Received: from localhost ([127.0.0.1]:51267 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhtVz-0001v4-QU for submit@debbugs.gnu.org; Wed, 06 Mar 2024 10:49:08 -0500 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:48808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhtVx-0001uU-Gf for 69398@debbugs.gnu.org; Wed, 06 Mar 2024 10:49:06 -0500 Received: from localhost (42-144-34-11.rev.home.ne.jp [42.144.34.11]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id E41785C; Thu, 7 Mar 2024 00:48:30 +0900 (JST) From: Ikumi Keita To: Ruiyang Wu Subject: Re: bug#69398: `LaTeX-fill-paragraph` behavior within indented environments In-reply-to: References: <6505E1F5-8641-49AD-AEF7-58D1622D27C6@gmail.com> <3371.1709455313@localhost> Comments: In-reply-to Ruiyang Wu message dated "Sun, 03 Mar 2024 09:44:12 -0500." X-Mailer: MH-E 8.6+git; nmh 1.8; Emacs 29.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4870.1709740110.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Thu, 07 Mar 2024 00:48:30 +0900 Message-ID: <4871.1709740110@localhost> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 69398 Cc: 69398@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ruiyang, >>>>> Ruiyang Wu writes: > Hi Ikumi, > Thanks for the reply and please take your time. I figured out the reason but haven't come up with a satisfactory solution. [Basis] The elisp function `save-excursion' uses marker internally to keep track of the original position. [Analysis] ,---- | \documentclass{article} | = | \begin{document} | \begin{itemize} | \item In indented environments, when the point is at the first letter | of a line, running ``LaTeX-fill-paragraph'' will move the point to | the beginning of the line. Ideally, it should stay with the letter. | \end{itemize} | \end{document} `---- During the course of the filling, in `LaTeX-indent-outer-do', the line in question once loses its indent: ,---- | \item In indented environments, when the point is at the first letter | of a line, running ``LaTeX-fill-paragraph'' will move the point to the b= eginning of the line. Ideally, it should stay with the letter. | \end{itemize} `---- At this time, the marker locates at the "correct" position, namely at the first "o" in the line immediately after "item". In other words, it is at the beginning of the line immediately after "item". Then `LaTeX-indent-outer-do' calls `indent-to', which inserts whitespaces, to give the correct indentation. However, this insertion is done at the position of the marker that the `save-excursion' uses. This means that emacs doesn't send the marker after the inserted whitespaces because that's the default behavior of emacs. Therefore, the marker stays at the beginning of the line and the point is moved to that marker position after M-q finishes, rather than the position after the indentation. [Solution?] We can work around this particular example by replacing (save-excursion ...) in `LaTeX-fill-paragraph' with (let ((m (point-marker))) (set-marker-insertion-type m t) ; Send marker after the inserted text. ... (goto-char m) (set-marker m nil)) , but I'm not sure this is the right thing to do: 1. This wouldn't match with behavior with other filling functions. 2. Even if we tweak all such occurences of `save-excursion', it isn't clear whether it is right that the position always "sticks" to the letter where before M-q is typed. Does anyone find a good solution? Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine #Gaza #StopMassiveKilling #CeasefireNOW