Eli Zaretskii [Mon, 7 Dec 2015 16:20:43 +0000 (18:20 +0200)]
Improve documentation of kill commands
* lisp/simple.el (region-extract-function, delete-backward-char)
(delete-forward-char, kill-region, copy-region-as-kill)
(kill-ring-save): Better document the optional argument REGION in
the doc strings. Mention in the doc strings that text put in the
kill-ring can be filtered by 'filter-buffer-substring'.
* doc/lispref/text.texi (Kill Functions): Mention that functions
described in this subsection can filter text they put in the
kill-ring. Add a cross-reference to "Buffer Contents" and an
index entry. Document the optional argument 'region' and its
effect.
(Bug#21315)
Michael Albinus [Mon, 7 Dec 2015 08:15:27 +0000 (08:15 +0000)]
Fix an utf8 problem for Tramp on BSD
* lisp/net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
Make lax check for utf8.
(tramp-get-remote-locale): Add "en_US.UTF-8" as candidate.
Paul Eggert [Sun, 6 Dec 2015 23:07:19 +0000 (15:07 -0800)]
Remove overenthusiastic eassert
* src/lisp.h (XSYMBOL): Remove eassert incorrectly added in
previous change. It breaks on MS-Windows --with-wide-int.
Problem reported by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00275.html
Michael Albinus [Sun, 6 Dec 2015 17:55:50 +0000 (18:55 +0100)]
Fix minor Tramp problems found on BSD
* lisp/net/tramp-sh.el (tramp-perl-file-truename): Do not append
trailing slash. Quote apostrophes.
(tramp-sh-handle-file-truename): Do not append trailing slash in
the "ls" case.
(tramp-get-ls-command-with-w-option): New defun.
(tramp-do-file-attributes-with-ls)
(tramp-do-directory-files-and-attributes-with-stat): Use it.
* test/automated/tramp-tests.el
(tramp-test31-special-characters-with-perl)
(tramp-test31-special-characters-with-ls)
(tramp-test32-utf8-with-perl, tramp-test32-utf8-with-ls):
Suppress also readlink.
Eli Zaretskii [Sun, 6 Dec 2015 17:27:12 +0000 (19:27 +0200)]
Fix cursor display when invisible text is at line beginning
* src/xdisp.c (redisplay_window): When scrolling fails to show
point, prefer using the desired matrix if possible for finding the
fallback glyph row for displaying the cursor. (Bug#22098)
(row_containing_pos): Exit the loop as soon as we hit the first
disabled glyph row. Otherwise we risk accessing garbled data and
departing to the no-no land.
Paul Eggert [Sun, 6 Dec 2015 17:09:07 +0000 (09:09 -0800)]
Improve module interface when WIDE_EMACS_INT
* src/emacs-module.c (plain_values): New constant.
(module_nil): Now a constant.
(Finternal_module_call, value_to_lisp_bits, lisp_to_value_bits)
(syms_of_module): Use if, not #ifdef, so that both sides are
checked at compile-time, and so that GCC doesn’t complain
about an unused var in the typical case. Also, depend on
plain_values, not on WIDE_EMACS_INT; the code shouldn’t assume
that WIDE_EMACS_INT implies !USE_LSB_TAG.
(value_to_lisp_bits, lisp_to_value_bits): New functions.
Sign-extend integers rather than zero-extending them, as small
negative integers are more likely.
(value_to_lisp, lisp_to_value): Rewrite in terms of the new *_bits
functions.
(HAVE_STRUCT_ATTRIBUTE_ALIGNED): Define to 0 if not already defined.
(mark_modules): Remove. All uses removed.
(lisp_to_value): Don’t assume Fcons returns a pointer aligned
to GCALIGNMENT.
(syms_of_module): Check that module_nil converts to Qnil.
* src/lisp.h (lisp_h_XSYMBOL, XSYMBOL): Use signed conversion, since
we prefer signed to unsigned when either will do.
(TAG_PTR): Sign-extend pointers when USE_LSB_TAG, as this is
a bit better for emacs-module.c.
Paul Eggert [Sun, 6 Dec 2015 16:55:30 +0000 (08:55 -0800)]
Port mod-test to x86-64 GNU/Linux running 32-bit
* modules/mod-test/test.el (mod-test-sum-test):
Don’t attempt to match descriptions to operating systems.
It didn’t work on Fedora x86-64 running a 32-bit executable,
and it’s not worth the trouble anyway.
Port to 32-bit platforms by removing an assumption about
fixnum widths.
Artur Malabarba [Sat, 5 Dec 2015 16:37:01 +0000 (16:37 +0000)]
* lisp/emacs-lisp/package.el: Don't install bad signatures (bug#22089)
(package--with-response-buffer): NOERROR and ERROR-FORM only
handle connection errors.
(bad-signature): New error type.
(package--check-signature-content): Use it.
(package--check-signature): Properly distinguish connection errors
from bad-signature errors. Do the check for
`package-check-signature' `allow-unsigned' here instead of forcing
the callbacks to do it. Add a new argument, UNWIND.
(package--download-one-archive, package-install-from-archive):
Update usage of `package--check-signature'.
Ulf Jasper [Sat, 5 Dec 2015 15:55:49 +0000 (16:55 +0100)]
Fix Bug#22092.
* lisp/calendar/icalendar.el (icalendar--get-unfolded-buffer):
Clean up inconsistent line endings. (Bug#22092)
(icalendar--clean-up-line-endings): New.
* test/automated/icalendar-tests.el (icalendar-real-world): Add test
for Bug#22092.
Eli Zaretskii [Sat, 5 Dec 2015 11:51:09 +0000 (13:51 +0200)]
Initial documentation of dynamic modules
* doc/lispref/loading.texi (Dynamic Modules): New section with
initial documentation for dynamic modules.
* doc/lispref/elisp.texi (Top): Add "Dynamic Modules" to the
detailed menu
Eli Zaretskii [Sat, 5 Dec 2015 10:52:54 +0000 (12:52 +0200)]
Add "Preliminaries" section to etc/DEBUG
* etc/DEBUG: Add the "Preliminaries" section for GDB beginners.
Most of the content was suggested by Phillip Lord
<phillip.lord@russet.org.uk>. Remove the section about debugging
with the Visual Studio, as building Emacs with the Microsoft
compilers is no longer supported. Minor fixes in some other
sections.
Alex Dunn [Sat, 5 Dec 2015 09:32:01 +0000 (11:32 +0200)]
Improve parsing of version strings
* lisp/subr.el (version-regexp-alist): Allow "." as priority separator
(version-to-list): More helpful error messages.
(version-to-list): ".5" is valid (update docstring). Make
"22.8X3" invalid, as the doc string says.
* test/automated/subr-tests.el (ert-test-version-parsing): New
tests for version string processing.
Glenn Morris [Sat, 5 Dec 2015 00:49:07 +0000 (19:49 -0500)]
* lisp/net/net-utils.el: Small improvements.
(net-utils--executable-find-sbin): New function.
(ifconfig-program): Check sbin directories.
Fallback to "ip". (Bug#22091)
(ifconfig-program-options): Check the actual program in use.
(arp-program): Check sbin directories.
Artur Malabarba [Fri, 4 Dec 2015 15:12:10 +0000 (15:12 +0000)]
* lisp/character-fold.el: Remove special case-folding support
(character-fold-to-regexp): Remove special code for
case-folding. Char-fold search still respects the
`case-fold-search' variable (i.e., f matches F). This only
removes the code that was added to ensure that f also matched
all chars that F matched. For instance, after this commit, f
no longer matches 𝔽.
This was necessary because the logic created a regexp with
2^(length of the string) redundant paths. So, when a very
long string "almost" matched, Emacs took a very long time to
figure out that it didn't. This became particularly relevant
because isearch's lazy-highlight does a search bounded by (1-
match-end) (which, in most circumstances, is a search that
almost matches). A recipe for this can be found in bug#22090.
Artur Malabarba [Thu, 3 Dec 2015 15:24:51 +0000 (15:24 +0000)]
* lisp/emacs-lisp/package.el (package-unpack): Load before compiling
Reload any previously loaded package files before compiling
the package (also reload the same files after compiling).
This ensures that we have the most recent definitions during
compilation, and avoids generating bad elc files when a macro
changes and it is used in a different file from the one it's
defined in.
(package-activate): Move code that activates dependencies into
package-activate-1.
(package--load-files-for-activation): New function.
(package-activate-1): Add code for (optionally) activating
dependencies, and move file-loading code into
`package--load-files-for-activation'.
Eli Zaretskii [Thu, 3 Dec 2015 16:03:47 +0000 (18:03 +0200)]
Document new font-related functionality
* doc/lispref/display.texi (Low-Level Font): Document
'default-font-width', 'default-font-height', 'window-font-width',
and 'window-font-height'.
* etc/NEWS: Move entries for 'default-font-width',
'default-font-height', 'window-font-width', and 'window-font-height'
to their place and mark them documented.
Eli Zaretskii [Thu, 3 Dec 2015 14:59:42 +0000 (16:59 +0200)]
Fix documentation and implementation of 'directory-name-p'
* lisp/files.el (directory-name-p): Modify to recognize
backslashes on MS-Windows and MS-DOS. Adjust the doc string
accordingly. Use '=', not char-equal, for comparison, as
letter-case cannot possibly be an issue here.
* doc/lispref/files.texi (Directory Names): Move the documentation
of directory-name-p here from "Relative File Names". Update the
description per the changes in implementation.
* etc/NEWS: Move the entry for 'directory-name-p' to its proper
place and mark it documented.
Eli Zaretskii [Wed, 2 Dec 2015 14:06:01 +0000 (16:06 +0200)]
More emacs-module.c fixes for wide ints
* src/emacs-module.c (value_to_lisp) [WIDE_EMACS_INT]: Use
unsigned data types to manipulate pointers, to avoid sign
extension coming after us with a vengeance.
* modules/mod-test/test.el (mod-test-sum-test): Add tests for
Emacs with wide ints that verify integer values near the critical
value that requires us to switch to a cons cell.
Dmitry Gutov [Wed, 2 Dec 2015 02:12:03 +0000 (04:12 +0200)]
APPEND etags--xref-backend to xref-backend-functions
* lisp/progmodes/xref.el (xref-backend-functions):
Use APPEND when adding the default element
(http://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00061.html).
Eli Zaretskii [Tue, 1 Dec 2015 19:29:14 +0000 (21:29 +0200)]
More accurate documentation of lax whitespace matching
* lisp/isearch.el (isearch-forward-word, isearch-forward-symbol)
(word-search-backward, word-search-forward)
(word-search-backward-lax, word-search-forward-lax): Mention in
doc strings that toggling lax whitespace matching has no effect on
these commands.
* doc/emacs/search.texi (Word Search, Symbol Search): Clarify that
lax whitespace matching has no effect on these commands.
Eli Zaretskii [Tue, 1 Dec 2015 18:34:12 +0000 (20:34 +0200)]
Fix emacs-module.c for wide ints
* src/emacs-module.c (lisp_to_value): Compare the produced value
with the original Lisp object, not with the one potentially
converted into a Lisp_Cons. Fixes assertion violations when
working with integers larger than fit into a 32-bit value.
* modules/mod-test/test.el (mod-test-sum-test): Add tests for
large integers, to test --with-wide-int.
Eli Zaretskii [Tue, 1 Dec 2015 16:11:11 +0000 (18:11 +0200)]
Document 'inhibit-read-only' property
* doc/lispref/text.texi (Special Properties): Describe the new
'inhibit-read-only' text property. Add cross-reference to where
read-only buffers are described.
* doc/lispref/buffers.texi (Read Only Buffers): Mention that
'inhibit-read-only' property exempts text from being read-only.
Add cross-reference to "Special Properties".
* etc/NEWS: Move the entry about 'inhibit-read-only' property to
its place and mark it documented.
Artur Malabarba [Tue, 1 Dec 2015 13:52:50 +0000 (13:52 +0000)]
* lisp/character-fold.el: Add back multi-char matching
(character-fold-to-regexp): Uncomment recently commented code
and make the algorithm "dummer" by not checking every possible
combination. This will miss some possible matches, but it
greatly reduces regexp size.
* test/automated/character-fold-tests.el
(character-fold--test-fold-to-regexp): Comment out test of
functionality no longer supported.
Stefan Monnier [Mon, 30 Nov 2015 19:34:42 +0000 (14:34 -0500)]
Rely on conservative stack scanning to find "emacs_value"s
* src/emacs-module.c (struct emacs_value_tag)
(struct emacs_value_frame, struct emacs_value_storage): Remove.
(value_frame_size): Remove constant.
(struct emacs_env_private): Use Lisp_Object for non_local_exit info.
(lisp_to_value): Remove first arg.
(module_nil): New constant.
Use it instead of NULL when returning an emacs_value.
(module_make_function): Adjust to new calling convention of
Qinternal_module_call.
(DEFUN): Receive args in an array rather than a list.
Use SAFE_ALLOCA rather than xnmalloc. Skip the lisp_to_value loop when
we don't have WIDE_EMACS_INT. Adjust to new type of non_local_exit info.
(module_non_local_exit_signal_1, module_non_local_exit_throw_1):
Adjust to new type of non_local_exit info.
(ltv_mark) [WIDE_EMACS_INT]: New constant.
(value_to_lisp, lisp_to_value): Rewrite.
(initialize_frame, initialize_storage, finalize_storage): Remove functions.
(allocate_emacs_value): Remove function.
(mark_modules): Gut it.
(initialize_environment): Don't initialize storage any more.
Keep the actual env object on Vmodule_environments.
(finalize_environment): Don't finalize storage any more.
(syms_of_module): Initialize ltv_mark and module_nil.
* src/emacs-module.h (emacs_value): Make it more clear that this type
is really opaque, including the fact that NULL may not be valid.
* modules/mod-test/mod-test.c (Fmod_test_signal, Fmod_test_throw):
Don't assume that NULL is a valid emacs_value.
Eli Zaretskii [Mon, 30 Nov 2015 17:30:29 +0000 (19:30 +0200)]
Yet another doc improvement for search commands
* doc/emacs/search.texi (Word Search, Symbol Search)
(Regexp Search): Document commands that don't support lax
whitespace matching or character folding.
(Nonincremental Search): Mention the search commands that can be
invoked from the menu bar.
* lisp/isearch.el (isearch-define-mode-toggle-word)
(isearch-define-mode-toggle-symbol)
(isearch-define-mode-toggle-character-fold): Note in the doc
string that turning these on exits the regexp mode.
(isearch-forward-regexp, isearch-forward-word)
(isearch-forward-symbol, isearch-backward-regexp)
(word-search-backward, word-search-forward)
(word-search-backward-lax, word-search-forward-lax): State in the
doc string which commands don't support character folding and/or
lax-whitespace matching.
Artur Malabarba [Mon, 30 Nov 2015 15:05:44 +0000 (15:05 +0000)]
* lisp/character-fold.el: Comment out branching code
(character-fold-to-regexp): Comment out code that uses multi-char
table. The branching caused by this induces absurdly long regexps,
up to 10k chars for as little as 25 input characters.
Artur Malabarba [Sun, 29 Nov 2015 21:20:33 +0000 (21:20 +0000)]
* lisp/menu-bar.el: Use folding in searches
(nonincremental-search-forward): Use `isearch-search-fun-default'
to determine the search function.
(nonincremental-search-backward)
(nonincremental-repeat-search-forward)
(nonincremental-repeat-search-backward): Use it.
Eli Zaretskii [Sun, 29 Nov 2015 17:40:08 +0000 (19:40 +0200)]
Document truncate-string-ellipsis
* doc/lispref/display.texi (Size of Displayed Text): Document
'truncate-string-ellipsis'.
* lisp/international/mule-util.el (truncate-string-ellipsis): Doc fix.
(truncate-string-to-width): Mention in the doc string that the
default for ELLIPSIS comes from 'truncate-string-ellipsis'.
* etc/NEWS: Move the 'truncate-string-ellipsis' entry to the "Lisp
Changes" section.
Eli Zaretskii [Sun, 29 Nov 2015 16:31:09 +0000 (18:31 +0200)]
Fix confusion wrt character folding in the Emacs manual
* doc/emacs/search.texi (Nonincremental Search, Regexp Search):
Document that invoking search-forward/backward and
re-search-forward/backward supports only case folding, but not the
rest of the lax-search features. Reported by Mike Kupfer
<m.kupfer@acm.org>.
Alan Mackenzie [Sun, 29 Nov 2015 16:17:07 +0000 (16:17 +0000)]
Byte compiler: Catch missing argument to `funcall'. Fixes bug#22051.
* lisp/emacs-lisp/bytecomp.el (byte-compile-funcall): When there's no argument
to `funcall', (i) Output an error message; (ii) Generate code to signal a
`wrong-number-of-arguments' error.
Eli Zaretskii [Sat, 28 Nov 2015 18:38:27 +0000 (20:38 +0200)]
Document renaming of x-select-enable-* variables
* doc/emacs/killing.texi (Clipboard): Rename
x-select-enable-clipboard to select-enable-clipboard and
x-select-enable-primary to select-enable-primary. Update index
entries.
Eli Zaretskii [Sat, 28 Nov 2015 18:27:52 +0000 (20:27 +0200)]
Document the shorthand hints displayed by M-x
* doc/emacs/m-x.texi (M-x): Document the numeric meaning of
suggest-key-bindings. Document the shorthand hints for commands
that have no key bindings. Document that M-x completion ignores
obsolete commands.
* etc/NEWS: Move the M-x entry to "Editing Changes" and mark it as
documented.
Artur Malabarba [Sat, 28 Nov 2015 12:15:17 +0000 (12:15 +0000)]
* lisp/character-fold.el: Add support for multi-char matches
(character-fold-table): Now has an extra-slot. This is a second
char-table that holds multi-character matches. See docstring for
details.
(character-fold-to-regexp): Can build branching regexps when a
character's entry the extra slot of `character-fold-table' matches the
characters that succeed it.
Artur Malabarba [Sat, 28 Nov 2015 10:32:46 +0000 (10:32 +0000)]
* lisp/character-fold.el: Code simplifications
(character-fold-table): Reduce the scope of a variable.
(character-fold-to-regexp): Change logic to work directly on the
input string. It's a little easier to understand, probably
faster, and sets us up for implementing multi-char matches.
* test/automated/character-fold-tests.el
(character-fold--test-fold-to-regexp): New test.
Eli Zaretskii [Sat, 28 Nov 2015 12:32:04 +0000 (14:32 +0200)]
Document new checkdoc features
* doc/lispref/tips.texi (Tips, Library Headers): Document the
keyword-checking features of checkdoc and the commands
'checkdoc-file' and 'checkdoc-current-buffer'.
* etc/NEWS: Move the checkdoc-related entries to their own
section.