1

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

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, privacy policy and cookie policy

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