Do potentially destructive operations in prepare-commit-msg
* build-aux/git-hooks/prepare-commit-msg: If someone occasionally puts
Signed-off line, it will likely get there through -s option of git.
Exploit this fact to abort before a user got a chance to type commit
message. (Bug#35368)
Paul Eggert [Mon, 13 May 2019 19:43:13 +0000 (12:43 -0700)]
Backport: fix broken build on m68k
The GCC + valgrind fix caused the m68k build to fail (Bug#35711).
Simplify string allocation a bit to make similar problems less
likely in the future.
* src/alloc.c (sdata, SDATA_NBYTES, SDATA_DATA) [GC_CHECK_STRING_BYTES]:
Use the same implementation as with !GC_CHECK_STRING_BYTES,
as the special case is no longer needed.
(SDATA_ALIGN): New constant.
(SDATA_SIZE): Remove this macro, replacing with ...
(sdata_size): ... this new function. All uses changed.
Properly account for sizes and alignments even in the m68k case,
and even if GC_CHECK_STRING_BYTES is not defined.
Noam Postavsky [Mon, 6 May 2019 23:55:17 +0000 (19:55 -0400)]
Handle GNUTLS_E_AGAIN in emacs_gnutls_read (Bug#34341)
Don't merge to master, this has already been fixed there by 2019-01-15
"Fix unlikely races with GnuTLS, datagrams".
* src/gnutls.c (emacs_gnutls_read): Similar to emacs_gnutls_write,
when gnutls_record_recv returns GNUTLS_E_AGAIN set errno to EGAIN.
Neil Roberts [Fri, 10 May 2019 10:57:28 +0000 (12:57 +0200)]
Let dir locals for more specific modes override those from less
The list of dir local variables to apply is now sorted by the number
of parent modes of the mode used as the key in the association list.
That way when the variables are applied in order the variables from
more specific modes will override those from less specific modes.
If there are directory entries in the list then they are sorted in
order of name length. The list of modes for that dir is then
recursively sorted with the same mechanism. That way variables tied
to a particular subdirectory override those in in a parent directory.
Previously the behaviour didn’t seem to be well defined anyway and was
dependent on the order they appeared in the file. However this order
was changed in version 26.1 and it probably also depended on the
number of dir-local files that are merged.
Bug#33400
* lisp/files.el (dir-locals-get-sort-score, dir-locals-sort-variables)
(dir-locals-read-from-dir): Sort the dir locals so that more precise
modes and directory-specific entries have override lesser ones.
* doc/emacs/custom.texi (Directory Variables): Document the priority.
Recognize single quote attribute values in nxml and sgml (Bug#35381)
* lisp/textmodes/sgml-mode.el (sgml-specials): Add single quote.
(sgml-syntax-propertize-rules): Handle single quote.
* test/lisp/nxml/nxml-mode-tests.el (nxml-mode-font-lock-quotes): New
test.
* test/lisp/textmodes/sgml-mode-tests.el
(sgml-delete-tag-bug-8203-should-not-delete-apostrophe): Now passes.
The change from 2016-01-16 "lisp/nxml: Use syntax-tables for comments"
made nxml-get-inside return non-nil for any string or comment,
including attribute strings. This caused incorrect and therefore
indentation.
* lisp/nxml/nxml-rap.el: Update commentary to reflect changes to
nxml-mode parsing.
(nxml-get-inside): Only return non-nil when inside comments and
generic strings, not normal quote-delimited strings.
* test/lisp/nxml/nxml-mode-tests.el: New tests.
Eli Zaretskii [Wed, 8 May 2019 17:34:09 +0000 (20:34 +0300)]
Fix positioning client buffer as instructed by emacsclient
* lisp/server.el (server-switch-buffer): Let-bind
switch-to-buffer-preserve-window-point to nil when switching
to the client buffer, when the client requested a specific
position. (Bug#35602)
Vitalie Spinu [Wed, 8 May 2019 09:12:29 +0000 (11:12 +0200)]
Fix incorrect cloning of eieio-instance-inheritor objects (Bug#34840)
* lisp/emacs-lisp/eieio-base.el (clone): Unbound slots of
eieio-instance-inheritor objects as documented in the docs string
and implemented in the original eieio implementation.
Eli Zaretskii [Sat, 4 May 2019 09:22:49 +0000 (12:22 +0300)]
Improve documentation of the daemon and emacsclient
* doc/emacs/misc.texi (emacsclient Options):
* doc/emacs/cmdargs.texi (Initial Options): Document that
using --daemon=NAME will need to specify the same NAME when
invoking 'emacscilent'. (Bug#35547)
* doc/lispref/processes.texi (Filter Functions): Use
insert-before-markers in the "ordinary" filter example, like
internal-default-process-filter does.
Be more careful about indent-sexp going over eol (Bug#35286)
* lisp/emacs-lisp/lisp-mode.el (indent-sexp): Only go over multiple
sexps if the end of line is within a sexp.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(indent-sexp-stop-before-eol-comment)
(indent-sexp-stop-before-eol-non-lisp): New tests.
For discussion, see thread starting at:
https://lists.gnu.org/archive/html/emacs-devel/2019-04/msg00316.html
* doc/lispref/customize.texi (Composite Types): Do not overspecify
:match-alternatives predicates.
* doc/lispref/eval.texi (Intro Eval): Anchor definition of "side
effect" for cross-referencing...
* doc/lispref/functions.texi (What Is a Function): ...from here.
Define what a pure function is.
* doc/lispref/internals.texi (Writing Emacs Primitives): Describe
currently preferred approach to marking primitives as pure and
side-effect-free.
* doc/lispref/symbols.texi (Standard Properties): Expand description
of pure and side-effect-free properties.
Backport: Avoid using obsolete indent-relative-maybe
* lisp/electric.el (electric-indent-functions-without-reindent):
* lisp/indent.el (indent-according-to-mode): Check for
indent-relative-first-indent-point in addition to its obsolete alias
indent-relative-maybe.
* lisp/obsolete/vi.el (vi-com-map): Use
indent-relative-first-indent-point in place of its obsolete alias
indent-relative-maybe.
Avoid false positives and false negatives of Info-quoted face
* lisp/info.el (Info-mode-font-lock-keywords): Modify the regexp, for
matching single quotes of opening single quote and closing single
quote, and avoid matching text followed by a curly quote when it is
not quoting. (Bug#35202)
Noam Postavsky [Mon, 5 Feb 2018 01:43:26 +0000 (20:43 -0500)]
Use pkg-config to find lcms2 CFLAGS and LIBS (Bug#30346)
* configure.ac: Use EMACS_CHECK_MODULES fors LCMS2 rather than
AC_SEARCH_LIBS.
* src/Makefile.in: Get LCMS2_LIBS and LCMS2_CFLAGS from configure,
instead of just LIBLCMS2.
Eli Zaretskii [Sat, 20 Apr 2019 07:21:02 +0000 (10:21 +0300)]
Backport doc improvement in ELisp manual
* doc/lispref/processes.texi (Accepting Output): Backport:
document how do avoid race conditions while waiting for all of
the process's output to arrive.
Braun Gábor [Fri, 22 Mar 2019 15:11:44 +0000 (16:11 +0100)]
Autoload cua-toggle-rectangle-mark (Bug#34947)
* lisp/emulation/cua-base.el (cua-toggle-rectangle-mark): Autoload it.
Library cua-base.el binds cua-toggle-rectangle-mark to a key in the
:set function in (defcustom cua-rectangle-mark-key ...), so it should
ensure that the command is defined.
Tell xclip not to expect job-control under eshell (Bug#35257)
* lisp/eshell/esh-proc.el (eshell-needs-pipe): Add "xclip" and other
programs that xclip.el (in GNU ELPA) calls with
`process-connection-type' bound to nil.
* lisp/image.el (image--set-property): Ensure new value is set even
in the unlikely case that the plist is empty. Fix off-by-one-link
error when deleting a property. (bug#35285)
* test/lisp/image-tests.el: New file.
(image--set-property): New test.
Eli Zaretskii [Tue, 16 Apr 2019 15:32:18 +0000 (18:32 +0300)]
Mention the assignment form in "Copyright Assignment"
* doc/emacs/trouble.texi (Copyright Assignment): Mention the
copyright assignment form explicitly. Suggested by Konstantin
Kharlamov <hi-angel@yandex.ru>.
Eli Zaretskii [Mon, 15 Apr 2019 15:05:52 +0000 (18:05 +0300)]
Fix the MSDOS build when running under CWSDPMI
* src/msdos.c (the_only_tty_output): Define.
* src/msdos.h (the_only_tty_output): Declare.
* src/frame.c (make_terminal_frame) [MSDOS]:
* src/dispnew.c (init_display) [MSDOS]: Set up
f->output_data.tty pointer using the_only_tty_output, before
dereferencing the pointer. This prevents crashes with DPMI
servers that provide NULL pointer protection.
Eli Zaretskii [Thu, 11 Apr 2019 14:00:44 +0000 (17:00 +0300)]
Improve documentation of 'read-command'
* src/minibuf.c (Fread_command): Document the return value
when DEFAULT-VALUE is nil and the user enters nothing.
* doc/lispref/minibuf.texi (High-Level Completion): Document
the printed representation of a symbol whose name is empty.
(Bug#3522)
Alex Branham [Tue, 26 Mar 2019 01:49:01 +0000 (20:49 -0500)]
Backport: Update documentation for indent-relative functions
* lisp/indent.el (indent-relative): Document what happens when there
is no previous nonblank line.
* doc/lispref/text.texi (Relative Indent): Document
indent-relative-first-indent-point instead of obsolete
indent-relative-maybe. Fix documentation of which argument from
'indent-relative' is used.
Update nxml-mode.texi: completion now gives xmlns="-!-"
* doc/misc/nxml-mode.texi (Completion): As of 2016-01-16 "* lisp/nxml:
Use standard completion; it also works for company-mode", completing
an attribute when there is only one candidate inserts both quotes.
Update the example accordingly.
Eric Abrahamsen [Wed, 10 Apr 2019 03:13:47 +0000 (20:13 -0700)]
Note that choose-completion-string-functions funcs take four args
* lisp/simple.el (choose-completion-string-functions): Functions in
this list actually need to accept four arguments, though the fourth
should be ignored.
Gemini Lasswell [Thu, 22 Nov 2018 21:00:03 +0000 (13:00 -0800)]
Address name conflicts in EIEIO documentation (bug#31660)
* doc/misc/eieio.texi (Quick Start): Rename the class used in the
example from 'record' to 'person'.
(Building Classes): Advise user to check for name conflicts before
naming a class. Add a missing apostrophe.
(Making New Objects): Correct grammar. Rename the class used in the
example from 'record' to 'my-class'.
* lisp/subr.el (alist-get):
Rephrase the initial text to clarify the meaning of the TESTFN argument.
It's an equality predicate, not a look-up function (Bug#35206).
Eli Zaretskii [Sat, 6 Apr 2019 08:22:13 +0000 (11:22 +0300)]
Improve documentation of set-window-start
* doc/lispref/windows.texi (Window Start and End):
* src/window.c (Fset_window_start): Document that reliable
setting of a window start position requires to adjust point to
be visible. (Bug#34038)
Eli Zaretskii [Sat, 6 Apr 2019 08:04:37 +0000 (11:04 +0300)]
Improve documentation of window parameters
* doc/lispref/windows.texi (Cyclic Window Ordering): Describe
the effect of the 'other-window' window parameter.
(Window Parameters): Improve the descriptions of window
parameters. Move the detailed description of the
'quit-restore' window parameter from here...
(Quitting Windows): ...to here. (Bug#35063)
Paul Eggert [Wed, 20 Mar 2019 21:43:30 +0000 (14:43 -0700)]
Say which regexp ranges should be avoided
* doc/lispref/searching.texi (Regexp Special): Say that
regular expressions like "[a-m-z]" and "[[:alpha:]-~]" should
be avoided, for the same reason that regular expressions like
"+" and "*" should be avoided: POSIX says their behavior is
undefined, and they are confusing anyway. Also, explain
better what happens when the bound of a range is a raw 8-bit
byte; the old explanation appears to have been obsolete
anyway. Finally, say that ranges like "[\u00FF-\xFF]" that
mix non-ASCII characters and raw 8-bit bytes should be
avoided, since it’s not clear what they should mean.
* lisp/url/url-handlers.el: Silence byte-compiler.
(url-copy-file): Add 6th argument following change to copy-file in
2012-12-16T19:22:27+01:00!romain@orebokech.com. (bug#4410)
Eli Zaretskii [Tue, 19 Mar 2019 11:16:50 +0000 (13:16 +0200)]
Fix downloading updates for packages with non-ASCII descriptions
* lisp/emacs-lisp/package.el (package--download-one-archive):
Make sure archive contents are written using UTF-8 encoding.
(Bug#34909)
(list-packages): Set buffer's encoding to UTF-8.
Martin Rudalics [Wed, 13 Mar 2019 09:45:28 +0000 (10:45 +0100)]
Document restrictions when setting window margins, fringes or scroll bars
* src/window.c (Fset_window_margins, Fset_window_fringes)
(Fset_window_scroll_bars): In doc-strings tell that a window
must be large enough to accommodate fringes, sroll bars and
margins of the desired size.
* doc/lispref/display.texi (Fringe Size/Pos, Scroll Bars)
(Display Margins): Tell that windows must be large enough to
accommodate fringes, sroll bars and margins of the desired
size.