diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2016-03-28 03:51:21 +0300 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2016-03-28 03:59:05 +0300 |
commit | 124c48619e2c68c497d9075e6e940142c174c77b (patch) | |
tree | 013cb50ed9f472ea2f7f036f310be00c4d98770b /lisp/progmodes/python.el | |
parent | e65c3079c65595d95749348366af9811fafff062 (diff) | |
download | emacs-124c48619e2c68c497d9075e6e940142c174c77b.tar.gz |
Remove prog-indentation-contextremove-prog-indentation-context
* lisp/progmodes/prog-mode.el: (prog-indentation-context)
(prog-first-column, prog-widen): Remove, as discussed in
http://lists.gnu.org/archive/html/emacs-devel/2016-03/msg01425.html.
* doc/lispref/text.texi (Mode-Specific Indent): Remove references
to them.
* etc/NEWS: Ditto.
* lisp/progmodes/python.el: (prog-widen, prog-first-column):
Remove the compatibility aliases and all uses.
Do not merge to master.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r-- | lisp/progmodes/python.el | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 5aeefe47a54..90097df7ef1 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -283,18 +283,6 @@ :version "24.3" :link '(emacs-commentary-link "python")) - -;;; 24.x Compat - - -(unless (fboundp 'prog-widen) - (defun prog-widen () - (widen))) - -(unless (fboundp 'prog-first-column) - (defun prog-first-column () - 0)) - ;;; Bindings @@ -761,7 +749,7 @@ work on `python-indent-calculate-indentation' instead." (interactive) (save-excursion (save-restriction - (prog-widen) + (widen) (goto-char (point-min)) (let ((block-end)) (while (and (not block-end) @@ -860,7 +848,7 @@ keyword - Point is on a line starting a dedenter block. - START is the position where the dedenter block starts." (save-restriction - (prog-widen) + (widen) (let ((ppss (save-excursion (beginning-of-line) (syntax-ppss)))) @@ -1007,10 +995,10 @@ current context or a list of integers. The latter case is only happening for :at-dedenter-block-start context since the possibilities can be narrowed to specific indentation points." (save-restriction - (prog-widen) + (widen) (save-excursion (pcase (python-indent-context) - (`(:no-indent . ,_) (prog-first-column)) ; usually 0 + (`(:no-indent . ,_) 0) (`(,(or :after-line :after-comment :inside-string @@ -1048,7 +1036,7 @@ possibilities can be narrowed to specific indentation points." (let ((opening-block-start-points (python-info-dedenter-opening-block-positions))) (if (not opening-block-start-points) - (prog-first-column) ; if not found default to first column + 0 ; if not found default to first column (mapcar (lambda (pos) (save-excursion (goto-char pos) @@ -1066,7 +1054,7 @@ integers. Levels are returned in ascending order, and in the case INDENTATION is a list, this order is enforced." (if (listp indentation) (sort (copy-sequence indentation) #'<) - (nconc (number-sequence (prog-first-column) (1- indentation) + (nconc (number-sequence 0 (1- indentation) python-indent-offset) (list indentation)))) @@ -1091,7 +1079,7 @@ minimum." (python-indent--previous-level levels (current-indentation)) (if levels (apply #'max levels) - (prog-first-column))))) + 0)))) (defun python-indent-line (&optional previous) "Internal implementation of `python-indent-line-function'. @@ -4479,7 +4467,7 @@ Optional argument INCLUDE-TYPE indicates to include the type of the defun. This function can be used as the value of `add-log-current-defun-function' since it returns nil if point is not inside a defun." (save-restriction - (prog-widen) + (widen) (save-excursion (end-of-line 1) (let ((names) @@ -4662,7 +4650,7 @@ likely an invalid python file." (let ((point (python-info-dedenter-opening-block-position))) (when point (save-restriction - (prog-widen) + (widen) (message "Closes %s" (save-excursion (goto-char point) (buffer-substring @@ -4683,7 +4671,7 @@ statement." With optional argument LINE-NUMBER, check that line instead." (save-excursion (save-restriction - (prog-widen) + (widen) (when line-number (python-util-goto-line line-number)) (while (and (not (eobp)) @@ -4699,7 +4687,7 @@ With optional argument LINE-NUMBER, check that line instead." Optional argument LINE-NUMBER forces the line number to check against." (save-excursion (save-restriction - (prog-widen) + (widen) (when line-number (python-util-goto-line line-number)) (when (python-info-line-ends-backslash-p) @@ -4716,7 +4704,7 @@ When current line is continuation of another return the point where the continued line ends." (save-excursion (save-restriction - (prog-widen) + (widen) (let* ((context-type (progn (back-to-indentation) (python-syntax-context-type))) |