Subject: Re: bug#2887: Suggestions for simple.el

From: "Arni Magnusson" <[email-masked]>
Date: Sat, 4 Apr 2009 23:35:28 -0000 (GMT)

Thank you, Stefan, for the prompt reply and interest. Please find below my
list of raisons d'être.

Arni

`backward-delete-word'
`delete-word'

Users can delete words while leaving the kill-ring unchanged. For example,
the user has copied a table from somewhere and is now deleting some words
before yanking the table where it belongs. It would be frustrating for the
user to yank and see recently deleted words instead of the table.

`kill-line-or-region'

Users can bind C-k to kill lines and regions (do what I mean), as an
alternative to the default C-k and C-w setup.

`pull-line-down'
`pull-line-up'

Users can move lines up and down more effectively thank with
`transpose-lines'.

`pos-at-beginning-of-line'
`pos-at-end-of-line'

Useful when writing a variety of editing functions. Should be in simple.el
for the same resons as `line-beginning-position' and `line-end-position'
are there.

`zap-back-to-char'
`zap-up-to-char'

Zapping is typically to delete garbage until some important location. The
existing `zap-to-char' often deletes the beginning of that important
location, an opening brace or the like.

`clean-trails'

Like `delete-trailing-white', but reports how many lines were cleaned, and
deletes ^M as well. Many programs and programmers write files with
trailing spaces and ^M glyphs. It's nice to be able to clean those and get
body count in one keystroke.

`delete-all-blank-lines'

It's often useful to get rid of extra vertical spacing in source code,
output files, etc., sometimes undoing after enjoying the squeezed view.
Without this command, it would take a lot of keystrokes to delete all
blank lines while retaining the cursor buffer position.

`delete-indentation-nospace'

The `delete-indentation' command is very useful, but it often creates an
unwanted space. Users will probably bind this command to a keystroke close
to the `delete-indentation' keystroke.

`goto-longest-line'

Users can find out the maximum width (columns) of a text file, to check
the coding style or for some other reason. Sometimes it's easiest to call
"wc -L" via `shell-command' or `dired-do-shell-command', but
`goto-longest-line' will often be quicker and moves the cursor to the
longest line, for closer examination.

I remember when I wrote this command I thought about implementing a
separate non-interactive function called `longest-line' that would just
return the line number. Then `goto-longest-line' would call `longest-line'
to do the calculations, and other functions might call `longest-line' with
some other purpose than moving the cursor to it. I would be happy to
contribute a two-function implementation instead, since `longest-line'
might be useful for many users.

`downcase-word-or-region'
`upcase-word-or-region'

Users can bind M-l and M-u to downcase/upcase words or regions (do what I
mean), as an alternative to the default C-x C-l, C-x C-u, M-l, and M-u
setup.