Hello, I wrote: > When the following steps are performed, the first line "def \" will > not be included in the region. > > 1. emacs -Q > 2. Load the following Python file using M-x find-file > > #+begin_src python > def \ > foo(x): > return x > #+end_src > > 3. M-x forward-line (Move point to the line "foo(x):".) > 4. M-x python-mark-defun In fact, this is not only the issue in python-mark-defun, but also the issue in python-nav-beginning-of-defun. In the example above, python-nav-beginning-of-defun does not move the point if the point is located at the beginning of the line "foo(x):". My previous patch was not sufficient to solve the issue in python-nav-beginning-of-defun. So I attach the revised patch. On the other hand, I'm wondering if it is worth supporting such rarely used forms, as there seems to be some more issues regarding the line continuation using backslash. Is it better to leave such rarely used forms unsupported and keep the code simple? Below is the explanation of my patch: > Sorry, it may not be good to change the behavior of > python-info-looking-at-beginning-of-defun. I will reconsider the fix. Instead of changing the default behavior of python-info-looking-at-beginning-of-defun, I added an argument to change the behavior. When CHECK-STATEMENT is non-nil, the current statement is checked instead of the current physical line. This argument is used in python-nav--beginning-of-defun to be able to recognize the defun with line continuation using backslash. When ARG is positive, the point is moved to the end of the statement if the point is located at the continuation line. This is necessary for re-search-backward to find the defun regexp. If the defun is found when ARG is negative, it is necessary to move point to the beginning of the statement, because the point is at the end of the defun regexp which may be in the different line from the beginning of the statement. Best Regards,