julia-emacs icon indicating copy to clipboard operation
julia-emacs copied to clipboard

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

Open dvdhansen opened this issue 5 years ago • 3 comments

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.

dvdhansen avatar May 29 '19 09:05 dvdhansen

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

nverno avatar May 29 '19 16:05 nverno

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.

dvdhansen avatar May 29 '19 18:05 dvdhansen

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).

nverno avatar May 29 '19 18:05 nverno