all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Glenn Morris <rgm@gnu.org>
Cc: 21492@debbugs.gnu.org, warren ferguson <gobold1y@hotmail.com>
Subject: bug#21492: 25.0.50: Make untabify work nicely with write-file-functions
Date: Wed, 16 Sep 2015 08:55:54 -0400	[thread overview]
Message-ID: <CAFyQvY1GH6EZXctLJSnGDg+iMHJ2JBsC6JFDOxfVMqTJss4+Uw@mail.gmail.com> (raw)
In-Reply-To: <2ufv2edb68.fsf@fencepost.gnu.org>

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

> which not consulting the return value indicates

I reviewed the code of untabify and it is not designed to return any value,
so setting the return value to nil does not hurt.

> Eg hope you like silently breaking every makefile you ever edit

I agree. The user needs to use their due diligence when they add untabify
to write-file-functions. They need to know how and when the hooks work and
the exact outcomes of the functions they add to the hooks. So I do NOT add
untabify to this hook globally.

> and irritating any other users of a shared VCS with whitespace changes.

- I am using Verilog code almost 95% of the time. For that, tabs don't
serve any special intent as in the Makefiles (also, in my career, I have
come across Makefile as the only "language" that needs tabs).
- The version control system we use does not care about white space diffs.
- Other team mates would unknowingly use tabs instead of spaces (they
wouldn't have cared if they used tabs or spaces or knew what difference
that makes). But that caused a lot of visual indentation annoyances and
trouble using stuff like multiple cursors. If you have a column of
contiguous white space stretching multiple lines, with some lines having
spaces and some having tabs, you won't be able to get a straight column of
multiple cursors through that.

So in the end, adding untabify locally only for verilog-mode-hook was a
transparent action.. No one realized that untabification was happening and
I also got to improve my coding experience.

That said, if making untabify returning nil does not break its
functionality when using alone or in correspondence with other functions,
is there any opposition to this commit.

As for the "issue" of vcs white space pollution, the user simply should not
add this function to the hook if they care about the whitespace pollution.

--
Kaushal Modi
On Sep 16, 2015 4:24 AM, "Glenn Morris" <rgm@gnu.org> wrote:

> Kaushal Modi wrote:
>
> > I personally have dealt with the issue where I cannot add untabify
> directly
> > to write-file-functions hook, because untabify does not return nil.
> >
> > I need some sort of custom wrapper that runs untabify and then returns
> nil.
>
> I'm pretty sure this has come up before.
> IMO it's a feature. :)
> Simply adding untabify to write-file-functions without thinking about it
> (which not consulting the return value indicates) is a recipe for trouble.
> Eg hope you like silently breaking every makefile you ever edit,
> and irritating any other users of a shared VCS with whitespace changes.
>

[-- Attachment #2: Type: text/html, Size: 3057 bytes --]

  reply	other threads:[~2015-09-16 12:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-16  3:35 bug#21492: 25.0.50: Make untabify work nicely with write-file-functions Kaushal Modi
2015-09-16  8:24 ` Glenn Morris
2015-09-16 12:55   ` Kaushal Modi [this message]
2015-09-16 13:13     ` Kaushal Modi
2015-09-16 13:14 ` Stefan Monnier
2015-09-16 15:54   ` Kaushal Modi
2015-09-17  1:54     ` Stefan Monnier
2015-09-17  2:54       ` Kaushal Modi

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY1GH6EZXctLJSnGDg+iMHJ2JBsC6JFDOxfVMqTJss4+Uw@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=21492@debbugs.gnu.org \
    --cc=gobold1y@hotmail.com \
    --cc=rgm@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.