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

[jasspa] single file history

Expand Messages
  • Lechee.Lai
    hi, does jasspa me have last file status for every file load, I only know there has load session feature in emf Thanks lechee
    Message 1 of 3 , Dec 10, 2009
    • 0 Attachment
      hi,
      does jasspa me have last file status for every file load, I only know there has load session feature in emf

      Thanks
      lechee
    • Lechee.Lai
      I ve make the simple quit for history.est ... define-macro save-history set-variable #l9 &spr %s %s n $buffer-fname $window-line set-variable #l8 &cat $home
      Message 2 of 3 , Dec 10, 2009
      • 0 Attachment
        I've make the simple quit for history.est
        ----
        define-macro save-history
        set-variable #l9 &spr "%s %s\n" $buffer-fname $window-line
        set-variable #l8 &cat $home ".jasspa/history.est"
        find-file #l8
        beginning-of-buffer
        insert-string #l9
        0 save-buffer
        0 delete-buffer $buffer-bname
        ; ml-write "history saved>>"
        !emacro

        0 define-macro save-rfname
        !if &len $buffer-fname 1
        set-variable %bfname $buffer-fname
        set-variable %bline $window-line
        le-insert-fname %bfname %bline
        save-history
        !endif
        !emacro

        define-macro le-quit
        set-variable #l0 $buffer-fname
        set-variable #l1 0
        next-buffer
        save-rfname
        ;; ToDO: skip for self save-history first
        !repeat
        !if ¬ &seq $buffer-fname #l0
        next-buffer
        save-rfname
        !endif
        !until &seq #l0 $buffer-fname
        save-buffers-exit-emacs
        !emacro
        ----
        the problem how to hook them during file open if same $buffer-fname is founded

        history.est
        -------------
        foo.c 100
        foo1.c 5

        open foo.c
        -------------
        me foo.c

        and goto line 100

        --- In jasspa@yahoogroups.com, "Lechee.Lai" <lecheel@...> wrote:
        >
        > hi,
        > does jasspa me have last file status for every file load, I only know there has load session feature in emf
        >
        > Thanks
        > lechee
        >
      • Lechee.Lai
        dirty work for single file history ... define-macro save-history set-variable #l9 &spr %s %s n $buffer-fname $window-line set-variable #l7 $buffer-fname
        Message 3 of 3 , Dec 12, 2009
        • 0 Attachment
          dirty work for single file history
          ---
          define-macro save-history
          set-variable #l9 &spr "%s %s\n" $buffer-fname $window-line
          set-variable #l7 $buffer-fname
          set-variable #l8 &cat $home ".jasspa/history.est"
          find-file #l8
          beginning-of-buffer
          ;;; find the duplicate file replace it otherwise just insert
          !force 0 search-forward &cat "^" #l7 &cat " [0-9].*"
          !if $status
          beginning-of-line
          1 kill-line
          beginning-of-line
          !else
          beginning-of-buffer
          !endif
          insert-string #l9
          0 save-buffer
          0 delete-buffer $buffer-bname
          !emacro

          define-macro le-quit
          set-variable #l0 $buffer-fname
          set-variable #l1 0
          next-buffer
          !if &xse $buffer-fname ".*[^/]"
          save-history
          !endif
          set-variable #l9 0
          !repeat
          !if ¬ &seq $buffer-fname #l0
          next-buffer
          !if &xse $buffer-fname ".*[^/]"
          save-history
          !endif
          !endif
          ;; stupid method prevent dead lock
          set-variable #l8 &inc #l9 1
          !if &seq #l8 "10"
          set-variable #l0 $buffer-fname
          !endif
          !until &seq #l0 $buffer-fname
          save-buffers-exit-emacs
          !emacro

          0 define-macro le-goto-line
          set-variable #l0 $buffer-fname
          set-variable #l1 &cat $home ".jasspa/history.est"
          find-file #l1
          beginning-of-buffer
          !force 0 search-forward &cat "^" #l0
          !if $status
          set-variable #l2 $window-col
          set-variable #l3 &rig @wl &inc #l2 1
          !force 0 delete-buffer $buffer-bname
          goto-line #l3
          !else
          !force 0 delete-buffer $buffer-bname
          !endif
          !emacro
          -----
          following add inside me.emf
          >>>>
          define-macro start-up
          set-variable #l0 $buffer-fname
          set-variable #l1 &cat $home ".jasspa/history.est"
          find-file #l1
          beginning-of-buffer
          !force 0 search-forward &cat "^" #l0
          !if $status
          set-variable #l2 $window-col
          set-variable #l3 &rig @wl &inc #l2 1
          !force 0 delete-buffer $buffer-bname
          goto-line #l3
          !else
          !force 0 delete-buffer $buffer-bname
          !endif
          !emacro

          <<<< the only problem is conflict with session
          don't know it's session start or history match
        Your message has been successfully submitted and would be delivered to recipients shortly.