diff options
author | Glenn Morris <rgm@gnu.org> | 2013-03-30 09:55:47 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2013-03-30 09:55:47 -0700 |
commit | 8d3655be5a5c41b1f0a9985bcdb614693fce67e5 (patch) | |
tree | c213796b69a9d40c6563c211c20ea815754ad560 | |
parent | 14a581695f7b9c70b8531a41a327a2e01f6125ba (diff) | |
parent | b011a6e8011c51e09f28d528a541509c17d4eed0 (diff) |
Merge from emacs-24; up to 2012-12-26T16:22:18Z!michael.albinus@gmx.de
-rw-r--r-- | etc/srecode/ede-autoconf.srt | 28 | ||||
-rw-r--r-- | lisp/ChangeLog | 16 | ||||
-rw-r--r-- | lisp/iswitchb.el | 2 | ||||
-rw-r--r-- | lisp/net/tramp.el | 19 | ||||
-rw-r--r-- | lisp/profiler.el | 8 | ||||
-rw-r--r-- | lisp/progmodes/python.el | 16 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/automated/python-tests.el | 30 |
8 files changed, 87 insertions, 37 deletions
diff --git a/etc/srecode/ede-autoconf.srt b/etc/srecode/ede-autoconf.srt index 3a292132ee..5eb2d2d24e 100644 --- a/etc/srecode/ede-autoconf.srt +++ b/etc/srecode/ede-autoconf.srt @@ -1,21 +1,23 @@ -;; ede/templates/autoconf.srt --- Templates for autoconf used by EDE. -;; +;;; ede/templates/autoconf.srt --- Templates for autoconf used by EDE + ;; Copyright (C) 2010, 2012-2013 Free Software Foundation, Inc. -;; + ;; Author: Eric M. Ludlam <eric@siege-engine.com> -;; -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2, or (at -;; your option) any later version. -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. +;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. set mode "autoconf-mode" set escape_start "{{" diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 26739a286e..d1b827966d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2013-03-30 Fabián Ezequiel Gallina <fabian@anue.biz> + + Un-indent after "pass" and "return" statements (Bug#13888) + * progmodes/python.el (python-indent-block-enders): New var. + (python-indent-calculate-indentation): Use it. + +2013-03-30 Michael Albinus <michael.albinus@gmx.de> + + * net/tramp.el (tramp-drop-volume-letter): Make it an ordinary + defun. Defining it as defalias could introduce too eager + byte-compiler optimization. (Bug#14030) + +2013-03-30 Chong Yidong <cyd@gnu.org> + + * iswitchb.el (iswitchb-read-buffer): Fix typo. + 2013-03-30 Leo Liu <sdl.web@gmail.com> * kmacro.el (kmacro-call-macro): Add optional arg MACRO. diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index 68749f1b01..07873db38e 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el @@ -597,7 +597,7 @@ the selection process begins. Used by isearchb.el." ;; The map is generated every time so that it can inherit new ;; functions. (let ((map (copy-keymap minibuffer-local-map)) - buf-sel iswitchb-final-text map + buf-sel iswitchb-final-text icomplete-mode) ; prevent icomplete starting up (define-key map "?" 'iswitchb-completion-help) (define-key map "\C-s" 'iswitchb-next-match) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 86f7f338b2..7795d9f808 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1660,23 +1660,16 @@ FILE must be a local file name on a connection identified via VEC." (tramp-compat-font-lock-add-keywords 'emacs-lisp-mode '("\\<with-tramp-connection-property\\>")) -(defalias 'tramp-drop-volume-letter - (if (memq system-type '(cygwin windows-nt)) - (lambda (name) - "Cut off unnecessary drive letter from file NAME. +(defun tramp-drop-volume-letter (name) + "Cut off unnecessary drive letter from file NAME. The functions `tramp-*-handle-expand-file-name' call `expand-file-name' locally on a remote file name. When the local system is a W32 system but the remote system is Unix, this introduces a superfluous drive letter into the file name. This function removes it." - (save-match-data - (if (string-match "\\`[a-zA-Z]:/" name) - (replace-match "/" nil t name) - name))) - - 'identity)) - -(if (featurep 'xemacs) - (defalias 'tramp-drop-volume-letter 'identity)) + (save-match-data + (if (string-match "\\`[a-zA-Z]:/" name) + (replace-match "/" nil t name) + name))) (defun tramp-cleanup (vec) "Cleanup connection VEC, but keep the debug buffer." diff --git a/lisp/profiler.el b/lisp/profiler.el index 07192a39be..093a01a860 100644 --- a/lisp/profiler.el +++ b/lisp/profiler.el @@ -5,18 +5,20 @@ ;; Author: Tomohiro Matsuyama <tomo@cx4a.org> ;; Keywords: lisp -;; This program is free software; you can redistribute it and/or modify +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. -;; This program is distributed in the hope that it will be useful, +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. +;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;;; Commentary: diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f0f67d0184..d1009534e4 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -638,6 +638,12 @@ It makes underscores and dots word constituent chars.") These make `python-indent-calculate-indentation' subtract the value of `python-indent-offset'.") +(defvar python-indent-block-enders '("return" "pass") + "List of words that mark the end of a block. +These make `python-indent-calculate-indentation' subtract the +value of `python-indent-offset' when `python-indent-context' is +AFTER-LINE.") + (defun python-indent-guess-indent-offset () "Guess and set `python-indent-offset' for the current buffer." (interactive) @@ -763,9 +769,13 @@ START is the buffer position where the sexp starts." (save-excursion (goto-char context-start) (current-indentation)) - (if (progn - (back-to-indentation) - (looking-at (regexp-opt python-indent-dedenters))) + (if (or (save-excursion + (back-to-indentation) + (looking-at (regexp-opt python-indent-dedenters))) + (save-excursion + (python-util-forward-comment -1) + (python-nav-beginning-of-statement) + (member (current-word) python-indent-block-enders))) python-indent-offset 0))) ;; When inside of a string, do nothing. just use the current diff --git a/test/ChangeLog b/test/ChangeLog index 43648ad1bb..cd4414cd07 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2013-03-30 Fabián Ezequiel Gallina <fabian@anue.biz> + + * automated/python-tests.el (python-indent-block-enders): New test. + (python-info-current-defun-2): Fix test. + 2013-03-05 Paul Eggert <eggert@cs.ucla.edu> * indent/octave.m: Fix encoding error in comment. Add coding tag. diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index ab8eb4816d..d0a7ab5725 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -444,6 +444,28 @@ objects = Thing.objects.all() \\\\ (should (eq (car (python-indent-context)) 'after-line)) (should (= (python-indent-calculate-indentation) 0)))) +(ert-deftest python-indent-block-enders () + "Test `python-indent-block-enders' value honouring." + (python-tests-with-temp-buffer + " +Class foo(object): + + def bar(self): + if self.baz: + return (1, + 2, + 3) + + else: + pass +" + (python-tests-look-at "3)") + (forward-line 1) + (= (python-indent-calculate-indentation) 12) + (python-tests-look-at "pass") + (forward-line 1) + (= (python-indent-calculate-indentation) 8))) + ;;; Navigation @@ -1546,13 +1568,13 @@ class C(object): return [] def b(): - pass + do_b() def a(): - pass + do_a() def c(self): - pass + do_c() " (forward-line 1) (should (string= "C" (python-info-current-defun))) @@ -1582,7 +1604,7 @@ class C(object): (python-tests-look-at "def c(self):") (should (string= "C.c" (python-info-current-defun))) (should (string= "def C.c" (python-info-current-defun t))) - (python-tests-look-at "pass") + (python-tests-look-at "do_c()") (should (string= "C.c" (python-info-current-defun))) (should (string= "def C.c" (python-info-current-defun t))))) |