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

Re: [jasspa] is it possible using ENTER in special mode

Expand Messages
  • lechee lai
    yes it s long time ago here is another part ==== ; -!- emf -!- ; This is part of the JASSPA MicroEmacs macro files ; Copyright (C) 2000-2006 JASSPA
    Message 1 of 5 , Jul 21, 2009
    • 0 Attachment
      yes it's long time ago here is another part
      ====
      ; -!- emf -!-
      ; This is part of the JASSPA MicroEmacs macro files
      ; Copyright (C) 2000-2006 JASSPA (www.jasspa.com)
      ; See the file me.emf for copying and conditions.
      ;
      ; Created:     2oo8
      ; Synopsis:    Hilighting for GRP files
      ; Authors:     Lechee Lai
      ;
      ;
      !if &not &exi .hilight.grp
          set-variable .hilight.grp  &pinc .hilight.next 1
      !endif

      ; buffer-init variables
      ;set-variable .fhook-grp.name "vGREP"
      ;set-variable .fhook-grp.command-kbind "|return|"
      ;$buffer-bhook

      !if &band .hilight.flags 0x02
          0 hilight .hilight.grp 0                 $global-scheme
          ; Gnu grp utility, uses --context
          hilight .hilight.grp 0x101 "\\d+"      .scheme.constant
          ; Common
          hilight .hilight.grp 0x102 "File"       .scheme.comment

      !endif

      define-macro le-grp
          !if &seq $buffer-bname "fte.grp"
              set-variable #l0 &left @wl 5
              !if &seq #l0 "File:"
                       set-variable #l2 @wl
                       set-variable #l3 "FILE"
              !endif

              !if &seq #l3 "FILE"
                      set-variable #l3 &right @wl 6
                      ml-write #l3
                      find-file #l3
              !else
                      set-variable #l1 @wl
                      !if &gre &set #l4 &rsin ":" #l1 1
                          set-variable #l0 &lef #l1 &sub #l4 1
                      !else
                          set-variable #l2 #l1
                      !endif
                      ml-write #l0
                      ; find filename
                      set-variable #l9 "0"
                      !repeat
                              backward-line
                              set-variable #l1 &left @wl 5
                              !if &seq #l1 "File:"
                                       set-variable #l2 @wl
                                       set-variable #l3 "FILE"
                                      !if &seq #l3 "FILE"
                                              set-variable #l3 &right @wl 6
                                              ml-write #l3
                                              set-variable #l9 "FOUNDED"
                                      !endif
                              !endif
                      !until &seq #l9 "FOUNDED"
                      !if &seq #l9 "FOUNDED"
                              find-file #l3
                              goto-line #l0
                      !endif
              !endif
          !else
              newline
          !endif
      !emacro

      define-macro fhook-grp
          ; Set up the buffer modes
          -1 buffer-mode "time"
          !if &band .hilight.flags 0x02
              set-variable $buffer-hilight .hilight.grp
          !endif
          buffer-init-hooks
      !emacro

      global-bind-key   "le-grp" "C-j"
      buffer-bind-key   "le-grp" "return"

      buffer-init-fhook "grp"
      ====
      Thanks for remind :-)

      --- 09/7/21 (二),Steven Phillips <bill@...> 寫道:

      寄件者: Steven Phillips <bill@...>
      主旨: Re: [jasspa] is it possible using ENTER in special mode
      收件者: jasspa@yahoogroups.com
      日期: 2009年7月21日,二,下午3:55

       

      Lechee,

      There are no key bindings in your code (to C-j or F11) have you missed this part of the code?

      With what is there I'm not sure what C-j or the 'return' key are meant to be used for nor how they are bound, if this is using standard bindings could this be a terminal setup problem? If so what platform are you using? Does the 'return' key usually work? And if you execute the command 'describe-key' and press the ENTER key does ME report:

          Show binding: "return" newline

      As it should?

      Thanks,

      Steve

      Lechee.Lai wrote:

       

      I've port one vgrep emf
      -----
      ; -!- emf -!-
      ; Created: Jul 18 2oo8
      ; Synopsis: "vgrep" command handling
      ; Authors: Lechee.Lai
      ;
      define-macro vlist
      set-variable #l0 &cat $home "fte.grp"
      view-file #l0
      set-position "\x88"
      goto-line 1
      set-variable #l0 @wl
      !if &seq &lef #l0 5 "File:"
      ml-write "Vaild GRP format :-) C-j for selection"
      !else
      ml-write "Invaild GRP"
      !force 0 delete-buffer "fte.grp"
      !return
      !endif
      goto-position "\x88"
      buffer-init- hooks
      !emacro

      define-macro vgrep
      !if &inw @wc
      set-variable #l0 $window-col
      forward-char
      backward-word
      set-variable #l1 $window-col
      forward-word
      set-variable .osd.pat-cur &mid @wl #l1 &sub $window-col #l1
      set-variable $window-col #l0
      !else
      set-variable .osd.pat-cur ""
      !endif

      set-variable #l0 @ml1 "Search" .osd.pat-cur
      !if &less &len #l0 1
      ml-write "Cancel!"
      !return
      !endif
      !if &xse $buffer-fname ".*\\.c"
      set-variable #l5 "*.[ch]"
      !else
      !if &seq &set #l3 $buffer-fname ""
      set-variable #l3 $buffer-bname
      !endif
      !if &gre &set #l6 &rsin "." #l3 1
      set-variable #l4 &lef #l3 &sub #l6 1
      set-variable #l5 &rig #l3 &sub #l6 1
      set-variable #l5 &cat "*" #l5
      !else
      set-variable #l4 #l3
      set-variable #l5 "*"
      !endif
      !endif
      set-variable #l2 @ml01 "Dir"
      set-variable #l1 @ml1 "Mask" #l5
      !force 0 find-buffer "fte.grp"
      !if $status
      !force 0 delete-buffer "fte.grp"
      !endif
      pipe-shell-command &spr "vgrep --grep %s %s \\%s i" #l0 #l2 #l1
      delete-buffer "*command*"
      delete-window "*command*"
      ml-write "F11 for vlist -- C-j for pickup"
      !emacro
      ---------
      is there any possible using ENTER instead C-j

      Thanks
      Lechee


      付費才容量無上限?Yahoo!奇摩電子信箱2.0免費給你,信件永遠不必刪! - 馬上體驗
    • lechee lai
      complete package running on linux ______________________________________________________________________________________________________
      Message 2 of 5 , Jul 21, 2009
      complete package running on linux

      付費才容量無上限?Yahoo!奇摩電子信箱2.0免費給你,信件永遠不必刪! - 馬上體驗
    • Jon Green
      ... These macros are on the contributions page - but not the executable. http://www.jasspa.com/contrib.html Never used vgrep? Not sure what it is. Thanks
      Message 3 of 5 , Oct 19, 2009
      • 0 Attachment
        lechee lai wrote:
        > [Attachment(s) <#TopText> from lechee lai included below]
        >
        > complete package running on linux
        >
        >
        > 付費才容量無上限?Yahoo!奇摩電子信箱2.0免費給你,信件永遠不必刪! - *馬
        > 上體驗*
        > <http://tw.rd.yahoo.com/referurl/mail/mail20/tag_hot0103/*http://tw.mg0.mail.yahoo.com/dc/landing>
        > *!*
        >
        >
        > Attachment(s) from lechee lai
        >
        > 3 of 3 File(s)
        >
        > hkgrp.emf <http://d.yimg.com/kq/groups/1188037/1840643211/name/hkgrp%2Eemf>
        > vgrep.emf <http://d.yimg.com/kq/groups/1188037/798514563/name/vgrep%2Eemf>
        > vgrep <http://d.yimg.com/kq/groups/1188037/946228357/name/vgrep>
        >
        >
        >

        These macros are on the "contributions" page - but not the executable.

        http://www.jasspa.com/contrib.html

        Never used vgrep? Not sure what it is.

        Thanks
        Jon.
      Your message has been successfully submitted and would be delivered to recipients shortly.