unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Advice needed on modeline customization hack...
@ 2017-04-16  1:28 Perry E. Metzger
  2017-04-16  1:55 ` Perry E. Metzger
  2017-04-16  3:11 ` Stefan Monnier
  0 siblings, 2 replies; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-16  1:28 UTC (permalink / raw)
  To: emacs-devel

So I have been irritated for a while by the fact that when you turn
on column-number-mode, that the displayed column starts at zero. GNU
coding standards say that compilers and the like are to spit out error
messages with column numbers starting at one, so what your modeline
tells you and what your error message tells you are off by one.

Of course, this being Emacs, I figure the right thing to do is to add
a customization opportunity so people can get this displayed starting
at one or at zero, as their tastes dictate, and presumably we leave
the default as it is, and then everyone is happy.

The two line patch at the end of this adds a %C modeline construct
that acts just like %c only it displays the modeline with characters
starting at 1 instead of zero. Doing it that way gives you essentially
no extra performance hit. That part turns out to be the easy bit.

Harder is this: short of redefining the entirety of the really, really
long mode-line-position variable from bindings.el, which isn't
something one wants to tell people to casually do in their .emacs
(it's long and complicated as heck), I'm not quite sure how to do a
practical customization here. Then again, I only half understand how
the modeline format stuff works at all, and it seems semantically
rich enough that some reasonable way to do this should exist.

Advice on how to do the elisp half of this so there can be an easy
setting to let you pick one based or zero based?

Perry

diff --git a/src/xdisp.c b/src/xdisp.c
index c6f8566523..f23dbcb585 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -23520,6 +23520,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
       break;
 
     case 'c':
+    case 'C':
       /* %c and %l are ignored in `frame-title-format'.
          (In redisplay_internal, the frame title is drawn _before_ the
          windows are updated, so the stuff which depends on actual
@@ -23530,6 +23531,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
       else
 	{
 	  ptrdiff_t col = current_column ();
+	  if (c == 'C') col++;
 	  w->column_number_displayed = col;
 	  pint2str (decode_mode_spec_buf, width, col);
 	  return decode_mode_spec_buf;


-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16  1:28 Advice needed on modeline customization hack Perry E. Metzger
@ 2017-04-16  1:55 ` Perry E. Metzger
  2017-04-16  3:11 ` Stefan Monnier
  1 sibling, 0 replies; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-16  1:55 UTC (permalink / raw)
  To: emacs-devel

On Sat, 15 Apr 2017 21:28:00 -0400 "Perry E. Metzger"
<perry@piermont.com> wrote:
> The two line patch at the end of this adds a %C modeline construct
> that acts just like %c only it displays the modeline with characters
> starting at 1 instead of zero. Doing it that way gives you
> essentially no extra performance hit. That part turns out to be the
> easy bit.
>
> Harder is this: short of redefining the entirety of the really,
> really long mode-line-position variable from bindings.el, which
> isn't something one wants to tell people to casually do in
> their .emacs (it's long and complicated as heck), I'm not quite
> sure how to do a practical customization here. Then again, I only
> half understand how the modeline format stuff works at all, and it
> seems semantically rich enough that some reasonable way to do this
> should exist.
>
> Advice on how to do the elisp half of this so there can be an easy
> setting to let you pick one based or zero based?

So, partially answering my own question, it seems like the only
obvious way to do this is to add yet another foo-mode variable and a
bunch of lines to the definition of mode-line-position in bindings.el
that do exactly what the current ones do for when column-number-mode
is set, only selecting between using %c and %C in the constructs.

This seems a little gross, but I'm not really sure what else is
practical. Assuming this is the right thing, advice on what to call
this new (very) minor mode are solicited.

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16  1:28 Advice needed on modeline customization hack Perry E. Metzger
  2017-04-16  1:55 ` Perry E. Metzger
@ 2017-04-16  3:11 ` Stefan Monnier
  2017-04-16 13:49   ` Perry E. Metzger
  1 sibling, 1 reply; 31+ messages in thread
From: Stefan Monnier @ 2017-04-16  3:11 UTC (permalink / raw)
  To: emacs-devel

> So I have been irritated for a while by the fact that when you turn
> on column-number-mode, that the displayed column starts at zero. GNU
> coding standards say that compilers and the like are to spit out error
> messages with column numbers starting at one, so what your modeline
> tells you and what your error message tells you are off by one.

FWIW there are other discrepancies in this area.  Some programs report
error's column number in terms of "bytes", others in terms of "chars",
and yet others in terms of "display columns" (e.g. counting TAB as
something like 8 spaces).  So there should be room for more customizability.

> Harder is this: short of redefining the entirety of the really, really
> long mode-line-position variable from bindings.el, which isn't
> something one wants to tell people to casually do in their .emacs
> (it's long and complicated as heck), I'm not quite sure how to do a
> practical customization here. Then again, I only half understand how
> the modeline format stuff works at all, and it seems semantically
> rich enough that some reasonable way to do this should exist.

I suggest adding a function `mode-line-substitute` which traverses the
mode-line-format looking for particular elements to replace with
something else.  So the user can do something like

    (mode-line-substitute "%c" "%C")


        Stefan




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16  3:11 ` Stefan Monnier
@ 2017-04-16 13:49   ` Perry E. Metzger
  2017-04-16 14:07     ` Stefan Monnier
  0 siblings, 1 reply; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-16 13:49 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On Sat, 15 Apr 2017 23:11:28 -0400 Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
> I suggest adding a function `mode-line-substitute` which traverses
> the mode-line-format looking for particular elements to replace with
> something else.  So the user can do something like
> 
>     (mode-line-substitute "%c" "%C")

Looking at what might be involved there to do this correctly (given
that one would want to be able to match arbitrary mode line list
elements etc. and the mode line format is nontrivial.) I think I'll
make that function a back burner project and just add another knob
instead. The big question for me right now is what to name the knob,
believe it or not.

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16 13:49   ` Perry E. Metzger
@ 2017-04-16 14:07     ` Stefan Monnier
  2017-04-16 14:46       ` Perry E. Metzger
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Monnier @ 2017-04-16 14:07 UTC (permalink / raw)
  To: emacs-devel

> instead. The big question for me right now is what to name the knob,
> believe it or not.

Suggestion of the day: perry-metzger-s-anonymous-knob ?


        Stefan




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16 14:07     ` Stefan Monnier
@ 2017-04-16 14:46       ` Perry E. Metzger
  2017-04-16 15:02         ` Clément Pit-Claudel
  0 siblings, 1 reply; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-16 14:46 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 554 bytes --]

On Sun, 16 Apr 2017 10:07:25 -0400 Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
> > instead. The big question for me right now is what to name the
> > knob, believe it or not.  
> 
> Suggestion of the day: perry-metzger-s-anonymous-knob ?

I'm trying column-number-mode-starts-from-zero instead. :P

Opinions on the attached patches? If there is consensus that they
could go in, I'll update the appropriate docs as well. (And should
column-number-mode-starts-from-zero be in simple.el where I put it?)

Perry
-- 
Perry E. Metzger		perry@piermont.com

[-- Attachment #2: column.diff --]
[-- Type: application/octet-stream, Size: 3776 bytes --]

diff --git a/etc/refcards/gnus-logo.pdf b/etc/refcards/gnus-logo.pdf
deleted file mode 100644
index 3629a605e6..0000000000
Binary files a/etc/refcards/gnus-logo.pdf and /dev/null differ
diff --git a/lisp/bindings.el b/lisp/bindings.el
index f641865ba3..47d9596176 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -368,12 +368,19 @@ mode-line-position
 mouse-1: Display Line and Column Mode Menu")))
     (line-number-mode
      ((column-number-mode
-       (10 ,(propertize
-	     " (%l,%c)"
-	     'local-map mode-line-column-line-number-mode-map
-	     'mouse-face 'mode-line-highlight
-	     'help-echo "Line number and Column number\n\
+       (column-number-mode-starts-from-zero
+        (10 ,(propertize
+              " (%l,%c)"
+              'local-map mode-line-column-line-number-mode-map
+              'mouse-face 'mode-line-highlight
+              'help-echo "Line number and Column number\n\
 mouse-1: Display Line and Column Mode Menu"))
+        (10 ,(propertize
+              " (%l,%C)"
+              'local-map mode-line-column-line-number-mode-map
+              'mouse-face 'mode-line-highlight
+              'help-echo "Line number and Column number\n\
+mouse-1: Display Line and Column Mode Menu")))
        (6 ,(propertize
 	    " L%l"
 	    'local-map mode-line-column-line-number-mode-map
@@ -381,12 +388,19 @@ mode-line-position
 	    'help-echo "Line Number\n\
 mouse-1: Display Line and Column Mode Menu"))))
      ((column-number-mode
-       (5 ,(propertize
-	    " C%c"
-	    'local-map mode-line-column-line-number-mode-map
-	    'mouse-face 'mode-line-highlight
-	    'help-echo "Column number\n\
-mouse-1: Display Line and Column Mode Menu"))))))
+       (column-number-mode-starts-from-zero
+        (5 ,(propertize
+             " C%c"
+             'local-map mode-line-column-line-number-mode-map
+             'mouse-face 'mode-line-highlight
+             'help-echo "Column number\n\
+mouse-1: Display Line and Column Mode Menu"))
+        (5 ,(propertize
+             " C%C"
+             'local-map mode-line-column-line-number-mode-map
+             'mouse-face 'mode-line-highlight
+             'help-echo "Column number\n\
+mouse-1: Display Line and Column Mode Menu")))))))
   "Mode line construct for displaying the position in the buffer.
 Normally displays the buffer percentage and, optionally, the
 buffer size, the line number and the column number.")
diff --git a/lisp/simple.el b/lisp/simple.el
index 5f70adedc4..f7d83903fa 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7198,6 +7198,10 @@ column-number-mode
 If called from Lisp, enable the mode if ARG is omitted or nil."
   :global t :group 'mode-line)
 
+(defvar column-number-mode-starts-from-zero t
+  "When set to true, Column Number mode displays columns starting from zero.
+Otherwise, column numbers start from one.")
+
 (define-minor-mode size-indication-mode
   "Toggle buffer size display in the mode line (Size Indication mode).
 With a prefix argument ARG, enable Size Indication mode if ARG is
diff --git a/src/xdisp.c b/src/xdisp.c
index c6f8566523..f23dbcb585 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -23520,6 +23520,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
       break;
 
     case 'c':
+    case 'C':
       /* %c and %l are ignored in `frame-title-format'.
          (In redisplay_internal, the frame title is drawn _before_ the
          windows are updated, so the stuff which depends on actual
@@ -23530,6 +23531,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
       else
 	{
 	  ptrdiff_t col = current_column ();
+	  if (c == 'C') col++;
 	  w->column_number_displayed = col;
 	  pint2str (decode_mode_spec_buf, width, col);
 	  return decode_mode_spec_buf;

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16 14:46       ` Perry E. Metzger
@ 2017-04-16 15:02         ` Clément Pit-Claudel
  2017-04-16 16:09           ` Perry E. Metzger
  0 siblings, 1 reply; 31+ messages in thread
From: Clément Pit-Claudel @ 2017-04-16 15:02 UTC (permalink / raw)
  To: Perry E. Metzger, Stefan Monnier; +Cc: emacs-devel

This looks good, thanks!  One minor nitpick:

On 2017-04-16 10:46, Perry E. Metzger wrote:
> +(defvar column-number-mode-starts-from-zero t
> +  "When set to true, Column Number mode displays columns starting from zero.
> +Otherwise, column numbers start from one.")

Maybe "displayed column numbers" instead of "column numbers"?  IIUC this patch doesn't (thankfully ^^) change the values returned by e.g. current-column.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16 15:02         ` Clément Pit-Claudel
@ 2017-04-16 16:09           ` Perry E. Metzger
  2017-04-16 20:59             ` Clément Pit-Claudel
  0 siblings, 1 reply; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-16 16:09 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: Stefan Monnier, emacs-devel

On Sun, 16 Apr 2017 11:02:31 -0400 Clément Pit-Claudel
<cpitclaudel@gmail.com> wrote:
> This looks good, thanks!  One minor nitpick:
> 
> On 2017-04-16 10:46, Perry E. Metzger wrote:
> > +(defvar column-number-mode-starts-from-zero t
> > +  "When set to true, Column Number mode displays columns
> > starting from zero. +Otherwise, column numbers start from one.")  
> 
> Maybe "displayed column numbers" instead of "column numbers"?

So how would you like the final version to read?

> IIUC
> this patch doesn't (thankfully ^^) change the values returned by
> e.g. current-column.
 
Yes. I tried only to alter the display in the mode line, and only for
people who prefer it the way I do.

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16 16:09           ` Perry E. Metzger
@ 2017-04-16 20:59             ` Clément Pit-Claudel
  2017-04-16 22:06               ` Perry E. Metzger
  0 siblings, 1 reply; 31+ messages in thread
From: Clément Pit-Claudel @ 2017-04-16 20:59 UTC (permalink / raw)
  To: Perry E. Metzger; +Cc: Stefan Monnier, emacs-devel

On 2017-04-16 12:09, Perry E. Metzger wrote:
>>> +(defvar column-number-mode-starts-from-zero t
>>> +  "When set to true, Column Number mode displays columns
>>> starting from zero. +Otherwise, column numbers start from one.")  
>> Maybe "displayed column numbers" instead of "column numbers"?
> So how would you like the final version to read?

Would "Otherwise, displayed column numbers start from one." work? Or does it sound unnatural?




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16 20:59             ` Clément Pit-Claudel
@ 2017-04-16 22:06               ` Perry E. Metzger
  2017-04-16 22:16                 ` Perry E. Metzger
  2017-04-17  6:02                 ` Eli Zaretskii
  0 siblings, 2 replies; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-16 22:06 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: Stefan Monnier, emacs-devel

On Sun, 16 Apr 2017 16:59:01 -0400 Clément Pit-Claudel
<cpitclaudel@gmail.com> wrote:
> On 2017-04-16 12:09, Perry E. Metzger wrote:
> >>> +(defvar column-number-mode-starts-from-zero t
> >>> +  "When set to true, Column Number mode displays columns
> >>> starting from zero. +Otherwise, column numbers start from
> >>> one.")    
> >> Maybe "displayed column numbers" instead of "column numbers"?  
> > So how would you like the final version to read?  
> 
> Would "Otherwise, displayed column numbers start from one." work?
> Or does it sound unnatural?

It seems fine to me, I'll make your suggested change.

I found an issue, though, which is that there's code throughout
xdisp.c that checks if w->column_number_displayed is the same as
current_column() in order to decide if it should update the modeline.
Naturally what I've done will break that.

I'm thinking perhaps I should add a flag to the window structure
instead that says "add one when printing this" instead of changing
the value of w->column_number_displayed, but I can't quite figure out
where the modeline actually gets printed, only where
column_number_displayed gets set.

(I'll keep hunting unless someone pipes up.)

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16 22:06               ` Perry E. Metzger
@ 2017-04-16 22:16                 ` Perry E. Metzger
  2017-04-16 22:57                   ` Perry E. Metzger
  2017-04-17  6:02                 ` Eli Zaretskii
  1 sibling, 1 reply; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-16 22:16 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: Stefan Monnier, emacs-devel

On Sun, 16 Apr 2017 18:06:20 -0400 "Perry E. Metzger"
<perry@piermont.com> wrote:
> I can't quite figure out where the modeline actually gets printed,
> only where column_number_displayed gets set.

I'm a moron. Figured it out.

New patch, including documentation fixes, in a bit.

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16 22:16                 ` Perry E. Metzger
@ 2017-04-16 22:57                   ` Perry E. Metzger
  2017-04-16 23:48                     ` Drew Adams
  2017-04-17  6:00                     ` Eli Zaretskii
  0 siblings, 2 replies; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-16 22:57 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

On Sun, 16 Apr 2017 18:16:07 -0400 "Perry E. Metzger"
<perry@piermont.com> wrote:
> New patch, including documentation fixes, in a bit.

Attached is an improved patch, including documentation changes.

For those who haven't been following, the patches allow the user to
customize the column number in column-number-mode to start from one
instead of from zero.

They:
1) Make the mode line element "%C" behave just like "%c" except "%C"
   displays the column starting at 1 and not 0.
2) Add a variable named "column-number-mode-starts-from-zero", which
   defaults to "t". If it is set to "t", "%c" is used for
   column-number-mode, and if it is "nil", "%C" is used.
3) Document (1) and (2).

Comments solicited. I'm not fond of the name
"column-number-mode-starts-from-zero" by the way.

Perry
-- 
Perry E. Metzger		perry@piermont.com

[-- Attachment #2: column.diff --]
[-- Type: application/octet-stream, Size: 8752 bytes --]

diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index 1a9c65a08c..7b28ba0c97 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1327,13 +1327,19 @@ Optional Mode Line
 @cindex mode, Column Number
 @findex column-number-mode
   Similarly, you can display the current column number by turning on
-Column number mode with @kbd{M-x column-number-mode}.  The column
+Column Number mode with @kbd{M-x column-number-mode}.  The column
 number is indicated by the letter @samp{C}.  However, when both of
 these modes are enabled, the line and column numbers are displayed in
 parentheses, the line number first, rather than with @samp{L} and
 @samp{C}.  For example: @samp{(561,2)}.  @xref{Minor Modes}, for more
 information about minor modes and about how to use these commands.
 
+@vindex column-number-mode-starts-from-zero
+  In Column Number mode, the displayed column number begins at zero at
+the start of a line. If you would prefer for the displayed column
+number to begin at one, you may set
+@code{column-number-mode-starts-from-zero} to @code{nil}.
+
 @cindex narrowing, and line number display
   If you have narrowed the buffer (@pxref{Narrowing}), the displayed
 line number is relative to the accessible portion of the buffer.
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index d6f014fada..bd2bacc739 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1871,7 +1871,7 @@ Frame Titles
 This variable specifies how to compute a name for a frame when you have
 not explicitly specified one.  The variable's value is actually a mode
 line construct, just like @code{mode-line-format}, except that the
-@samp{%c} and @samp{%l} constructs are ignored.  @xref{Mode Line
+@samp{%c}, @samp{%C}, and @samp{%l} constructs are ignored.  @xref{Mode Line
 Data}.
 @end defvar
 
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 132dda3fc6..623b4c52b7 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2093,7 +2093,10 @@ %-Constructs
 @xref{Buffer Names}.
 
 @item %c
-The current column number of point.
+The current column number of point, starting from zero.
+
+@item %C
+The current column number of point, starting from one.
 
 @item %e
 When Emacs is nearly out of memory for Lisp objects, a brief message
diff --git a/etc/refcards/gnus-logo.pdf b/etc/refcards/gnus-logo.pdf
deleted file mode 100644
index 3629a605e6..0000000000
Binary files a/etc/refcards/gnus-logo.pdf and /dev/null differ
diff --git a/lisp/bindings.el b/lisp/bindings.el
index f641865ba3..47d9596176 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -368,12 +368,19 @@ mode-line-position
 mouse-1: Display Line and Column Mode Menu")))
     (line-number-mode
      ((column-number-mode
-       (10 ,(propertize
-	     " (%l,%c)"
-	     'local-map mode-line-column-line-number-mode-map
-	     'mouse-face 'mode-line-highlight
-	     'help-echo "Line number and Column number\n\
+       (column-number-mode-starts-from-zero
+        (10 ,(propertize
+              " (%l,%c)"
+              'local-map mode-line-column-line-number-mode-map
+              'mouse-face 'mode-line-highlight
+              'help-echo "Line number and Column number\n\
 mouse-1: Display Line and Column Mode Menu"))
+        (10 ,(propertize
+              " (%l,%C)"
+              'local-map mode-line-column-line-number-mode-map
+              'mouse-face 'mode-line-highlight
+              'help-echo "Line number and Column number\n\
+mouse-1: Display Line and Column Mode Menu")))
        (6 ,(propertize
 	    " L%l"
 	    'local-map mode-line-column-line-number-mode-map
@@ -381,12 +388,19 @@ mode-line-position
 	    'help-echo "Line Number\n\
 mouse-1: Display Line and Column Mode Menu"))))
      ((column-number-mode
-       (5 ,(propertize
-	    " C%c"
-	    'local-map mode-line-column-line-number-mode-map
-	    'mouse-face 'mode-line-highlight
-	    'help-echo "Column number\n\
-mouse-1: Display Line and Column Mode Menu"))))))
+       (column-number-mode-starts-from-zero
+        (5 ,(propertize
+             " C%c"
+             'local-map mode-line-column-line-number-mode-map
+             'mouse-face 'mode-line-highlight
+             'help-echo "Column number\n\
+mouse-1: Display Line and Column Mode Menu"))
+        (5 ,(propertize
+             " C%C"
+             'local-map mode-line-column-line-number-mode-map
+             'mouse-face 'mode-line-highlight
+             'help-echo "Column number\n\
+mouse-1: Display Line and Column Mode Menu")))))))
   "Mode line construct for displaying the position in the buffer.
 Normally displays the buffer percentage and, optionally, the
 buffer size, the line number and the column number.")
diff --git a/lisp/simple.el b/lisp/simple.el
index 5f70adedc4..821880b1f3 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7198,6 +7198,10 @@ column-number-mode
 If called from Lisp, enable the mode if ARG is omitted or nil."
   :global t :group 'mode-line)
 
+(defvar column-number-mode-starts-from-zero t
+  "When set to true, Column Number mode displays columns starting from zero.
+Otherwise, displayed column numbers start from one.")
+
 (define-minor-mode size-indication-mode
   "Toggle buffer size display in the mode line (Size Indication mode).
 With a prefix argument ARG, enable Size Indication mode if ARG is
diff --git a/src/buffer.c b/src/buffer.c
index 8ef27dee0f..7661e13623 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5608,8 +5608,10 @@ A string is printed verbatim in the mode line except for %-constructs:
 	For a modified read-only buffer, %* gives % and %+ gives *.
   %s -- print process status.   %l -- print the current line number.
   %c -- print the current column number (this makes editing slower).
+        The leftmost column is displayed as 0.
         To make the column number update correctly in all cases,
 	`column-number-mode' must be non-nil.
+  %C -- Like %c, but the leftmost column is displayed as 1.
   %i -- print the size of the buffer.
   %I -- like %i, but use k, M, G, etc., to abbreviate.
   %p -- print percent of buffer above top of window, or Top, Bot or All.
diff --git a/src/xdisp.c b/src/xdisp.c
index c6f8566523..cab01ec701 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -475,7 +475,7 @@ int windows_or_buffers_changed;
    used to track down the cause for this full-redisplay).
 
    Since the frame title uses the same %-constructs as the mode line
-   (except %c and %l), if this variable is non-zero, we also consider
+   (except %c, %C, and %l), if this variable is non-zero, we also consider
    redisplaying the title of each frame, see x_consider_frame_title.
 
    The `redisplay' bits are the same as those used for
@@ -11462,7 +11462,7 @@ window_buffer_changed (struct window *w)
   return (BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) != w->last_had_star;
 }
 
-/* True if W has %c in its mode line and mode line should be updated.  */
+/* True if W has %c or %C in its mode line and mode line should be updated.  */
 
 static bool
 mode_line_update_needed (struct window *w)
@@ -23520,7 +23520,8 @@ decode_mode_spec (struct window *w, register int c, int field_width,
       break;
 
     case 'c':
-      /* %c and %l are ignored in `frame-title-format'.
+    case 'C':
+      /* %c, %C, and %l are ignored in `frame-title-format'.
          (In redisplay_internal, the frame title is drawn _before_ the
          windows are updated, so the stuff which depends on actual
          window contents (such as %l) may fail to render properly, or
@@ -23530,8 +23531,9 @@ decode_mode_spec (struct window *w, register int c, int field_width,
       else
 	{
 	  ptrdiff_t col = current_column ();
+	  int disp_col = (c == 'C') ? col + 1 : col;
 	  w->column_number_displayed = col;
-	  pint2str (decode_mode_spec_buf, width, col);
+	  pint2str (decode_mode_spec_buf, width, disp_col);
 	  return decode_mode_spec_buf;
 	}
 
@@ -23579,7 +23581,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
 	ptrdiff_t topline, nlines, height;
 	ptrdiff_t junk;
 
-	/* %c and %l are ignored in `frame-title-format'.  */
+	/* %c, %C, and %l are ignored in `frame-title-format'.  */
 	if (mode_line_target == MODE_LINE_TITLE)
 	  return "";
 
@@ -31530,7 +31532,7 @@ This variable is not guaranteed to be accurate except while processing
 \(Assuming the window manager supports this feature.)
 
 This variable has the same structure as `mode-line-format', except that
-the %c and %l constructs are ignored.  It is used only on frames for
+the %c, %C, and %l constructs are ignored.  It is used only on frames for
 which no explicit name has been set (see `modify-frame-parameters').  */);
 
   DEFVAR_LISP ("icon-title-format", Vicon_title_format,

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* RE: Advice needed on modeline customization hack...
  2017-04-16 22:57                   ` Perry E. Metzger
@ 2017-04-16 23:48                     ` Drew Adams
  2017-04-17  0:13                       ` Perry E. Metzger
  2017-04-17  6:00                     ` Eli Zaretskii
  1 sibling, 1 reply; 31+ messages in thread
From: Drew Adams @ 2017-04-16 23:48 UTC (permalink / raw)
  To: Perry E. Metzger, Clément Pit-Claudel; +Cc: Stefan Monnier, emacs-devel

> the patches allow the user to customize the column number
> in column-number-mode to start from one instead of from zero.

Why?



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16 23:48                     ` Drew Adams
@ 2017-04-17  0:13                       ` Perry E. Metzger
  0 siblings, 0 replies; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-17  0:13 UTC (permalink / raw)
  To: Drew Adams; +Cc: Clément Pit-Claudel, Stefan Monnier, emacs-devel

On Sun, 16 Apr 2017 16:48:54 -0700 (PDT) Drew Adams
<drew.adams@oracle.com> wrote:
> > the patches allow the user to customize the column number
> > in column-number-mode to start from one instead of from zero.  
> 
> Why?
> 

Because all compilers spit out errors that start at column 1 and not
0, and this means that what I see in the mode line will match the
error output of the compilers I use (including those following GNU
coding standards, which see.)

It is not the default, it is a new knob you can turn. If you don't
like the feature, then don't set the variable controlling it.

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16 22:57                   ` Perry E. Metzger
  2017-04-16 23:48                     ` Drew Adams
@ 2017-04-17  6:00                     ` Eli Zaretskii
  2017-04-17 12:53                       ` Perry E. Metzger
  1 sibling, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2017-04-17  6:00 UTC (permalink / raw)
  To: Perry E. Metzger; +Cc: cpitclaudel, monnier, emacs-devel

> Date: Sun, 16 Apr 2017 18:57:40 -0400
> From: "Perry E. Metzger" <perry@piermont.com>
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
> 
> Attached is an improved patch, including documentation changes.

Thanks.  Allow me a few comments below.

> Comments solicited. I'm not fond of the name
> "column-number-mode-starts-from-zero" by the way.

How about column-number-indicator-zero-based instead?

> +@vindex column-number-mode-starts-from-zero
> +  In Column Number mode, the displayed column number begins at zero at
> +the start of a line. If you would prefer for the displayed column
> +number to begin at one, you may set
> +@code{column-number-mode-starts-from-zero} to @code{nil}.

The first sentence is ambiguous with the current bidirectional
display, because "start of line" is ambiguous.  I suggest to use the
wording with which we describe current-column:

  ... the displayed column number counts from 0 at the left margin of
  the window.

I also think that using digits 0 and 1 is better than using the words,
but that's my personal preference, so if you feel strongly about using
words, I won't object.

Also, please leave 2 spaces between sentences, as we use the US
English conventions in our documentation.

>  @item %c
> -The current column number of point.
> +The current column number of point, starting from zero.
> +
> +@item %C
> +The current column number of point, starting from one.

I think "zero-based" and "one-based" is better.  Or maybe include a
more detailed description of how the column is counted.

Please also add a NEWS entry about this new option.

> diff --git a/lisp/simple.el b/lisp/simple.el
> index 5f70adedc4..821880b1f3 100644
> --- a/lisp/simple.el
> +++ b/lisp/simple.el
> @@ -7198,6 +7198,10 @@ column-number-mode
>  If called from Lisp, enable the mode if ARG is omitted or nil."
>    :global t :group 'mode-line)
>  
> +(defvar column-number-mode-starts-from-zero t
> +  "When set to true, Column Number mode displays columns starting from zero.
> +Otherwise, displayed column numbers start from one.")

This should be a defcustom, not defvar.  I think it's best to have it
in xdisp.c, where the feature is implemented, in which case you should
add the necessary stuff to cus-start.el to allow its customization by
Custom.

What about the required change to mode_line_update_needed?



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-16 22:06               ` Perry E. Metzger
  2017-04-16 22:16                 ` Perry E. Metzger
@ 2017-04-17  6:02                 ` Eli Zaretskii
  2017-04-17 12:32                   ` Perry E. Metzger
  1 sibling, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2017-04-17  6:02 UTC (permalink / raw)
  To: Perry E. Metzger; +Cc: cpitclaudel, monnier, emacs-devel

> Date: Sun, 16 Apr 2017 18:06:20 -0400
> From: "Perry E. Metzger" <perry@piermont.com>
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
> 
> I found an issue, though, which is that there's code throughout
> xdisp.c that checks if w->column_number_displayed is the same as
> current_column() in order to decide if it should update the modeline.
> Naturally what I've done will break that.
> 
> I'm thinking perhaps I should add a flag to the window structure
> instead that says "add one when printing this" instead of changing
> the value of w->column_number_displayed, but I can't quite figure out
> where the modeline actually gets printed, only where
> column_number_displayed gets set.

I don't think adding a flag to the window object is necessary, as this
option is global.  You just need to make mode_line_update_needed look
at the new variable, and offset the displayed column by one if the
one-based display is used.  Will this work, or am I missing something?

Thanks.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17  6:02                 ` Eli Zaretskii
@ 2017-04-17 12:32                   ` Perry E. Metzger
  0 siblings, 0 replies; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-17 12:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: cpitclaudel, monnier, emacs-devel

On Mon, 17 Apr 2017 09:02:47 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
> I don't think adding a flag to the window object is necessary, as
> this option is global.  You just need to make
> mode_line_update_needed look at the new variable, and offset the
> displayed column by one if the one-based display is used.  Will
> this work, or am I missing something?

No, you are quite correct, and, that's what I'd done at the
point I sent out the patch last night.

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17  6:00                     ` Eli Zaretskii
@ 2017-04-17 12:53                       ` Perry E. Metzger
  2017-04-17 14:17                         ` Eli Zaretskii
  2017-04-17 15:21                         ` Perry E. Metzger
  0 siblings, 2 replies; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-17 12:53 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: cpitclaudel, monnier, emacs-devel

On Mon, 17 Apr 2017 09:00:24 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
> Thanks.  Allow me a few comments below.

Thank you for taking the time!

> > Comments solicited. I'm not fond of the name
> > "column-number-mode-starts-from-zero" by the way.
>
> How about column-number-indicator-zero-based instead?

That seems superior. I'll make the change.

> > +@vindex column-number-mode-starts-from-zero
> > +  In Column Number mode, the displayed column number begins at
> > zero at +the start of a line. If you would prefer for the
> > displayed column +number to begin at one, you may set
> > +@code{column-number-mode-starts-from-zero} to @code{nil}.
>
> The first sentence is ambiguous with the current bidirectional
> display, because "start of line" is ambiguous.  I suggest to use the
> wording with which we describe current-column:
>
>   ... the displayed column number counts from 0 at the left margin
> of the window.

I'll do that.

> I also think that using digits 0 and 1 is better than using the
> words, but that's my personal preference, so if you feel strongly
> about using words, I won't object.

I'm used to the usual rule in English classes that one uses the
written out words for small numbers, but this is technical
documentation and I think I'll change it to the way you prefer.

> Also, please leave 2 spaces between sentences, as we use the US
> English conventions in our documentation.

I didn't realize that translated through to the final texinfo
document. I'll change it.

> >  @item %c
> > -The current column number of point.
> > +The current column number of point, starting from zero.
> > +
> > +@item %C
> > +The current column number of point, starting from one.
> 
> I think "zero-based" and "one-based" is better.  Or maybe include a
> more detailed description of how the column is counted.

I'll think about this. I may use your formulation.

> Please also add a NEWS entry about this new option.

Will write one. How does one do a patch for that, given that by the
time this is applied it may be in the wrong place? Or should I just
include the blurb and whomever does the commit will add it?

> > diff --git a/lisp/simple.el b/lisp/simple.el
> > index 5f70adedc4..821880b1f3 100644
> > --- a/lisp/simple.el
> > +++ b/lisp/simple.el
> > @@ -7198,6 +7198,10 @@ column-number-mode
> >  If called from Lisp, enable the mode if ARG is omitted or nil."
> >    :global t :group 'mode-line)
> >  
> > +(defvar column-number-mode-starts-from-zero t
> > +  "When set to true, Column Number mode displays columns
> > starting from zero. +Otherwise, displayed column numbers start
> > from one.")  
> 
> This should be a defcustom, not defvar.

Easily fixed.

> I think it's best to have
> it in xdisp.c, where the feature is implemented, in which case you
> should add the necessary stuff to cus-start.el to allow its
> customization by Custom.

I thought that since the rest of the lisp side was done there
(including the minor mode) that it was better to have it in the .el
file. Do you have a strong opinion?

> What about the required change to mode_line_update_needed?

I no longer need that since I now only increment the column number for
the routine that generates the modeline string and not for the
variable in the window structure. See the patch for details.

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 12:53                       ` Perry E. Metzger
@ 2017-04-17 14:17                         ` Eli Zaretskii
  2017-04-17 15:24                           ` Perry E. Metzger
  2017-04-17 15:21                         ` Perry E. Metzger
  1 sibling, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2017-04-17 14:17 UTC (permalink / raw)
  To: Perry E. Metzger; +Cc: cpitclaudel, monnier, emacs-devel

> Date: Mon, 17 Apr 2017 08:53:26 -0400
> From: "Perry E. Metzger" <perry@piermont.com>
> Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> > Please also add a NEWS entry about this new option.
> 
> Will write one. How does one do a patch for that, given that by the
> time this is applied it may be in the wrong place? Or should I just
> include the blurb and whomever does the commit will add it?

The place where the entry ends up isn't important, because usually
NEWS entries get rearranged shortly before the release anyway.

> > I think it's best to have
> > it in xdisp.c, where the feature is implemented, in which case you
> > should add the necessary stuff to cus-start.el to allow its
> > customization by Custom.
> 
> I thought that since the rest of the lisp side was done there
> (including the minor mode) that it was better to have it in the .el
> file. Do you have a strong opinion?

It isn't a strong opinion, it just will make it easier to find the
implementation given the option and vice versa.  We do have exceptions
from this semi-rule, so this could be another one.

> > What about the required change to mode_line_update_needed?
> 
> I no longer need that since I now only increment the column number for
> the routine that generates the modeline string and not for the
> variable in the window structure. See the patch for details.

Right you are, sorry for missing that.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 12:53                       ` Perry E. Metzger
  2017-04-17 14:17                         ` Eli Zaretskii
@ 2017-04-17 15:21                         ` Perry E. Metzger
  2017-04-17 15:31                           ` Eli Zaretskii
  1 sibling, 1 reply; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-17 15:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: cpitclaudel, monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 2112 bytes --]

Attached find new patches. I've made most of the changes requested,
with two small exceptions noted below:

On Mon, 17 Apr 2017 08:53:26 -0400 "Perry E. Metzger"
<perry@piermont.com> wrote:
> > I also think that using digits 0 and 1 is better than using the
> > words, but that's my personal preference, so if you feel strongly
> > about using words, I won't object.
>
> I'm used to the usual rule in English classes that one uses the
> written out words for small numbers, but this is technical
> documentation and I think I'll change it to the way you prefer.

So I read the surrounding documentation and docstrings, and it seems
that there is a consistent style, both in docstrings and in the
manuals, of saying "zero" and "one" rather than "0" and "1", so in
order to keep to the apparent style I will be leaving it as "zero" and
one".

I have made all your other proposed changes to the documentation.

I've renamed the variable column-number-indicator-zero-based as
suggested, though I'm wondering if we should say "display" instead of
"indicator" to match the documentation.

> > > +(defvar column-number-mode-starts-from-zero t
> > > +  "When set to true, Column Number mode displays columns
> > > starting from zero. +Otherwise, displayed column numbers start
> > > from one.")
> >
> > This should be a defcustom, not defvar.
>
> Easily fixed.

I've set it to :type 'boolean in :group 'mode-line (and have made all
your other proposed changes with one exception):

> > I think it's best to have
> > it in xdisp.c, where the feature is implemented, in which case you
> > should add the necessary stuff to cus-start.el to allow its
> > customization by Custom.
>
> I thought that since the rest of the lisp side was done there
> (including the minor mode) that it was better to have it in the .el
> file. Do you have a strong opinion?

Looking around, it seems that many such customization variables are in
simple.el already, and that there is a bias now towards putting code
into the lisp side and not the C side, so for now, my new patch leaves
it there.

Perry
-- 
Perry E. Metzger		perry@piermont.com

[-- Attachment #2: column.diff --]
[-- Type: application/octet-stream, Size: 9003 bytes --]

diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index 1a9c65a08c..38ef917377 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1327,13 +1327,19 @@ Optional Mode Line
 @cindex mode, Column Number
 @findex column-number-mode
   Similarly, you can display the current column number by turning on
-Column number mode with @kbd{M-x column-number-mode}.  The column
+Column Number mode with @kbd{M-x column-number-mode}.  The column
 number is indicated by the letter @samp{C}.  However, when both of
 these modes are enabled, the line and column numbers are displayed in
 parentheses, the line number first, rather than with @samp{L} and
 @samp{C}.  For example: @samp{(561,2)}.  @xref{Minor Modes}, for more
 information about minor modes and about how to use these commands.
 
+@vindex column-number-indicator-zero-based
+  In Column Number mode, the displayed column number counts from zero
+starting at the left margin of the window.  If you would prefer for
+the displayed column number to count from one, you may set
+@code{column-number-indicator-zero-based} to @code{nil}.
+
 @cindex narrowing, and line number display
   If you have narrowed the buffer (@pxref{Narrowing}), the displayed
 line number is relative to the accessible portion of the buffer.
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index d6f014fada..bd2bacc739 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1871,7 +1871,7 @@ Frame Titles
 This variable specifies how to compute a name for a frame when you have
 not explicitly specified one.  The variable's value is actually a mode
 line construct, just like @code{mode-line-format}, except that the
-@samp{%c} and @samp{%l} constructs are ignored.  @xref{Mode Line
+@samp{%c}, @samp{%C}, and @samp{%l} constructs are ignored.  @xref{Mode Line
 Data}.
 @end defvar
 
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 132dda3fc6..1303cb6caf 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2093,7 +2093,12 @@ %-Constructs
 @xref{Buffer Names}.
 
 @item %c
-The current column number of point.
+The current column number of point, counting from zero starting at the
+left margin of the window.
+
+@item %C
+The current column number of point, counting from one starting at the
+left margin of the window.
 
 @item %e
 When Emacs is nearly out of memory for Lisp objects, a brief message
diff --git a/etc/refcards/gnus-logo.pdf b/etc/refcards/gnus-logo.pdf
deleted file mode 100644
index 3629a605e6..0000000000
Binary files a/etc/refcards/gnus-logo.pdf and /dev/null differ
diff --git a/lisp/bindings.el b/lisp/bindings.el
index f641865ba3..da90165ae1 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -368,12 +368,19 @@ mode-line-position
 mouse-1: Display Line and Column Mode Menu")))
     (line-number-mode
      ((column-number-mode
-       (10 ,(propertize
-	     " (%l,%c)"
-	     'local-map mode-line-column-line-number-mode-map
-	     'mouse-face 'mode-line-highlight
-	     'help-echo "Line number and Column number\n\
+       (column-number-indicator-zero-based
+        (10 ,(propertize
+              " (%l,%c)"
+              'local-map mode-line-column-line-number-mode-map
+              'mouse-face 'mode-line-highlight
+              'help-echo "Line number and Column number\n\
 mouse-1: Display Line and Column Mode Menu"))
+        (10 ,(propertize
+              " (%l,%C)"
+              'local-map mode-line-column-line-number-mode-map
+              'mouse-face 'mode-line-highlight
+              'help-echo "Line number and Column number\n\
+mouse-1: Display Line and Column Mode Menu")))
        (6 ,(propertize
 	    " L%l"
 	    'local-map mode-line-column-line-number-mode-map
@@ -381,12 +388,19 @@ mode-line-position
 	    'help-echo "Line Number\n\
 mouse-1: Display Line and Column Mode Menu"))))
      ((column-number-mode
-       (5 ,(propertize
-	    " C%c"
-	    'local-map mode-line-column-line-number-mode-map
-	    'mouse-face 'mode-line-highlight
-	    'help-echo "Column number\n\
-mouse-1: Display Line and Column Mode Menu"))))))
+       (column-number-indicator-zero-based
+        (5 ,(propertize
+             " C%c"
+             'local-map mode-line-column-line-number-mode-map
+             'mouse-face 'mode-line-highlight
+             'help-echo "Column number\n\
+mouse-1: Display Line and Column Mode Menu"))
+        (5 ,(propertize
+             " C%C"
+             'local-map mode-line-column-line-number-mode-map
+             'mouse-face 'mode-line-highlight
+             'help-echo "Column number\n\
+mouse-1: Display Line and Column Mode Menu")))))))
   "Mode line construct for displaying the position in the buffer.
 Normally displays the buffer percentage and, optionally, the
 buffer size, the line number and the column number.")
diff --git a/lisp/simple.el b/lisp/simple.el
index 5f70adedc4..0a8dbd1696 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -7198,6 +7198,13 @@ column-number-mode
 If called from Lisp, enable the mode if ARG is omitted or nil."
   :global t :group 'mode-line)
 
+(defcustom column-number-indicator-zero-based t
+  "When set to true, Column Number mode displays columns starting
+from zero at the left margin of the window. Otherwise, displayed
+column numbers start from one."
+  :type 'boolean
+  :group 'mode-line)
+
 (define-minor-mode size-indication-mode
   "Toggle buffer size display in the mode line (Size Indication mode).
 With a prefix argument ARG, enable Size Indication mode if ARG is
diff --git a/src/buffer.c b/src/buffer.c
index 8ef27dee0f..261c0c15a3 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5608,8 +5608,11 @@ A string is printed verbatim in the mode line except for %-constructs:
 	For a modified read-only buffer, %* gives % and %+ gives *.
   %s -- print process status.   %l -- print the current line number.
   %c -- print the current column number (this makes editing slower).
+        Columns are numbered starting from the left margin, and the
+        leftmost column is displayed as zero.
         To make the column number update correctly in all cases,
 	`column-number-mode' must be non-nil.
+  %C -- Like %c, but the leftmost column is displayed as one.
   %i -- print the size of the buffer.
   %I -- like %i, but use k, M, G, etc., to abbreviate.
   %p -- print percent of buffer above top of window, or Top, Bot or All.
diff --git a/src/xdisp.c b/src/xdisp.c
index c6f8566523..cab01ec701 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -475,7 +475,7 @@ int windows_or_buffers_changed;
    used to track down the cause for this full-redisplay).
 
    Since the frame title uses the same %-constructs as the mode line
-   (except %c and %l), if this variable is non-zero, we also consider
+   (except %c, %C, and %l), if this variable is non-zero, we also consider
    redisplaying the title of each frame, see x_consider_frame_title.
 
    The `redisplay' bits are the same as those used for
@@ -11462,7 +11462,7 @@ window_buffer_changed (struct window *w)
   return (BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) != w->last_had_star;
 }
 
-/* True if W has %c in its mode line and mode line should be updated.  */
+/* True if W has %c or %C in its mode line and mode line should be updated.  */
 
 static bool
 mode_line_update_needed (struct window *w)
@@ -23520,7 +23520,8 @@ decode_mode_spec (struct window *w, register int c, int field_width,
       break;
 
     case 'c':
-      /* %c and %l are ignored in `frame-title-format'.
+    case 'C':
+      /* %c, %C, and %l are ignored in `frame-title-format'.
          (In redisplay_internal, the frame title is drawn _before_ the
          windows are updated, so the stuff which depends on actual
          window contents (such as %l) may fail to render properly, or
@@ -23530,8 +23531,9 @@ decode_mode_spec (struct window *w, register int c, int field_width,
       else
 	{
 	  ptrdiff_t col = current_column ();
+	  int disp_col = (c == 'C') ? col + 1 : col;
 	  w->column_number_displayed = col;
-	  pint2str (decode_mode_spec_buf, width, col);
+	  pint2str (decode_mode_spec_buf, width, disp_col);
 	  return decode_mode_spec_buf;
 	}
 
@@ -23579,7 +23581,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
 	ptrdiff_t topline, nlines, height;
 	ptrdiff_t junk;
 
-	/* %c and %l are ignored in `frame-title-format'.  */
+	/* %c, %C, and %l are ignored in `frame-title-format'.  */
 	if (mode_line_target == MODE_LINE_TITLE)
 	  return "";
 
@@ -31530,7 +31532,7 @@ This variable is not guaranteed to be accurate except while processing
 \(Assuming the window manager supports this feature.)
 
 This variable has the same structure as `mode-line-format', except that
-the %c and %l constructs are ignored.  It is used only on frames for
+the %c, %C, and %l constructs are ignored.  It is used only on frames for
 which no explicit name has been set (see `modify-frame-parameters').  */);
 
   DEFVAR_LISP ("icon-title-format", Vicon_title_format,

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 14:17                         ` Eli Zaretskii
@ 2017-04-17 15:24                           ` Perry E. Metzger
  2017-04-17 15:34                             ` Eli Zaretskii
  0 siblings, 1 reply; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-17 15:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: cpitclaudel, monnier, emacs-devel

On Mon, 17 Apr 2017 17:17:23 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Mon, 17 Apr 2017 08:53:26 -0400
> > From: "Perry E. Metzger" <perry@piermont.com>
> > Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca,
> > emacs-devel@gnu.org 
> > > Please also add a NEWS entry about this new option.  
> > 
> > Will write one. How does one do a patch for that, given that by
> > the time this is applied it may be in the wrong place? Or should
> > I just include the blurb and whomever does the commit will add
> > it?  
> 
> The place where the entry ends up isn't important, because usually
> NEWS entries get rearranged shortly before the release anyway.

Here is my proposed entry:

------
** New variable 'column-number-indicator-zero-based'
Traditionally, in Column Number mode, the displayed column number
counts from zero starting at the left margin of the window. This
behavior is now controlled by 'column-number-indicator-zero-based'.
If you would prefer for the displayed column number to count from one,
you may set this variable to nil. (Behind the scenes, there is now a
new mode line construct, '%C', which operates exactly as '%c' does
except that it counts from one.)
------

If the patch is accepted, will this go in 25.2 or in the master
branch? My patches are currently vs. master on the assumption that
25.2 was about to go out the door.

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 15:21                         ` Perry E. Metzger
@ 2017-04-17 15:31                           ` Eli Zaretskii
  2017-04-17 15:55                             ` Perry E. Metzger
  0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2017-04-17 15:31 UTC (permalink / raw)
  To: Perry E. Metzger; +Cc: cpitclaudel, monnier, emacs-devel

> Date: Mon, 17 Apr 2017 11:21:44 -0400
> From: "Perry E. Metzger" <perry@piermont.com>
> Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> I've renamed the variable column-number-indicator-zero-based as
> suggested, though I'm wondering if we should say "display" instead of
> "indicator" to match the documentation.

The manual speaks of an indicator, so I think this is okay.  But I
don't pretend to be good with names, so if someone has a better name,
I hope they will speak up.

> I've set it to :type 'boolean in :group 'mode-line (and have made all
> your other proposed changes with one exception):
> 
> > > I think it's best to have
> > > it in xdisp.c, where the feature is implemented, in which case you
> > > should add the necessary stuff to cus-start.el to allow its
> > > customization by Custom.
> >
> > I thought that since the rest of the lisp side was done there
> > (including the minor mode) that it was better to have it in the .el
> > file. Do you have a strong opinion?
> 
> Looking around, it seems that many such customization variables are in
> simple.el already, and that there is a bias now towards putting code
> into the lisp side and not the C side, so for now, my new patch leaves
> it there.

Then I think it should be in bindings.el, not in simple.el, to at
least be in the same file as related code.

> +(defcustom column-number-indicator-zero-based t
> +  "When set to true, Column Number mode displays columns starting
> +from zero at the left margin of the window. Otherwise, displayed
> +column numbers start from one."
> +  :type 'boolean
> +  :group 'mode-line)

Please add a ':version' tag.

Thanks.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 15:24                           ` Perry E. Metzger
@ 2017-04-17 15:34                             ` Eli Zaretskii
  2017-04-17 18:07                               ` Perry E. Metzger
  0 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2017-04-17 15:34 UTC (permalink / raw)
  To: Perry E. Metzger; +Cc: cpitclaudel, monnier, emacs-devel

> Date: Mon, 17 Apr 2017 11:24:01 -0400
> From: "Perry E. Metzger" <perry@piermont.com>
> Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> ------
> ** New variable 'column-number-indicator-zero-based'
> Traditionally, in Column Number mode, the displayed column number
> counts from zero starting at the left margin of the window. This
> behavior is now controlled by 'column-number-indicator-zero-based'.
> If you would prefer for the displayed column number to count from one,
> you may set this variable to nil. (Behind the scenes, there is now a
> new mode line construct, '%C', which operates exactly as '%c' does
> except that it counts from one.)
> ------

Thanks.  The entry could be shorter, but I don't have anything against
this text, either.  Just keep 2 spaces between sentences ;-)

The entry should be preceded by "+++", to indicate that the manuals
were updated.

> If the patch is accepted, will this go in 25.2 or in the master
> branch?

It should go to master, as the release branch doesn't get new
features.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 15:31                           ` Eli Zaretskii
@ 2017-04-17 15:55                             ` Perry E. Metzger
  2017-04-17 16:13                               ` Eli Zaretskii
  0 siblings, 1 reply; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-17 15:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: monnier, emacs-devel

On Mon, 17 Apr 2017 18:31:28 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
> > +(defcustom column-number-indicator-zero-based t
> > +  "When set to true, Column Number mode displays columns starting
> > +from zero at the left margin of the window. Otherwise, displayed
> > +column numbers start from one."
> > +  :type 'boolean
> > +  :group 'mode-line)  
> 
> Please add a ':version' tag.

Easily done, but is 25.2.1 the right number (that's what
emacs-version built from master says) or something else?

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 15:55                             ` Perry E. Metzger
@ 2017-04-17 16:13                               ` Eli Zaretskii
  0 siblings, 0 replies; 31+ messages in thread
From: Eli Zaretskii @ 2017-04-17 16:13 UTC (permalink / raw)
  To: Perry E. Metzger; +Cc: monnier, emacs-devel

> Date: Mon, 17 Apr 2017 11:55:04 -0400
> From: "Perry E. Metzger" <perry@piermont.com>
> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> > Please add a ':version' tag.
> 
> Easily done, but is 25.2.1 the right number (that's what
> emacs-version built from master says) or something else?

It should be 26.1, the version which the master branch will become.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 15:34                             ` Eli Zaretskii
@ 2017-04-17 18:07                               ` Perry E. Metzger
  2017-04-17 18:23                                 ` Eli Zaretskii
  0 siblings, 1 reply; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-17 18:07 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: cpitclaudel, monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

On Mon, 17 Apr 2017 18:34:25 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
> The entry should be preceded by "+++", to indicate that the manuals
> were updated.

I vaguely remember that convention but I couldn't find it documented
so I wasn't quite sure what "preceded" meant. I've put +++ in a
leading location (just after the *s) in the attached. I also moved the
customization variable to bindings.el, adjacent to where it is used,
as you suggested. I've left the variable name alone as neither of us
has a better idea.

Let me know if there are any more changes you would like here. I
don't have direct commit access but I do have a copyright assignment
at FSF so feel free to commit to master if you are happy with this.


Perry
-- 
Perry E. Metzger		perry@piermont.com

[-- Attachment #2: NEWS.new --]
[-- Type: application/octet-stream, Size: 498 bytes --]

** +++ New variable 'column-number-indicator-zero-based'
Traditionally, in Column Number mode, the displayed column number
counts from zero starting at the left margin of the window.  This
behavior is now controlled by 'column-number-indicator-zero-based'.
If you would prefer for the displayed column number to count from one,
you may set this variable to nil.  (Behind the scenes, there is now a
new mode line construct, '%C', which operates exactly as '%c' does
except that it counts from one.)

[-- Attachment #3: column.diff --]
[-- Type: application/octet-stream, Size: 8760 bytes --]

diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index 1a9c65a08c..38ef917377 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1327,13 +1327,19 @@ Optional Mode Line
 @cindex mode, Column Number
 @findex column-number-mode
   Similarly, you can display the current column number by turning on
-Column number mode with @kbd{M-x column-number-mode}.  The column
+Column Number mode with @kbd{M-x column-number-mode}.  The column
 number is indicated by the letter @samp{C}.  However, when both of
 these modes are enabled, the line and column numbers are displayed in
 parentheses, the line number first, rather than with @samp{L} and
 @samp{C}.  For example: @samp{(561,2)}.  @xref{Minor Modes}, for more
 information about minor modes and about how to use these commands.
 
+@vindex column-number-indicator-zero-based
+  In Column Number mode, the displayed column number counts from zero
+starting at the left margin of the window.  If you would prefer for
+the displayed column number to count from one, you may set
+@code{column-number-indicator-zero-based} to @code{nil}.
+
 @cindex narrowing, and line number display
   If you have narrowed the buffer (@pxref{Narrowing}), the displayed
 line number is relative to the accessible portion of the buffer.
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index d6f014fada..bd2bacc739 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -1871,7 +1871,7 @@ Frame Titles
 This variable specifies how to compute a name for a frame when you have
 not explicitly specified one.  The variable's value is actually a mode
 line construct, just like @code{mode-line-format}, except that the
-@samp{%c} and @samp{%l} constructs are ignored.  @xref{Mode Line
+@samp{%c}, @samp{%C}, and @samp{%l} constructs are ignored.  @xref{Mode Line
 Data}.
 @end defvar
 
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 132dda3fc6..1303cb6caf 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -2093,7 +2093,12 @@ %-Constructs
 @xref{Buffer Names}.
 
 @item %c
-The current column number of point.
+The current column number of point, counting from zero starting at the
+left margin of the window.
+
+@item %C
+The current column number of point, counting from one starting at the
+left margin of the window.
 
 @item %e
 When Emacs is nearly out of memory for Lisp objects, a brief message
diff --git a/etc/refcards/gnus-logo.pdf b/etc/refcards/gnus-logo.pdf
deleted file mode 100644
index 3629a605e6..0000000000
Binary files a/etc/refcards/gnus-logo.pdf and /dev/null differ
diff --git a/lisp/bindings.el b/lisp/bindings.el
index f641865ba3..8f9db350d9 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -350,6 +350,14 @@ mode-line-column-line-number-mode-map
     map) "\
 Keymap to display on column and line numbers.")
 
+(defcustom column-number-indicator-zero-based t
+  "When set to true, Column Number mode displays columns starting
+from zero at the left margin of the window. Otherwise, displayed
+column numbers start from one."
+  :type 'boolean
+  :group 'mode-line
+  :version "26.1")
+
 (defvar mode-line-position
   `((-3 ,(propertize
 	  "%p"
@@ -368,12 +376,19 @@ mode-line-position
 mouse-1: Display Line and Column Mode Menu")))
     (line-number-mode
      ((column-number-mode
-       (10 ,(propertize
-	     " (%l,%c)"
-	     'local-map mode-line-column-line-number-mode-map
-	     'mouse-face 'mode-line-highlight
-	     'help-echo "Line number and Column number\n\
+       (column-number-indicator-zero-based
+        (10 ,(propertize
+              " (%l,%c)"
+              'local-map mode-line-column-line-number-mode-map
+              'mouse-face 'mode-line-highlight
+              'help-echo "Line number and Column number\n\
 mouse-1: Display Line and Column Mode Menu"))
+        (10 ,(propertize
+              " (%l,%C)"
+              'local-map mode-line-column-line-number-mode-map
+              'mouse-face 'mode-line-highlight
+              'help-echo "Line number and Column number\n\
+mouse-1: Display Line and Column Mode Menu")))
        (6 ,(propertize
 	    " L%l"
 	    'local-map mode-line-column-line-number-mode-map
@@ -381,12 +396,19 @@ mode-line-position
 	    'help-echo "Line Number\n\
 mouse-1: Display Line and Column Mode Menu"))))
      ((column-number-mode
-       (5 ,(propertize
-	    " C%c"
-	    'local-map mode-line-column-line-number-mode-map
-	    'mouse-face 'mode-line-highlight
-	    'help-echo "Column number\n\
-mouse-1: Display Line and Column Mode Menu"))))))
+       (column-number-indicator-zero-based
+        (5 ,(propertize
+             " C%c"
+             'local-map mode-line-column-line-number-mode-map
+             'mouse-face 'mode-line-highlight
+             'help-echo "Column number\n\
+mouse-1: Display Line and Column Mode Menu"))
+        (5 ,(propertize
+             " C%C"
+             'local-map mode-line-column-line-number-mode-map
+             'mouse-face 'mode-line-highlight
+             'help-echo "Column number\n\
+mouse-1: Display Line and Column Mode Menu")))))))
   "Mode line construct for displaying the position in the buffer.
 Normally displays the buffer percentage and, optionally, the
 buffer size, the line number and the column number.")
diff --git a/src/buffer.c b/src/buffer.c
index 8ef27dee0f..261c0c15a3 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -5608,8 +5608,11 @@ A string is printed verbatim in the mode line except for %-constructs:
 	For a modified read-only buffer, %* gives % and %+ gives *.
   %s -- print process status.   %l -- print the current line number.
   %c -- print the current column number (this makes editing slower).
+        Columns are numbered starting from the left margin, and the
+        leftmost column is displayed as zero.
         To make the column number update correctly in all cases,
 	`column-number-mode' must be non-nil.
+  %C -- Like %c, but the leftmost column is displayed as one.
   %i -- print the size of the buffer.
   %I -- like %i, but use k, M, G, etc., to abbreviate.
   %p -- print percent of buffer above top of window, or Top, Bot or All.
diff --git a/src/xdisp.c b/src/xdisp.c
index c6f8566523..cab01ec701 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -475,7 +475,7 @@ int windows_or_buffers_changed;
    used to track down the cause for this full-redisplay).
 
    Since the frame title uses the same %-constructs as the mode line
-   (except %c and %l), if this variable is non-zero, we also consider
+   (except %c, %C, and %l), if this variable is non-zero, we also consider
    redisplaying the title of each frame, see x_consider_frame_title.
 
    The `redisplay' bits are the same as those used for
@@ -11462,7 +11462,7 @@ window_buffer_changed (struct window *w)
   return (BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) != w->last_had_star;
 }
 
-/* True if W has %c in its mode line and mode line should be updated.  */
+/* True if W has %c or %C in its mode line and mode line should be updated.  */
 
 static bool
 mode_line_update_needed (struct window *w)
@@ -23520,7 +23520,8 @@ decode_mode_spec (struct window *w, register int c, int field_width,
       break;
 
     case 'c':
-      /* %c and %l are ignored in `frame-title-format'.
+    case 'C':
+      /* %c, %C, and %l are ignored in `frame-title-format'.
          (In redisplay_internal, the frame title is drawn _before_ the
          windows are updated, so the stuff which depends on actual
          window contents (such as %l) may fail to render properly, or
@@ -23530,8 +23531,9 @@ decode_mode_spec (struct window *w, register int c, int field_width,
       else
 	{
 	  ptrdiff_t col = current_column ();
+	  int disp_col = (c == 'C') ? col + 1 : col;
 	  w->column_number_displayed = col;
-	  pint2str (decode_mode_spec_buf, width, col);
+	  pint2str (decode_mode_spec_buf, width, disp_col);
 	  return decode_mode_spec_buf;
 	}
 
@@ -23579,7 +23581,7 @@ decode_mode_spec (struct window *w, register int c, int field_width,
 	ptrdiff_t topline, nlines, height;
 	ptrdiff_t junk;
 
-	/* %c and %l are ignored in `frame-title-format'.  */
+	/* %c, %C, and %l are ignored in `frame-title-format'.  */
 	if (mode_line_target == MODE_LINE_TITLE)
 	  return "";
 
@@ -31530,7 +31532,7 @@ This variable is not guaranteed to be accurate except while processing
 \(Assuming the window manager supports this feature.)
 
 This variable has the same structure as `mode-line-format', except that
-the %c and %l constructs are ignored.  It is used only on frames for
+the %c, %C, and %l constructs are ignored.  It is used only on frames for
 which no explicit name has been set (see `modify-frame-parameters').  */);
 
   DEFVAR_LISP ("icon-title-format", Vicon_title_format,

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 18:07                               ` Perry E. Metzger
@ 2017-04-17 18:23                                 ` Eli Zaretskii
  2017-04-17 18:55                                   ` Perry E. Metzger
  2017-05-10 17:59                                   ` Eli Zaretskii
  0 siblings, 2 replies; 31+ messages in thread
From: Eli Zaretskii @ 2017-04-17 18:23 UTC (permalink / raw)
  To: Perry E. Metzger; +Cc: cpitclaudel, monnier, emacs-devel

> Date: Mon, 17 Apr 2017 14:07:40 -0400
> From: "Perry E. Metzger" <perry@piermont.com>
> Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> On Mon, 17 Apr 2017 18:34:25 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
> > The entry should be preceded by "+++", to indicate that the manuals
> > were updated.
> 
> I vaguely remember that convention but I couldn't find it documented

It's documented at the beginning of NEWS.  And you can see examples of
that in other NEWS entries.

> +(defcustom column-number-indicator-zero-based t
> +  "When set to true, Column Number mode displays columns starting
> +from zero at the left margin of the window. Otherwise, displayed
> +column numbers start from one."

The first line of a doc string should be a complete sentence.
Something like

    When non-nil, mode line displays column numbers zero-based.

  This variable has effect only when Column Number mode is turned on,
  which displays column numbers in the mode line.
  If the value is non-nil, the displayed column numbers start from
  zero, otherwise they start from one.

Also, 2 spaces between sentences...

Don't worry about these nits, they can be fixed when pushing.

Let's wait for a few days to give others a chance to comment.

Thanks.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 18:23                                 ` Eli Zaretskii
@ 2017-04-17 18:55                                   ` Perry E. Metzger
  2017-04-17 19:07                                     ` Noam Postavsky
  2017-05-10 17:59                                   ` Eli Zaretskii
  1 sibling, 1 reply; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-17 18:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On Mon, 17 Apr 2017 21:23:35 +0300 Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Mon, 17 Apr 2017 14:07:40 -0400
> > From: "Perry E. Metzger" <perry@piermont.com>
> > Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca,
> > emacs-devel@gnu.org
> >
> > On Mon, 17 Apr 2017 18:34:25 +0300 Eli Zaretskii <eliz@gnu.org>
> > wrote:
> > > The entry should be preceded by "+++", to indicate that the
> > > manuals were updated.
> >
> > I vaguely remember that convention but I couldn't find it
> > documented
>
> It's documented at the beginning of NEWS.  And you can see examples
> of that in other NEWS entries.

Maybe it isn't documented on master that way? This is what I see at
the start of the file, and a search for "+++" in the NEWS file on the
master branch turns up nothing:

-----
GNU Emacs NEWS -- history of user-visible changes.

Copyright (C) 2014-2017 Free Software Foundation, Inc.
See the end of the file for license conditions.

Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
If possible, use M-x report-emacs-bug.

This file is about changes in Emacs version 25.

See file HISTORY for a list of GNU Emacs versions and release dates.
See files NEWS.24, NEWS.23, NEWS.22, NEWS.21, NEWS.20, NEWS.19, NEWS.18,
and NEWS.1-17 for changes in older Emacs versions.

You can narrow news to a specific version by calling 'view-emacs-news'
with a prefix argument or by typing C-u C-h C-n.

^L
* Changes in Emacs 25.2

This is mainly a bug-fix release, but there are some other changes.

-----

> > +(defcustom column-number-indicator-zero-based t
> > +  "When set to true, Column Number mode displays columns starting
> > +from zero at the left margin of the window. Otherwise, displayed
> > +column numbers start from one."
>
> The first line of a doc string should be a complete sentence.
> Something like
>
>     When non-nil, mode line displays column numbers zero-based.

Gotcha. Will fix that for later.

> Let's wait for a few days to give others a chance to comment.

Sounds good.

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 18:55                                   ` Perry E. Metzger
@ 2017-04-17 19:07                                     ` Noam Postavsky
  2017-04-17 19:18                                       ` Perry E. Metzger
  0 siblings, 1 reply; 31+ messages in thread
From: Noam Postavsky @ 2017-04-17 19:07 UTC (permalink / raw)
  To: Perry E. Metzger; +Cc: Eli Zaretskii, Emacs developers

On Mon, Apr 17, 2017 at 11:55 AM, Perry E. Metzger <perry@piermont.com> wrote:
>
> Easily done, but is 25.2.1 the right number (that's what
> emacs-version built from master says)
>

emacs-version in master should be 26.0.50

On Mon, Apr 17, 2017 at 2:55 PM, Perry E. Metzger <perry@piermont.com> wrote:
>
> Maybe it isn't documented on master that way? This is what I see at
> the start of the file, and a search for "+++" in the NEWS file on the
> master branch turns up nothing:
>
> -----
> GNU Emacs NEWS -- history of user-visible changes.
>
> Copyright (C) 2014-2017 Free Software Foundation, Inc.
> See the end of the file for license conditions.
>
> Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
> If possible, use M-x report-emacs-bug.
>
> This file is about changes in Emacs version 25.

It looks like you might not actually be using master? etc/NEWS should
start like this:

-----
GNU Emacs NEWS -- history of user-visible changes.

Copyright (C) 2014-2017 Free Software Foundation, Inc.
See the end of the file for license conditions.

Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
If possible, use M-x report-emacs-bug.

This file is about changes in Emacs version 26.

See file HISTORY for a list of GNU Emacs versions and release dates.
See files NEWS.25, NEWS.24, NEWS.23, NEWS.22, NEWS.21, NEWS.20,
NEWS.19, NEWS.18, and NEWS.1-17 for changes in older Emacs versions.

You can narrow news to a specific version by calling 'view-emacs-news'
with a prefix argument or by typing C-u C-h C-n.

Temporary note:
+++ indicates that all necessary documentation updates are complete.
    (This means all relevant manuals in doc/ AND lisp doc-strings.)
--- means no change in the manuals is needed.
When you add a new item, use the appropriate mark if you are sure it applies,


* Installation Changes in Emacs 26.1



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 19:07                                     ` Noam Postavsky
@ 2017-04-17 19:18                                       ` Perry E. Metzger
  0 siblings, 0 replies; 31+ messages in thread
From: Perry E. Metzger @ 2017-04-17 19:18 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Eli Zaretskii, Emacs developers

On Mon, 17 Apr 2017 15:07:58 -0400 Noam Postavsky
<npostavs@users.sourceforge.net> wrote:
> On Mon, Apr 17, 2017 at 11:55 AM, Perry E. Metzger
> <perry@piermont.com> wrote:
> >
> > Easily done, but is 25.2.1 the right number (that's what
> > emacs-version built from master says)
> >  
> 
> emacs-version in master should be 26.0.50

Maybe I'm accidentally on the branch...

Perry
-- 
Perry E. Metzger		perry@piermont.com



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Advice needed on modeline customization hack...
  2017-04-17 18:23                                 ` Eli Zaretskii
  2017-04-17 18:55                                   ` Perry E. Metzger
@ 2017-05-10 17:59                                   ` Eli Zaretskii
  1 sibling, 0 replies; 31+ messages in thread
From: Eli Zaretskii @ 2017-05-10 17:59 UTC (permalink / raw)
  To: perry; +Cc: cpitclaudel, monnier, emacs-devel

> Date: Mon, 17 Apr 2017 21:23:35 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: cpitclaudel@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> Don't worry about these nits, they can be fixed when pushing.
> 
> Let's wait for a few days to give others a chance to comment.

Pushed to master.

Sorry for the delay, and thanks for your patience, and for working on
this.



^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2017-05-10 17:59 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-16  1:28 Advice needed on modeline customization hack Perry E. Metzger
2017-04-16  1:55 ` Perry E. Metzger
2017-04-16  3:11 ` Stefan Monnier
2017-04-16 13:49   ` Perry E. Metzger
2017-04-16 14:07     ` Stefan Monnier
2017-04-16 14:46       ` Perry E. Metzger
2017-04-16 15:02         ` Clément Pit-Claudel
2017-04-16 16:09           ` Perry E. Metzger
2017-04-16 20:59             ` Clément Pit-Claudel
2017-04-16 22:06               ` Perry E. Metzger
2017-04-16 22:16                 ` Perry E. Metzger
2017-04-16 22:57                   ` Perry E. Metzger
2017-04-16 23:48                     ` Drew Adams
2017-04-17  0:13                       ` Perry E. Metzger
2017-04-17  6:00                     ` Eli Zaretskii
2017-04-17 12:53                       ` Perry E. Metzger
2017-04-17 14:17                         ` Eli Zaretskii
2017-04-17 15:24                           ` Perry E. Metzger
2017-04-17 15:34                             ` Eli Zaretskii
2017-04-17 18:07                               ` Perry E. Metzger
2017-04-17 18:23                                 ` Eli Zaretskii
2017-04-17 18:55                                   ` Perry E. Metzger
2017-04-17 19:07                                     ` Noam Postavsky
2017-04-17 19:18                                       ` Perry E. Metzger
2017-05-10 17:59                                   ` Eli Zaretskii
2017-04-17 15:21                         ` Perry E. Metzger
2017-04-17 15:31                           ` Eli Zaretskii
2017-04-17 15:55                             ` Perry E. Metzger
2017-04-17 16:13                               ` Eli Zaretskii
2017-04-17  6:02                 ` Eli Zaretskii
2017-04-17 12:32                   ` Perry E. Metzger

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).