[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r116950: Merge from emacs-24; up to r116924
From: |
Daniel Colascione |
Subject: |
[Emacs-diffs] trunk r116950: Merge from emacs-24; up to r116924 |
Date: |
Mon, 07 Apr 2014 20:54:37 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 116950 [merge]
revision-id: address@hidden
parent: address@hidden
parent: address@hidden
committer: Daniel Colascione <address@hidden>
branch nick: trunk
timestamp: Mon 2014-04-07 13:54:16 -0700
message:
Merge from emacs-24; up to r116924
modified:
ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1538
configure.ac
configure.in-20091113204419-o5vbwnq5f7feedwu-783
doc/emacs/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-6227
doc/emacs/arevert-xtra.texi
arevertxtra.texi-20091113204419-o5vbwnq5f7feedwu-6232
doc/emacs/files.texi files.texi-20091113204419-o5vbwnq5f7feedwu-6249
doc/emacs/trouble.texi
trouble.texi-20091113204419-o5vbwnq5f7feedwu-6279
doc/lispref/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-6155
doc/lispref/backups.texi
backups.texi-20091113204419-o5vbwnq5f7feedwu-6162
doc/lispref/os.texi os.texi-20091113204419-o5vbwnq5f7feedwu-6205
etc/NEWS news-20100311060928-aoit31wvzf25yr1z-1
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/autorevert.el
autorevert.el-20091113204419-o5vbwnq5f7feedwu-1197
lisp/doc-view.el docview.el-20091113204419-o5vbwnq5f7feedwu-6334
lisp/elec-pair.el elecpair.el-20131227124533-yaq8recs0j0ggt67-1
lisp/faces.el faces.el-20091113204419-o5vbwnq5f7feedwu-562
lisp/files.el files.el-20091113204419-o5vbwnq5f7feedwu-265
lisp/help.el help.el-20091113204419-o5vbwnq5f7feedwu-280
lisp/international/characters.el
characters.el-20091113204419-o5vbwnq5f7feedwu-1037
lisp/leim/quail/ipa.el ipa.el-20091113204419-o5vbwnq5f7feedwu-1210
lisp/mpc.el mpc.el-20091201190351-ubdosyf8lle4bzd3-10
lisp/progmodes/perl-mode.el perlmode.el-20091113204419-o5vbwnq5f7feedwu-402
lisp/progmodes/python.el python.el-20091113204419-o5vbwnq5f7feedwu-3008
lisp/shell.el shell.el-20091113204419-o5vbwnq5f7feedwu-150
nt/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1545
nt/emacs.rc emacs.rc-20091113204419-o5vbwnq5f7feedwu-875
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/Makefile.in makefile.in-20091113204419-o5vbwnq5f7feedwu-631
src/alloc.c alloc.c-20091113204419-o5vbwnq5f7feedwu-252
src/bidi.c bidi.c-20091231194348-rm8gzug639w0dpq5-1
src/buffer.h buffer.h-20091113204419-o5vbwnq5f7feedwu-196
src/frame.h frame.h-20091113204419-o5vbwnq5f7feedwu-229
src/keyboard.c keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
src/lisp.h lisp.h-20091113204419-o5vbwnq5f7feedwu-253
test/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-8588
test/automated/electric-tests.el
electrictests.el-20131226202454-s3cqbs9maop0w8qy-1
test/automated/python-tests.el
pythontests.el-20130220195218-kqcioz3fssz9hwe1-1
test/indent/perl.perl perl.perl-20121031024456-cjjxr53eeyg5rvml-1
=== modified file 'ChangeLog'
--- a/ChangeLog 2014-04-03 01:16:18 +0000
+++ b/ChangeLog 2014-04-07 20:54:16 +0000
@@ -1,3 +1,8 @@
+2014-04-03 Ken Brown <address@hidden>
+
+ * configure.ac (EMACS_MANIFEST, UPDATE_MANIFEST): Leave these
+ variables empty on Cygwin. (Bug#17176)
+
2014-04-03 Glenn Morris <address@hidden>
* make-dist: Further update AC_INIT regexp.
=== modified file 'configure.ac'
--- a/configure.ac 2014-04-02 15:14:50 +0000
+++ b/configure.ac 2014-04-07 20:54:16 +0000
@@ -1835,11 +1835,6 @@
W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
EMACSRES="emacs.res"
- case "$canonical" in
- x86_64-*-*) EMACS_MANIFEST="emacs-x64.manifest" ;;
- *) EMACS_MANIFEST="emacs-x86.manifest" ;;
- esac
- UPDATE_MANIFEST=update-game-score.exe.manifest
if test "${opsys}" = "cygwin"; then
W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
W32_LIBS="$W32_LIBS -lusp10 -lcomctl32 -lwinspool"
@@ -1847,6 +1842,11 @@
# the rc file), not a linker script.
W32_RES_LINK="-Wl,emacs.res"
else
+ case "$canonical" in
+ x86_64-*-*) EMACS_MANIFEST="emacs-x64.manifest" ;;
+ *) EMACS_MANIFEST="emacs-x86.manifest" ;;
+ esac
+ UPDATE_MANIFEST=update-game-score.exe.manifest
W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o"
W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32"
W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32 -lusp10"
=== modified file 'doc/emacs/ChangeLog'
--- a/doc/emacs/ChangeLog 2014-03-28 01:29:54 +0000
+++ b/doc/emacs/ChangeLog 2014-04-07 20:54:16 +0000
@@ -1,3 +1,15 @@
+2014-04-05 Glenn Morris <address@hidden>
+
+ * trouble.texi (Checklist): Dribble files may contain passwords.
+
+2014-04-04 Glenn Morris <address@hidden>
+
+ * files.texi (Backup Names):
+ * arevert-xtra.texi (Supporting additional buffers):
+ Update for default values of some -function vars no longer being nil.
+ (Supporting additional buffers):
+ Update for buffer-stale-function also applying to file-buffers.
+
2014-03-28 Glenn Morris <address@hidden>
* custom.texi (Terminal Init): Mention term-file-aliases.
=== modified file 'doc/emacs/arevert-xtra.texi'
--- a/doc/emacs/arevert-xtra.texi 2014-01-01 07:43:34 +0000
+++ b/doc/emacs/arevert-xtra.texi 2014-04-04 02:09:35 +0000
@@ -103,15 +103,15 @@
This section is intended for Elisp programmers who would like to add
support for auto-reverting new types of buffers.
-To support auto-reverting the buffer must first of all have a
+To support auto-reverting the buffer must first of all have a suitable
@code{revert-buffer-function}. @xref{Definition of
revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}.
-In addition, it @emph{must} have a @code{buffer-stale-function}.
+In addition, it must have a suitable @code{buffer-stale-function}.
@c FIXME only defvar in all of doc/emacs!
@defvar buffer-stale-function
-The value of this variable is a function to check whether a non-file
+The value of this variable is a function to check whether a
buffer needs reverting. This should be a function with one optional
argument @var{noconfirm}. The function should return address@hidden
if the buffer should be reverted. The buffer is current when this
@@ -132,7 +132,7 @@
@code{auto-revert-interval} seconds (like the Buffer Menu), use:
@example
-(set (make-local-variable 'buffer-stale-function)
+(setq-local buffer-stale-function
#'(lambda (&optional noconfirm) 'fast))
@end example
@@ -149,7 +149,7 @@
auto-reverting.
@end defvar
-Once the buffer has a @code{revert-buffer-function} and a
+Once the buffer has a suitable @code{revert-buffer-function} and
@code{buffer-stale-function}, several problems usually remain.
The buffer will only auto-revert if it is marked unmodified. Hence,
=== modified file 'doc/emacs/files.texi'
--- a/doc/emacs/files.texi 2014-01-24 03:34:31 +0000
+++ b/doc/emacs/files.texi 2014-04-04 01:49:28 +0000
@@ -594,8 +594,8 @@
backup.
@vindex make-backup-file-name-function
- If you define the variable @code{make-backup-file-name-function} to
-a suitable Lisp function, that overrides the usual way Emacs
+ If you set the variable @code{make-backup-file-name-function} to
+a suitable Lisp function, you can override the usual way Emacs
constructs backup file names.
@node Backup Deletion
=== modified file 'doc/emacs/trouble.texi'
--- a/doc/emacs/trouble.texi 2014-02-18 18:15:29 +0000
+++ b/doc/emacs/trouble.texi 2014-04-05 18:33:55 +0000
@@ -759,7 +759,9 @@
One way to record the input to Emacs precisely is to write a dribble
file. To start the file, use the @kbd{M-x open-dribble-file
@key{RET}} command. From then on, Emacs copies all your input to the
-specified dribble file until the Emacs process is killed.
+specified dribble file until the Emacs process is killed. Be aware
+that sensitive information (such as passwords) may end up recorded in
+the dribble file.
@item
@findex open-termscript
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog 2014-03-31 02:25:02 +0000
+++ b/doc/lispref/ChangeLog 2014-04-07 20:54:16 +0000
@@ -1,3 +1,14 @@
+2014-04-05 Glenn Morris <address@hidden>
+
+ * os.texi (Recording Input): Dribble files may contain passwords.
+
+2014-04-04 Glenn Morris <address@hidden>
+
+ * backups.texi (Making Backups, Reverting):
+ Update for default values of some -function vars no longer being nil.
+ (Reverting): Update for buffer-stale-function
+ also applying to file-buffers.
+
2014-03-31 Daniel Colascione <address@hidden>
* minibuf.texi (Completion in Buffers): Discuss using lazy
=== modified file 'doc/lispref/backups.texi'
--- a/doc/lispref/backups.texi 2014-01-05 23:36:13 +0000
+++ b/doc/lispref/backups.texi 2014-04-04 02:09:35 +0000
@@ -90,8 +90,7 @@
@smallexample
@group
(add-hook 'rmail-mode-hook
- (lambda ()
- (set (make-local-variable 'make-backup-files) nil)))
+ (lambda () (setq-local make-backup-files nil)))
@end group
@end smallexample
@end defopt
@@ -150,13 +149,12 @@
@end defopt
@defopt make-backup-file-name-function
-This variable's value is a function to use for making backups instead
-of the default @code{make-backup-file-name}. A value of @code{nil}
-gives the default @code{make-backup-file-name} behavior.
+This variable's value is a function to use for making backup file names.
+The function @code{make-backup-file-name} calls it.
@xref{Backup Names,, Naming Backup Files}.
This could be buffer-local to do something special for specific
-files. If you define it, you may need to change
+files. If you change it, you may need to change
@code{backup-file-name-p} and @code{file-name-sans-versions} too.
@end defopt
@@ -727,25 +725,24 @@
@defvar revert-buffer-function
@anchor{Definition of revert-buffer-function}
The value of this variable is the function to use to revert this
-buffer. If address@hidden, it should be a function with two optional
+buffer. It should be a function with two optional
arguments to do the work of reverting. The two optional arguments,
@var{ignore-auto} and @var{noconfirm}, are the arguments that
address@hidden received. If the value is @code{nil}, reverting
-works the usual way.
address@hidden received.
Modes such as Dired mode, in which the text being edited does not
consist of a file's contents but can be regenerated in some other
-fashion, can give this variable a buffer-local value that is a function to
-regenerate the contents.
+fashion, can give this variable a buffer-local value that is a special
+function to regenerate the contents.
@end defvar
@defvar revert-buffer-insert-file-contents-function
-The value of this variable, if address@hidden, specifies the function to use to
+The value of this variable specifies the function to use to
insert the updated contents when reverting this buffer. The function
receives two arguments: first the file name to use; second, @code{t} if
the user has asked to read the auto-save file.
-The reason for a mode to set this variable instead of
+The reason for a mode to change this variable instead of
@code{revert-buffer-function} is to avoid duplicating or replacing the
rest of what @code{revert-buffer} does: asking for confirmation,
clearing the undo list, deciding the proper major mode, and running the
@@ -753,21 +750,23 @@
@end defvar
@defvar before-revert-hook
-This normal hook is run by @code{revert-buffer} before
-inserting the modified contents---but only if
address@hidden is @code{nil}.
+This normal hook is run by the default @code{revert-buffer-function}
+before inserting the modified contents. A custom @code{revert-buffer-function}
+may or may not run this hook.
@end defvar
@defvar after-revert-hook
-This normal hook is run by @code{revert-buffer} after inserting
-the modified contents---but only if @code{revert-buffer-function} is
address@hidden
+This normal hook is run by the default @code{revert-buffer-function}
+after inserting the modified contents. A custom @code{revert-buffer-function}
+may or may not run this hook.
@end defvar
@c FIXME? Move this section from arevert-xtra to here?
@defvar buffer-stale-function
-The value of this variable, if address@hidden, specifies a function
-to call to check whether a non-file buffer needs reverting
+The value of this variable specifies a function to call to check
+whether a buffer needs reverting. The default value only handles
+buffers that are visiting files, by checking their modification time.
+Buffers that are not visiting files require a custom function
@iftex
(@pxref{Supporting additional buffers,,, emacs-xtra, Specialized Emacs
Features}).
@end iftex
=== modified file 'doc/lispref/os.texi'
--- a/doc/lispref/os.texi 2014-03-28 01:39:30 +0000
+++ b/doc/lispref/os.texi 2014-04-07 20:54:16 +0000
@@ -2001,20 +2001,11 @@
dribble file is open, each input event from the keyboard or mouse (but
not those from keyboard macros) is written in that file. A
non-character event is expressed using its printed representation
-surrounded by @samp{<@dots{}>}.
+surrounded by @samp{<@dots{}>}. Be aware that sensitive information
+(such as passwords) may end up recorded in the dribble file.
You close the dribble file by calling this function with an argument
of @code{nil}.
-
-This function is normally used to record the input necessary to
-trigger an Emacs bug, for the sake of a bug report.
-
address@hidden
address@hidden
-(open-dribble-file "~/dribble")
- @result{} nil
address@hidden group
address@hidden example
@end deffn
See also the @code{open-termscript} function (@pxref{Terminal Output}).
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2014-04-02 15:14:50 +0000
+++ b/etc/NEWS 2014-04-07 20:54:16 +0000
@@ -219,6 +219,10 @@
** In keymaps where SPC scrolls forward, S-SPC now scrolls backward.
This affects View mode, etc.
++++
+** The default value of `make-backup-file-name-function' is no longer nil.
+Instead it defaults to a function that does what the nil value used to.
+
** Help changes
+++
@@ -1457,9 +1461,13 @@
** Revert and Autorevert changes
-*** The default value of `revert-buffer-function' is no longer nil.
-Instead it defaults to a function that does what the nil value used to.
-The same applies for `revert-buffer-insert-file-contents-function'.
++++
+*** The default values of `buffer-stale-function', `revert-buffer-function',
+and `revert-buffer-insert-file-contents-function' are no longer nil.
+Instead they default to functions that do what the nil value used to.
+
++++
+*** `buffer-stale-function' is now used for buffers visiting files too.
---
*** If Emacs is compiled with file notification support, it uses notifications
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-04-07 00:51:52 +0000
+++ b/lisp/ChangeLog 2014-04-07 20:54:16 +0000
@@ -1,3 +1,128 @@
+2014-04-07 João Távora <address@hidden>
+
+ * elec-pair.el:
+ (electric-pair--syntax-ppss): When inside comments parse from
+ comment beginning.
+ (electric-pair--balance-info): Fix typo in comment.
+ (electric-pair--in-unterminated-string-p): Delete.
+ (electric-pair--unbalanced-strings-p): New function.
+ (electric-pair-string-bound-function): New var.
+ (electric-pair-inhibit-if-helps-balance): Decide quote pairing
+ according to `electric-pair--in-unterminated-string-p'
+
+2014-04-07 João Távora <address@hidden>
+
+ * elec-pair.el (electric-pair-inhibit-if-helps-balance): Inhibit
+ quote pairing if point-max is inside an unterminated string.
+ (electric-pair--looking-at-unterminated-string-p):
+ Delete.
+ (electric-pair--in-unterminated-string-p): New function.
+
+2014-04-07 Glenn Morris <address@hidden>
+
+ * shell.el (shell-directory-tracker):
+ Go back to just ignoring failures. (Bug#17159)
+
+2014-04-06 João Távora <address@hidden>
+
+ Fix `electric-pair-delete-adjacent-pairs' in modes binding
+ backspace. (bug#16981)
+ * elec-pair.el (electric-pair-backward-delete-char): Delete.
+ (electric-pair-backward-delete-char-untabify): Delete.
+ (electric-pair-mode-map): Bind backspace to a menu item filtering
+ a new `electric-pair-delete-pair' command.
+ (electric-pair-delete-pair): New command.
+
+2014-04-06 João Távora <address@hidden>
+
+ * progmodes/python.el (python-electric-pair-string-delimiter): Fix
+ triple-quoting electricity. (Bug#17192)
+
+2014-04-06 João Távora <address@hidden>
+
+ * elec-pair.el (electric-pair-post-self-insert-function): Don't
+ skip whitespace when `electric-pair-text-pairs' and
+ `electric-pair-pairs' were used. syntax to
+ electric-pair--skip-whitespace. (Bug#17183)
+
+2014-04-06 Eli Zaretskii <address@hidden>
+
+ * leim/quail/ipa.el (ipa-x-sampa): Fix the character produced for
+ "<F>". (Bug#17199)
+
+2014-04-06 Stefan Monnier <address@hidden>
+
+ * mpc.el (mpc--status-timer-run): Disable timer if not displayed.
+ (mpc--status-idle-timer-run): Use mpc--status-timer-run.
+
+2014-04-05 Glenn Morris <address@hidden>
+
+ * help.el (view-lossage): Doc tweak.
+
+2014-04-05 Matthias Dahl <address@hidden>
+
+ * faces.el (face-spec-recalc): Call make-face-x-resource-internal
+ only when inhibit-x-resources is nil, and do that earlier in the
+ function. Doc fix. (Bug#16694)
+ (face-spec-choose): Accept additional optional argument, whose
+ value is returned if no matching attributes are found.
+ (face-spec-recalc): Use the new optional argument when calling
+ face-spec-choose. (Bug#16378)
+ (make-face-x-resource-internal): Do nothing when
+ inhibit-x-resources is non-nil. Don't touch the default face if
+ reversed video is given--as was done in previous versions of Emacs.
+ (face-set-after-frame-default): Don't call
+ make-face-x-resource-internal here. (Bug#16434)
+
+2014-04-04 Tassilo Horn <address@hidden>
+
+ * doc-view.el (doc-view-bookmark-jump):
+ Use `bookmark-after-jump-hook' to jump to the right page after the
+ buffer is shown in a window. (bug#16090)
+
+2014-04-04 Eli Zaretskii <address@hidden>
+
+ * international/characters.el (mirroring): Fix last change:
+ instead of loading uni-mirrored.el explicitly, do that implicitly
+ by creating the 'mirroring' uniprop table. This avoids announcing
+ the loading of uni-mirrored.el.
+
+2014-04-04 Glenn Morris <address@hidden>
+
+ * files.el (buffer-stale--default-function)
+ (buffer-stale-function, revert-buffer--default):
+ * autorevert.el (auto-revert-buffers): Doc tweaks.
+
+2014-04-03 Eli Zaretskii <address@hidden>
+
+ * international/characters.el: Preload uni-mirrored.el. (Bug#17169)
+
+2014-04-03 Glenn Morris <address@hidden>
+
+ * files.el (make-backup-file-name-function)
+ (make-backup-file-name, make-backup-file-name--default-function)
+ (make-backup-file-name-1, find-backup-file-name)
+ (revert-buffer-function, revert-buffer-insert-file-contents-function)
+ (buffer-stale--default-function, buffer-stale-function)
+ (before-revert-hook, after-revert-hook, revert-buffer-in-progress-p)
+ (revert-buffer, revert-buffer--default)
+ (revert-buffer-insert-file-contents--default-function):
+ Doc fixes related to defaults no longer being nil.
+ (make-backup-file-name-function): Bump :version.
+ Restore nil as a valid but deprecated custom type.
+
+2014-04-03 Stefan Monnier <address@hidden>
+
+ * progmodes/perl-mode.el (perl-syntax-propertize-function): Handle $'
+ used as a variable (bug#17174).
+
+2014-04-02 Stefan Monnier <address@hidden>
+
+ * progmodes/perl-mode.el (perl-indent-new-calculate):
+ Handle forward-sexp failure (bug#16985).
+ (perl-syntax-propertize-function): Add "foreach" and "for" statement
+ modifiers introducing expressions (bug#17116).
+
2014-04-06 Stefan Monnier <address@hidden>
* dired-aux.el (dired-file-set-difference): Use lexical-scoping.
@@ -488,6 +613,19 @@
(tty-color-approximate, tty-color-by-index, tty-color-values)
(tty-color-desc): Remove superfluous backslashes.
+2014-03-20 Stefan Monnier <address@hidden>
+
+ * electric.el (electric-newline-and-maybe-indent): New command.
+ Bind it globally to C-j.
+ (electric-indent-mode): Don't mess with the global map any more.
+ Don't drop the post-self-insert-hook is some buffer is still using it
+ (bug#16770).
+
+ * bindings.el (global-map): Remove C-j binding.
+
+ * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find
+ the docstring of functions advised before dumping (bug#16993).
+
2014-03-21 Glenn Morris <address@hidden>
* cus-start.el (history-length): Bump :version.
@@ -516,18 +654,6 @@
* skeleton.el (skeleton-autowrap): Mark as obsolete. Doc fix.
-2014-03-20 Stefan Monnier <address@hidden>
-
- * electric.el (electric-newline-and-maybe-indent): New command.
- Bind it globally to C-j.
- (electric-indent-mode): Don't mess with the global map any more.
- Don't drop the post-self-insert-hook is some buffer is still using it
- (bug#16770).
- * bindings.el (global-map): Remove C-j binding.
-
- * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find
- the docstring of functions advised before dumping (bug#16993).
-
2014-03-19 Stefan-W. Hahn <address@hidden> (tiny change)
* ps-print.el (ps-generate-postscript-with-faces):
@@ -2154,7 +2280,6 @@
* net/shr.el (shr-tag-img): Prefer the title over the alt text
(bug#16537).
->>>>>>> MERGE-SOURCE
2014-01-24 Juanma Barranquero <address@hidden>
* net/eww.el (eww-download-callback):
=== modified file 'lisp/autorevert.el'
--- a/lisp/autorevert.el 2014-01-01 07:43:34 +0000
+++ b/lisp/autorevert.el 2014-04-04 02:09:35 +0000
@@ -672,7 +672,7 @@
are checked.
Non-file buffers that have a custom `revert-buffer-function' and
-a `buffer-stale-function' are reverted either when Auto-Revert
+`buffer-stale-function' are reverted either when Auto-Revert
Mode is active in that buffer, or when the variable
`global-auto-revert-non-file-buffers' is non-nil and Global
Auto-Revert Mode is active.
=== modified file 'lisp/doc-view.el'
--- a/lisp/doc-view.el 2014-01-01 07:43:34 +0000
+++ b/lisp/doc-view.el 2014-04-04 17:42:55 +0000
@@ -1862,20 +1862,23 @@
`((page . ,(doc-view-current-page))
(handler . doc-view-bookmark-jump))))
-
;;;###autoload
(defun doc-view-bookmark-jump (bmk)
;; This implements the `handler' function interface for record type
;; returned by `doc-view-bookmark-make-record', which see.
- (prog1 (bookmark-default-handler bmk)
- (let ((page (bookmark-prop-get bmk 'page)))
- (when (not (eq major-mode 'doc-view-mode))
- (doc-view-toggle-display))
- (with-selected-window
- (or (get-buffer-window (current-buffer) 0)
- (selected-window))
- (doc-view-goto-page page)))))
-
+ (let ((page (bookmark-prop-get bmk 'page))
+ (show-fn-sym (make-symbol "doc-view-bookmark-after-jump-hook")))
+ (fset show-fn-sym
+ (lambda ()
+ (remove-hook 'bookmark-after-jump-hook show-fn-sym)
+ (when (not (eq major-mode 'doc-view-mode))
+ (doc-view-toggle-display))
+ (with-selected-window
+ (or (get-buffer-window (current-buffer) 0)
+ (selected-window))
+ (doc-view-goto-page page))))
+ (add-hook 'bookmark-after-jump-hook show-fn-sym)
+ (bookmark-default-handler bmk)))
(provide 'doc-view)
=== modified file 'lisp/elec-pair.el'
--- a/lisp/elec-pair.el 2014-04-04 23:31:02 +0000
+++ b/lisp/elec-pair.el 2014-04-07 20:54:16 +0000
@@ -166,36 +166,6 @@
quotes or comments. If lookup fails here, `electric-pair-text-pairs' will
be considered.")
-(defun electric-pair-backward-delete-char (n &optional killflag untabify)
- "Delete characters backward, and maybe also two adjacent paired delimiters.
-
-Remaining behavior is given by `backward-delete-char' or, if UNTABIFY is
-non-nil, `backward-delete-char-untabify'."
- (interactive "*p\nP")
- (let* ((prev (char-before))
- (next (char-after))
- (syntax-info (and prev
- (electric-pair-syntax-info prev)))
- (syntax (car syntax-info))
- (pair (cadr syntax-info)))
- (when (and next pair
- (if (functionp electric-pair-delete-adjacent-pairs)
- (funcall electric-pair-delete-adjacent-pairs)
- electric-pair-delete-adjacent-pairs)
- (memq syntax '(?\( ?\" ?\$))
- (eq pair next))
- (delete-char 1 killflag))
- (if untabify
- (backward-delete-char-untabify n killflag)
- (backward-delete-char n killflag))))
-
-(defun electric-pair-backward-delete-char-untabify (n &optional killflag)
- "Delete characters backward, and maybe also two adjacent paired delimiters.
-
-Remaining behavior is given by `backward-delete-char-untabify'."
- (interactive "*p\nP")
- (electric-pair-backward-delete-char n killflag t))
-
(defun electric-pair-conservative-inhibit (char)
(or
;; I find it more often preferable not to pair when the
@@ -503,10 +473,12 @@
(funcall electric-pair-skip-self last-command-event)
electric-pair-skip-self))
(save-excursion
- (when (setq skip-whitespace-info
- (if (functionp electric-pair-skip-whitespace)
- (funcall electric-pair-skip-whitespace)
- electric-pair-skip-whitespace))
+ (when (and (not (and unconditional
+ (eq syntax ?\")))
+ (setq skip-whitespace-info
+ (if (functionp
electric-pair-skip-whitespace)
+ (funcall
electric-pair-skip-whitespace)
+ electric-pair-skip-whitespace)))
(electric-pair--skip-whitespace))
(eq (char-after) last-command-event))))
;; This is too late: rather than insert&delete we'd want to only
@@ -546,14 +518,34 @@
(memq (car (electric-pair-syntax-info last-command-event))
'(?\( ?\) ?\" ?\$))))
+(defun electric-pair-delete-pair (arg &optional killp)
+ "When between adjacent paired delimiters, delete both of them.
+ARG and KILLP are passed directly to
+`backward-delete-char-untabify', which see."
+ (interactive "*p\nP")
+ (delete-char 1)
+ (backward-delete-char-untabify arg killp))
+
(defvar electric-pair-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map [remap backward-delete-char-untabify]
- 'electric-pair-backward-delete-char-untabify)
- (define-key map [remap backward-delete-char]
- 'electric-pair-backward-delete-char)
- (define-key map [remap delete-backward-char]
- 'electric-pair-backward-delete-char)
+ (define-key map "\177"
+ `(menu-item
+ "" electric-pair-delete-pair
+ :filter
+ ,(lambda (cmd)
+ (let* ((prev (char-before))
+ (next (char-after))
+ (syntax-info (and prev
+ (electric-pair-syntax-info prev)))
+ (syntax (car syntax-info))
+ (pair (cadr syntax-info)))
+ (and next pair
+ (memq syntax '(?\( ?\" ?\$))
+ (eq pair next)
+ (if (functionp electric-pair-delete-adjacent-pairs)
+ (funcall electric-pair-delete-adjacent-pairs)
+ electric-pair-delete-adjacent-pairs)
+ cmd)))))
map)
"Keymap used by `electric-pair-mode'.")
=== modified file 'lisp/faces.el'
--- a/lisp/faces.el 2014-03-28 07:16:42 +0000
+++ b/lisp/faces.el 2014-04-07 20:54:16 +0000
@@ -354,11 +354,16 @@
(defun make-face-x-resource-internal (face &optional frame)
"Fill frame-local FACE on FRAME from X resources.
-FRAME nil or not specified means do it for all frames."
- (if (null frame)
- (dolist (frame (frame-list))
- (set-face-attributes-from-resources face frame))
- (set-face-attributes-from-resources face frame)))
+FRAME nil or not specified means do it for all frames.
+
+If `inhibit-x-resources' is non-nil, this function does nothing."
+ (unless inhibit-x-resources
+ (dolist (frame (if (null frame) (frame-list) (list frame)))
+ ;; `x-create-frame' already took care of correctly handling
+ ;; the reverse video case-- do _not_ touch the default face
+ (unless (and (eq face 'default)
+ (frame-parameter frame 'reverse))
+ (set-face-attributes-from-resources face frame)))))
@@ -1532,13 +1537,15 @@
match))
-(defun face-spec-choose (spec &optional frame)
- "Choose the proper attributes for FRAME, out of SPEC.
-If SPEC is nil, return nil."
+(defun face-spec-choose (spec &optional frame no-match-retval)
+ "Return the proper attributes for FRAME, out of SPEC.
+
+If no match is found or SPEC is nil, return nil, unless NO-MATCH-RETVAL
+is given, in which case return its value instead."
(unless frame
(setq frame (selected-frame)))
(let ((tail spec)
- result defaults)
+ result defaults match-found)
(while tail
(let* ((entry (pop tail))
(display (car entry))
@@ -1558,9 +1565,18 @@
(setq defaults thisval)
;; Otherwise, if it matches, use it.
(when (face-spec-set-match-display display frame)
- (setq result thisval)
- (setq tail nil)))))
- (if defaults (append result defaults) result)))
+ (setq result thisval
+ tail nil
+ match-found t)))))
+ ;; If defaults have been found, it's safe to just append those to the
result
+ ;; list (which at this point will be either nil or contain actual specs)
and
+ ;; return it to the caller. Since there will most definitely be something
to
+ ;; return in this case, there's no need to know/check if a match was found.
+ (if defaults
+ (append result defaults)
+ (if match-found
+ result
+ no-match-retval))))
(defun face-spec-reset-face (face &optional frame)
@@ -1639,19 +1655,27 @@
(defun face-spec-recalc (face frame)
"Reset the face attributes of FACE on FRAME according to its specs.
-This applies the defface/custom spec first, then the custom theme specs,
-then the override spec."
+After the reset, the specs are applied from the following sources in this
order:
+ X resources (if applicable)
+ |
+ (theme and user customization)
+ or, if nonexistent or does not match the current frame,
+ (defface default spec)
+ |
+ defface override spec"
(while (get face 'face-alias)
(setq face (get face 'face-alias)))
(face-spec-reset-face face frame)
+ (make-face-x-resource-internal face frame)
;; If FACE is customized or themed, set the custom spec from
;; `theme-face' records.
(let ((theme-faces (get face 'theme-face))
+ (no-match-found 0)
spec theme-face-applied)
(if theme-faces
(dolist (elt (reverse theme-faces))
- (setq spec (face-spec-choose (cadr elt) frame))
- (when spec
+ (setq spec (face-spec-choose (cadr elt) frame no-match-found))
+ (unless (eq spec no-match-found)
(face-spec-set-2 face frame spec)
(setq theme-face-applied t))))
;; If there was a spec applicable to FRAME, that overrides the
@@ -1661,8 +1685,7 @@
(setq spec (face-spec-choose (face-default-spec face) frame))
(face-spec-set-2 face frame spec))
(setq spec (face-spec-choose (get face 'face-override-spec) frame))
- (face-spec-set-2 face frame spec))
- (make-face-x-resource-internal face frame))
+ (face-spec-set-2 face frame spec)))
(defun face-spec-set-2 (face frame spec)
"Set the face attributes of FACE on FRAME according to SPEC."
@@ -2046,10 +2069,6 @@
(progn
;; Initialize faces from face spec and custom theme.
(face-spec-recalc face frame)
- ;; X resources for the default face are applied during
- ;; `x-create-frame'.
- (and (not (eq face 'default)) window-system-p
- (make-face-x-resource-internal face frame))
;; Apply attributes specified by face-new-frame-defaults
(internal-merge-in-global-face face frame))
;; Don't let invalid specs prevent frame creation.
=== modified file 'lisp/files.el'
--- a/lisp/files.el 2014-03-26 01:14:44 +0000
+++ b/lisp/files.el 2014-04-07 20:54:16 +0000
@@ -4207,15 +4207,22 @@
(defcustom make-backup-file-name-function
#'make-backup-file-name--default-function
- "A function to use instead of the default `make-backup-file-name'.
-
-This could be buffer-local to do something special for specific
-files. If you define it, you may need to change `backup-file-name-p'
-and `file-name-sans-versions' too.
+ "A function that `make-backup-file-name' uses to create backup file names.
+The function receives a single argument, the original file name.
+
+If you change this, you may need to change `backup-file-name-p' and
+`file-name-sans-versions' too.
+
+You could make this buffer-local to do something special for specific files.
+
+For historical reasons, a value of nil means to use the default function.
+This should not be relied upon.
See also `backup-directory-alist'."
+ :version "24.4" ; nil -> make-backup-file-name--default-function
:group 'backup
- :type '(function :tag "Your function"))
+ :type '(choice (const :tag "Deprecated way to get the default function" nil)
+ (function :tag "Function")))
(defcustom backup-directory-alist nil
"Alist of filename patterns and backup directory names.
@@ -4272,20 +4279,17 @@
(defun make-backup-file-name (file)
"Create the non-numeric backup file name for FILE.
-Normally this will just be the file's name with `~' appended.
-Customization hooks are provided as follows.
-
-The value of `make-backup-file-name-function' should be a function which
-will be called with FILE as its argument; the resulting name is used.
-
-By default, a match for FILE is sought in `backup-directory-alist'; see
-the documentation of that variable. If the directory for the backup
-doesn't exist, it is created."
+This calls the function that `make-backup-file-name-function' specifies,
+with a single argument FILE."
(funcall (or make-backup-file-name-function
#'make-backup-file-name--default-function)
file))
(defun make-backup-file-name--default-function (file)
+ "Default function for `make-backup-file-name'.
+Normally this just returns FILE's name with `~' appended.
+It searches for a match for FILE in `backup-directory-alist'.
+If the directory for the backup doesn't exist, it is created."
(if (and (eq system-type 'ms-dos)
(not (msdos-long-file-names)))
(let ((fn (file-name-nondirectory file)))
@@ -4297,7 +4301,8 @@
(concat (make-backup-file-name-1 file) "~")))
(defun make-backup-file-name-1 (file)
- "Subroutine of `make-backup-file-name' and `find-backup-file-name'."
+ "Subroutine of `make-backup-file-name--default-function'.
+The function `find-backup-file-name' also uses this."
(let ((alist backup-directory-alist)
elt backup-directory abs-backup-directory)
(while alist
@@ -4374,8 +4379,8 @@
Value is a list whose car is the name for the backup file
and whose cdr is a list of old versions to consider deleting now.
If the value is nil, don't make a backup.
-Uses `backup-directory-alist' in the same way as does
-`make-backup-file-name'."
+Uses `backup-directory-alist' in the same way as
+`make-backup-file-name--default-function' does."
(let ((handler (find-file-name-handler fn 'find-backup-file-name)))
;; Run a handler for this function so that ange-ftp can refuse to do it.
(if handler
@@ -5312,28 +5317,41 @@
(put 'revert-buffer-function 'permanent-local t)
(defvar revert-buffer-function #'revert-buffer--default
- "Function to use to revert this buffer, or nil to do the default.
+ "Function to use to revert this buffer.
The function receives two arguments IGNORE-AUTO and NOCONFIRM,
which are the arguments that `revert-buffer' received.
It also has access to the `preserve-modes' argument of `revert-buffer'
-via the `revert-buffer-preserve-modes' dynamic variable.")
+via the `revert-buffer-preserve-modes' dynamic variable.
+
+For historical reasons, a value of nil means to use the default function.
+This should not be relied upon.")
(put 'revert-buffer-insert-file-contents-function 'permanent-local t)
(defvar revert-buffer-insert-file-contents-function
#'revert-buffer-insert-file-contents--default-function
"Function to use to insert contents when reverting this buffer.
-Gets two args, first the nominal file name to use,
-and second, t if reading the auto-save file.
-
-The function you specify is responsible for updating (or preserving) point.")
+The function receives two arguments: the first the nominal file name to use;
+the second is t if reading the auto-save file.
+
+The function is responsible for updating (or preserving) point.
+
+For historical reasons, a value of nil means to use the default function.
+This should not be relied upon.")
(defun buffer-stale--default-function (&optional _noconfirm)
+ "Default function to use for `buffer-stale-function'.
+This function ignores its argument.
+This returns non-nil if the current buffer is visiting a readable file
+whose modification time does not match that of the buffer.
+
+This function only handles buffers that are visiting files.
+Non-file buffers need a custom function"
(and buffer-file-name
(file-readable-p buffer-file-name)
(not (verify-visited-file-modtime (current-buffer)))))
(defvar buffer-stale-function #'buffer-stale--default-function
- "Function to check whether a non-file buffer needs reverting.
+ "Function to check whether a buffer needs reverting.
This should be a function with one optional argument NOCONFIRM.
Auto Revert Mode passes t for NOCONFIRM. The function should return
non-nil if the buffer should be reverted. A return value of
@@ -5346,13 +5364,16 @@
user. In such situations, one has to be careful with potentially
time consuming operations.
+For historical reasons, a value of nil means to use the default function.
+This should not be relied upon.
+
For more information on how this variable is used by Auto Revert mode,
see Info node `(emacs)Supporting additional buffers'.")
(defvar before-revert-hook nil
"Normal hook for `revert-buffer' to run before reverting.
-If `revert-buffer-function' is used to override the normal revert
-mechanism, this hook is not used.")
+The function `revert-buffer--default' runs this.
+A customized `revert-buffer-function' need not run this hook.")
(defvar after-revert-hook nil
"Normal hook for `revert-buffer' to run after reverting.
@@ -5360,12 +5381,11 @@
before reverting; that makes a difference if you have buffer-local
hook functions.
-If `revert-buffer-function' is used to override the normal revert
-mechanism, this hook is not used.")
+The function `revert-buffer--default' runs this.
+A customized `revert-buffer-function' need not run this hook.")
(defvar revert-buffer-in-progress-p nil
- "Non-nil if a `revert-buffer' operation is in progress, nil otherwise.
-This is true even if a `revert-buffer-function' is being used.")
+ "Non-nil if a `revert-buffer' operation is in progress, nil otherwise.")
(defvar revert-buffer-internal-hook)
@@ -5402,12 +5422,10 @@
This function binds `revert-buffer-in-progress-p' non-nil while it operates.
-If the value of `revert-buffer-function' is non-nil, it is called to
-do all the work for this command. Otherwise, the hooks
-`before-revert-hook' and `after-revert-hook' are run at the beginning
-and the end, and if `revert-buffer-insert-file-contents-function' is
-non-nil, it is called instead of rereading visited file contents."
-
+This function calls the function that `revert-buffer-function' specifies
+to do the work, with arguments IGNORE-AUTO and NOCONFIRM.
+The default function runs the hooks `before-revert-hook' and
+`after-revert-hook'."
;; I admit it's odd to reverse the sense of the prefix argument, but
;; there is a lot of code out there which assumes that the first
;; argument should be t to avoid consulting the auto-save file, and
@@ -5419,7 +5437,19 @@
(revert-buffer-preserve-modes preserve-modes))
(funcall (or revert-buffer-function #'revert-buffer--default)
ignore-auto noconfirm)))
+
(defun revert-buffer--default (ignore-auto noconfirm)
+ "Default function for `revert-buffer'.
+The arguments IGNORE-AUTO and NOCONFIRM are as described for `revert-buffer'.
+Runs the hooks `before-revert-hook' and `after-revert-hook' at the
+start and end.
+
+Calls `revert-buffer-insert-file-contents-function' to reread the
+contents of the visited file, with two arguments: the first is the file
+name, the second is non-nil if reading an auto-save file.
+
+This function only handles buffers that are visiting files.
+Non-file buffers need a custom function."
(with-current-buffer (or (buffer-base-buffer (current-buffer))
(current-buffer))
(let* ((auto-save-p (and (not ignore-auto)
@@ -5473,6 +5503,10 @@
t)))))
(defun revert-buffer-insert-file-contents--default-function (file-name
auto-save-p)
+ "Default function for `revert-buffer-insert-file-contents-function'.
+The function `revert-buffer--default' calls this.
+FILE-NAME is the name of the file. AUTO-SAVE-P is non-nil if this is
+an auto-save file."
(cond
((not (file-exists-p file-name))
(error (if buffer-file-number
=== modified file 'lisp/help.el'
--- a/lisp/help.el 2014-03-22 23:47:20 +0000
+++ b/lisp/help.el 2014-04-07 20:54:16 +0000
@@ -446,7 +446,7 @@
(defun view-lossage ()
"Display last 300 input keystrokes.
-To record all your input on a file, use `open-dribble-file'."
+To record all your input, use `open-dribble-file'."
(interactive)
(help-setup-xref (list #'view-lossage)
(called-interactively-p 'interactive))
=== modified file 'lisp/international/characters.el'
--- a/lisp/international/characters.el 2014-01-06 06:25:30 +0000
+++ b/lisp/international/characters.el 2014-04-04 08:26:00 +0000
@@ -495,6 +495,13 @@
(modify-category-entry key ?L))))
table)))
+;; Load uni-mirrored.el if available, so that it gets dumped into
+;; Emacs. This allows to start Emacs with force-load-messages in
+;; ~/.emacs, and avoid infinite recursion in bidi_initialize, which
+;; needs to load uni-mirrored.el in order to display the "Loading"
+;; messages.
+(unicode-property-table-internal 'mirroring)
+
;; Latin
(modify-category-entry '(#x80 . #x024F) ?l)
=== modified file 'lisp/leim/quail/ipa.el'
--- a/lisp/leim/quail/ipa.el 2014-01-16 06:24:06 +0000
+++ b/lisp/leim/quail/ipa.el 2014-04-06 15:21:35 +0000
@@ -475,7 +475,7 @@
("_d" "̪") ;; Dental U+032A
("_e" "̴") ;; Velarized or pharyngeal U+0334
- ("<F>" "↙") ;; Global fall; SOUTH EAST ARROW; may be a bit smaller than
+ ("<F>" "↘") ;; Global fall; SOUTH EAST ARROW; may be a bit smaller than
;; intended.
("_F" "̂") ;; Falling tone U+0302
("_G" "ˠ") ;; Velarized U+02E0
=== modified file 'lisp/mpc.el'
--- a/lisp/mpc.el 2014-01-01 07:43:34 +0000
+++ b/lisp/mpc.el 2014-04-06 13:08:00 +0000
@@ -491,9 +491,13 @@
(cancel-timer mpc--status-timer)
(setq mpc--status-timer nil)))
(defun mpc--status-timer-run ()
- (with-demoted-errors "MPC: %s"
+ (with-demoted-errors "MPC: %S"
(when (process-get (mpc-proc) 'ready)
- (with-local-quit (mpc-status-refresh)))))
+ (let* ((buf (mpc-proc-buffer (mpc-proc) 'status))
+ (win (get-buffer-window buf t)))
+ (if (not win)
+ (mpc--status-timer-stop)
+ (with-local-quit (mpc-status-refresh)))))))
(defvar mpc--status-idle-timer nil)
(defun mpc--status-idle-timer-start ()
@@ -518,10 +522,8 @@
;; client starts playback, we may get a chance to notice it.
(run-with-idle-timer 10 t 'mpc--status-idle-timer-run))))
(defun mpc--status-idle-timer-run ()
- (when (process-get (mpc-proc) 'ready)
- (with-demoted-errors "MPC: %s"
- (with-local-quit (mpc-status-refresh))))
- (mpc--status-timer-start))
+ (mpc--status-timer-start)
+ (mpc--status-timer-run))
(defun mpc--status-timers-refresh ()
"Start/stop the timers according to whether a song is playing."
=== modified file 'lisp/progmodes/perl-mode.el'
--- a/lisp/progmodes/perl-mode.el 2014-02-10 01:34:22 +0000
+++ b/lisp/progmodes/perl-mode.el 2014-04-03 00:41:09 +0000
@@ -250,7 +250,11 @@
;; Catch ${ so that ${var} doesn't screw up indentation.
;; This also catches $' to handle 'foo$', although it should really
;; check that it occurs inside a '..' string.
- ("\\(\\$\\)[{']" (1 ". p"))
+ ("\\(\\$\\)[{']" (1 (unless (and (eq ?\' (char-after (match-end 1)))
+ (save-excursion
+ (not (nth 3 (syntax-ppss
+ (match-beginning 0))))))
+ (string-to-syntax ". p"))))
;; Handle funny names like $DB'stop.
("\\$ ?{?^?[_[:alpha:]][_[:alnum:]]*\\('\\)[_[:alpha:]]" (1 "_"))
;; format statements
@@ -276,7 +280,7 @@
;; perl-font-lock-special-syntactic-constructs.
((concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)"
(regexp-opt '("split" "if" "unless" "until" "while" "split"
- "grep" "map" "not" "or" "and"))
+ "grep" "map" "not" "or" "and" "for" "foreach"))
"\\|[?:.,;=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)")
(2 (ignore
(if (and (match-end 1) ; / at BOL.
@@ -854,11 +858,12 @@
(and (= (char-syntax (following-char)) ?\))
(save-excursion
(forward-char 1)
- (forward-sexp -1)
- (perl-indent-new-calculate
- ;; Recalculate the parsing-start, since we may have jumped
- ;; dangerously close (typically in the case of nested functions).
- 'virtual nil (save-excursion (perl-beginning-of-function)))))
+ (when (condition-case nil (progn (forward-sexp -1) t)
+ (scan-error nil))
+ (perl-indent-new-calculate
+ ;; Recalculate the parsing-start, since we may have jumped
+ ;; dangerously close (typically in the case of nested functions).
+ 'virtual nil (save-excursion (perl-beginning-of-function))))))
(and (and (= (following-char) ?{)
(save-excursion (forward-char) (perl-hanging-paren-p)))
(+ (or default (perl-calculate-indent parse-start))
=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el 2014-03-15 17:37:58 +0000
+++ b/lisp/progmodes/python.el 2014-04-06 23:23:45 +0000
@@ -3651,8 +3651,9 @@
(let ((count 0))
(while (eq (char-before (- (point) count)) last-command-event)
(cl-incf count))
- (= count 3)))
- (save-excursion (insert (make-string 3 last-command-event)))))
+ (= count 3))
+ (eq (char-after) last-command-event))
+ (save-excursion (insert (make-string 2 last-command-event)))))
(defvar electric-indent-inhibit)
=== modified file 'lisp/shell.el'
--- a/lisp/shell.el 2014-02-10 01:34:22 +0000
+++ b/lisp/shell.el 2014-04-07 01:27:32 +0000
@@ -792,8 +792,11 @@
Environment variables are expanded, see function `substitute-in-file-name'."
(if shell-dirtrackp
;; We fail gracefully if we think the command will fail in the shell.
- (with-demoted-errors "Couldn't cd: %s"
- (let ((start (progn (string-match
+;;; (with-demoted-errors "Directory tracker failure: %s"
+ ;; This fails so often that it seems better to just ignore errors (?).
+ ;; Eg even: foo=/tmp; cd $foo is beyond us (bug#17159).
+ (ignore-errors
+ (let ((start (progn (string-match
(concat "^" shell-command-separator-regexp)
str) ; skip whitespace
(match-end 0)))
=== modified file 'nt/ChangeLog'
--- a/nt/ChangeLog 2014-03-03 04:57:26 +0000
+++ b/nt/ChangeLog 2014-04-03 19:10:35 +0000
@@ -1,3 +1,7 @@
+2014-04-03 Ken Brown <address@hidden>
+
+ * emacs.rc: Don't use manifest on Cygwin. (Bug#17176)
+
2014-02-17 Juanma Barranquero <address@hidden>
* Makefile.in (install): Create destination directory before copying
=== modified file 'nt/emacs.rc'
--- a/nt/emacs.rc 2014-03-21 10:12:53 +0000
+++ b/nt/emacs.rc 2014-04-07 20:54:16 +0000
@@ -1,10 +1,12 @@
Emacs ICON icons/emacs.ico
32649 CURSOR icons/hand.cur
-#if defined (WIN64) || defined (__x86_64__)
+#ifndef __CYGWIN__
+#ifdef WIN64
1 24 "emacs-x64.manifest"
#else
1 24 "emacs-x86.manifest"
#endif
+#endif
#ifndef VS_VERSION_INFO
#define VS_VERSION_INFO 1
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2014-04-07 17:52:38 +0000
+++ b/src/ChangeLog 2014-04-07 20:54:16 +0000
@@ -1,3 +1,37 @@
+2014-04-07 Stefan Monnier <address@hidden>
+
+ * lisp.h (struct Lisp_Symbol): New bitfield `pinned'.
+
+ * alloc.c: Keep track of symbols referenced from pure space (bug#17168).
+ (symbol_block_pinned): New var.
+ (Fmake_symbol): Initialize `pinned'.
+ (purecopy): New function, extracted from Fpurecopy. Mark symbols as
+ pinned and signal an error for un-purifiable objects.
+ (pure_cons): Use it.
+ (Fpurecopy): Use it, except for objects that can't be purified.
+ (mark_pinned_symbols): New function.
+ (Fgarbage_collect): Use it.
+ (gc_sweep): Remove hack made unnecessary.
+
+2014-04-05 Glenn Morris <address@hidden>
+
+ * keyboard.c (Fopen_dribble_file): Doc tweak.
+
+2014-04-04 Jan Djärv <address@hidden>
+
+ Backport from trunk.
+ * nsterm.m (updateFrameSize:): If waiting for the tool bar and tool
+ bar is zero height, just return (Bug#16976).
+ (initFrameFromEmacs:): Initialize wait_for_tool_bar.
+ * nsterm.h (EmacsView): Add wait_for_tool_bar.
+ * nsmenu.m (update_frame_tool_bar): Return early if view or toolbar
+ is nil. If waiting for toolbar to complete, force a redraw.
+ (free_frame_tool_bar): Set wait_for_tool_bar = NO (Bug#16976).
+
+2014-04-03 Ken Brown <address@hidden>
+
+ * Makefile.in (EMACS_MANIFEST): Update comment. (Bug#17176)
+
2014-04-07 Paul Eggert <address@hidden>
* alloc.c: Simplify by removing use of HAVE_EXECINFO_H.
@@ -4490,7 +4524,7 @@
* frame.c (delete_frame): Block/unblock input to overcome race
condition (Bug#15475).
-2013-09-29 Andreas Politz <address@hidden> (tiny change)
+2013-09-29 Andreas Politz <address@hidden>
* frame.c (delete_frame): Record selected frame only after
calling Qdelete_frame_functions (Bug#15477).
=== modified file 'src/Makefile.in'
--- a/src/Makefile.in 2014-01-12 17:27:17 +0000
+++ b/src/Makefile.in 2014-04-03 19:10:35 +0000
@@ -259,7 +259,7 @@
## emacs.res if HAVE_W32
EMACSRES = @EMACSRES@
-## emacs-*.manifest if HAVE_W32
+## emacs-*.manifest if WINDOWSNT
EMACS_MANIFEST = @EMACS_MANIFEST@
## If HAVE_W32, compiler arguments for including
## the resource file in the binary.
=== modified file 'src/alloc.c'
--- a/src/alloc.c 2014-04-07 17:52:38 +0000
+++ b/src/alloc.c 2014-04-07 20:54:16 +0000
@@ -3357,6 +3357,13 @@
static struct symbol_block *symbol_block;
static int symbol_block_index = SYMBOL_BLOCK_SIZE;
+/* Pointer to the first symbol_block that contains pinned symbols.
+ Tests for 24.4 showed that at dump-time, Emacs contains about 15K symbols,
+ 10K of which are pinned (and all but 250 of them are interned in obarray),
+ whereas a "typical session" has in the order of 30K symbols.
+ `symbol_block_pinned' lets mark_pinned_symbols scan only 15K symbols rather
+ than 30K to find the 10K symbols we need to mark. */
+static struct symbol_block *symbol_block_pinned;
/* List of free symbols. */
@@ -3409,10 +3416,11 @@
SET_SYMBOL_VAL (p, Qunbound);
set_symbol_function (val, Qnil);
set_symbol_next (val, NULL);
- p->gcmarkbit = 0;
+ p->gcmarkbit = false;
p->interned = SYMBOL_UNINTERNED;
p->constant = 0;
- p->declared_special = 0;
+ p->declared_special = false;
+ p->pinned = false;
consing_since_gc += sizeof (struct Lisp_Symbol);
symbols_consed++;
total_free_symbols--;
@@ -5214,6 +5222,8 @@
return string;
}
+static Lisp_Object purecopy (Lisp_Object obj);
+
/* Return a cons allocated from pure space. Give it pure copies
of CAR as car and CDR as cdr. */
@@ -5223,8 +5233,8 @@
Lisp_Object new;
struct Lisp_Cons *p = pure_alloc (sizeof *p, Lisp_Cons);
XSETCONS (new, p);
- XSETCAR (new, Fpurecopy (car));
- XSETCDR (new, Fpurecopy (cdr));
+ XSETCAR (new, purecopy (car));
+ XSETCDR (new, purecopy (cdr));
return new;
}
@@ -5265,9 +5275,19 @@
{
if (NILP (Vpurify_flag))
return obj;
-
- if (PURE_POINTER_P (XPNTR (obj)))
+ else if (MARKERP (obj) || OVERLAYP (obj)
+ || HASH_TABLE_P (obj) || SYMBOLP (obj))
+ /* Can't purify those. */
return obj;
+ else
+ return purecopy (obj);
+}
+
+static Lisp_Object
+purecopy (Lisp_Object obj)
+{
+ if (PURE_POINTER_P (XPNTR (obj)) || INTEGERP (obj) || SUBRP (obj))
+ return obj; /* Already pure. */
if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */
{
@@ -5295,7 +5315,7 @@
size &= PSEUDOVECTOR_SIZE_MASK;
vec = XVECTOR (make_pure_vector (size));
for (i = 0; i < size; i++)
- vec->contents[i] = Fpurecopy (AREF (obj, i));
+ vec->contents[i] = purecopy (AREF (obj, i));
if (COMPILEDP (obj))
{
XSETPVECTYPE (vec, PVEC_COMPILED);
@@ -5304,11 +5324,23 @@
else
XSETVECTOR (obj, vec);
}
- else if (MARKERP (obj))
- error ("Attempt to copy a marker to pure storage");
+ else if (SYMBOLP (obj))
+ {
+ if (!XSYMBOL (obj)->pinned)
+ { /* We can't purify them, but they appear in many pure objects.
+ Mark them as `pinned' so we know to mark them at every GC cycle.
*/
+ XSYMBOL (obj)->pinned = true;
+ symbol_block_pinned = symbol_block;
+ }
+ return obj;
+ }
else
- /* Not purified, don't hash-cons. */
- return obj;
+ {
+ Lisp_Object args[2];
+ args[0] = build_pure_c_string ("Don't know how to purify: %S");
+ args[1] = obj;
+ Fsignal (Qerror, (Fcons (Fformat (2, args), Qnil)));
+ }
if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */
Fputhash (obj, obj, Vpurify_flag);
@@ -5471,6 +5503,24 @@
return list;
}
+static void
+mark_pinned_symbols (void)
+{
+ struct symbol_block *sblk;
+ int lim = (symbol_block_pinned == symbol_block
+ ? symbol_block_index : SYMBOL_BLOCK_SIZE);
+
+ for (sblk = symbol_block_pinned; sblk; sblk = sblk->next)
+ {
+ union aligned_Lisp_Symbol *sym = sblk->symbols, *end = sym + lim;
+ for (; sym < end; ++sym)
+ if (sym->s.pinned)
+ mark_object (make_lisp_ptr (&sym->s, Lisp_Symbol));
+
+ lim = SYMBOL_BLOCK_SIZE;
+ }
+}
+
DEFUN ("garbage-collect", Fgarbage_collect, Sgarbage_collect, 0, 0, "",
doc: /* Reclaim storage for Lisp objects no longer needed.
Garbage collection happens automatically if you cons more than
@@ -5573,6 +5623,7 @@
for (i = 0; i < staticidx; i++)
mark_object (*staticvec[i]);
+ mark_pinned_symbols ();
mark_specpdl ();
mark_terminals ();
mark_kboards ();
@@ -6574,12 +6625,7 @@
for (; sym < end; ++sym)
{
- /* Check if the symbol was created during loadup. In such a case
- it might be pointed to by pure bytecode which we don't trace,
- so we conservatively assume that it is live. */
- bool pure_p = PURE_POINTER_P (XSTRING (sym->s.name));
-
- if (!sym->s.gcmarkbit && !pure_p)
+ if (!sym->s.gcmarkbit)
{
if (sym->s.redirect == SYMBOL_LOCALIZED)
xfree (SYMBOL_BLV (&sym->s));
@@ -6593,8 +6639,6 @@
else
{
++num_used;
- if (!pure_p)
- eassert (!STRING_MARKED_P (XSTRING (sym->s.name)));
sym->s.gcmarkbit = 0;
}
}
=== modified file 'src/bidi.c'
--- a/src/bidi.c 2014-01-01 17:44:48 +0000
+++ b/src/bidi.c 2014-04-06 15:56:01 +0000
@@ -22,9 +22,16 @@
A sequential implementation of the Unicode Bidirectional algorithm,
(UBA) as per UAX#9, a part of the Unicode Standard.
- Unlike the reference and most other implementations, this one is
- designed to be called once for every character in the buffer or
- string.
+ Unlike the Reference Implementation and most other implementations,
+ this one is designed to be called once for every character in the
+ buffer or string. That way, we can leave intact the design of the
+ Emacs display engine, whereby an iterator object is used to
+ traverse buffer or string text character by character, and generate
+ the necessary data for displaying each character in 'struct glyph'
+ objects. (See xdisp.c for the details of that iteration.) The
+ functions on this file replace the original linear iteration in the
+ logical order of the text with a non-linear iteration in the visual
+ order, i.e. in the order characters should be shown on display.
The main entry point is bidi_move_to_visually_next. Each time it
is called, it finds the next character in the visual order, and
@@ -52,7 +59,182 @@
A note about references to UAX#9 rules: if the reference says
something like "X9/Retaining", it means that you need to refer to
rule X9 and to its modifications described in the "Implementation
- Notes" section of UAX#9, under "Retaining Format Codes". */
+ Notes" section of UAX#9, under "Retaining Format Codes".
+
+ Here's the overview of the design of the reordering engine
+ implemented by this file.
+
+ Basic implementation structure
+ ------------------------------
+
+ The sequential processing steps described by UAX#9 are implemented
+ as recursive levels of processing, all of which examine the next
+ character in the logical order. This hierarchy of processing looks
+ as follows, from the innermost (deepest) to the outermost level,
+ omitting some subroutines used by each level:
+
+ bidi_fetch_char -- fetch next character
+ bidi_resolve_explicit -- resolve explicit levels and directions
+ bidi_resolve_weak -- resolve weak types
+ bidi_resolve_neutral -- resolve neutral types
+ bidi_level_of_next_char -- resolve implicit levels
+
+ Each level calls the level below it, and works on the result
+ returned by the lower level, including all of its sub-levels.
+
+ Unlike all the levels below it, bidi_level_of_next_char can return
+ the information about either the next or previous character in the
+ logical order, depending on the current direction of scanning the
+ buffer or string. For the next character, it calls all the levels
+ below it; for the previous character, it uses the cache, described
+ below.
+
+ Thus, the result of calling bidi_level_of_next_char is the resolved
+ level of the next or the previous character in the logical order.
+ Based on this information, the function bidi_move_to_visually_next
+ finds the next character in the visual order and updates the
+ direction in which the buffer is scanned, either forward or
+ backward, to find the next character to be displayed. (Text is
+ scanned backwards when it needs to be reversed for display, i.e. if
+ the visual order is the inverse of the logical order.) This
+ implements the last, reordering steps of the UBA, by successively
+ calling bidi_level_of_next_char until the character of the required
+ embedding level is found; the scan direction is dynamically updated
+ as a side effect. See the commentary before the 'while' loop in
+ bidi_move_to_visually_next, for the details.
+
+ Fetching characters
+ -------------------
+
+ In a nutshell, fetching the next character boils down to calling
+ STRING_CHAR_AND_LENGTH, passing it the address of a buffer or
+ string position. See bidi_fetch_char. However, if the next
+ character is "covered" by a display property of some kind,
+ bidi_fetch_char returns the u+FFFC "object replacement character"
+ that represents the entire run of text covered by the display
+ property. (The ch_len and nchars members of 'struct bidi_it'
+ reflect the length in bytes and characters of that text.) This is
+ so we reorder text on both sides of the display property as
+ appropriate for an image or embedded string. Similarly, text
+ covered by a display spec of the form '(space ...)', is replaced
+ with the u+2029 paragraph separator character, so such display
+ specs produce the same effect as a TAB under UBA. Both these
+ special characters are not actually displayed -- the display
+ property is displayed instead -- but just used to compute the
+ embedding level of the surrounding text so as to produce the
+ required effect.
+
+ Bidi iterator states
+ --------------------
+
+ The UBA is highly context dependent in some of its parts,
+ i.e. results of processing a character can generally depend on
+ characters very far away. The UAX#9 description of the UBA
+ prescribes a stateful processing of each character, whereby the
+ results of this processing depend on various state variables, such
+ as the current embedding level, level stack, and directional
+ override status. In addition, the UAX#9 description includes many
+ passages like this (from rule W2 in this case):
+
+ Search backward from each instance of a European number until the
+ first strong type (R, L, AL, or sos) is found. If an AL is found,
+ change the type of the European number to Arabic number.
+
+ To support this, we use a bidi iterator object, 'struct bidi_it',
+ which is a sub-structure of 'struct it' used by xdisp.c (see
+ dispextern.h for the definition of both of these structures). The
+ bidi iterator holds the entire state of the iteration required by
+ the UBA, and is updated as the text is traversed. In particular,
+ the embedding level of the current character being resolved is
+ recorded in the iterator state. To avoid costly searches backward
+ in support of rules like W2 above, the necessary character types
+ are also recorded in the iterator state as they are found during
+ the forward scan, and then used when such rules need to be applied.
+ (Forward scans cannot be avoided in this way; they need to be
+ performed at least once, and the results recorded in the iterator
+ state, to be reused until the forward scan oversteps the recorded
+ position.)
+
+ In this manner, the iterator state acts as a mini-cache of
+ contextual information required for resolving the level of the
+ current character by various UBA rules.
+
+ Caching of bidi iterator states
+ -------------------------------
+
+ As described above, the reordering engine uses the information
+ recorded in the bidi iterator state in order to resolve the
+ embedding level of the current character. When the reordering
+ engine needs to process the next character in the logical order, it
+ fetches it and applies to it all the UBA levels, updating the
+ iterator state as it goes. But when the buffer or string is
+ scanned backwards, i.e. in the reverse order of buffer/string
+ positions, the scanned characters were already processed during the
+ preceding forward scan (see bidi_find_other_level_edge). To avoid
+ costly re-processing of characters that were already processed
+ during the forward scan, the iterator states computed while
+ scanning forward are cached.
+
+ The cache is just a linear array of 'struct bidi_it' objects, which
+ is dynamically allocated and reallocated as needed, since the size
+ of the cache depends on the text being processed. We only need the
+ cache while processing embedded levels higher than the base
+ paragraph embedding level, because these higher levels require
+ changes in scan direction. Therefore, as soon as we are back to
+ the base embedding level, we can free the cache; see the calls to
+ bidi_cache_reset and bidi_cache_shrink, for the conditions to do
+ this.
+
+ The cache maintains the index of the next unused cache slot -- this
+ is where the next iterator state will be cached. The function
+ bidi_cache_iterator_state saves an instance of the state in the
+ cache and increments the unused slot index. The companion function
+ bidi_cache_find looks up a cached state that corresponds to a given
+ buffer/string position. All of the cached states must correspond
+ 1:1 to the buffer or string region whose processing they reflect;
+ bidi.c will abort if it finds cache slots that violate this 1:1
+ correspondence.
+
+ When the parent iterator 'struct it' is pushed (see push_it in
+ xdisp.c) to pause the current iteration and start iterating over a
+ different object (e.g., a 'display' string that covers some buffer
+ text), the bidi iterator cache needs to be "pushed" as well, so
+ that a new empty cache could be used while iterating over the new
+ object. Later, when the new object is exhausted, and xdisp.c calls
+ pop_it, we need to "pop" the bidi cache as well and return to the
+ original cache. See bidi_push_it and bidi_pop_it for how this is
+ done.
+
+ Some functions of the display engine save copies of 'struct it' in
+ local variables, and restore them later. For examples, see
+ pos_visible_p and move_it_in_display_line_to in xdisp.c, and
+ window_scroll_pixel_based in window.c. When this happens, we need
+ to save and restore the bidi cache as well, because conceptually
+ the cache is part of the 'struct it' state, and needs to be in
+ perfect sync with the portion of the buffer/string that is being
+ processed. This saving and restoring of the cache state is handled
+ by bidi_shelve_cache and bidi_unshelve_cache, and the helper macros
+ SAVE_IT and RESTORE_IT defined on xdisp.c.
+
+ Note that, because reordering is implemented below the level in
+ xdisp.c that breaks glyphs into screen lines, we are violating
+ paragraph 3.4 of UAX#9. which mandates that line breaking shall be
+ done before reordering each screen line separately. However,
+ following UAX#9 to the letter in this matter goes against the basic
+ design of the Emacs display engine, and so we choose here this
+ minor deviation from the UBA letter in preference to redesign of
+ the display engine. The effect of this is only seen in continued
+ lines that are broken into screen lines in the middle of a run
+ whose direction is opposite to the paragraph's base direction.
+
+ Important design and implementation note: when the code needs to
+ scan far ahead, be sure to avoid such scans as much as possible
+ when the buffer/string doesn't contain any RTL characters. Users
+ of left-to-right scripts will never forgive you if you introduce
+ some slow-down due to bidi in situations that don't involve any
+ bidirectional text. See the large comment near the beginning of
+ bidi_resolve_neutral, for one situation where such shortcut was
+ necessary. */
#include <config.h>
#include <stdio.h>
=== modified file 'src/buffer.h'
--- a/src/buffer.h 2014-01-01 07:43:34 +0000
+++ b/src/buffer.h 2014-04-04 16:59:50 +0000
@@ -847,8 +847,8 @@
struct region_cache *width_run_cache;
struct region_cache *bidi_paragraph_cache;
- /* Non-zero means don't use redisplay optimizations for
- displaying this buffer. */
+ /* Non-zero means disable redisplay optimizations when rebuilding the glyph
+ matrices (but not when redrawing). */
bool_bf prevent_redisplay_optimizations_p : 1;
/* Non-zero whenever the narrowing is changed in this buffer. */
=== modified file 'src/frame.h'
--- a/src/frame.h 2014-03-20 14:09:37 +0000
+++ b/src/frame.h 2014-04-04 16:59:50 +0000
@@ -375,7 +375,8 @@
set this directly, use SET_FRAME_ICONIFIED instead. */
bool_bf iconified : 1;
- /* True if this frame should be redrawn. */
+ /* True if this frame should be fully redisplayed. Disables all
+ optimizations while rebuilding matrices and redrawing. */
bool_bf garbaged : 1;
/* False means, if this frame has just one window,
=== modified file 'src/keyboard.c'
--- a/src/keyboard.c 2014-04-05 19:30:36 +0000
+++ b/src/keyboard.c 2014-04-07 20:54:16 +0000
@@ -1,7 +1,6 @@
/* Keyboard and mouse input; editor command loop.
-Copyright (C) 1985-1989, 1993-1997, 1999-2014 Free Software Foundation,
-Inc.
+Copyright (C) 1985-1989, 1993-1997, 1999-2014 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -2379,7 +2378,7 @@
-2 means do neither.
1 means do both. */
-/* The arguments MAP is for menu prompting. MAP is a keymap.
+/* The argument MAP is a keymap for menu prompting.
PREV_EVENT is the previous input event, or nil if we are reading
the first event of a key sequence (or not reading a key sequence).
@@ -10068,7 +10067,10 @@
"FOpen dribble file: ",
doc: /* Start writing all keyboard characters to a dribble file called
FILE.
If FILE is nil, close any open dribble file.
-The file will be closed when Emacs exits. */)
+The file will be closed when Emacs exits.
+
+Be aware that this records ALL characters you type!
+This may include sensitive information such as passwords. */)
(Lisp_Object file)
{
if (dribble)
=== modified file 'src/lisp.h'
--- a/src/lisp.h 2014-04-05 19:30:36 +0000
+++ b/src/lisp.h 2014-04-07 20:54:16 +0000
@@ -1572,6 +1572,9 @@
special (with `defvar' etc), and shouldn't be lexically bound. */
bool_bf declared_special : 1;
+ /* True if pointed to from purespace and hence can't be GC'd. */
+ bool_bf pinned : 1;
+
/* The symbol's name, as a Lisp string. */
Lisp_Object name;
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog 2014-04-04 23:31:02 +0000
+++ b/test/ChangeLog 2014-04-07 20:54:16 +0000
@@ -1,3 +1,28 @@
+2014-04-07 João Távora <address@hidden>
+
+ * automated/electric-tests.el (define-electric-pair-test): Don't
+ overtest..
+ (inhibit-in-mismatched-string-inside-ruby-comments): New test.
+ (inhibit-in-mismatched-string-inside-c-comments): New test.
+
+2014-04-07 João Távora <address@hidden>
+
+ * automated/electric-tests.el (inhibit-if-strings-mismatched):
+ New test, change from `inhibit-only-of-next-is-mismatched'.
+
+2014-04-06 João Távora <address@hidden>
+
+ * automated/python-tests.el (python-triple-quote-pairing): New test.
+ (python-syntax-after-python-backspace): New test.
+
+2014-04-06 João Távora <address@hidden>
+
+ * automated/electric-tests.el (electric-pair-define-test-form):
+ More readable test docstrings.
+ (whitespace-skipping-for-quotes-not-ouside)
+ (whitespace-skipping-for-quotes-only-inside)
+ (whitespace-skipping-for-quotes-in-text-mode): New tests.
+
2014-04-04 João Távora <address@hidden>
* automated/electric-tests.el (define-electric-pair-test): Don't
=== modified file 'test/automated/electric-tests.el'
--- a/test/automated/electric-tests.el 2014-04-04 23:31:02 +0000
+++ b/test/automated/electric-tests.el 2014-04-07 20:54:16 +0000
@@ -114,8 +114,8 @@
mode
extra-desc))
()
- ,(format "With \"%s\", try input %c at point %d. \
-Should %s \"%s\" and point at %d"
+ ,(format "With |%s|, try input %c at point %d. \
+Should %s |%s| and point at %d"
fixture
char
(1+ pos)
@@ -383,6 +383,31 @@
:test-in-code nil
:test-in-comments t)
+(define-electric-pair-test whitespace-skipping-for-quotes-not-ouside
+ " \" \"" "\"-----" :expected-string "\"\" \" \""
+ :expected-point 2
+ :bindings '((electric-pair-skip-whitespace . chomp))
+ :test-in-strings nil
+ :test-in-code t
+ :test-in-comments nil)
+
+(define-electric-pair-test whitespace-skipping-for-quotes-only-inside
+ " \" \"" "---\"--" :expected-string " \"\""
+ :expected-point 5
+ :bindings '((electric-pair-skip-whitespace . chomp))
+ :test-in-strings nil
+ :test-in-code t
+ :test-in-comments nil)
+
+(define-electric-pair-test whitespace-skipping-quotes-not-without-proper-syntax
+ " \" \"" "---\"--" :expected-string " \"\"\" \""
+ :expected-point 5
+ :modes '(text-mode)
+ :bindings '((electric-pair-skip-whitespace . chomp))
+ :test-in-strings nil
+ :test-in-code t
+ :test-in-comments nil)
+
;;; Pairing arbitrary characters
;;;
=== modified file 'test/automated/python-tests.el'
--- a/test/automated/python-tests.el 2014-01-01 07:43:34 +0000
+++ b/test/automated/python-tests.el 2014-04-06 23:23:45 +0000
@@ -134,6 +134,16 @@
;;; Font-lock and syntax
+(ert-deftest python-syntax-after-python-backspace ()
+ ;; `python-indent-dedent-line-backspace' garbles syntax
+ :expected-result :failed
+ (python-tests-with-temp-buffer
+ "\"\"\""
+ (goto-char (point-max))
+ (python-indent-dedent-line-backspace 1)
+ (should (string= (buffer-string) "\"\""))
+ (should (null (nth 3 (syntax-ppss))))))
+
;;; Indentation
@@ -2696,6 +2706,9 @@
(equal (symbol-value (car ccons)) (cdr ccons)))))
(kill-buffer buffer)))
+
+;;; Electricity
+
(ert-deftest python-util-forward-comment-1 ()
(python-tests-with-temp-buffer
(concat
@@ -2708,6 +2721,32 @@
(python-util-forward-comment -1)
(should (= (point) (point-min)))))
+(ert-deftest python-triple-quote-pairing ()
+ (python-tests-with-temp-buffer
+ "\"\"\n"
+ (goto-char (1- (point-max)))
+ (let ((last-command-event ?\"))
+ (call-interactively 'self-insert-command))
+ (should (string= (buffer-string)
+ "\"\"\"\"\"\"\n"))
+ (should (= (point) 4)))
+ (python-tests-with-temp-buffer
+ "\n"
+ (let ((last-command-event ?\"))
+ (dotimes (i 3)
+ (call-interactively 'self-insert-command)))
+ (should (string= (buffer-string)
+ "\"\"\"\"\"\"\n"))
+ (should (= (point) 4)))
+ (python-tests-with-temp-buffer
+ "\"\n\"\"\n"
+ (goto-char (1- (point-max)))
+ (let ((last-command-event ?\"))
+ (call-interactively 'self-insert-command))
+ (should (= (point) (1- (point-max))))
+ (should (string= (buffer-string)
+ "\"\n\"\"\"\n"))))
+
(provide 'python-tests)
=== modified file 'test/indent/perl.perl'
--- a/test/indent/perl.perl 2013-05-06 19:33:56 +0000
+++ b/test/indent/perl.perl 2014-04-03 00:41:09 +0000
@@ -16,5 +16,9 @@
bar
EOF2
+print $'; # This should not start a string!
+
+print "hello" for /./;
+
$fileType_filesButNot # bug#12373?
= join( '|', map { quotemeta($_).'$' } @{$fileType->{filesButNot}} );
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r116950: Merge from emacs-24; up to r116924,
Daniel Colascione <=