emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ERC no (shown) blank lines at top/bottom of buffer


From: Emanuel Berg
Subject: ERC no (shown) blank lines at top/bottom of buffer
Date: Wed, 23 Dec 2020 07:12:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

I have tried some Elisp for ERC [code last] this night and it
is such a big and immediately apparent improvement if I dare
say, at least to my use case (projector resolution 640x480,
Linux VT, only 30 lines, see this screenshot [1]).

But even if it wasn't a practical concern, just esthetically,
it looks soo much better!

As for the implementation, maybe that can be improved. But it
works, I have tried it. It needed some keybinding (the keys
that usually do `beginning-of-buffer' and `end-of-buffer') and
required some integration with my other Elisp for ERC [2], but
other than that, yeah, ready to rumble.

Note that this: (erc-scrolltobottom-enable) - not mine BTW -
that improves the situation, when you start typing, but it
doesn't do anything for moving to the top/end of the buffer
using the all-Emacs methods.

(defun erc-scroll-to-top-no-blanks ()
  (interactive)
  (goto-char (point-min))
  (when (and (looking-at "^$")
             (re-search-forward "[[:graph:]]" (point-max) t) )
    (beginning-of-line)
    (recenter 0) ))

(defun erc-scroll-to-bottom-no-blanks ()
  (interactive)
  (goto-char (point-max))
  (when (and (looking-at "^$")
             (re-search-backward "[[:graph:]]" (point-min) t) )
    (beginning-of-line)
    (recenter -1) ))

[1] https://dataswamp.org/~incal/figures/emacs/erc-gnus.png

[2] e.g., `erc-next-buffer', line 82 -
    https://dataswamp.org/~incal/emacs-init/erc-my.el - BTW
    also basic stuff, it feels strange one has to (?) set that
    up oneself - why don't you add it (if it isn't there
    already, if so, please tell me) but again, as for the
    implementation, as long as it does the same or virtually
    the same I'm sure some of you guys can write it in better
    Lisp, so be my guest :)

Happy holidays Emacs hackers all around the world! <3

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]