Gnus development mailing list
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
Subject: Re: Reloading info files
Date: Sat, 06 Sep 2003 07:58:36 +1000	[thread overview]
Message-ID: <87k78maodv.fsf@zip.com.au> (raw)
In-Reply-To: <v9vfs8fqbv.fsf_-_@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Thu, 04 Sep 2003 18:53:08 +0200")

Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:
>
> (defun rs-info-reload ()
>   "Reload current info node."

You can enhance that by saving point as line+column, and the window
position as a line, to stop it jumping around too much on small
changes in the re-read text.  Code below from the emacs cvs.


;; It's perhaps a bit nasty to kill the *info* buffer to force a re-read,
;; but at least it keeps this routine (which is only for the benefit of
;; makeinfo-buffer) out of the way of normal operations.
;;
(defun Info-revert-find-node (filename nodename)
  "Go to an info node FILENAME and NODENAME, re-reading disk contents.
When *info* is already displaying FILENAME and NODENAME, the window position
is preserved, if possible."
  (pop-to-buffer "*info*")
  (let ((old-filename Info-current-file)
	(old-nodename Info-current-node)
	(pcolumn      (current-column))
	(pline        (count-lines (point-min) (line-beginning-position)))
	(wline        (count-lines (point-min) (window-start)))
	(old-history  Info-history)
	(new-history (and Info-current-file
			  (list Info-current-file Info-current-node (point)))))
    (kill-buffer (current-buffer))
    (Info-find-node filename nodename)
    (setq Info-history old-history)
    (if (and (equal old-filename Info-current-file)
	     (equal old-nodename Info-current-node))
	(progn
	  ;; note goto-line is no good, we want to measure from point-min
	  (beginning-of-buffer)
	  (forward-line wline)
	  (set-window-start (selected-window) (point))
	  (beginning-of-buffer)
	  (forward-line pline)
	  (move-to-column pcolumn))
      ;; only add to the history when coming from a different file+node
      (if new-history
	  (setq Info-history (cons new-history Info-history))))))



  reply	other threads:[~2003-09-05 21:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-26 16:52 gnus-url-mailto broken on foo+bar@somewhere.invalid Reiner Steib
2003-08-26 18:05 ` Karl Pflästerer
2003-08-27 13:22   ` Reiner Steib
2003-08-27 14:43     ` Karl Pflästerer
2003-08-26 21:37 ` Jesper Harder
2003-08-27 11:42   ` Benjamin Riefenstahl
2003-08-27 13:57     ` Reiner Steib
2003-08-27 14:53       ` Jesper Harder
2003-08-27 17:37         ` Kai Großjohann
2003-08-27 18:33           ` Jesper Harder
2003-09-04  1:59       ` Jesper Harder
2003-09-04 13:15         ` Reiner Steib
2003-09-04 15:32           ` Jesper Harder
2003-09-04 16:10             ` Simon Josefsson
2003-09-04 16:53               ` Reloading info files (was: gnus-url-mailto broken on foo+bar@somewhere.invalid) Reiner Steib
2003-09-05 21:58                 ` Kevin Ryde [this message]
2003-09-04 17:43               ` gnus-url-mailto broken on foo+bar@somewhere.invalid Jesper Harder
2003-09-04 22:42                 ` Simon Josefsson
2003-09-04 21:46 ` Frank Schmitt
2003-09-05  1:34   ` Jesper Harder
2003-09-05  7:33     ` Frank Schmitt

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=87k78maodv.fsf@zip.com.au \
    --to=user42@zip.com.au \
    /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).