nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] Add function to convert leading whitespace to tabs


From: Benno Schulenberg
Subject: Re: [Nano-devel] Add function to convert leading whitespace to tabs
Date: Sun, 19 Oct 2014 22:22:31 +0200

On Sun, Oct 19, 2014, at 17:10, Erik Lundin wrote:
> I've attached a revised patch with the key-mappings removed and basic
> undo-support.

Nice.

However, two things.  When not assigning a default shortcut to
whitespace_to_tabs(), then there is no need for most of the
changes to global.c -- adding an empty "" shortcut to the list
is pointless.  When adding a short help text for a function,
then it should really also have a default shortcut.

The question is: do we want to eat up one of the few remaining
unassigned key combos for a function that very, very few people
are ever going to use?  (No one ever asked for it so far.)

You see, there may be still more functions that people may want
(for an example, see https://savannah.gnu.org/patch/?8208), and
if we add a help line for each such function, then soon the main
help text (^G) will show several lines explaining functions that
are really available because they are not bound to any key.  (Or
we should decide that any unbound function should not be shown
in the help text.)  --  Opinions?

Oh, the other thing: when the tab size is eight, and I have say
two leading spaces followed by a tab, then whitespace_to_tabs()
converts this to two tabs.  This is not correct, because in fact
two spaces plus a tab take up the same size as a single tab.  You
cannot simply count the number of tabs and spaces independently,
you also have to take into account their order: a tab plus two
spaces converts to two tabs, but two spaces plus a tab to just a
single tab, in my opinion.

Benno

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service




reply via email to

[Prev in Thread] Current Thread [Next in Thread]