aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2022-02-16 01:02:06 -0800
committerGravatar Tom Willemse2022-02-16 01:02:06 -0800
commitf78a8b1a4ec40639c22cdc7cf8800154327ce89d (patch)
tree9e4e60f479c1fd2bba201dc2414775bc535afc51
parent13e7e8767f513a6402fafaa01373d60bbae48dcf (diff)
downloademacs-config-f78a8b1a4ec40639c22cdc7cf8800154327ce89d.tar.gz
emacs-config-f78a8b1a4ec40639c22cdc7cf8800154327ce89d.zip
[oni-gnus] Make point always move to the ‘:’ after the size
-rw-r--r--oni-gnus.el18
1 files changed, 18 insertions, 0 deletions
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