[Top][All Lists]

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

bug#2887: Suggestions for simple.el

From: Arni Magnusson
Subject: bug#2887: Suggestions for simple.el
Date: Sat, 4 Apr 2009 23:35:28 -0000 (GMT)
User-agent: SquirrelMail/1.4.10a

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



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.


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.


Users can move lines up and down more effectively thank with


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.


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.


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.


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.


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.


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.


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

reply via email to

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