Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
03970739
Kaydet (Commit)
03970739
authored
Tem 03, 1996
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
(py-delete-char): Obey numeric argument.
üst
dea4a29e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
python-mode.el
Misc/python-mode.el
+21
-15
No files found.
Misc/python-mode.el
Dosyayı görüntüle @
03970739
...
...
@@ -25,9 +25,10 @@
;; At some point this mode will undergo a rewrite to bring it more in
;; line with GNU Emacs Lisp coding standards. But all in all, the
;; mode works exceedingly well, and I've simply been twe
e
king it as I
;; mode works exceedingly well, and I've simply been twe
a
king it as I
;; go along. Ain't it wonderful that Python has a much more sane
;; syntax than C? (or <shudder> C++?! :-).
;; syntax than C? (or <shudder> C++?! :-). I can say that; I maintain
;; cc-mode!
;; The following statements, placed in your .emacs file or
;; site-init.el, will cause this file to be autoloaded, and
...
...
@@ -50,7 +51,7 @@
;; - proper interaction with pending-del and del-sel modes.
;; - New py-electric-colon (:) command for improved outdenting. Also
;; py-indent-line (TAB) should handle outdented lines better.
;; -
New commands py-outdent-left (C-c C-l) and py-indent-right (C-c C-r)
;; -
improved (I think) C-c > and C-c <
;; Here's a brief to do list:
;;
...
...
@@ -667,7 +668,7 @@ See the `\\[py-execute-region]' docs for an account of some subtleties."
;; Functions for Python style indentation
(
defun
py-delete-char
()
(
defun
py-delete-char
(
count
)
"Reduce indentation or delete character.
If point is at the leftmost column, deletes the preceding newline.
...
...
@@ -676,16 +677,18 @@ neither a continuation line nor a non-indenting comment line, or if
point is at the end of a blank line, reduces the indentation to match
that of the line that opened the current block of code. The line that
opened the block is displayed in the echo area to help you keep track
of where you are.
of where you are. With numeric count, outdents that many blocks (but
not past column zero).
Else the preceding character is deleted, converting a tab to spaces if
needed so that only a single column position is deleted."
(
interactive
"*"
)
needed so that only a single column position is deleted. Numeric
argument delets that many characters."
(
interactive
"*p"
)
(
if
(
or
(
/=
(
current-indentation
)
(
current-column
))
(
bolp
)
(
py-continuation-line-p
)
(
looking-at
"#[^ \t\n]"
))
; non-indenting #
(
backward-delete-char-untabify
1
)
(
backward-delete-char-untabify
count
)
;; else indent the same as the colon line that opened the block
;; force non-blank so py-goto-block-up doesn't ignore it
...
...
@@ -694,13 +697,16 @@ needed so that only a single column position is deleted."
(
let
((
base-indent
0
)
; indentation of base line
(
base-text
""
)
; and text of base line
(
base-found-p
nil
))
(
condition-case
nil
; in case no enclosing block
(
save-excursion
(
py-goto-block-up
'no-mark
)
(
setq
base-indent
(
current-indentation
)
base-text
(
py-suck-up-leading-text
)
base-found-p
t
))
(
error
nil
))
(
save-excursion
(
while
(
<
0
count
)
(
condition-case
nil
; in case no enclosing block
(
progn
(
py-goto-block-up
'no-mark
)
(
setq
base-indent
(
current-indentation
)
base-text
(
py-suck-up-leading-text
)
base-found-p
t
))
(
error
nil
))
(
setq
count
(
1-
count
))))
(
delete-char
1
)
; toss the dummy character
(
delete-horizontal-space
)
(
indent-to
base-indent
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment