Giter Site home page Giter Site logo

C-M-a and C-M-e about lua-mode HOT 4 CLOSED

immerrr avatar immerrr commented on June 4, 2024
C-M-a and C-M-e

from lua-mode.

Comments (4)

immerrr avatar immerrr commented on June 4, 2024

It should bring you to the beginning of line containing a header (or a footer, so to speak, if C-M-e was pressed) of top-level function. If you want to jump out of "{}" or "()" you are better off with backward-up-alist (C-M-u).

from lua-mode.

immerrr avatar immerrr commented on June 4, 2024

It's an open question though if it should bring you to the beginning of non-toplevel function if you're inside one, i.e.

function foo()
   return function ()
      return 'bar' 
   end
end

if point is on 'bar' is it the inner or the outer function to skip to. I need to skim through the code to see the impact of this change.

from lua-mode.

impaktor avatar impaktor commented on June 4, 2024

I'd prefer going to line 2, and then line 1 in your example, when pressing C-M-a, but I'm not sure what the conventional way is.

from lua-mode.

immerrr avatar immerrr commented on June 4, 2024

Ok, I've refreshed this in my memory and it is an Emacs convention: according to the manual C-M-a and C-M-e should move point ... based on top-level major definitions, also called defuns.

It means that lua-mode works as expected and therefore I'm closing the issue. But, making backward-up-list (C-M-u) work with function and control blocks is a valid point and must be done eventually. I always thought smartparens is capable of that, but I'm not sure if library integration is within lua-mode's scope.

from lua-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.