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


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

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