1

What is a good way to replace (line-end-position) with a function that doesn't include trailing whitespace?

0

1 Answer 1

2

Without an argument, (line-end-position) is functionally equivalent to (save-excursion (end-of-line) (point)). Armed with that knowledge, your custom function could be defined as follows:

(defun my-line-end-position ()
  (save-excursion
    (end-of-line)
    (skip-syntax-backward "-")
    (point)))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.