mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-27 16:51:06 -07:00
Merge from origin/emacs-24
e726f20Handle "#" operator properly inside macro. Fix coding bug.618931bHandle dead frame in menu-bar-non-minibuffer-window-p. (Bug#19728)017a03aDocument MS-Windows file-name idiosyncrasies (Bug#19463)f3faf4fFix description of Customize buffer in Emacs manual.1c1d0b7Fix a typo in the Emacs manual's Hungry Delete description.be7fb82src/dispextern.h (FACE_FOR_CHAR): Fix the commentary.33c4409Spelling fixes6c8231epython.el: Handle tabs in python-indent-dedent-line.41c3b92* lisp/progmodes/python.el: Respect user indentation after comment.868df45Avoid compiler warnings in decode_env_path.b28c979Fix XEmacs version typo in comment and ChangeLog989fb32Improve solution of bug #197016310530Fix refilling of list of language environments in User Manualc4c447dRestore XEmacs compatibility Conflicts: doc/emacs/ChangeLog lisp/ChangeLog src/ChangeLog test/ChangeLog
This commit is contained in:
commit
d8e9122115
17 changed files with 304 additions and 138 deletions
|
|
@ -843,15 +843,6 @@ keyword
|
|||
;; Beginning of buffer.
|
||||
((= (line-number-at-pos) 1)
|
||||
(cons :no-indent 0))
|
||||
;; Comment continuation (maybe).
|
||||
((save-excursion
|
||||
(when (and
|
||||
(or
|
||||
(python-info-current-line-comment-p)
|
||||
(python-info-current-line-empty-p))
|
||||
(forward-comment -1)
|
||||
(python-info-current-line-comment-p))
|
||||
(cons :after-comment (point)))))
|
||||
;; Inside a string.
|
||||
((let ((start (python-syntax-context 'string ppss)))
|
||||
(when start
|
||||
|
|
@ -963,28 +954,29 @@ keyword
|
|||
((let ((start (python-info-dedenter-statement-p)))
|
||||
(when start
|
||||
(cons :at-dedenter-block-start start))))
|
||||
;; After normal line.
|
||||
((let ((start (save-excursion
|
||||
(back-to-indentation)
|
||||
(skip-chars-backward " \t\n")
|
||||
(python-nav-beginning-of-statement)
|
||||
(point))))
|
||||
(when start
|
||||
(if (save-excursion
|
||||
(python-util-forward-comment -1)
|
||||
(python-nav-beginning-of-statement)
|
||||
(looking-at (python-rx block-ender)))
|
||||
(cons :after-block-end start)
|
||||
(cons :after-line start)))))
|
||||
;; Default case: do not indent.
|
||||
(t (cons :no-indent 0))))))
|
||||
;; After normal line, comment or ender (default case).
|
||||
((save-excursion
|
||||
(back-to-indentation)
|
||||
(skip-chars-backward " \t\n")
|
||||
(python-nav-beginning-of-statement)
|
||||
(cons
|
||||
(cond ((python-info-current-line-comment-p)
|
||||
:after-comment)
|
||||
((save-excursion
|
||||
(goto-char (line-end-position))
|
||||
(python-util-forward-comment -1)
|
||||
(python-nav-beginning-of-statement)
|
||||
(looking-at (python-rx block-ender)))
|
||||
:after-block-end)
|
||||
(t :after-line))
|
||||
(point))))))))
|
||||
|
||||
(defun python-indent--calculate-indentation ()
|
||||
"Internal implementation of `python-indent-calculate-indentation'.
|
||||
May return an integer for the maximum possible indentation at
|
||||
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 especific indentation points."
|
||||
possibilities can be narrowed to specific indentation points."
|
||||
(save-restriction
|
||||
(widen)
|
||||
(save-excursion
|
||||
|
|
@ -1075,7 +1067,7 @@ minimum."
|
|||
(defun python-indent-line (&optional previous)
|
||||
"Internal implementation of `python-indent-line-function'.
|
||||
Use the PREVIOUS level when argument is non-nil, otherwise indent
|
||||
to the maxium available level. When indentation is the minimum
|
||||
to the maximum available level. When indentation is the minimum
|
||||
possible and PREVIOUS is non-nil, cycle back to the maximum
|
||||
level."
|
||||
(let ((follow-indentation-p
|
||||
|
|
@ -1110,9 +1102,7 @@ indentation levels from right to left."
|
|||
(interactive "*")
|
||||
(when (and (not (bolp))
|
||||
(not (python-syntax-comment-or-string-p))
|
||||
(= (+ (line-beginning-position)
|
||||
(current-indentation))
|
||||
(point)))
|
||||
(= (current-indentation) (current-column)))
|
||||
(python-indent-line t)
|
||||
t))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue