🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.vm.bug
Article #9276

Re: Another VM wishlist.

#9276
From: Len Weisberg
Date: Mon, 10 Feb 1992 01:44
66 lines
2946 bytes
Michael Frank writes:
> 2.  Have a command that lets me search (with C-s) in the summary
> buffer and then goes to the line my cursor is on.  Like RET, but with
> its argument given implicitly by the current line in the summary
> buffer.


Try this replacement for the function bound to RET.
Let us (especially Kyle) know how you like it.
(I am currently using this on:   emacs 18.57   vm 5.31 )


- Len Weisberg - weisberg@corp.hp.com - HP - Palo Alto Info Tech Center
==============================================================================

(defun vm-goto-message (n)
  "Go to the message numbered N.
Interactively N is the prefix argument.  If no prefix arg is provided
and vm cannot follow the summary cursor, N is prompted for in the minibuffer.

If vm-follow-summary-cursor is non-nil this command first tries
to follow the summary cursor to a new message.  If a new message
is selected in this way, no further action is taken.  I.e. you can move
the cursor in the summary buffer, press RETURN and select a new
message without typing in a message number.
Even if vm-follow-summary-cursor is nil the default response to the 
prompt is to follow the summary cursor."
  (interactive
   (list
    (cond
     (current-prefix-arg (prefix-numeric-value current-prefix-arg))
     ((vm-follow-summary-cursor) nil)
     ((vm-read-number "Go to message: "))
     ((let ((vm-follow-summary-cursor t))
	(vm-follow-summary-cursor))
      nil)
     (t (let ((num nil))
	  (while (null (setq num (vm-read-number "Go to message: "))))
	  num))
     )))

  (if (null n)
      ()                                ; nil means work has been done already
    (vm-select-folder-buffer)
    (vm-check-for-killed-summary)
    (vm-error-if-folder-empty)
    (let ((cons (nthcdr (1- n) vm-message-list)))
      (if (null cons)
          (error "No such message."))
      (if (eq vm-message-pointer cons)
          (vm-preview-current-message)
        (vm-record-and-change-message-pointer vm-message-pointer cons)
        (setq vm-need-summary-pointer-update t)
        (vm-preview-current-message)))))



(defun vm-read-number (prompt)
  (let (result)
    (while
        (null
         (string-match "^[ \t]*-?[0-9]*[ \t]*$"
		       (setq result (read-string prompt)))))
    (if (string-match "^[ \t]*$" result)
	nil
      (string-to-int result))))
Technical Details
Message-ID: <30920028@hpcc01.corp.hp.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!mips!sdd.hp.com!hplabs!hpl-opus!hpcc05!hpcc01!weisberg
References: <MPF.92Feb8183547@oreo.ai.mit.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f6829,f024461c5fdb9527
X-Google-Attributes: gidf6829,public
X-Google-ArrivalTime: 1992-02-16 18:47:38 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!mips!sdd.hp.com!hplabs!hpl-opus!hpcc05!hpcc01!weisberg
From: weisberg@hpcc01.corp.hp.com (Len Weisberg)
Newsgroups: gnu.emacs.vm.bug
Subject: Re: Another VM wishlist.
Message-ID: <30920028@hpcc01.corp.hp.com>
Date: 10 Feb 92 01:44:05 GMT
References: <MPF.92Feb8183547@oreo.ai.mit.edu>
Organization: HP Palo Alto Info Tech Center
Lines: 66