From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GL4bBM4ze2C2eQEAgWs5BA (envelope-from ) for ; Sat, 17 Apr 2021 21:15:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YAA8O80ze2DLQQAAB5/wlQ (envelope-from ) for ; Sat, 17 Apr 2021 19:15:25 +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 94347DC1D for ; Sat, 17 Apr 2021 21:15:25 +0200 (CEST) Received: from localhost ([::1]:39682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXqPc-0004Gj-MV for larch@yhetil.org; Sat, 17 Apr 2021 15:15:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXqNl-0003zp-G5 for emacs-orgmode@gnu.org; Sat, 17 Apr 2021 15:13:30 -0400 Received: from out0.migadu.com ([2001:41d0:2:267::]:52489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXqNi-00077E-Mo for emacs-orgmode@gnu.org; Sat, 17 Apr 2021 15:13:29 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1618686800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UZLh53YbiW29gvthQBFUrtwSwhv1oFfD1OTHyT0MLcQ=; b=LeGbNSQEgzlSZpcWABGmNUx7AYd1IeyXpvACeB3bFh43pUYvdHD6jxnghM29yLb/V+pqdI wOgbspL1fyNMtpm8qQLiryt9FA5ybEXgzoK9zF31ZnYw56WMvKGyzaglJP2cYPfu0yTVQE 4de1dQN2E36u32peoQoTVZ8Jcmrn/aR6BuwzYJ7Ruvg02mNec3Y5AKGMP543SxLadLTxvK NNkznIs2Hjf8LkYOLIUenQbdKBN75tDxymT0w/CSbDEor918YDozggcRoHoXnQrR0n5x1D KvqTs6auXA24UJbxHButUq3lrI+IdN7qKbpZWQy5ygFC3zCQAJTTDhCfPnBNXw== From: Kyle Meyer To: Oorja Sandhu Subject: Re: Bug: table header line mode causes next-line to reach beginning of line In-Reply-To: <1b8b1a96-149e-4409-9738-fc45fad3a604@www.fastmail.com> References: <1b8b1a96-149e-4409-9738-fc45fad3a604@www.fastmail.com> Date: Sat, 17 Apr 2021 15:13:17 -0400 Message-ID: <87pmyslo6q.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Auth-User: kyle@kyleam.com Received-SPF: pass client-ip=2001:41d0:2:267::; envelope-from=kyle@kyleam.com; helo=out0.migadu.com 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, 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618686925; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=UZLh53YbiW29gvthQBFUrtwSwhv1oFfD1OTHyT0MLcQ=; b=t5b41gbvf8S+MlW0tfNu9SxPcwrJwePsQG6Gv2TSRGMoh05uoyCHBS1axz92IqIsLQ0U8q WhYaw+QwohVry0Ire9R0WLLL8leVidRQ767JENbVLMYSNDm3sk9er9zYnWZjbKEwhTM4Hq HT2GeSj+vsI1cOQM8+FZL1n6tNTqYU/8FsmmPsDfyOQVbE4itMEul9IYe6BhvT6P6FtaGF rbFPaNbVUxN1Vhmm/64VOs3QMKK1SOEGdfHuZJotmhw1PC2JRmBgUIGhFZR5gKt2qfvw8p QXGC3ioYmaVH8MyPI8jVJrzCUKX3Y55axaXU05Z86oYHJMXzpTPJyKl+McDsaw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618686925; a=rsa-sha256; cv=none; b=ARCOZzW/EOn2BQpT0paEP6sV6nmkPGZoO58XryQGfP+c+1kahy2qCxfqqpdRPsj2ZKGuFT 83nzTsojR9U/kwZHEjlJFaJNU4J4jxmbJh0Q9/EC2xijRn9V3r3kc55kEptnKMrqnRAs9B AiW01klInuwna7/kNWRnEUcti8iLgQq+x03kf8sJggRTcDurp0OP+ZVvwahjtZoDrREVTN XfZ2o/rMxsmH+ykZi8uVeEhwAHFiXz7gDsS+NeHfdg6a9LdX9DYfSfZTBbzc/9CEKit6Fd dj9VjqUrHnXpCKYDCLdfKAcNDJTd6hxI1onshauUu2tVtplH+z+vqjfPYx6Ggw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=LeGbNSQE; 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-Migadu-Spam-Score: -1.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b=LeGbNSQE; 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-Migadu-Queue-Id: 94347DC1D X-Spam-Score: -1.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: iVR4/mU15RtY Oorja Sandhu writes: [...] > 3. M-x org-table-header-line-mode > > 4. Resize emacs window very small such that horizontal as well as > vertical scrolling is required to see it fully. > > Otherwise, add rows and columns in the org table in the file such that > it exceeds window size both vertically and horizontally. This is not a > useless example because the header line mode is most useful when you > have a big table and heading scrolls off your visible window. > > 5. Go to end of line in a row in the table when the header line > overlay is active. > > 6. Press C-n (or down arrow) twice > > Observation : cursor is at the beginning-of-line > > Expected : cursor should remain at the same column as earlier Thanks for the report and the clear steps to reproduce the issue. > ========= > My unsuccessful code analysis, if anyone is interested : > There is a post command hook to update the overlay of table > header. This includes the function "beginning-of-line". In more recent > versions of org, it is (move-beginning-of-line 2). > > But all instances of "beginning-of-line" or "move-beginning-of-line" > are wrapped in "save-excursion".. In fact if I invoke > (org-table-header-set-header) instead of C-n, the cursor does not go > to beginning of line. Yes, it looks like the issue is that the movement in org-table-header-set-header resets temporary-goal-column to 0, messing with the logic in line-move-1. This should be fixed by f12ca1a56.