From f78a8b1a4ec40639c22cdc7cf8800154327ce89d Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 16 Feb 2022 01:02:06 -0800 Subject: [oni-gnus] Make point always move to the ‘:’ after the size --- oni-gnus.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/oni-gnus.el b/oni-gnus.el index aa7e9a5..9c45931 100644 --- a/oni-gnus.el +++ b/oni-gnus.el @@ -34,6 +34,24 @@ (require 'oni-data-dir) (require 'sendmail) +(defun oni-gnus-goto-bracket-then-colon () + "Find the first occurrence of [ on the current line and then :. +The default function ‘gnus-goto-colon' only goes to the first +colon and then stops there. When there is a date with a time +involved, it just goes to the time, not the colon after the size +of the email." + (move-beginning-of-line 1) + (let ((eol (point-at-eol))) + (goto-char (or (text-property-any (point) eol 'gnus-position t) + (progn (search-forward "[" eol t) + (search-forward ":" eol t)) + (point))))) + +;;; Make sure that repositioning point in Gnus means that first the bracket is +;;; found and then the following colon, instead of the first colon which is +;;; possibly one from a time stamp. +(defalias 'gnus-summary-position-point 'oni-gnus-goto-bracket-then-colon) + (setq gnus-directory (oni-data-dir-locate "News") gnus-article-save-directory gnus-directory gnus-cache-directory gnus-directory -- cgit v1.2.3-54-g00ecf