mucking around in .changes file on linux/ubuntu

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

mucking around in .changes file on linux/ubuntu

Jerome Peace

Hi all,

At some point in making and finding bugs, I am left with having to pick up pieces. On my mac I could always just read the whole changes file into a text editor and extract manually the tail bit.

Having moved on to Ubuntu 8.04 my tools don't seem to match my needs.

The Gedit editor refuses to read the text because it is in a format it can't decode. It tries Utf-8 and latin1.

The Emacs editor will gladly read in the file but because the line endings are cr rather than crlf I get a file all on one line.

My emacs skills are rusty so I've not figured out what to do next.

Is there anyone out there who has deal with changes files and linux editors? What might work most elegantly or robustly?

Yours in curiosity and service, --Jerome Peace


     
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: mucking around in .changes file on linux/ubuntu

laurent laffont
In Emacs:

M-x revert-buffer-with-coding-system   utf-8-mac

Laurent Laffont


On Sun, Feb 14, 2010 at 7:26 AM, Jerome Peace <[hidden email]> wrote:

Hi all,

At some point in making and finding bugs, I am left with having to pick up pieces. On my mac I could always just read the whole changes file into a text editor and extract manually the tail bit.

Having moved on to Ubuntu 8.04 my tools don't seem to match my needs.

The Gedit editor refuses to read the text because it is in a format it can't decode. It tries Utf-8 and latin1.

The Emacs editor will gladly read in the file but because the line endings are cr rather than crlf I get a file all on one line.

My emacs skills are rusty so I've not figured out what to do next.

Is there anyone out there who has deal with changes files and linux editors? What might work most elegantly or robustly?

Yours in curiosity and service, --Jerome Peace



_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: mucking around in .changes file on linux/ubuntu

Enrico Schwass-2
In reply to this post by Jerome Peace
Jerome Peace <[hidden email]> writes:

Hello,

emacs can do what you want.

Try this sequence

Ctrl-x Enter R

to revisit a file in different encoding

dos, unix, windows might help as a start, use tab-completion for more

Furthermore you can use Alt-% to replace unprintable characters.

Dont know its worth, but you could implement a whole squeakbin emacs
mode to do regular editings.

hexl-mode is useful to see a file as hex dump

hth
Enno

> At some point in making and finding bugs, I am left with having to
> pick up pieces. On my mac I could always just read the whole changes
> file into a text editor and extract manually the tail bit.
>
> Having moved on to Ubuntu 8.04 my tools don't seem to match my needs.
>
> The Gedit editor refuses to read the text because it is in a format it
> can't decode. It tries Utf-8 and latin1.
>
> The Emacs editor will gladly read in the file but because the line
> endings are cr rather than crlf I get a file all on one line.
>
> My emacs skills are rusty so I've not figured out what to do next.
>
> Is there anyone out there who has deal with changes files and linux
>editors? What might work most elegantly or robustly?
>
> Yours in curiosity and service, --Jerome Peace
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: mucking around in .changes file on linux/ubuntu

David T. Lewis
In reply to this post by Jerome Peace
On Sat, Feb 13, 2010 at 10:26:13PM -0800, Jerome Peace wrote:

>
> Hi all,
>
> At some point in making and finding bugs, I am left with having to pick up pieces. On my mac I could always just read the whole changes file into a text editor and extract manually the tail bit.
>
> Having moved on to Ubuntu 8.04 my tools don't seem to match my needs.
>
> The Gedit editor refuses to read the text because it is in a format it can't decode. It tries Utf-8 and latin1.
>
> The Emacs editor will gladly read in the file but because the line endings are cr rather than crlf I get a file all on one line.
>
> My emacs skills are rusty so I've not figured out what to do next.
>
> Is there anyone out there who has deal with changes files and linux editors? What might work most elegantly or robustly?
>
> Yours in curiosity and service, --Jerome Peace
>

I use a local one-liner shell script that I call "sqcat":

#!/bin/sh
cat $* | tr '\015' '\012'

And another called "sqless"

#!/bin/sh
sqcat $* | less

These are handy for viewing Smalltalk formatted files from the unix
command line.

If I have a scrambled image and want to edit the end of the changes
with a vi editor, I do this:

$ sqcat squeak.changes | tail -4000 > changes.txt

The puts the last 4000 lines of the changes file into a text file
for editing.

When I am ready to to use the text file in Squeak, I use a file
browser and do the "remove line feeds" menu option before using
the file.

Dave

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: mucking around in .changes file on linux/ubuntu

Chris Kassopulo-2
In reply to this post by Jerome Peace
On Sun, 14 Feb 2010 01:26:13 -0500, Jerome Peace  
<[hidden email]> wrote:

> Having moved on to Ubuntu 8.04 my tools don't seem to match my needs.
>
> The Gedit editor refuses to read the text because it is in a format it  
> can't decode. It tries Utf-8 and latin1.
>
> The Emacs editor will gladly read in the file but because the line  
> endings are cr rather than crlf I get a file all on one line.
>
> My emacs skills are rusty so I've not figured out what to do next.
>
> Is there anyone out there who has deal with changes files and linux  
> editors? What might work most elegantly or robustly?
>
> Yours in curiosity and service, --Jerome Peace

