1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 03:40:56 -08:00

Merge from emacs-24; up to 2014-04-25T10:35:01Z!michael.albinus@gmx.de

This commit is contained in:
Juanma Barranquero 2014-04-25 18:11:07 +02:00
commit dff4a9f6a4
18 changed files with 176 additions and 67 deletions

View file

@ -1,3 +1,9 @@
2014-04-25 Eli Zaretskii <eliz@gnu.org>
* strings.texi (Text Comparison): Mention
equal-including-properties for when text properties of the strings
matter for comparison.
2014-04-22 Eli Zaretskii <eliz@gnu.org>
* text.texi (Registers): Document register-read-with-preview.

View file

@ -423,8 +423,10 @@ the symbol names are used. Case is always significant, regardless of
This function is equivalent to @code{equal} for comparing two strings
(@pxref{Equality Predicates}). In particular, the text properties of
the two strings are ignored. But if either argument is not a string
or symbol, an error is signaled.
the two strings are ignored; use @code{equal-including-properties} if
you need to distinguish between strings that differ only in their text
properties. However, unlike @code{equal}, if either argument is not a
string or symbol, @code{string=} signals an error.
@example
(string= "abc" "abc")

View file

@ -1,3 +1,37 @@
2014-04-25 Eli Zaretskii <eliz@gnu.org>
* tooltip.el (tooltip-show-help-non-mode, tooltip-show-help): Use
equal-including-properties to compare help-echo strings. (Bug#17331)
2014-04-25 Leo Liu <sdl.web@gmail.com>
* emacs-lisp/lisp-mode.el (emacs-lisp-mode-syntax-table):
Fix syntax for @. (Bug#17325)
2014-04-25 Daniel Colascione <dancol@dancol.org>
* emacs-lisp/cl.el (gv): Require gv early to break eager
macro-expansion cycles.
2014-04-25 Stefan Monnier <monnier@iro.umontreal.ca>
* simple.el (region-active-p): Check there's a mark (bug#17324).
* simple.el (completion-list-mode-map): Use choose-completion for the
mouse binding as well (bug#17302).
(completion-list-mode, completion-setup-function): Adjust docstring and
echo area message accordingly.
* progmodes/idlwave.el (idlwave-choose-completion): Adjust to new
calling convention of choose-completion.
* comint.el (comint-dynamic-list-completions):
* term.el (term-dynamic-list-completions): Accept choose-completion.
* progmodes/perl-mode.el (perl-syntax-propertize-function): Slash after
&, |, +, - and * can't be a division (bug#17317).
* term/xterm.el (xterm--version-handler): Don't use modern xterm
features on gnome-terminal (bug#16988).
2014-04-25 Thien-Thi Nguyen <ttn@gnu.org>
Improve Scheme font-locking for (define ((foo ...) ...) ...).

View file

@ -3332,8 +3332,9 @@ the completions."
(and (consp first) (consp (event-start first))
(eq (window-buffer (posn-window (event-start first)))
(get-buffer "*Completions*"))
(eq (key-binding key) 'mouse-choose-completion)))
;; If the user does mouse-choose-completion with the mouse,
(memq (key-binding key)
'(mouse-choose-completion choose-completion))))
;; If the user does choose-completion with the mouse,
;; execute the command, then delete the completion window.
(progn
(choose-completion first)

View file

@ -29,6 +29,7 @@
(require 'cl-lib)
(require 'macroexp)
(require 'gv)
;; (defun cl--rename ()
;; (let ((vdefs ())

View file

@ -74,7 +74,7 @@ It has `lisp-mode-abbrev-table' as its parent."
(modify-syntax-entry ?` "' " table)
(modify-syntax-entry ?' "' " table)
(modify-syntax-entry ?, "' " table)
(modify-syntax-entry ?@ "' " table)
(modify-syntax-entry ?@ "_ p" table)
;; Used to be singlequote; changed for flonums.
(modify-syntax-entry ?. "_ " table)
(modify-syntax-entry ?# "' " table)

View file

@ -7170,7 +7170,7 @@ If these don't exist, a letter in the string is automatically selected."
(defun idlwave-choose-completion (&rest args)
"Choose the completion that point is in or next to."
(interactive)
(interactive (list last-nonmenu-event))
(apply 'idlwave-choose 'choose-completion args))
(defun idlwave-mouse-choose-completion (&rest args)

View file

@ -281,7 +281,7 @@
((concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)"
(regexp-opt '("split" "if" "unless" "until" "while" "split"
"grep" "map" "not" "or" "and" "for" "foreach"))
"\\|[?:.,;=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)")
"\\|[-?:.,;|&+*=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)")
(2 (ignore
(if (and (match-end 1) ; / at BOL.
(save-excursion

View file

@ -4503,7 +4503,12 @@ Some commands act specially on the region when Transient Mark
mode is enabled. Usually, such commands should use
`use-region-p' instead of this function, because `use-region-p'
also checks the value of `use-empty-active-region'."
(and transient-mark-mode mark-active))
(and transient-mark-mode mark-active
;; FIXME: Somehow we sometimes end up with mark-active non-nil but
;; without the mark being set (e.g. bug#17324). We really should fix
;; that problem, but in the mean time, let's make sure we don't say the
;; region is active when there's no mark.
(mark)))
(defvar redisplay-unhighlight-region-function
@ -6872,7 +6877,7 @@ With a prefix argument, set VARIABLE to VALUE buffer-locally."
(defvar completion-list-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [mouse-2] 'mouse-choose-completion)
(define-key map [mouse-2] 'choose-completion)
(define-key map [follow-link] 'mouse-face)
(define-key map [down-mouse-2] nil)
(define-key map "\C-m" 'choose-completion)
@ -7121,8 +7126,7 @@ back on `completion-list-insert-choice-function' when nil."
"Major mode for buffers showing lists of possible completions.
Type \\<completion-list-mode-map>\\[choose-completion] in the completion list\
to select the completion near point.
Use \\<completion-list-mode-map>\\[mouse-choose-completion] to select one\
with the mouse.
Or click to select one with the mouse.
\\{completion-list-mode-map}"
(set (make-local-variable 'completion-base-size) nil))
@ -7180,7 +7184,7 @@ Called from `temp-buffer-show-hook'."
(goto-char (point-min))
(if (display-mouse-p)
(insert (substitute-command-keys
"Click \\[mouse-choose-completion] on a completion to select it.\n")))
"Click on a completion to select it.\n")))
(insert (substitute-command-keys
"In this buffer, type \\[choose-completion] to \
select the completion near point.\n\n"))))))

View file

@ -4137,8 +4137,9 @@ Typing SPC flushes the help buffer."
(and (consp first)
(eq (window-buffer (posn-window (event-start first)))
(get-buffer "*Completions*"))
(eq (key-binding key) 'mouse-choose-completion)))
;; If the user does mouse-choose-completion with the mouse,
(memq (key-binding key)
'(mouse-choose-completion choose-completion))))
;; If the user does choose-completion with the mouse,
;; execute the command, then delete the completion window.
(progn
(choose-completion first)

View file

@ -530,6 +530,12 @@ The relevant features are:
;; Since xterm-280, the terminal type (NUMBER1) is now 41 instead of 0.
(when (string-match "\\([0-9]+\\);\\([0-9]+\\);0" str)
(let ((version (string-to-number (match-string 2 str))))
(when (and (> version 2000) (equal (match-string 1 str) "1"))
;; Hack attack! bug#16988: gnome-terminal reports "1;NNNN;0"
;; with a large NNNN but is based on a rather old xterm code.
;; Gnome terminal 3.6.1 reports 1;3406;0
;; Gnome terminal 2.32.1 reports 1;2802;0
(setq version 200))
;; If version is 242 or higher, assume the xterm supports
;; reporting the background color (TODO: maybe earlier
;; versions do too...)

View file

@ -343,9 +343,9 @@ It is also called if Tooltip mode is on, for text-only displays."
((stringp help)
(setq help (replace-regexp-in-string "\n" ", " help))
(unless (or tooltip-previous-message
(string-equal help (current-message))
(equal-including-properties help (current-message))
(and (stringp tooltip-help-message)
(string-equal tooltip-help-message
(equal-including-properties tooltip-help-message
(current-message))))
(setq tooltip-previous-message (current-message)))
(setq tooltip-help-message help)
@ -369,7 +369,7 @@ MSG is either a help string to display, or nil to cancel the display."
;; Cancel display. This also cancels a delayed tip, if
;; there is one.
(tooltip-hide))
((equal previous-help msg)
((equal-including-properties previous-help msg)
;; Same help as before (but possibly the mouse has moved).
;; Keep what we have.
)

View file

@ -1,3 +1,9 @@
2014-04-25 Eli Zaretskii <eliz@gnu.org>
* search.c (Fnewline_cache_check): Don't try to count newlines
outside the buffer's restriction, as find_newline doesn't support
that.
2014-04-24 Stefan Monnier <monnier@iro.umontreal.ca>
* window.c (Fset_window_configuration): Deactivate the mark before

View file

@ -3199,7 +3199,7 @@ the first based on the cache, the second based on actually scanning
the buffer. If the buffer doesn't have a cache, the value is nil. */)
(Lisp_Object buffer)
{
struct buffer *buf;
struct buffer *buf, *old = NULL;
ptrdiff_t shortage, nl_count_cache, nl_count_buf;
Lisp_Object cache_newlines, buf_newlines, val;
ptrdiff_t from, found, i;
@ -3210,6 +3210,7 @@ the buffer. If the buffer doesn't have a cache, the value is nil. */)
{
CHECK_BUFFER (buffer);
buf = XBUFFER (buffer);
old = current_buffer;
}
if (buf->base_buffer)
buf = buf->base_buffer;
@ -3219,46 +3220,63 @@ the buffer. If the buffer doesn't have a cache, the value is nil. */)
|| buf->newline_cache == NULL)
return Qnil;
/* find_newline can only work on the current buffer. */
if (old != NULL)
set_buffer_internal_1 (buf);
/* How many newlines are there according to the cache? */
find_newline (BUF_BEG (buf), BUF_BEG_BYTE (buf),
BUF_Z (buf), BUF_Z_BYTE (buf),
find_newline (BEGV, BEGV_BYTE, ZV, ZV_BYTE,
TYPE_MAXIMUM (ptrdiff_t), &shortage, NULL, true);
nl_count_cache = TYPE_MAXIMUM (ptrdiff_t) - shortage;
/* Create vector and populate it. */
cache_newlines = make_uninit_vector (nl_count_cache);
for (from = BUF_BEG( buf), found = from, i = 0;
from < BUF_Z (buf);
from = found, i++)
if (nl_count_cache)
{
for (from = BEGV, found = from, i = 0; from < ZV; from = found, i++)
{
ptrdiff_t from_byte = CHAR_TO_BYTE (from);
found = find_newline (from, from_byte, 0, -1, 1, &shortage, NULL, true);
if (shortage == 0)
found = find_newline (from, from_byte, 0, -1, 1, &shortage,
NULL, true);
if (shortage != 0 || i >= nl_count_cache)
break;
ASET (cache_newlines, i, make_number (found - 1));
}
/* Fill the rest of slots with an invalid position. */
for ( ; i < nl_count_cache; i++)
ASET (cache_newlines, i, make_number (-1));
}
/* Now do the same, but without using the cache. */
find_newline1 (BUF_BEG (buf), BUF_BEG_BYTE (buf),
BUF_Z (buf), BUF_Z_BYTE (buf),
find_newline1 (BEGV, BEGV_BYTE, ZV, ZV_BYTE,
TYPE_MAXIMUM (ptrdiff_t), &shortage, NULL, true);
nl_count_buf = TYPE_MAXIMUM (ptrdiff_t) - shortage;
buf_newlines = make_uninit_vector (nl_count_buf);
for (from = BUF_BEG( buf), found = from, i = 0;
from < BUF_Z (buf);
from = found, i++)
if (nl_count_buf)
{
for (from = BEGV, found = from, i = 0; from < ZV; from = found, i++)
{
ptrdiff_t from_byte = CHAR_TO_BYTE (from);
found = find_newline1 (from, from_byte, 0, -1, 1, &shortage, NULL, true);
if (shortage == 0)
found = find_newline1 (from, from_byte, 0, -1, 1, &shortage,
NULL, true);
if (shortage != 0 || i >= nl_count_buf)
break;
ASET (buf_newlines, i, make_number (found - 1));
}
for ( ; i < nl_count_buf; i++)
ASET (buf_newlines, i, make_number (-1));
}
/* Construct the value and return it. */
val = make_uninit_vector (2);
ASET (val, 0, cache_newlines);
ASET (val, 1, buf_newlines);
if (old != NULL)
set_buffer_internal_1 (old);
return val;
}

View file

@ -1,3 +1,17 @@
2014-04-25 Michael Albinus <michael.albinus@gmx.de>
* automated/tramp-tests.el (top):
* automated/file-notify-tests.el (top): Do not disable interactive
passwords in batch mode.
(password-cache-expiry): Set to nil.
* automated/file-notify-tests.el
(file-notify-test-remote-temporary-file-directory):
* automated/tramp-tests.el (tramp-test-temporary-file-directory):
Use a mock-up method as default.
(tramp-test00-availability): Print the used directory name.
(tramp-test33-recursive-load): Fix typo.
2014-04-22 Michael Albinus <michael.albinus@gmx.de>
* automated/tramp-tests.el (tramp--test-check-files): Remove traces.

View file

@ -19,15 +19,17 @@
;;; Commentary:
;; Some of the tests require access to a remote host files. Set
;; $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order
;; to overwrite the default value. If you want to skip tests
;; accessing a remote host, set this environment variable to
;; "/dev/null" or whatever is appropriate on your system.
;; Some of the tests require access to a remote host files. Since
;; this could be problematic, a mock-up connection method "mock" is
;; used. Emulating a remote connection, it simply calls "sh -i".
;; Tramp's file name handlers still run, so this test is sufficient
;; except for connection establishing.
;; When running the tests in batch mode, it must NOT require an
;; interactive password prompt unless the environment variable
;; $REMOTE_ALLOW_PASSWORD is set.
;; If you want to test a real Tramp connection, set
;; $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order to
;; overwrite the default value. If you want to skip tests accessing a
;; remote host, set this environment variable to "/dev/null" or
;; whatever is appropriate on your system.
;; A whole test run can be performed calling the command `file-notify-test-all'.
@ -35,13 +37,22 @@
(require 'ert)
(require 'filenotify)
(require 'tramp)
;; There is no default value on w32 systems, which could work out of the box.
(defconst file-notify-test-remote-temporary-file-directory
(cond
((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY"))
((eq system-type 'windows-nt) null-device)
(t (format "/ssh::%s" temporary-file-directory)))
(t (add-to-list
'tramp-methods
'("mock"
(tramp-login-program "sh")
(tramp-login-args (("-i")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-connection-timeout 10)))
(format "/mock::%s" temporary-file-directory)))
"Temporary directory for Tramp tests.")
(defvar file-notify--test-tmpfile nil)
@ -49,14 +60,10 @@
(defvar file-notify--test-results nil)
(defvar file-notify--test-event nil)
(require 'tramp)
(setq tramp-verbose 0
(setq password-cache-expiry nil
tramp-verbose 0
tramp-message-show-message nil)
;; Disable interactive passwords in batch mode.
(when (and noninteractive (not (getenv "REMOTE_ALLOW_PASSWORD")))
(defalias 'tramp-read-passwd 'ignore))
;; This shall happen on hydra only.
(when (getenv "NIX_STORE")
(add-to-list 'tramp-remote-path 'tramp-own-remote-path))

View file

@ -21,15 +21,17 @@
;; The tests require a recent ert.el from Emacs 24.4.
;; Some of the tests require access to a remote host files. Set
;; $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order
;; to overwrite the default value. If you want to skip tests
;; accessing a remote host, set this environment variable to
;; "/dev/null" or whatever is appropriate on your system.
;; Some of the tests require access to a remote host files. Since
;; this could be problematic, a mock-up connection method "mock" is
;; used. Emulating a remote connection, it simply calls "sh -i".
;; Tramp's file name handlers still run, so this test is sufficient
;; except for connection establishing.
;; When running the tests in batch mode, it must NOT require an
;; interactive password prompt unless the environment variable
;; $REMOTE_ALLOW_PASSWORD is set.
;; If you want to test a real Tramp connection, set
;; $REMOTE_TEMPORARY_FILE_DIRECTORY to a suitable value in order to
;; overwrite the default value. If you want to skip tests accessing a
;; remote host, set this environment variable to "/dev/null" or
;; whatever is appropriate on your system.
;; A whole test run can be performed calling the command `tramp-test-all'.
@ -51,7 +53,15 @@
(cond
((getenv "REMOTE_TEMPORARY_FILE_DIRECTORY"))
((eq system-type 'windows-nt) null-device)
(t (format "/ssh::%s" temporary-file-directory)))
(t (add-to-list
'tramp-methods
'("mock"
(tramp-login-program "sh")
(tramp-login-args (("-i")))
(tramp-remote-shell "/bin/sh")
(tramp-remote-shell-args ("-c"))
(tramp-connection-timeout 10)))
(format "/mock::%s" temporary-file-directory)))
"Temporary directory for Tramp tests.")
(setq password-cache-expiry nil
@ -59,10 +69,6 @@
tramp-copy-size-limit nil
tramp-message-show-message nil)
;; Disable interactive passwords in batch mode.
(when (and noninteractive (not (getenv "REMOTE_ALLOW_PASSWORD")))
(defalias 'tramp-read-passwd 'ignore))
;; This shall happen on hydra only.
(when (getenv "NIX_STORE")
(add-to-list 'tramp-remote-path 'tramp-own-remote-path))
@ -127,6 +133,7 @@ eval properly in `should', `should-not' or `should-error'."
(ert-deftest tramp-test00-availability ()
"Test availability of Tramp functions."
:expected-result (if (tramp--test-enabled) :passed :failed)
(message "Remote directory: `%s'" tramp-test-temporary-file-directory)
(should (ignore-errors
(and
(file-remote-p tramp-test-temporary-file-directory)
@ -1589,7 +1596,7 @@ process sentinels. They shall not disturb each other."
(dolist (code
(list
(format
"(expand-file-name %S))"
"(expand-file-name %S)"
tramp-test-temporary-file-directory)
(format
"(let ((default-directory %S)) (expand-file-name %S))"

View file

@ -1,6 +1,8 @@
#!/usr/bin/perl
# -*- eval: (bug-reference-mode 1) -*-
if ($c && /====/){xyz;}
print <<"EOF1" . s/he"llo/th'ere/;
foo
EOF2