1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

Merge from emacs-24; up to 2012-12-26T16:22:18Z!michael.albinus@gmx.de

This commit is contained in:
Glenn Morris 2013-03-30 09:55:47 -07:00
commit 8d3655be5a
8 changed files with 89 additions and 39 deletions

View file

@ -1,21 +1,23 @@
;; 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.
;;; ede/templates/autoconf.srt --- Templates for autoconf used by EDE
;; 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.
;; Copyright (C) 2010, 2012-2013 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
;; 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 "{{"

View file

@ -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.

View file

@ -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)

View file

@ -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."

View file

@ -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:

View file

@ -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

View file

@ -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.

View file

@ -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)))))