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

global-bind-key

Expand Messages
  • Rick Owen
    Greetings, I used global-bind-key to bind a key to search-buffer. That works fine except that with each invocation of the bound key I am prompted to enter
    Message 1 of 3 , Aug 30 7:57 AM
    • 0 Attachment
      Greetings,

      I used global-bind-key to bind a key to search-buffer.  That works fine except that with each invocation of the bound key I am prompted to enter "Search Flags:" and then the search string.  Is there any way to pass arguments using global-bind-key other than the numeric argument shown in the example from the help file.  If not, how would I write a macro that I could bind to a key that would ask for the search string and then call buffer-search with the default set of flags that I define?

      Example from help file:
           n global-bind-key "command" "key"
       

      Thanks,
      Rick.
    • Jon Green
      ... Follows are some options, not sure exactly what kind of search you are looking for. Regards Jon. ; Example using search buffer. search-buffer is used for
      Message 2 of 3 , Aug 30 1:09 PM
      • 0 Attachment
        Rick Owen wrote:
        > Greetings,
        >
        > I used global-bind-key to bind a key to search-buffer. That works fine
        > except that with each invocation of the bound key I am prompted to enter
        > "Search Flags:" and then the search string. Is there any way to pass
        > arguments using global-bind-key other than the numeric argument shown in
        > the example from the help file. If not, how would I write a macro that
        > I could bind to a key that would ask for the search string and then call
        > buffer-search with the default set of flags that I define?
        >
        > Example from help file:
        > n global-bind-key "command" "key"
        >
        >
        > Thanks,
        > Rick.

        Follows are some options, not sure exactly what kind of search you are
        looking for.

        Regards
        Jon.

        ; Example using search buffer. search-buffer is used for macro
        ; development invocation only and should be used wrapped in a
        ; macro. Note we have to test the exist status if we want to
        ; show a message when the search pattern is not found. Use @ml
        ; with the search history.
        define-macro my-search-forward
        ; Lets say we want case insensitive and no magic, forwards direction.
        !force search-buffer "EM" @ml05 "Search"
        !if ¬ $status
        ml-write "[Not Found]"
        !endif
        !emacro
        global-bind-key my-search-forward "f9"

        ; Bind the isearch; isearch is best once you get used to it.
        global-bind-key isearch-forward "S-f9"

        ; A regular search, honours the current exact+magic modes
        global-bind-key search-forward "C-f9"
      • Rick Owen
        Jon, Thanks for the help. The macros are starting to make sense to me and I hope I won t have to keep asking for help for too much longer. Thanks, Rick. ...
        Message 3 of 3 , Aug 30 1:25 PM
        • 0 Attachment
          Jon,

          Thanks for the help.  The macros are starting to make sense to me and I hope I won't have to keep asking for help for too much longer.

          Thanks,
          Rick.
           



          ----- Original Message ----
          From: Jon Green <jon@...>
          To: jasspa@yahoogroups.com
          Sent: Wednesday, August 30, 2006 2:09:29 PM
          Subject: Re: [jasspa] global-bind-key

          Rick Owen wrote:

          > Greetings,
          >
          > I used global-bind- key to bind a key to search-buffer. That works fine
          > except that with each invocation of the bound key I am prompted to enter
          > "Search Flags:" and then the search string. Is there any way to pass
          > arguments using global-bind- key other than the numeric argument shown in
          > the example from the help file. If not, how would I write a macro that
          > I could bind to a key that would ask for the search string and then call
          > buffer-search with the default set of flags that I define?
          >
          > Example from help file:
          > n global-bind- key "command" "key"
          >
          >
          > Thanks,
          > Rick.

          Follows are some options, not sure exactly what kind of search you are
          looking for.

          Regards
          Jon.

          ; Example using search buffer. search-buffer is used for macro
          ; development invocation only and should be used wrapped in a
          ; macro. Note we have to test the exist status if we want to
          ; show a message when the search pattern is not found. Use @ml
          ; with the search history.
          define-macro my-search-forward
          ; Lets say we want case insensitive and no magic, forwards direction.
          !force search-buffer "EM" @ml05 "Search"
          !if &not $status
          ml-write "[Not Found]"
          !endif
          !emacro
          global-bind- key my-search-forward "f9"

          ; Bind the isearch; isearch is best once you get used to it.
          global-bind- key isearch-forward "S-f9"

          ; A regular search, honours the current exact+magic modes
          global-bind- key search-forward "C-f9"


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