help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: ediff & No newline at end of file


From: sandro dentella
Subject: Re: ediff & No newline at end of file
Date: Sat, 21 Jun 2008 10:45:52 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

On Sat, Jun 21, 2008 at 10:32:42AM +0200, Thierry Volpiatto wrote:
> sandro dentella <address@hidden> writes:
> 
> > On 21 Giu, 07:03, Thierry Volpiatto <address@hidden>
> > wrote:
> >> Hi,
> >> that will not correct your problem but help in the future.
> >>
> >> ,----
> >> | ;; Add newline at end of files
> >> | (setq require-final-newline t)
> >> `----
> >> Now when you edit a file and you save it it will have a newline at end.
> >
> >
> > I already have it, the fact is that I use if with files generated by
> > others as well...
> You can easily write a small function that take as args file1 and file2
> and modify these files before calling ediff.
> something like:

my wrote my 'emadiff' as:

  for f in $1 $2
  do
    if [ $(tail -n1 $f|wc -c |sed 's/ //') -gt 0 ] ; then
        echo -e "\n" >> $f
    fi
  done
  #gnuclient --eval "(ediff-buffers \"$f1\"  \"$f2\")"  $f1 $f2
  
  emacs --eval "(ediff-files \"$1\"  \"$2\")"  
  
so does exactly what you suggest, but I think is a workaround that I'd like
to avoid. It seems strange to me that emacs just stops working when it could
just issue a waring on nothing at all. I'd expect a configuration parameter
to silent it as there's a configuration parameter that says "add a newline
at the end".

Thanks anyhow

sandro
*:-)





reply via email to

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