notmuch-hello: Preserve current position when invoking notmuch-hello

Previously, we preserved the current position only when returning to
the notmuch-hello buffer or when refreshing it. Fix to also preserve
the position when directly invoking notmuch-hello, (such as from a
global keybinding).
This commit is contained in:
Carl Worth 2010-04-26 19:43:21 -07:00
parent 3ac2727dae
commit 7fa6306cae

View file

@ -194,20 +194,23 @@ diagonal."
(defun notmuch-hello-update (&optional no-display)
;; Lazy - rebuild everything.
(interactive)
(let ((target (if (widget-at)
(widget-value (widget-at))
(progn
(widget-forward 1)
(widget-value (widget-at))))))
(notmuch-hello no-display target)))
(notmuch-hello no-display))
(defun notmuch-hello (&optional no-display target)
(defun notmuch-hello (&optional no-display)
(interactive)
(if no-display
(set-buffer "*notmuch-hello*")
(switch-to-buffer "*notmuch-hello*"))
(let ((target (if (widget-at)
(widget-value (widget-at))
(condition-case nil
(progn
(widget-forward 1)
(widget-value (widget-at)))
(error nil)))))
(kill-all-local-variables)
(let ((inhibit-read-only t))
(erase-buffer))
@ -368,7 +371,7 @@ diagonal."
(goto-char final-target-pos)
(if (not (widget-at))
(widget-forward 1))))
(widget-forward 1)))))
;;