[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: last-non-white-space-on-line
From: |
Andreas Roehler |
Subject: |
Re: last-non-white-space-on-line |
Date: |
Tue, 06 Jun 2006 13:23:21 +0200 |
User-agent: |
KNode/0.9.2 |
Arndt Jonasson wrote:
> Andreas Roehler wrote:
>> is there a function known to jump to the last
>> non-whitspace char in line - as (back-to-indentation)
>> does in the other direction?
>>
>> Could write something like
>>
>> (defun last-non-white-space-on-line ()
>> " "
>> (interactive)
>> (end-of-line)
>> (skip-chars-backward "[ \t]"))
>>
>> Nonetheles, would prever to use an already existing
>> macro.
>
> Not one function of course, but I would do C-e M-\
> This deletes the whitespace, but that's what I want to happen
> anyway if I'm not adding more to the line.
Basicaly you are right, don't imagine any use of
whitespaces at the end of line.
Thanks
Andreas Roehler
BTW.: Got a hint concerning an error in the previous
draft. Here a better one:
(defun last-non-white-space-on-line ()
" "
(interactive)
(end-of-line)
(skip-chars-backward " \t"))
;; To do it with (delete-horizontal-space):
(defun last-non-white-space-on-line ()
" "
(interactive)
(end-of-line)
(delete-horizontal-space)
;; (skip-chars-backward " \t")
(backward-char 1))