Loading ...
Sorry, an error occurred while loading the content.

[jasspa] reread-file [hack encl.]

Expand Messages
  • Thomas Hundt
    1. Help file: ^HC, list-commands, creates a buffer o commands which may be double-clicked on to open the relevant help file. This is a Good Thing. However,
    Message 1 of 1 , Mar 14, 2000
    • 0 Attachment
      1. Help file: ^HC, list-commands, creates a buffer o' commands which may be double-clicked on to open the relevant help file. This is a Good Thing. However, I can't figure out how to open one via the keyboard (e.g., after doing a search for something [see below], my cursor landed on find-zfile and I wanted to find out what the heck that was -- how to open it? Take hand off keyboard, move mouse, click... seems kinda inefficient.)

      2. One thing I do a lot is look at logfiles in ME. It's fast loading and searching speed and seemingly limitless capacity (unlike vi ["window too wide"] and Notepad) make it wonderful for this. Naturally, as a power user, I want it all, and in this case the feature I need is an ability to reload a file. See below.

      3. What do the "shove" commands do? (shove-back, etc.) My version doesn't have a help file for these.

      * * *

      I cooked up the following to reread a file:

      ;------------------------------------------------------------
      ; reread-file: reload the current file (w/ safety prompt)
      ;------------------------------------------------------------
      define-macro reread-file
      set-variable #l1 $window-aline
      set-variable #l2 $buffer-fname
      !if &bmod "edit"
      !if &iseq @mc1 "Buffer has been changed; reread anyway [y/n]? " "yYnN" "n"
      !abort
      !endif
      !endif
      0 delete-buffer $buffer-bname ; force destroy (prompting user doesn't work in macro)
      ml-write &spr "[Rereading %s]" #l2
      read-file #l2
      #l1 goto-line
      !emacro
      !force global-bind-key reread-file "C-x f"


      (I'm sure you're now going to e-mail me, "Oh, this is already in there, just use Ctrl-Alt-Shift-%" -- I'm sure I'm not the only one who's thought of it... :-)

      -Th
    Your message has been successfully submitted and would be delivered to recipients shortly.