Gnus development mailing list
 help / color / mirror / Atom feed
From: Andreas Fuchs <asf@void.at>
Cc: ding@gnus.org
Subject: Re: header-sensitive beginning-of-line?
Date: Fri, 09 Nov 2001 12:08:45 +0100	[thread overview]
Message-ID: <E1629Wf-0006N3-00@eris.ath.cx> (raw)
In-Reply-To: <87g07otsm4.fsf@squeaker.lickey.com>


[-- Attachment #1.1: Type: text/plain, Size: 1245 bytes --]

On 2001-11-08, Matt Armstrong <matt+dated+1007876070.52bd2b@lickey.com>
wrote:
> Of course, if point is already at the sweet spot, message-bol should
> then go to the real beginning of line.

This does what you want (I'm not sure if I duplicated some functionality
with message-point-in-header-p, maybe some more experienced gnus hacker
can tell me):

(defun message-point-in-header-p ()
  (let* ((point-in-header (point))
         (body-begin (progn
                       (message-goto-body)
                       (point))))
    (prog1
        (< point-in-header body-begin)
      (goto-char point-in-header))))  ; saves the save-excursion overhead

(defun message-beginning-of-line (&optional n)
  (interactive "p")
  (let ((cur-point (point)))
    (beginning-of-line n)
    (when (message-point-in-header-p)
      (let ((to-point  (save-excursion
                         (end-of-line)
                         (re-search-backward "^[^:]*: " nil t)
                         (match-end 0))))
      (unless (= cur-point to-point)
        (goto-char to-point))))))
      

(define-key message-mode-map "\C-a" 'message-beginning-of-line)

Have fun,
-- 
Andreas Fuchs, <asf@acm.org>, asf@jabber.at, antifuchs

[-- Attachment #2: Type: application/pgp-signature, Size: 231 bytes --]

  reply	other threads:[~2001-11-09 11:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-09  0:47 Benjamin Rutt
2001-11-09  5:34 ` Matt Armstrong
2001-11-09 11:08   ` Andreas Fuchs [this message]
2001-11-09 12:20     ` Colin Marquardt
2001-11-09  8:48 ` Kai Großjohann
2001-11-11  9:17   ` Karl Eichwalder
2001-11-11 18:12     ` Benjamin Rutt
2001-11-11 19:28       ` Kai Großjohann
2001-11-09 14:31 ` Kai Großjohann
2001-11-09 14:43   ` Kai Großjohann
2001-11-09 15:23     ` Benjamin Rutt
2001-11-09 16:08       ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1629Wf-0006N3-00@eris.ath.cx \
    --to=asf@void.at \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).