aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-02-18 12:52:55 +0100
committerLars Ingebrigtsen2021-02-18 12:52:55 +0100
commiteb9f80e37b42576dd5a86c89e18d44ad2cec4273 (patch)
tree9f788aa6079518167673d2510b8ae5306fe5c872 /lisp/progmodes/python.el
parent546f552e7b2439b482c7d28222fb88761a9c876a (diff)
downloademacs-eb9f80e37b42576dd5a86c89e18d44ad2cec4273.tar.gz
emacs-eb9f80e37b42576dd5a86c89e18d44ad2cec4273.zip
Revert "Do interactive mode tagging for python.el navigation functions."
This reverts commit 546f552e7b2439b482c7d28222fb88761a9c876a. This is a "core package", so can't use the new syntax.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el36
1 files changed, 18 insertions, 18 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 7506043a190..afb96974b17 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1506,7 +1506,7 @@ point position. Return non-nil if point is moved to
1506(defun python-nav-end-of-defun () 1506(defun python-nav-end-of-defun ()
1507 "Move point to the end of def or class. 1507 "Move point to the end of def or class.
1508Returns nil if point is not in a def or class." 1508Returns nil if point is not in a def or class."
1509 (interactive nil python-mode) 1509 (interactive)
1510 (let ((beg-defun-indent) 1510 (let ((beg-defun-indent)
1511 (beg-pos (point))) 1511 (beg-pos (point)))
1512 (when (or (python-info-looking-at-beginning-of-defun) 1512 (when (or (python-info-looking-at-beginning-of-defun)
@@ -1577,19 +1577,19 @@ repeat it."
1577 "Navigate to closer defun backward ARG times. 1577 "Navigate to closer defun backward ARG times.
1578Unlikely `python-nav-beginning-of-defun' this doesn't care about 1578Unlikely `python-nav-beginning-of-defun' this doesn't care about
1579nested definitions." 1579nested definitions."
1580 (interactive "^p" python-mode) 1580 (interactive "^p")
1581 (python-nav--forward-defun (- (or arg 1)))) 1581 (python-nav--forward-defun (- (or arg 1))))
1582 1582
1583(defun python-nav-forward-defun (&optional arg) 1583(defun python-nav-forward-defun (&optional arg)
1584 "Navigate to closer defun forward ARG times. 1584 "Navigate to closer defun forward ARG times.
1585Unlikely `python-nav-beginning-of-defun' this doesn't care about 1585Unlikely `python-nav-beginning-of-defun' this doesn't care about
1586nested definitions." 1586nested definitions."
1587 (interactive "^p" python-mode) 1587 (interactive "^p")
1588 (python-nav--forward-defun (or arg 1))) 1588 (python-nav--forward-defun (or arg 1)))
1589 1589
1590(defun python-nav-beginning-of-statement () 1590(defun python-nav-beginning-of-statement ()
1591 "Move to start of current statement." 1591 "Move to start of current statement."
1592 (interactive "^" python-mode) 1592 (interactive "^")
1593 (forward-line 0) 1593 (forward-line 0)
1594 (let* ((ppss (syntax-ppss)) 1594 (let* ((ppss (syntax-ppss))
1595 (context-point 1595 (context-point
@@ -1613,7 +1613,7 @@ nested definitions."
1613Optional argument NOEND is internal and makes the logic to not 1613Optional argument NOEND is internal and makes the logic to not
1614jump to the end of line when moving forward searching for the end 1614jump to the end of line when moving forward searching for the end
1615of the statement." 1615of the statement."
1616 (interactive "^" python-mode) 1616 (interactive "^")
1617 (let (string-start bs-pos (last-string-end 0)) 1617 (let (string-start bs-pos (last-string-end 0))
1618 (while (and (or noend (goto-char (line-end-position))) 1618 (while (and (or noend (goto-char (line-end-position)))
1619 (not (eobp)) 1619 (not (eobp))
@@ -1654,7 +1654,7 @@ Overlapping strings detected (start=%d, last-end=%d)")
1654(defun python-nav-backward-statement (&optional arg) 1654(defun python-nav-backward-statement (&optional arg)
1655 "Move backward to previous statement. 1655 "Move backward to previous statement.
1656With ARG, repeat. See `python-nav-forward-statement'." 1656With ARG, repeat. See `python-nav-forward-statement'."
1657 (interactive "^p" python-mode) 1657 (interactive "^p")
1658 (or arg (setq arg 1)) 1658 (or arg (setq arg 1))
1659 (python-nav-forward-statement (- arg))) 1659 (python-nav-forward-statement (- arg)))
1660 1660
@@ -1662,7 +1662,7 @@ With ARG, repeat. See `python-nav-forward-statement'."
1662 "Move forward to next statement. 1662 "Move forward to next statement.
1663With ARG, repeat. With negative argument, move ARG times 1663With ARG, repeat. With negative argument, move ARG times
1664backward to previous statement." 1664backward to previous statement."
1665 (interactive "^p" python-mode) 1665 (interactive "^p")
1666 (or arg (setq arg 1)) 1666 (or arg (setq arg 1))
1667 (while (> arg 0) 1667 (while (> arg 0)
1668 (python-nav-end-of-statement) 1668 (python-nav-end-of-statement)
@@ -1677,7 +1677,7 @@ backward to previous statement."
1677 1677
1678(defun python-nav-beginning-of-block () 1678(defun python-nav-beginning-of-block ()
1679 "Move to start of current block." 1679 "Move to start of current block."
1680 (interactive "^" python-mode) 1680 (interactive "^")
1681 (let ((starting-pos (point))) 1681 (let ((starting-pos (point)))
1682 (if (progn 1682 (if (progn
1683 (python-nav-beginning-of-statement) 1683 (python-nav-beginning-of-statement)
@@ -1701,7 +1701,7 @@ backward to previous statement."
1701 1701
1702(defun python-nav-end-of-block () 1702(defun python-nav-end-of-block ()
1703 "Move to end of current block." 1703 "Move to end of current block."
1704 (interactive "^" python-mode) 1704 (interactive "^")
1705 (when (python-nav-beginning-of-block) 1705 (when (python-nav-beginning-of-block)
1706 (let ((block-indentation (current-indentation))) 1706 (let ((block-indentation (current-indentation)))
1707 (python-nav-end-of-statement) 1707 (python-nav-end-of-statement)
@@ -1717,7 +1717,7 @@ backward to previous statement."
1717(defun python-nav-backward-block (&optional arg) 1717(defun python-nav-backward-block (&optional arg)
1718 "Move backward to previous block of code. 1718 "Move backward to previous block of code.
1719With ARG, repeat. See `python-nav-forward-block'." 1719With ARG, repeat. See `python-nav-forward-block'."
1720 (interactive "^p" python-mode) 1720 (interactive "^p")
1721 (or arg (setq arg 1)) 1721 (or arg (setq arg 1))
1722 (python-nav-forward-block (- arg))) 1722 (python-nav-forward-block (- arg)))
1723 1723
@@ -1725,7 +1725,7 @@ With ARG, repeat. See `python-nav-forward-block'."
1725 "Move forward to next block of code. 1725 "Move forward to next block of code.
1726With ARG, repeat. With negative argument, move ARG times 1726With ARG, repeat. With negative argument, move ARG times
1727backward to previous block." 1727backward to previous block."
1728 (interactive "^p" python-mode) 1728 (interactive "^p")
1729 (or arg (setq arg 1)) 1729 (or arg (setq arg 1))
1730 (let ((block-start-regexp 1730 (let ((block-start-regexp
1731 (python-rx line-start (* whitespace) block-start)) 1731 (python-rx line-start (* whitespace) block-start))
@@ -1878,7 +1878,7 @@ throw errors when at end of sexp, skip it instead. With optional
1878argument SKIP-PARENS-P force sexp motion to ignore parenthesized 1878argument SKIP-PARENS-P force sexp motion to ignore parenthesized
1879expressions when looking at them in either direction (forced to t 1879expressions when looking at them in either direction (forced to t
1880in interactive calls)." 1880in interactive calls)."
1881 (interactive "^p" python-mode) 1881 (interactive "^p")
1882 (or arg (setq arg 1)) 1882 (or arg (setq arg 1))
1883 ;; Do not follow parens on interactive calls. This hack to detect 1883 ;; Do not follow parens on interactive calls. This hack to detect
1884 ;; if the function was called interactively copes with the way 1884 ;; if the function was called interactively copes with the way
@@ -1912,7 +1912,7 @@ throw errors when at end of sexp, skip it instead. With optional
1912argument SKIP-PARENS-P force sexp motion to ignore parenthesized 1912argument SKIP-PARENS-P force sexp motion to ignore parenthesized
1913expressions when looking at them in either direction (forced to t 1913expressions when looking at them in either direction (forced to t
1914in interactive calls)." 1914in interactive calls)."
1915 (interactive "^p" python-mode) 1915 (interactive "^p")
1916 (or arg (setq arg 1)) 1916 (or arg (setq arg 1))
1917 (python-nav-forward-sexp (- arg) safe skip-parens-p)) 1917 (python-nav-forward-sexp (- arg) safe skip-parens-p))
1918 1918
@@ -1922,7 +1922,7 @@ With ARG, do it that many times. Negative arg -N means move
1922backward N times. With optional argument SKIP-PARENS-P force 1922backward N times. With optional argument SKIP-PARENS-P force
1923sexp motion to ignore parenthesized expressions when looking at 1923sexp motion to ignore parenthesized expressions when looking at
1924them in either direction (forced to t in interactive calls)." 1924them in either direction (forced to t in interactive calls)."
1925 (interactive "^p" python-mode) 1925 (interactive "^p")
1926 (python-nav-forward-sexp arg t skip-parens-p)) 1926 (python-nav-forward-sexp arg t skip-parens-p))
1927 1927
1928(defun python-nav-backward-sexp-safe (&optional arg skip-parens-p) 1928(defun python-nav-backward-sexp-safe (&optional arg skip-parens-p)
@@ -1931,7 +1931,7 @@ With ARG, do it that many times. Negative arg -N means move
1931forward N times. With optional argument SKIP-PARENS-P force sexp 1931forward N times. With optional argument SKIP-PARENS-P force sexp
1932motion to ignore parenthesized expressions when looking at them in 1932motion to ignore parenthesized expressions when looking at them in
1933either direction (forced to t in interactive calls)." 1933either direction (forced to t in interactive calls)."
1934 (interactive "^p" python-mode) 1934 (interactive "^p")
1935 (python-nav-backward-sexp arg t skip-parens-p)) 1935 (python-nav-backward-sexp arg t skip-parens-p))
1936 1936
1937(defun python-nav--up-list (&optional dir) 1937(defun python-nav--up-list (&optional dir)
@@ -1977,7 +1977,7 @@ DIR is always 1 or -1 and comes sanitized from
1977With ARG, do this that many times. 1977With ARG, do this that many times.
1978A negative argument means move backward but still to a less deep spot. 1978A negative argument means move backward but still to a less deep spot.
1979This command assumes point is not in a string or comment." 1979This command assumes point is not in a string or comment."
1980 (interactive "^p" python-mode) 1980 (interactive "^p")
1981 (or arg (setq arg 1)) 1981 (or arg (setq arg 1))
1982 (while (> arg 0) 1982 (while (> arg 0)
1983 (python-nav--up-list 1) 1983 (python-nav--up-list 1)
@@ -1991,7 +1991,7 @@ This command assumes point is not in a string or comment."
1991With ARG, do this that many times. 1991With ARG, do this that many times.
1992A negative argument means move forward but still to a less deep spot. 1992A negative argument means move forward but still to a less deep spot.
1993This command assumes point is not in a string or comment." 1993This command assumes point is not in a string or comment."
1994 (interactive "^p" python-mode) 1994 (interactive "^p")
1995 (or arg (setq arg 1)) 1995 (or arg (setq arg 1))
1996 (python-nav-up-list (- arg))) 1996 (python-nav-up-list (- arg)))
1997 1997
@@ -1999,7 +1999,7 @@ This command assumes point is not in a string or comment."
1999 "Move point at the beginning the __main__ block. 1999 "Move point at the beginning the __main__ block.
2000When \"if __name__ == \\='__main__\\=':\" is found returns its 2000When \"if __name__ == \\='__main__\\=':\" is found returns its
2001position, else returns nil." 2001position, else returns nil."
2002 (interactive nil python-mode) 2002 (interactive)
2003 (let ((point (point)) 2003 (let ((point (point))
2004 (found (catch 'found 2004 (found (catch 'found
2005 (goto-char (point-min)) 2005 (goto-char (point-min))