From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Glenn Morris <rgm@gnu.org>
Cc: Sam Steingold <sds@gnu.org>, rms@gnu.org, emacs-devel@gnu.org
Subject: Re: next-line screws up column at the EOL
Date: Thu, 27 Sep 2007 14:25:45 -0400 [thread overview]
Message-ID: <jwvzlz8m0hq.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <do7imdt8y7.fsf@fencepost.gnu.org> (Glenn Morris's message of "Wed\, 26 Sep 2007 17\:26\:08 -0400")
>> I cannot reproduce your problem. Can you give a recipe starting from
>> "emacs -Q"? My guess is that some code somewhere uses "column + 1"
>> so the most-positive-fixnum causes a wraparound, but I can't find
>> the relevant code.
> For me, in a 64-bit Emacs
> (move-to-column most-positive-fixnum)
Does the patch below fix the problem?
Stefan
--- indent.c 29 aoû 2007 22:33:12 -0400 1.195
+++ indent.c 27 sep 2007 14:22:46 -0400
@@ -932,19 +932,19 @@
(column, force)
Lisp_Object column, force;
{
- register int pos;
- register int col = current_column ();
- register int goal;
- register int end;
+ register EMACS_INT pos;
+ register EMACS_INT col = current_column ();
+ register EMACS_INT goal;
+ register EMACS_INT end;
register int tab_width = XINT (current_buffer->tab_width);
register int ctl_arrow = !NILP (current_buffer->ctl_arrow);
register struct Lisp_Char_Table *dp = buffer_display_table ();
register int multibyte = !NILP (current_buffer->enable_multibyte_characters);
Lisp_Object val;
- int prev_col = 0;
+ EMACS_INT prev_col = 0;
int c = 0;
- int next_boundary, pos_byte;
+ EMACS_INT next_boundary, pos_byte;
if (tab_width <= 0 || tab_width > 1000) tab_width = 8;
CHECK_NATNUM (column);
@@ -970,7 +970,7 @@
{
while (pos == next_boundary)
{
- int prev = pos;
+ EMACS_INT prev = pos;
pos = skip_invisible (pos, &next_boundary, end, Qnil);
if (pos != prev)
pos_byte = CHAR_TO_BYTE (pos);
@@ -1090,7 +1090,7 @@
and scan through it again. */
if (!NILP (force) && col > goal && c == '\t' && prev_col < goal)
{
- int goal_pt, goal_pt_byte;
+ EMACS_INT goal_pt, goal_pt_byte;
/* Insert spaces in front of the tab to reach GOAL. Do this
first so that a marker at the end of the tab gets
next prev parent reply other threads:[~2007-09-27 18:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-19 16:58 next-line screws up column at the EOL sds
2007-09-20 1:47 ` Glenn Morris
2007-09-23 15:04 ` Richard Stallman
2007-09-24 16:33 ` Sam Steingold
2007-09-26 20:14 ` Stefan Monnier
2007-09-26 21:26 ` Glenn Morris
2007-09-27 13:11 ` Stefan Monnier
2007-09-27 18:25 ` Stefan Monnier [this message]
2007-09-27 18:35 ` Glenn Morris
2007-09-27 18:59 ` Stefan Monnier
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=jwvzlz8m0hq.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=rgm@gnu.org \
--cc=rms@gnu.org \
--cc=sds@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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).