1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00

Merge from emacs-24; up to 2014-07-04T02:28:54Z!dmantipov@yandex.ru

This commit is contained in:
Glenn Morris 2014-09-02 21:21:40 -07:00
commit 62fca47221
16 changed files with 150 additions and 57 deletions

View File

@ -1,3 +1,45 @@
2014-09-03 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/package.el (package-generate-description-file):
Properly quote the arguments (bug#18332). Change second arg.
(package--alist-to-plist-args): Rename from package--alist-to-plist and
quote the elements.
(package--make-autoloads-and-stuff): Fix the test for pre-existence of
the *-pkg.el file. Adjust to new calling convention of
package-generate-description-file.
* progmodes/gud.el (gud-gdb-completion-at-point): Add hack (bug#18282).
(gud-gdb-completions): Remove obsolete workaround.
2014-09-03 Eli Zaretskii <eliz@gnu.org>
* subr.el (posn-col-row): Revert the change from commit
2010-11-13T21:07:58Z!eliz@gnu.org, which
was inadvertently merged from emacs-23 release branch in 2010-11-18T03:54:14Z!monnier@iro.umontreal.ca
monnier@iro.umontreal.ca-20101118035414-yvlg7k7dk4k4l3q, and
introduced an off-by-one error in the reported row when there is a
header line. (Bug#18384)
2014-09-03 Fabián Ezequiel Gallina <fgallina@gnu.org>
* progmodes/python.el (python-indent-post-self-insert-function):
Avoid electric colon at beginning-of-defun. (Bug#18228)
2014-09-03 Glenn Morris <rgm@gnu.org>
* tutorial.el (tutorial--display-changes):
Fix 2014-08-01 change. (Bug#18382)
2014-09-03 Ken Brown <kbrown@cornell.edu>
* startup.el (fancy-splash-frame): Extend the fix for Bug#16014 to
the Cygwin-w32 build. (Bug#18347)
2014-09-03 Glenn Morris <rgm@gnu.org>
* tar-mode.el (tar--extract, tar-extract):
Avoid permanently disabling undo in extracted buffers. (Bug#18344)
2014-09-03 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/sh-script.el (sh-font-lock-quoted-subshell): Try to better

View File

@ -689,11 +689,9 @@ untar into a directory named DIR; otherwise, signal an error."
(error "Package does not untar cleanly into directory %s/" dir)))))
(tar-untar-buffer))
(defun package-generate-description-file (pkg-desc pkg-dir)
(defun package-generate-description-file (pkg-desc pkg-file)
"Create the foo-pkg.el file for single-file packages."
(let* ((name (package-desc-name pkg-desc))
(pkg-file (expand-file-name (package--description-file pkg-dir)
pkg-dir)))
(let* ((name (package-desc-name pkg-desc)))
(let ((print-level nil)
(print-quoted t)
(print-length nil))
@ -714,25 +712,20 @@ untar into a directory named DIR; otherwise, signal an error."
(list (car elt)
(package-version-join (cadr elt))))
requires))))
(let ((alist (package-desc-extras pkg-desc))
flat)
(while alist
(let* ((pair (pop alist))
(key (car pair))
(val (cdr pair)))
;; Don't bother quoteing key; it is always a keyword.
(push key flat)
(push (if (and (not (consp val))
(or (keywordp val)
(not (symbolp val))
(memq val '(nil t))))
val
`',val)
flat)))
(nreverse flat))))
(package--alist-to-plist-args
(package-desc-extras pkg-desc))))
"\n")
nil pkg-file nil 'silent))))
(defun package--alist-to-plist-args (alist)
(mapcar (lambda (x)
(if (and (not (consp x))
(or (keywordp x)
(not (symbolp x))
(memq x '(nil t))))
x `',x))
(apply #'nconc
(mapcar (lambda (pair) (list (car pair) (cdr pair))) alist))))
(defun package-unpack (pkg-desc)
"Install the contents of the current buffer as a package."
(let* ((name (package-desc-name pkg-desc))
@ -764,9 +757,10 @@ untar into a directory named DIR; otherwise, signal an error."
(defun package--make-autoloads-and-stuff (pkg-desc pkg-dir)
"Generate autoloads, description file, etc.. for PKG-DESC installed at PKG-DIR."
(package-generate-autoloads (package-desc-name pkg-desc) pkg-dir)
(let ((desc-file (package--description-file pkg-dir)))
(let ((desc-file (expand-file-name (package--description-file pkg-dir)
pkg-dir)))
(unless (file-exists-p desc-file)
(package-generate-description-file pkg-desc pkg-dir)))
(package-generate-description-file pkg-desc desc-file)))
;; FIXME: Create foo.info and dir file from foo.texi?
)

View File

@ -810,18 +810,6 @@ CONTEXT is the text before COMMAND on the line."
(current-buffer)
;; From string-match above.
(length context))))
;; `gud-gdb-run-command-fetch-lines' has some nasty side-effects on the
;; buffer (via `gud-delete-prompt-marker'): it removes the prompt and then
;; re-adds it later, thus messing up markers and overlays along the way.
;; This is a problem for completion-in-region which uses an overlay to
;; create a field.
;; So we restore completion-in-region's field if needed.
;; FIXME: change gud-gdb-run-command-fetch-lines so it doesn't modify the
;; buffer at all.
(when (/= start (- (point) (field-beginning)))
(dolist (ol (overlays-at (1- (point))))
(when (eq (overlay-get ol 'field) 'completion)
(move-overlay ol (- (point) start) (overlay-end ol)))))
;; Protect against old versions of GDB.
(and complete-list
(string-match "^Undefined command: \"complete\"" (car complete-list))
@ -860,7 +848,14 @@ CONTEXT is the text before COMMAND on the line."
(save-excursion
(skip-chars-backward "^ " (comint-line-beginning-position))
(point))))
(list start end
;; FIXME: `gud-gdb-run-command-fetch-lines' has some nasty side-effects on
;; the buffer (via `gud-delete-prompt-marker'): it removes the prompt and
;; then re-adds it later, thus messing up markers and overlays along the
;; way (bug#18282).
;; We use an "insert-before" marker for `start', since it's typically right
;; after the prompt, which works around the problem, but is a hack (and
;; comes with other downsides, e.g. if completion adds text at `start').
(list (copy-marker start t) end
(completion-table-dynamic
(apply-partially gud-gdb-completion-function
(buffer-substring (comint-line-beginning-position)

View File

@ -1162,9 +1162,15 @@ the line will be re-indented automatically if needed."
((and (eq ?: last-command-event)
(memq ?: electric-indent-chars)
(not current-prefix-arg)
;; Trigger electric colon only at end of line
(eolp)
;; Avoid re-indenting on extra colon
(not (equal ?: (char-before (1- (point)))))
(not (python-syntax-comment-or-string-p)))
(not (python-syntax-comment-or-string-p))
;; Never re-indent at beginning of defun
(not (save-excursion
(python-nav-beginning-of-statement)
(python-info-looking-at-beginning-of-defun))))
(python-indent-line)))))

View File

@ -1797,7 +1797,7 @@ we put it on this frame."
(let (chosen-frame)
;; MS-Windows needs this to have a chance to make the initial
;; frame visible.
(if (eq system-type 'windows-nt)
(if (eq (window-system) 'w32)
(sit-for 0 t))
(dolist (frame (append (frame-list) (list (selected-frame))))
(if (and (frame-visible-p frame)

View File

@ -1156,10 +1156,7 @@ and `event-end' functions."
((null spacing)
(setq spacing 0)))
(cons (/ (car pair) (frame-char-width frame))
(- (/ (cdr pair) (+ (frame-char-height frame) spacing))
(if (null (with-current-buffer (window-buffer window)
header-line-format))
0 1))))))))
(/ (cdr pair) (+ (frame-char-height frame) spacing))))))))
(defun posn-actual-col-row (position)
"Return the actual column and row in POSITION, measured in characters.

View File

@ -800,8 +800,6 @@ tar-file's buffer."
tarname
")"))
(buffer (generate-new-buffer bufname)))
(with-current-buffer buffer
(setq buffer-undo-list t))
(with-current-buffer tar-data-buffer
(let (coding)
(narrow-to-region start end)
@ -829,7 +827,11 @@ tar-file's buffer."
(with-current-buffer buffer
(set-buffer-multibyte nil)))
(widen)
(decode-coding-region start end coding buffer)))
(with-current-buffer buffer
(setq buffer-undo-list t))
(decode-coding-region start end coding buffer)
(with-current-buffer buffer
(setq buffer-undo-list nil))))
buffer))
(defun tar-extract (&optional other-window-p)
@ -869,7 +871,6 @@ tar-file's buffer."
(with-current-buffer tar-buffer
default-directory))
(set-buffer-modified-p nil)
(setq buffer-undo-list t)
(normal-mode) ; pick a mode.
(set (make-local-variable 'tar-superior-buffer) tar-buffer)
(set (make-local-variable 'tar-superior-descriptor) descriptor)

View File

@ -209,10 +209,10 @@ LEFT and RIGHT are the elements to compare."
(symbol-name cx)))))))
(defconst tutorial--default-keys
;; On window system, `suspend-emacs' is replaced in the default
;; keymap
;; On window system, `suspend-emacs' is replaced in the default keymap.
(let* ((suspend-emacs 'suspend-frame)
(default-keys
;; The first few are not mentioned but are basic:
`((ESC-prefix [27])
(Control-X-prefix [?\C-x])
(mode-specific-command-prefix [?\C-c])
@ -552,7 +552,7 @@ with some explanatory links."
;; binding because the Hebrew tutorial uses directional
;; controls and Hebrew character maqaf, the Hebrew hyphen,
;; immediately before the binding string.
(concat "\\([[:space:]]\\|[[:punct:]]\\)\\("
(concat "\\(?:[[:space:]]\\|[[:punct:]]\\)\\("
(mapconcat (lambda (kdf) (regexp-quote
(tutorial--key-description
(nth 1 kdf))))

View File

@ -1,3 +1,25 @@
2014-09-03 Eli Zaretskii <eliz@gnu.org>
* dispnew.c (buffer_posn_from_coords): Fix an off-by-one error in
the reported row in the case of a window with a header line, by
improving on the fix committed in 2011-10-08T10:58:50Z!eliz@gnu.org
eliz@gnu.org-20111008105850-ht4tvsayohvr1kjc. (Bug#18384)
2014-09-03 Paul Eggert <eggert@cs.ucla.edu>
* eval.c (internal_lisp_condition_case): Don't overrun the stack
when configured --with-wide-int on typical 32-bit platforms.
2014-09-03 Eli Zaretskii <eliz@gnu.org>
* xdisp.c (display_and_set_cursor): Call erase_phys_cursor also
when HPOS is negative, for the benefit of R2L glyph rows whose
newline overflows into the fringe.
2014-09-03 Ken Brown <kbrown@cornell.edu>
* conf_post.h (strnicmp) [CYGWIN && HAVE_NTGUI]: Define. (Bug#18366)
2014-09-02 Paul Eggert <eggert@cs.ucla.edu>
Minor cleanup of recent strlen-avoiding patch.

View File

@ -193,6 +193,10 @@ extern void _DebPrint (const char *fmt, ...);
#if defined CYGWIN && defined HAVE_NTGUI
# define NTGUI_UNICODE /* Cygwin runs only on UNICODE-supporting systems */
# define _WIN32_WINNT 0x500 /* Win2k */
/* The following was in /usr/include/string.h prior to Cygwin 1.7.33. */
#ifndef strnicmp
#define strnicmp strncasecmp
#endif
#endif
#ifdef emacs /* Don't do this for lib-src. */

View File

@ -5121,7 +5121,7 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
#ifdef HAVE_WINDOW_SYSTEM
struct image *img = 0;
#endif
int x0, x1, to_x;
int x0, x1, to_x, it_vpos;
void *itdata = NULL;
/* We used to set current_buffer directly here, but that does the
@ -5130,11 +5130,6 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
itdata = bidi_shelve_cache ();
CLIP_TEXT_POS_FROM_MARKER (startp, w->start);
start_display (&it, w, startp);
/* start_display takes into account the header-line row, but IT's
vpos still counts from the glyph row that includes the window's
start position. Adjust for a possible header-line row. */
it.vpos += WINDOW_WANTS_HEADER_LINE_P (w);
x0 = *x;
/* First, move to the beginning of the row corresponding to *Y. We
@ -5204,8 +5199,13 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
}
#endif
if (it.vpos < w->current_matrix->nrows
&& (row = MATRIX_ROW (w->current_matrix, it.vpos),
/* IT's vpos counts from the glyph row that includes the window's
start position, i.e. it excludes the header-line row, but
MATRIX_ROW includes the header-line row. Adjust for a possible
header-line row. */
it_vpos = it.vpos + WINDOW_WANTS_MODELINE_P (w);
if (it_vpos < w->current_matrix->nrows
&& (row = MATRIX_ROW (w->current_matrix, it_vpos),
row->enabled_p))
{
if (it.hpos < row->used[TEXT_AREA])

View File

@ -1273,7 +1273,7 @@ internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform,
{ /* The first clause is the one that should be checked first, so it should
be added to handlerlist last. So we build in `clauses' a table that
contains `handlers' but in reverse order. */
Lisp_Object *clauses = alloca (clausenb * sizeof (Lisp_Object *));
Lisp_Object *clauses = alloca (clausenb * sizeof *clauses);
Lisp_Object *volatile clauses_volatile = clauses;
int i = clausenb;
for (val = handlers; CONSP (val); val = XCDR (val))

View File

@ -27513,6 +27513,10 @@ display_and_set_cursor (struct window *w, bool on,
&& (!on
|| w->phys_cursor.x != x
|| w->phys_cursor.y != y
/* HPOS can be negative in R2L rows whose
exact_window_width_line_p flag is set (i.e. their newline
would "overflow into the fringe"). */
|| hpos < 0
|| new_cursor_type != w->phys_cursor_type
|| ((new_cursor_type == BAR_CURSOR || new_cursor_type == HBAR_CURSOR)
&& new_cursor_width != w->phys_cursor_width)))

View File

@ -1,3 +1,8 @@
2014-09-03 Fabián Ezequiel Gallina <fgallina@gnu.org>
* automated/python-tests.el (python-indent-electric-colon-1):
New test. (Bug#18228)
2014-08-29 Dmitry Antipov <dmantipov@yandex.ru>
* automated/fns-tests.el (fns-tests-sort): New test.

View File

@ -711,6 +711,20 @@ if a:
(should (= (python-indent-calculate-indentation) 0))
(should (equal (python-indent-calculate-levels) '(0)))))
(ert-deftest python-indent-electric-colon-1 ()
"Test indentation case from Bug#18228."
(python-tests-with-temp-buffer
"
def a():
pass
def b()
"
(python-tests-look-at "def b()")
(goto-char (line-end-position))
(python-tests-self-insert ":")
(should (= (current-indentation) 0))))
;;; Navigation

9
test/indent/scheme.scm Normal file
View File

@ -0,0 +1,9 @@
#!/usr/bin/scheme is this a comment?
;; This one is a comment
(a)
#| and this one as #|well|# as this! |#
(b)
(cons #;(this is a
comment)
head tail)