Is there a way to make the “o” keypress of other-window repeatable?Make helm window the only windowDefining the window pointed by “other-window”How to modify bindings to match ECB window numbers?Creating function to move top-buffer to other windowDefine an emacs function to take arguments in the same way as something like M-x goto-linePrevent *org todo* pop-up window from displaying in new frame (dedicated window scenario)How to make pop-up window appear in the divided portion of the frameemacs home made perspective: source + eshell + compilationhow to use this-command and last-command in tests?

Is there a commercial liquid with refractive index greater than n=2?

Virtual destructor moves object out of rodata section

How does the illumination of the sky from the sun compare to that of the moon?

Why don't politicians push for fossil fuel reduction by pointing out their scarcity?

What's the point of writing that I know will never be used or read?

What security risks does exposing the size of the plaintext entail?

Why was ramjet fuel used as hydraulic fluid during Saturn V checkout?

Starships without computers?

Can you find the next number in the following series?

Will some rockets really collapse under their own weight?

My new Acer Aspire 7 doesn't have a Legacy Boot option, what can I do to get it?

Designing a prison for a telekinetic race

Is there a way to make the "o" keypress of other-window <C-x><C-o> repeatable?

Spongy green glass found on graves

Best model for precedence constraints within scheduling problem

How to add a table description to a longtable?

what article (a/an) to use when there when there's a parenthesis following it?

Rotate List by K places

Why should P.I be willing to write strong LOR even if that means losing a undergraduate from his/her lab?

Has there ever been a truly bilingual country prior to the contemporary period?

Is there a utility / method to organize trad gear so that each piece is immediately accessible?

Would getting a natural 20 with a penalty still count as a critical hit?

Testing control surfaces pre flight; what feedback does pilot recieve?

Why is su world executable?



Is there a way to make the “o” keypress of other-window repeatable?


Make helm window the only windowDefining the window pointed by “other-window”How to modify bindings to match ECB window numbers?Creating function to move top-buffer to other windowDefine an emacs function to take arguments in the same way as something like M-x goto-linePrevent *org todo* pop-up window from displaying in new frame (dedicated window scenario)How to make pop-up window appear in the divided portion of the frameemacs home made perspective: source + eshell + compilationhow to use this-command and last-command in tests?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















Question is as stated in the title.



Instead of using various packages for switching windows, it might be simpler to make <C-x><C-o> behave like <C-x><C-+>, such that repeated presses of the o key after the initial <C-x><C-o> will keep switching windows.










share|improve this question


























  • github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.

    – Marco Wahl
    9 hours ago

















3















Question is as stated in the title.



Instead of using various packages for switching windows, it might be simpler to make <C-x><C-o> behave like <C-x><C-+>, such that repeated presses of the o key after the initial <C-x><C-o> will keep switching windows.










share|improve this question


























  • github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.

    – Marco Wahl
    9 hours ago













3












3








3








Question is as stated in the title.



Instead of using various packages for switching windows, it might be simpler to make <C-x><C-o> behave like <C-x><C-+>, such that repeated presses of the o key after the initial <C-x><C-o> will keep switching windows.










share|improve this question
















Question is as stated in the title.



Instead of using various packages for switching windows, it might be simpler to make <C-x><C-o> behave like <C-x><C-+>, such that repeated presses of the o key after the initial <C-x><C-o> will keep switching windows.







window commands navigation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 4 hours ago









Drew

50.9k4 gold badges65 silver badges113 bronze badges




50.9k4 gold badges65 silver badges113 bronze badges










asked 11 hours ago









yongjieyongjieyongjieyongjie

1113 bronze badges




1113 bronze badges















  • github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.

    – Marco Wahl
    9 hours ago

















  • github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.

    – Marco Wahl
    9 hours ago
















github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.

– Marco Wahl
9 hours ago





github.com/alphapapa/defrepeater.el looks like a general path to realize such requests as yours. When I tried that out it refused to work occasionally. Finally I stopped using it. But I guess it's worth to be rediscovered.

– Marco Wahl
9 hours ago










3 Answers
3






active

oldest

