Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Hikaru Ichijyo <ichijyo@macross.sdf.jp>
To: info-gnus-english@gnu.org
Subject: Re: binding a summary key to *two* commands
Date: Tue, 20 Jan 2015 21:43:24 -0600	[thread overview]
Message-ID: <8xxvbk094tf.fsf@village.keycorner.org> (raw)
In-Reply-To: <mailman.18212.1421777358.1147.info-gnus-english@gnu.org>

Ok, the function I was trying to make, debugged, in case anyone wants
it.  If you press "d", it sets the expirable mark and moves forward
without reading the next message (good if you're in the middle of a lot
of trash messages); if you press "D", it sets expirable and reads the
next one (good if you're in a lot of message you want to read but not
keep).  When RET is pressed in the Summary buffer on an article that
isn't yet being displayed, it calls gnus-summary-scroll-up, which only
does what it's name says if the article had already been displayed.  If
not (as in this case), it reads the article under point in the Summary.


(defun delete-then-read-next ()
  (interactive)
  (gnus-summary-mark-as-expirable 1)
  (gnus-summary-scroll-up 1)
)
(add-hook 'gnus-summary-mode-hook (lambda ()
    (local-set-key "D" 'delete-then-read-next)
    (local-set-key "d" 'gnus-summary-put-mark-as-expirable-next)
    (local-set-key "u" 'gnus-summary-clear-mark-forward)
    (local-set-key "x" 'gnus-summary-expire-articles)
    (local-set-key "s" 'gnus-summary-move-article)))

-- 
He that would make his own liberty secure must guard even his enemy from
oppression; for if he violates this duty, he establishes a precedent
that will reach to himself.
					--Thomas Paine

  parent reply	other threads:[~2015-01-21  3:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 17:54 Hikaru Ichijyo
2015-01-20 18:08 ` Adam Sjøgren
     [not found] ` <mailman.18212.1421777358.1147.info-gnus-english@gnu.org>
2015-01-20 22:11   ` Hikaru Ichijyo
2015-01-21  3:43   ` Hikaru Ichijyo [this message]
2015-01-22 22:53     ` Emanuel Berg

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=8xxvbk094tf.fsf@village.keycorner.org \
    --to=ichijyo@macross.sdf.jp \
    --cc=info-gnus-english@gnu.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).