unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ERC no (shown) blank lines at top/bottom of buffer
@ 2020-12-23  6:12 Emanuel Berg via Emacs development discussions.
  0 siblings, 0 replies; only message in thread
From: Emanuel Berg via Emacs development discussions. @ 2020-12-23  6:12 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-23  6:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23  6:12 ERC no (shown) blank lines at top/bottom of buffer Emanuel Berg via Emacs development discussions.

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).