unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: emacs-devel@gnu.org
Subject: Re: Proposal: diff-remove-trailing-blanks
Date: Thu, 01 May 2008 03:04:08 +0200	[thread overview]
Message-ID: <prs66div.fsf@telefonica.net> (raw)
In-Reply-To: 4819101D.5010004@ig.com.br

Vinicius Jose Latorre <viniciusjl@ig.com.br> writes:

>>>      (while (re-search-forward "^[+!>].*?[ \t]+$" (point-max) t)
>>>     
>>
>> As every change indicator is followed by a white space in non-unified
>> format, this regexp matches every change on normal and context
>> formats. This is not bad, as the trailing whitespace condition is tested
>> again below for the source file, which is what matters. But then, you
>> could use a simpler regexp above ("^[+!>]", for instance), for behaving
>> the same with diff formats.
>>   
>
> Ok, but the search in diff buffer is only for modified lines with
> trailing blanks,
> so there is less finds/replacements in the source file.

Precisely, my point is that non-unified format has a trailing blank for
empty new lines, even when the new line has no trailing blank. You can
check that yourself adding an empty new line to a file, diff it in
`context' or `normal' format and you can check that the diff has a blank
space after the `>' or `+'.

[snip]

>> Do you intend to install it on CVS soon?
>>   
>
> Well, can I install diff-kill-trailing-whitespace
> and diff-show-trailing-whitespace into diff-mode?

The reason I would prefer diff-mode.el for those features, is that you
can also install a key sequence for it (I suggested C-c C-k). If you do
not receive authorization from an Emacs maintainer for adding the
functions to diff-mode, just rename them to whitespace-kill-from-diff or
something and install them in whitespace.el.

-- 
Oscar





  reply	other threads:[~2008-05-01  1:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-26 14:59 Proposal: diff-remove-trailing-blanks Óscar Fuentes
2008-04-26 18:44 ` Dan Nicolaescu
2008-04-26 19:38   ` Óscar Fuentes
2008-04-26 19:50   ` Vinicius Jose Latorre
2008-04-26 20:08     ` Óscar Fuentes
     [not found]       ` <4813A244.4050908@ig.com.br>
2008-04-26 22:07         ` Óscar Fuentes
2008-04-27  2:30           ` Vinicius Jose Latorre
2008-04-27  2:59             ` Vinicius Jose Latorre
2008-04-27  4:04             ` Óscar Fuentes
     [not found]               ` <48146DF3.3090706@ig.com.br>
     [not found]                 ` <48147BC0.6080406@ig.com.br>
2008-04-27 15:15                   ` Óscar Fuentes
2008-04-27 17:30                     ` Vinicius Jose Latorre
2008-04-27 20:05                       ` Óscar Fuentes
2008-05-01  0:34                         ` Vinicius Jose Latorre
2008-05-01  1:04                           ` Óscar Fuentes [this message]
2008-05-02 14:22                           ` Stefan Monnier
2008-05-07  0:25                             ` Vinicius Jose Latorre
2008-05-07  2:04                               ` Stefan Monnier
2008-05-10  0:45                                 ` Vinicius Jose Latorre

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=prs66div.fsf@telefonica.net \
    --to=ofv@wanadoo.es \
    --cc=emacs-devel@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).