all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: ERC top/bottom 2*blank lines
       [not found] ` <87k0ta1ean.fsf@zoho.eu>
@ 2020-12-22 17:50   ` Emanuel Berg via General discussion about ERC
  2020-12-23  1:05     ` Emanuel Berg via General discussion about ERC
  0 siblings, 1 reply; 2+ messages in thread
From: Emanuel Berg via General discussion about ERC @ 2020-12-22 17:50 UTC (permalink / raw)
  To: emacs-erc; +Cc: help-gnu-emacs

>> I wonder ... why does ERC have two blank lines at the top
>> and button after you go to the top/bottom of the buffer?
>>
>> Can I configure away this?
>
> [...]
>
> (setq erc-input-line-position -1)

that, with

;; (setq erc-mode-hook nil)
(defun erc-mode-hook-f ()
  ;; [...]
  (erc-scrolltobottom-enable)
  )
(add-hook 'erc-mode-hook #'erc-mode-hook-f)

works when hitting a key, true, but for
`beginnig-of-buffer'/`end-of-buffer', them need (?) to be
replaced by

(defun erc-scroll-to-top ()
  (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 ()
  (interactive)
  (goto-char (point-max))
  (when (and (looking-at "^$")
             (re-search-backward "[[:graph:]]" (point-min) t) )
    (beginning-of-line)
    (recenter -1) ))

and then bound to keys, I have them `C-o i' and `C-o k'... [1]

PS. gmane.emacs.erc.general seems to be dead so I cross post
    this for completeness, with Followup-To: gmane.emacs.help

[1] https://dataswamp.org/~incal/emacs-init/erc-my.el

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ERC top/bottom 2*blank lines
  2020-12-22 17:50   ` ERC top/bottom 2*blank lines Emanuel Berg via General discussion about ERC
@ 2020-12-23  1:05     ` Emanuel Berg via General discussion about ERC
  0 siblings, 0 replies; 2+ messages in thread
From: Emanuel Berg via General discussion about ERC @ 2020-12-23  1:05 UTC (permalink / raw)
  To: emacs-erc; +Cc: help-gnu-emacs

> (defun erc-scroll-to-top () [...]
> (defun erc-scroll-to-bottom () [...]
>
> https://dataswamp.org/~incal/emacs-init/erc-my.el

Oh, there is already a `erc-scroll-to-bottom'.

(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) ))

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-23  1:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87wnxa1mxu.fsf@zoho.eu>
     [not found] ` <87k0ta1ean.fsf@zoho.eu>
2020-12-22 17:50   ` ERC top/bottom 2*blank lines Emanuel Berg via General discussion about ERC
2020-12-23  1:05     ` Emanuel Berg via General discussion about ERC

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.