JuliaEditorSupport / julia-emacs

Julia support in Emacs.
Other
286 stars 62 forks source link

beginning-/end-of-defun should move out of the *top-level* construct #76

Open dvdhansen opened 5 years ago

dvdhansen commented 5 years ago

The Emacs manual is quite clear about this:

These commands move point or set up the region based on top-level major definitions, also called “defuns”.

(emacs) Moving by Defuns

In interactive programming jupyter-eval-defun (or whatever method you use) should eval the current top-level construct. This may be a function but could also be a type definition or whatever. *-eval-defun relies on beginning-/end-of-defun.

nverno commented 5 years ago

This is often not the case, eg. python-mode. But, the beg/end-of-defun functions are buggy

dvdhansen commented 5 years ago

nverno writes:

This is often not the case, eg. python-mode. But, the beg/end-of-defun functions are buggy

Is there some consensus how these function should behave? IMHO C-M-x should work as expected with function, macro, and struct. But this could also be fixed in *-eval-defun.

nverno commented 5 years ago

I agree with you about -*eval-defun. I don't think there is a general consensus on the beg/end-of-defun functions with respect to nested functions? I just ported python's implementation given the language similarities (although it is obviously buggy, I just haven't been using Julia for a while so haven't been inclined to fix it).