Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: info-gnus-english@gnu.org
Subject: Article: Toggle headers visibility
Date: Fri, 17 May 2013 01:42:40 +0200	[thread overview]
Message-ID: <87obcav6dr.fsf@VLAN-3434.student.uu.se> (raw)

I'm trying to get the headers not to show (none of them). This I
managed to do with the call below marked with [1]. (The code is pasted
last.)

But, sometimes I need the data in the headers:

1) Are those stored in local variables? If so, that would be easier,
to write access defuns like `kill-article-author' and the like.

2) If not, I'd like to strike a command, view the headers (some of
them), move point (etc.), and get them.

So I wrote the defun at [2]. That actually works, only I have to read
the article again manually from the summary - is there a way to do it
programatically, like `gnus-article-redraw' or something?

But, once I've done that, I try to hide the headers again. But, then,
the defun at [3] won't have any affect (or rather, the highlight of
the From header face changes - ? - that's all). But, didn't it work
the first time around?

I'm pretty confused by this, so any explanations would be great. If
you have another solution to this problem, I'd be happy to read that,
as well. Cheers.

The code:

;;; headers
;; won't work the second time - [3]
(defun gnus-article-hide-headers ()
  "Hide all headers when showing an article."
  (interactive)
  (setq gnus-visible-headers "^XXX") )
;; works - [2]
(defun gnus-article-show-some-headers ()
  "Show those headers that I've needed so far."
  (interactive)
  (setq gnus-visible-headers "^From:\\|^Newsgroups:") )
(gnus-article-hide-headers) ; first, the XXX method works [1]
(defalias 'hide-headers 'gnus-article-hide-headers)
(defalias 'show-headers 'gnus-article-show-some-headers)

-- 
Emanuel Berg - programmer (hire me! CV below)
computer projects: http://user.it.uu.se/~embe8573
internet activity: http://home.student.uu.se/embe8573

             reply	other threads:[~2013-05-16 23:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 23:42 Emanuel Berg [this message]
2013-05-17 19:05 ` 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=87obcav6dr.fsf@VLAN-3434.student.uu.se \
    --to=embe8573@student.uu.se \
    --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).