From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Emanuel Berg via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: ERC no (shown) blank lines at top/bottom of buffer Date: Wed, 23 Dec 2020 07:12:06 +0100 Message-ID: <87o8il9hl5.fsf@zoho.eu> Reply-To: Emanuel Berg Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31121"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: emacs-devel@gnu.org Cancel-Lock: sha1:ygYFJ9wjbpaDXWPF3Q0gkhSibEw= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 23 07:33:52 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1krxia-0007zJ-RC for ged-emacs-devel@m.gmane-mx.org; Wed, 23 Dec 2020 07:33:52 +0100 Original-Received: from localhost ([::1]:37252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1krxiZ-0005Nr-Pb for ged-emacs-devel@m.gmane-mx.org; Wed, 23 Dec 2020 01:33:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krxO5-00025e-WC for emacs-devel@gnu.org; Wed, 23 Dec 2020 01:12:42 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]:37540) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1krxO4-0004vK-D2 for emacs-devel@gnu.org; Wed, 23 Dec 2020 01:12:41 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1krxNz-0005qR-SV for emacs-devel@gnu.org; Wed, 23 Dec 2020 07:12:35 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Mail-Copies-To: never Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:261568 Archived-At: 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