I wanted something that highlighted a snippet of code that I wanted to keep in mind - NOT marking it, I just want it to pop out visually. As a bonus, I'd like it to get pushed to the mark ring so I can navigate back to it easily. highlight.el and similar packages are annoying though, because if the region is not active, they'll highlight the entire buffer - for what reason, I have no idea but it makes them unusable imo, as I want to be able to tag stuff with a single keystroke. So:
;; highlights line if region not active (defun highlight-region (beg end) (interactive "r") (unless (use-region-p) (setq beg (line-beginning-position)) (setq end (line-end-position))) (push-mark beg) (set-text-properties beg end '(font-lock-face (:background "yellow" :foreground "black") highlighted t help-echo "highlighted")))
This works great, along with some related functions I stole from somewhere. But what I'd like is for the full line, from col 1 to col 80, to be highlighted - not just the columns that contains text and none of the overflow at col 81+. I'd need something like
(setq end (point-at-col 80))
does something like this exist?