votes


















1














You could write a function similar to text-scale-adjust. E.g.



(defun mw-other-window-repeat (count &optional all-frames)
"Wrapper around `other-window' to continue to jump to other with key o."
(interactive "p")
(other-window count all-frames)
(message "Use o to jump to next window.")
(set-transient-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "o")
(lambda () (interactive) (mw-other-window-repeat 1)))
map)))

(global-set-key (kbd "C-x o") #'mw-other-window-repeat)



C-x ooooooo




has the desired effect AFAICS. The repetition is over with another key press than o.






share|improve this answer
































    1














    I use this in several of my libraries. Use it to make pretty much any command repeatable even when it's on a prefix key.



    (defun repeat-command (command)
    "Repeat COMMAND."
    (require 'repeat)
    (let ((repeat-previous-repeated-command command)
    (repeat-message-function #'ignore)
    (last-repeatable-command 'repeat))
    (repeat nil)))


    Then define a repeatable version of an existing command, such as other-window, just by passing that command to repeat-command. For example:



    (defun other-window-repeat ()
    "Select another window in cyclic ordering of windows.
    This is a repeatable version of `other-window'."
    (interactive)
    (repeat-command 'other-window))

    (global-set-key (kbd "C-x 4 o") 'other-window-repeat)





    share|improve this answer
































      0














      hydra (https://github.com/abo-abo/hydra) are another way to get repeatable commands. This doesn't move the point on the first call, but you can press o as many times as you want to move around.



      (defhydra other-window (:color red :body-pre (other-window 1))
      "other window"
      ("o" (other-window 1)))

      (global-set-key (kbd "C-x o") #'other-window/body)





      share|improve this answer



























      • You can add :body-pre (other-window 1) to the hydra arguments to have it move the point on first call.

        – clemera
        3 hours ago











      • Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!

        – John Kitchin
        34 mins ago













      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "583"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f52201%2fis-there-a-way-to-make-the-o-keypress-of-other-window-c-xc-o-repeatable%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      You could write a function similar to text-scale-adjust. E.g.



      (defun mw-other-window-repeat (count &optional all-frames)
      "Wrapper around `other-window' to continue to jump to other with key o."
      (interactive "p")
      (other-window count all-frames)
      (message "Use o to jump to next window.")
      (set-transient-map
      (let ((map (make-sparse-keymap)))
      (define-key map (kbd "o")
      (lambda () (interactive) (mw-other-window-repeat 1)))
      map)))

      (global-set-key (kbd "C-x o") #'mw-other-window-repeat)



      C-x ooooooo




      has the desired effect AFAICS. The repetition is over with another key press than o.






      share|improve this answer





























        1














        You could write a function similar to text-scale-adjust. E.g.



        (defun mw-other-window-repeat (count &optional all-frames)
        "Wrapper around `other-window' to continue to jump to other with key o."
        (interactive "p")
        (other-window count all-frames)
        (message "Use o to jump to next window.")
        (set-transient-map
        (let ((map (make-sparse-keymap)))
        (define-key map (kbd "o")
        (lambda () (interactive) (mw-other-window-repeat 1)))
        map)))

        (global-set-key (kbd "C-x o") #'mw-other-window-repeat)



        C-x ooooooo




        has the desired effect AFAICS. The repetition is over with another key press than o.






        share|improve this answer



























          1












          1








          1







          You could write a function similar to text-scale-adjust. E.g.



          (defun mw-other-window-repeat (count &optional all-frames)
          "Wrapper around `other-window' to continue to jump to other with key o."
          (interactive "p")
          (other-window count all-frames)
          (message "Use o to jump to next window.")
          (set-transient-map
          (let ((map (make-sparse-keymap)))
          (define-key map (kbd "o")
          (lambda () (interactive) (mw-other-window-repeat 1)))
          map)))

          (global-set-key (kbd "C-x o") #'mw-other-window-repeat)



          C-x ooooooo




          has the desired effect AFAICS. The repetition is over with another key press than o.






          share|improve this answer













          You could write a function similar to text-scale-adjust. E.g.



          (defun mw-other-window-repeat (count &optional all-frames)
          "Wrapper around `other-window' to continue to jump to other with key o."
          (interactive "p")
          (other-window count all-frames)
          (message "Use o to jump to next window.")
          (set-transient-map
          (let ((map (make-sparse-keymap)))
          (define-key map (kbd "o")
          (lambda () (interactive) (mw-other-window-repeat 1)))
          map)))

          (global-set-key (kbd "C-x o") #'mw-other-window-repeat)



          C-x ooooooo




          has the desired effect AFAICS. The repetition is over with another key press than o.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 9 hours ago









          Marco WahlMarco Wahl

          1,8064 silver badges7 bronze badges




          1,8064 silver badges7 bronze badges


























              1














              I use this in several of my libraries. Use it to make pretty much any command repeatable even when it's on a prefix key.



              (defun repeat-command (command)
              "Repeat COMMAND."
              (require 'repeat)
              (let ((repeat-previous-repeated-command command)
              (repeat-message-function #'ignore)
              (last-repeatable-command 'repeat))
              (repeat nil)))


              Then define a repeatable version of an existing command, such as other-window, just by passing that command to repeat-command. For example:



              (defun other-window-repeat ()
              "Select another window in cyclic ordering of windows.
              This is a repeatable version of `other-window'."
              (interactive)
              (repeat-command 'other-window))

              (global-set-key (kbd "C-x 4 o") 'other-window-repeat)





              share|improve this answer





























                1














                I use this in several of my libraries. Use it to make pretty much any command repeatable even when it's on a prefix key.



                (defun repeat-command (command)
                "Repeat COMMAND."
                (require 'repeat)
                (let ((repeat-previous-repeated-command command)
                (repeat-message-function #'ignore)
                (last-repeatable-command 'repeat))
                (repeat nil)))


                Then define a repeatable version of an existing command, such as other-window, just by passing that command to repeat-command. For example:



                (defun other-window-repeat ()
                "Select another window in cyclic ordering of windows.
                This is a repeatable version of `other-window'."
                (interactive)
                (repeat-command 'other-window))

                (global-set-key (kbd "C-x 4 o") 'other-window-repeat)





                share|improve this answer



























                  1












                  1








                  1







                  I use this in several of my libraries. Use it to make pretty much any command repeatable even when it's on a prefix key.



                  (defun repeat-command (command)
                  "Repeat COMMAND."
                  (require 'repeat)
                  (let ((repeat-previous-repeated-command command)
                  (repeat-message-function #'ignore)
                  (last-repeatable-command 'repeat))
                  (repeat nil)))


                  Then define a repeatable version of an existing command, such as other-window, just by passing that command to repeat-command. For example:



                  (defun other-window-repeat ()
                  "Select another window in cyclic ordering of windows.
                  This is a repeatable version of `other-window'."
                  (interactive)
                  (repeat-command 'other-window))

                  (global-set-key (kbd "C-x 4 o") 'other-window-repeat)





                  share|improve this answer













                  I use this in several of my libraries. Use it to make pretty much any command repeatable even when it's on a prefix key.



                  (defun repeat-command (command)
                  "Repeat COMMAND."
                  (require 'repeat)
                  (let ((repeat-previous-repeated-command command)
                  (repeat-message-function #'ignore)
                  (last-repeatable-command 'repeat))
                  (repeat nil)))


                  Then define a repeatable version of an existing command, such as other-window, just by passing that command to repeat-command. For example:



                  (defun other-window-repeat ()
                  "Select another window in cyclic ordering of windows.
                  This is a repeatable version of `other-window'."
                  (interactive)
                  (repeat-command 'other-window))

                  (global-set-key (kbd "C-x 4 o") 'other-window-repeat)






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 4 hours ago









                  DrewDrew

                  50.9k4 gold badges65 silver badges113 bronze badges




                  50.9k4 gold badges65 silver badges113 bronze badges
























                      0














                      hydra (https://github.com/abo-abo/hydra) are another way to get repeatable commands. This doesn't move the point on the first call, but you can press o as many times as you want to move around.



                      (defhydra other-window (:color red :body-pre (other-window 1))
                      "other window"
                      ("o" (other-window 1)))

                      (global-set-key (kbd "C-x o") #'other-window/body)





                      share|improve this answer



























                      • You can add :body-pre (other-window 1) to the hydra arguments to have it move the point on first call.

                        – clemera
                        3 hours ago











                      • Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!

                        – John Kitchin
                        34 mins ago















                      0














                      hydra (https://github.com/abo-abo/hydra) are another way to get repeatable commands. This doesn't move the point on the first call, but you can press o as many times as you want to move around.



                      (defhydra other-window (:color red :body-pre (other-window 1))
                      "other window"
                      ("o" (other-window 1)))

                      (global-set-key (kbd "C-x o") #'other-window/body)





                      share|improve this answer



























                      • You can add :body-pre (other-window 1) to the hydra arguments to have it move the point on first call.

                        – clemera
                        3 hours ago











                      • Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!

                        – John Kitchin
                        34 mins ago













                      0












                      0








                      0







                      hydra (https://github.com/abo-abo/hydra) are another way to get repeatable commands. This doesn't move the point on the first call, but you can press o as many times as you want to move around.



                      (defhydra other-window (:color red :body-pre (other-window 1))
                      "other window"
                      ("o" (other-window 1)))

                      (global-set-key (kbd "C-x o") #'other-window/body)





                      share|improve this answer















                      hydra (https://github.com/abo-abo/hydra) are another way to get repeatable commands. This doesn't move the point on the first call, but you can press o as many times as you want to move around.



                      (defhydra other-window (:color red :body-pre (other-window 1))
                      "other window"
                      ("o" (other-window 1)))

                      (global-set-key (kbd "C-x o") #'other-window/body)






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited 35 mins ago

























                      answered 6 hours ago









                      John KitchinJohn Kitchin

                      6,5161 gold badge6 silver badges20 bronze badges




                      6,5161 gold badge6 silver badges20 bronze badges















                      • You can add :body-pre (other-window 1) to the hydra arguments to have it move the point on first call.

                        – clemera
                        3 hours ago











                      • Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!

                        – John Kitchin
                        34 mins ago

















                      • You can add :body-pre (other-window 1) to the hydra arguments to have it move the point on first call.

                        – clemera
                        3 hours ago











                      • Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!

                        – John Kitchin
                        34 mins ago
















                      You can add :body-pre (other-window 1) to the hydra arguments to have it move the point on first call.

                      – clemera
                      3 hours ago





                      You can add :body-pre (other-window 1) to the hydra arguments to have it move the point on first call.

                      – clemera
                      3 hours ago













                      Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!

                      – John Kitchin
                      34 mins ago





                      Cool, thanks! I only knew of :pre which runs before every head. I updated this solution with your suggestion!

                      – John Kitchin
                      34 mins ago

















                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Emacs Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f52201%2fis-there-a-way-to-make-the-o-keypress-of-other-window-c-xc-o-repeatable%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                      Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                      François Viète Contents Biography Work and thought Bibliography See also Notes Further reading External links Navigation menup. 21Google Bookspp. 75–77Google BooksDe thou (from University of Saint Andrews)ArchivedGoogle BooksGoogle BooksGoogle BooksGoogle booksGoogle Bookscc-parthenay.frL'histoire universelle (fr)Universal History (en)ArchivedAdsabs.harvard.eduPagesperso-orange.frArchive.orgChikara Sasaki. Descartes' mathematical thought p.259Google BooksGoogle BooksGoogle Bookspp. 152 and onwardGoogle BooksGoogle BooksScribd.comGoogle Books1257-7979Google BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGoogle BooksGallica.bnf.frGoogle BooksGoogle Books"François Viète"Francois Viète: Father of Modern Algebraic NotationThe Lawyer and the GamblerAbout TarporleySite de Jean-Paul GuichardL'algèbre nouvelle"About the Harmonicon"cb120511976(data)1188044800000 0001 0913 5903n82164680ola2013766880073431702w6vt1sb70287374827140948071409480