emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: Esc-d deletes too much in a shell script


From: Peter Dyballa
Subject: Re: Esc-d deletes too much in a shell script
Date: Mon, 17 Apr 2006 12:36:35 +0200


Am 17.04.2006 um 08:38 schrieb Eli Zaretskii:

From: Peter Dyballa <address@hidden>
Date: Sun, 16 Apr 2006 21:54:34 +0200

In a (Bourne) shell script I was editing the "envelope" of a set of
echo statements because it was too long (copied from another file),
so I pressed Esc-d at the point where the superfluity began -- and
too much was deleted!

Thank you for your report, but I need a much more powerful crystal
ball than what I have now to guess what exactly did you see as a
problem.  Please show only the relevant fragment of the script, not
all of it, please show where was the cursor when you typed ESC-d and
what it deleted, and please tell what you expected it to delete at
that point.

Another such case happens at line #21 in the above example. When the
cursor is for example in column #24 of this line and I press Esc-d,
again too much is deleted.

``Another case''?  So what was the ``first case''?

First case here (with leading line numbers):
Y cursor position
   55       echo "################################################"
   56   fi
   57   #
   58   echo "\$\$\$\$\$\$\$\$\$ $0 \$\$\$\$\$\$\$\$\$"

After Esc-d:

Y cursor position
   55       echo "############################################
   56   #
   57   echo "\$\$\$\$\$\$\$\$\$ $0 \$\$\$\$\$\$\$\$\$"


Here is the state after:

        
##################################################################### ###
#####
        #
        echo "^^^^^^^^^ $0 ^^^^^=`date "+%+"`

Are you complaining that it removed the newline as well, which you
didn't expect?

No. Also the next line was partially deleted (the variable's name `Datum´).

  (M-f from any point will show you how far will ESC-d
delete from that point, and C-h s will show you the buffer's syntax
table.)

Outside of "words" of `^´ or `#´ Esc-d deletes correctly till the end
of the word, i.e. up to but not including the `"´. GNU Emacs was
launched with -Q when it fails to delete-word in lines #21, 51, 55,
and 58 of the above example.

Again, please show where the position of point in each one of these
lines.

Here is the second case (with leading line numbers):

   20   #
                                Y cursor position
   21   echo "^^^^^^^^^ $0 ^^^^^^^^^"
   22   Datum=`date "+%+"`
   23    Fund=0

which becomes afterwards:

   20   #
                                Y cursor position
   21   echo "^^^^^^^^^ $0 ^^^^^=`date "+%+"`
   22    Fund=0


The next case is:

   50   else
                                                  Y cursor position
   51       echo "############################################"
   52       echo "Your .login might already contain all things"
   53       echo "needed to make MacTeX work in X11 ..."

which becomes afterwards:

   50   else
                                                  Y cursor position
51 echo "################################ "Your .login might already contain all things"
   52       echo "needed to make MacTeX work in X11 ..."


The last case is:

   56   fi
   57   #
                                              Y cursor position
   58   echo "\$\$\$\$\$\$\$\$\$ $0 \$\$\$\$\$\$\$\$\$"


which becomes:

   56   fi
   57   #
                                              Y cursor position
   58   echo "\$\$\$\$\$\$\$\$\$ $0 \$\$\$\$\$




In addition, your mailer wraps lines, so the script arrives heavily
munged and hard to read.  Could you please do something to fix that?

Sorry, I have no idea what to do! When I receive from another (Apple) Mail user an eMail that originally contained lines longer than 70 or such columns they appear on my screen as of original length. I, too, can complain about other MUAs like Thunderbird or such that do not seem to work right. I think Mail converts the eMail body as typed in UTF-8 to 7-bit MIME to send it through relays without falsification to the receiver ...

I tried to answer myself citing a long line from my original post, while putting Mail off-line. So I could examine the outgoing mailbox. I found there this line:

        >    41                      Anzahl=3D`top -FRl 1 | grep Finder | wc 
-l`      =
         # OR =20
        > loginwindo OR ATSServer OR SystemUIServer OR Dock ...

It looks like correctly converted to MIME. The single `=´ stands for a line continuation, the compound `=20´ seems to indicate that the line was broken at a word boundary -- probably not so clever! But reading my eMail I see the three lines from above as exactly one cited line ... You can't teach your MUA to handle MIME encoded eMails cleverly? Because, when I send this eMail to another account and I read this eMail in Thunderbird 1.5 (December 2005) I see the line as one ...

--
Greetings

  Pete

To be is to do.
                       -- I. Kant
To do is to be.
                       -- A. Sartre
Yabba-Dabba-Doo!
                       -- F. Flintstone






reply via email to

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