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


1 Answer 1


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 ()
    (skip-syntax-backward "-")

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.