Try "scite" (available through Synaptic). It is a programming editor that
handles EOL more gracefully. You can save a file preserving or changing  
line
end coding.

 From their documentation:

view.eol
Setting this to 1 makes SciTE display the characters that make up line  
ends.
This looks similar to (CR), (LF), or (CR)(LF). This is useful when using  
files
created on another operating system with software that is picky about line  
ends.

eol.mode
The default EOL mode (characters that make up line ends) depends on your  
platform.
You can overwrite this behaviour by setting the property to
     LF for UNIX format
     CR for Macintosh format
     CRLF for DOS/Windows format
As you see, Windows combines the best of the other worlds ;-)

eol.auto
This setting overrides the eol.mode value and chooses the end of line  
character
sequence based on the current contents of the file when it is opened. The  
line
ending used the most in the file is chosen.

It also does syntax highlighting and recognizes smalltalk although I've  
never
tried it.

Chris

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: mucking around in .changes file on linux/ubuntu

Antonio Moreno
In reply to this post by Jerome Peace
Try Smultron.

Regards

El sáb, 13-02-2010 a las 22:26 -0800, Jerome Peace escribió:
Hi all,

At some point in making and finding bugs, I am left with having to pick up pieces. On my mac I could always just read the whole changes file into a text editor and extract manually the tail bit.

Having moved on to Ubuntu 8.04 my tools don't seem to match my needs.

The Gedit editor refuses to read the text because it is in a format it can't decode. It tries Utf-8 and latin1.

The Emacs editor will gladly read in the file but because the line endings are cr rather than crlf I get a file all on one line. 

My emacs skills are rusty so I've not figured out what to do next. 

Is there anyone out there who has deal with changes files and linux editors? What might work most elegantly or robustly? 

Yours in curiosity and service, --Jerome Peace


      
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: mucking around in .changes file on linux/ubuntu

K. K. Subramaniam
In reply to this post by Jerome Peace
On Sunday 14 February 2010 11:56:13 am Jerome Peace wrote:
> Is there anyone out there who has deal with changes files and linux
> editors? What might work most elegantly or robustly?
I run the file through a filter while viewing/editing them in vi. On opening
   !Gtr \\r \\n

and just before writing:
   !Gtr \\n \\r

Kate (text editor in KDE) preserves line endings.

Subbu
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: mucking around in .changes file on linux/ubuntu

Jerome Peace
In reply to this post by David T. Lewis
Hi Dave, Subbu, Chris, Laurent, antonio

Thank you for the many solutions to my problems. Many alternates are what I was looking for.

Many of your solutions look useful. All look interesting.

I will try them soon.

Cheers.

Yours in curiosity and service, --Jerome Peace

--- On Sun, 2/14/10, David T. Lewis <[hidden email]> wrote:

> From: David T. Lewis <[hidden email]>
> Subject: Re: [Newbies] mucking around in .changes file on linux/ubuntu
> To: "A friendly place to get answers to even the most basic questions about Squeak." <[hidden email]>
> Date: Sunday, February 14, 2010, 8:41 AM
> On Sat, Feb 13, 2010 at 10:26:13PM
> -0800, Jerome Peace wrote:
> >
> > Hi all,
> >
> > At some point in making and finding bugs, I am left
> with having to pick up pieces. On my mac I could always just
> read the whole changes file into a text editor and extract
> manually the tail bit.
> >
> > Having moved on to Ubuntu 8.04 my tools don't seem to
> match my needs.
> >
> > The Gedit editor refuses to read the text because it
> is in a format it can't decode. It tries Utf-8 and latin1.
> >
> > The Emacs editor will gladly read in the file but
> because the line endings are cr rather than crlf I get a
> file all on one line.
> >
> > My emacs skills are rusty so I've not figured out what
> to do next.
> >
> > Is there anyone out there who has deal with changes
> files and linux editors? What might work most elegantly or
> robustly?
> >
> > Yours in curiosity and service, --Jerome Peace
> >
>
> I use a local one-liner shell script that I call "sqcat":
>
> #!/bin/sh
> cat $* | tr '\015' '\012'
>
> And another called "sqless"
>
> #!/bin/sh
> sqcat $* | less
>
> These are handy for viewing Smalltalk formatted files from
> the unix
> command line.
>
> If I have a scrambled image and want to edit the end of the
> changes
> with a vi editor, I do this:
>
> $ sqcat squeak.changes | tail -4000 > changes.txt
>
> The puts the last 4000 lines of the changes file into a
> text file
> for editing.
>
> When I am ready to to use the text file in Squeak, I use a
> file
> browser and do the "remove line feeds" menu option before
> using
> the file.
>
> Dave
>
Ah. I new there must be a way to get linux to do the work. :)

--Jer


     
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: mucking around in .changes file on linux/ubuntu

Jerome Peace
In reply to this post by Enrico Schwass-2
Hi Enno

Thanks for your solution too.

--Jer

--- On Sun, 2/14/10, Enrico Schwass <[hidden email]> wrote:

> From: Enrico Schwass <[hidden email]>
<snip>
>


     
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners