Glenn Morris [Fri, 16 Nov 2018 16:30:20 +0000 (08:30 -0800)]
Merge from origin/emacs-26
936a8f3 (origin/emacs-26) Document Emacs 26 behavior of Dired's 'Z' o... 99f99a1 ; Minor editing change in windows.texi 13bb665 Fix a typo in the Emacs manual
Juri Linkov [Thu, 15 Nov 2018 23:09:54 +0000 (01:09 +0200)]
* lisp/windmove.el: Support more prefix args (bug#32790)
* lisp/windmove.el (windmove-left, windmove-up, windmove-right)
(windmove-down): Use prefix-numeric-value to support more prefix args
like 'C-u' and 'M--'. Doc fix.
Paul Eggert [Sun, 21 Jan 2018 03:12:05 +0000 (19:12 -0800)]
Fix tempfile creation when byte compiling
This improves on the recent fix for master failing to build
on FreeBSD. Suggested by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2018-01/msg00600.html
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Put tempfile next to the target file, as was the original intent.
Juri Linkov [Wed, 14 Nov 2018 22:23:47 +0000 (00:23 +0200)]
Isearch hit count. (Bug#29321)
* lisp/isearch.el (isearch-lazy-count): New defcustom.
(lazy-count): New defgroup.
(lazy-count-prefix-format, lazy-count-suffix-format): New defcustom.
(isearch-lazy-count-format): New function.
(isearch-message-prefix, isearch-message-suffix): Use it.
(isearch-lazy-highlight-window-start-changed)
(isearch-lazy-highlight-window-end-changed)
(isearch-lazy-count-current, isearch-lazy-count-total)
(isearch-lazy-count-hash): New variables.
(isearch-lazy-highlight-new-loop): Reset isearch-lazy-count-total
and update isearch-lazy-count-current for isearch-message.
(isearch-lazy-highlight-update): Run full-buffer loop for
isearch-lazy-count.
(isearch-lazy-highlight-buffer-update): Count isearch-lazy-count-total.
Set isearch-lazy-count-current at the end.
Paul Eggert [Wed, 14 Nov 2018 19:42:59 +0000 (11:42 -0800)]
Fix probing for pre-1970 DST
* lisp/calendar/cal-dst.el (calendar-next-time-zone-transition):
Fix recently-introduced rounding bug when probing for DST
transitions before 1970 (Bug#33380).
Paul Eggert [Wed, 14 Nov 2018 17:31:28 +0000 (09:31 -0800)]
Document recent change to HOME handling
* doc/emacs/cmdargs.texi (General Variables):
* doc/emacs/custom.texi (Find Init):
* doc/lispref/files.texi (File Name Expansion):
* etc/NEWS: Document behavior when HOME is a relative file name.
Markus Triska [Tue, 13 Nov 2018 21:42:01 +0000 (22:42 +0100)]
Small documentation correction.
* doc/lispref/windows.texi (Textual Scrolling): In the description of
scroll-up-aggressively, refer to scroll-down-aggressively instead of
a recursive reference to scroll-up-aggressively. (Bug#33369)
Juri Linkov [Wed, 14 Nov 2018 00:23:04 +0000 (02:23 +0200)]
New option vc-find-revision-no-save to not write revision to file
* lisp/vc/vc.el (vc-find-revision-no-save): New defcustom (bug#33319).
(vc-find-revision): Depending on vc-find-revision-no-save,
call either vc-find-revision-no-save or vc-find-revision-save.
(vc-find-revision-save): Rename from vc-find-revision.
(vc-find-revision-no-save): New function.
* lisp/vc/diff-mode.el (diff-find-source-location):
Let-bind vc-find-revision-no-save to t.
Juri Linkov [Wed, 14 Nov 2018 00:14:52 +0000 (02:14 +0200)]
Support VC revisions in diff-goto-source (bug#33319)
* lisp/vc/diff-mode.el (diff-vc-revisions): New defvar.
(diff-find-source-location): Call vc-find-revision for
non-nil values of 'other', diff-vc-backend, diff-vc-revisions.
* lisp/vc/vc.el (vc-diff-internal): Set buffer-local
diff-vc-revisions to the list of used revisions.
* doc/emacs/files.texi (Diff Mode): Update diff-goto-source
for VC-related prefix argument.
Paul Eggert [Tue, 13 Nov 2018 18:56:26 +0000 (10:56 -0800)]
Update from Gnulib
This incorporates:
2018-11-03 nstrftime: simplify test for mktime failure
2018-11-02 gnulib-common.m4: port _Noreturn to C++
2018-10-22 std-gnu11: Support Autoconf versions < 2.64
2018-10-22 Assume Autoconf >= 2.63
2018-10-16 Remove support for Ultrix
2018-10-16 getloadavg: Remove support for ConvexOS
2018-10-16 getloadavg: Remove support for Sony NEWS
2018-10-16 Remove support for Dynix/ptx
2018-10-16 fsusage: Remove support for AIX 3
2018-10-16 fsusage, stat-size, getloadavg: Remove support for AIX PS/2
2018-10-16 getloadavg: Remove support for HP-UX on m68k
2018-10-16 fsusage, mountlist: Remove support for DolphinOS
2018-10-16 getloadavg: Remove support for Alliant FX/2800
2018-10-16 getloadavg: Remove support for tek4300
2018-10-16 getloadavg: Remove support for Ardent
* build-aux/config.guess, build-aux/config.sub, lib/_Noreturn.h:
* lib/fsusage.c, lib/getgroups.c, lib/getloadavg.c:
* lib/nstrftime.c, lib/time.in.h, m4/errno_h.m4:
* m4/fsusage.m4, m4/getgroups.m4, m4/gnulib-common.m4, m4/longlong.m4:
* m4/std-gnu11.m4, m4/stdint.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate:
Glenn Morris [Tue, 13 Nov 2018 18:15:39 +0000 (13:15 -0500)]
Root emacsclient no longer connects to non-root sockets
* lib-src/emacsclient.c (set_local_socket): Don't ignore socket
ownership when run by root.
Ref: http://lists.gnu.org/r/emacs-devel/2018-11/msg00019.html
Paul Eggert [Tue, 13 Nov 2018 17:29:14 +0000 (09:29 -0800)]
Act like POSIX sh if $HOME is relative
POSIX says sh ~/foo should act like $HOME/foo even if $HOME is
relative, so be consistent with that (Bug#33255).
* admin/merge-gnulib (GNULIB_MODULES): Add dosname.
* src/buffer.c (init_buffer): Use emacs_wd to get
initial working directory with slash appended if needed.
(default-directory): Say it must be absolute.
* src/emacs.c (emacs_wd): New global variable.
(init_cmdargs): Dir arg is now char const *.
(main): Set emacs_wd.
* src/emacs.c (main) [NS_IMPL_COCOA]:
* src/fileio.c (Fexpand_file_name):
Use get_homedir instead of egetenv ("HOME").
* src/fileio.c: Include dosname.h, for IS_ABSOLUTE_FILE_NAME.
(splice_dir_file, get_homedir): New functions.
* src/xrdb.c (gethomedir): Remove. All callers changed
to use get_homedir and splice_dir_file.
* test/src/fileio-tests.el (fileio-tests--relative-HOME): New test.
Noam Postavsky [Tue, 13 Nov 2018 13:25:35 +0000 (08:25 -0500)]
Fix build fail on files.el change (Bug#32352)
* lisp/files.el (dir-locals-read-from-dir): Reduce scope of
`read-circle' let-binding to go around the `read' call only.
Otherwise it can interfere with loading of files which use the
circular read syntax (e.g., executing the setf expression in
`dir-locals-set-class-variables' may require loading gv.elc).
Paul Eggert [Mon, 12 Nov 2018 06:34:46 +0000 (22:34 -0800)]
Work around dumping bug on GNU/Linux ppc64le
Problem reported by Thomas Fitzsimmons (Bug#33174).
Do not merge to master, as we have a better fix there.
* src/Makefile.in (emacs$(EXEEXT)):
(bootstrap-emacs$(EXEEXT)):
Unset EMACS_HEAP_EXEC before invoking temacs.
Paul Eggert [Mon, 12 Nov 2018 06:18:47 +0000 (22:18 -0800)]
Fix dumping on GNU/Linux ppc64le
Problem reported by Thomas Fitzsimmons (Bug#33174).
* src/emacs.c (main): Adjust to sysdep.c changes.
* src/sysdep.c (exec_personality): New static var.
(disable_address_randomization): Remove, replacing with ...
(maybe_disable_address_randomization): ... this new function.
Do not set or use an environment variable; use a command-line
argument instead, and set the new static var. Migrate the emacs.c
personality-change code to here, where it belongs.
(emacs_exec_file): Simplify by using new static var.
Paul Eggert [Sun, 11 Nov 2018 17:58:29 +0000 (09:58 -0800)]
Pacify gcc -Wunused-macros in older GnuTLS
I ran into this problem on Ubuntu 18.04.1 LTS.
* src/gnutls.c (HAVE_GNUTLS_CIPHER_GET_IV_SIZE)
(HAVE_GNUTLS_CIPHER_GET_TAG_SIZE, HAVE_GNUTLS_DIGEST_LIST):
New macros. This uses the same style as the other
macros that depend on GnuTLS version, as opposed to trying
to do things a bit more cleverly.
(gnutls_cipher_get_iv_size, gnutls_cipher_get_tag_size)
(gnutls_digest_list, gnutls_digest_get_name):
Define these macros only if they will be used.
Eli Zaretskii [Sat, 10 Nov 2018 20:14:42 +0000 (22:14 +0200)]
Make 'move-file-to-trash' behave according to the documentation
* lisp/files.el (move-file-to-trash): Behave like the doc
string says: check whether 'system-move-file-to-trash' is
defined before testing that 'trash-directory' is non-nil.
(Bug#33335)
Paul Eggert [Sat, 10 Nov 2018 17:00:43 +0000 (09:00 -0800)]
Dissociate controlling tty better on Darwin
* src/process.c (dissociate_controlling_tty): New function.
(create_process): Use it to dissociate controlling tty if setsid
fails, which happens on Darwin after a vfork (Bug#33154).
Do this on all platforms, not just on Darwin, as a similar
problem is plausible elsewhere.
* src/callproc.c (call_process): Use the new function here, too,
for consistency and to avoid duplicate code.
* lisp/net/tramp.el (tramp-get-local-gid):
Use `group-name' if available.
(tramp-debug-message):
* lisp/net/tramp-cmds.el (tramp-bug): Report also
`tramp-repository-branch' and `tramp-repository-version'.
* lisp/net/trampver.el (tramp-repository-branch)
(tramp-repository-version): New defconst.
(tramp-repository-get-version): Remove.
Allen Li [Thu, 25 Oct 2018 02:44:01 +0000 (20:44 -0600)]
Add 'ring-resize' function
* lisp/emacs-lisp/ring.el (ring-resize): New function. (Bug#32849)
* doc/lispref/sequences.texi (Rings): Document new function 'ring-resize'.
* etc/NEWS: Document new function 'ring-resize'.
* test/lisp/emacs-lisp/ring-tests.el (ring-test-ring-resize): New tests.
Eli Zaretskii [Sat, 10 Nov 2018 09:16:17 +0000 (11:16 +0200)]
Fix last change
* src/editfns.c (Fgroup_name): Fix the doc string. Move
closer to the "group" functions.
* src/w32.c (getgrgid): Return NULL if GID is not the group ID
of the user of this Emacs session
* test/src/editfns-tests.el (test-group-name): Rename from
'group-name'. Add tests for non-Posix hosts. Test error when
the argument to group-name is invalid.
Noam Postavsky [Mon, 29 Oct 2018 23:01:07 +0000 (19:01 -0400)]
Note that lex bound lambda forms are not self-quoting (Bug#33199)
* doc/lispref/functions.texi (Anonymous Functions):
* lisp/subr.el (lambda): Note that under lexical binding a lambda form
yields a closure object (Bug#33199).
* lisp/bookmark.el (bookmark-jump-other-frame): New function.
Bind in bookmark-map.
(bookmark-bmenu-other-frame): New function.
Bind in bookmark-bmenu-mode-map.
Martin Rudalics [Thu, 8 Nov 2018 19:20:13 +0000 (20:20 +0100)]
Rewrite buffer display related doc-strings and doc
* lisp/window.el (display-buffer-overriding-action)
(display-buffer-alist, display-buffer-base-action)
(display-buffer-fallback-action, display-buffer-assq-regexp)
(display-buffer): Rewrite doc-strings using suggestions by
Alan Mackenzie <acm@muc.de>.
(display-buffer-use-some-frame): Adjust doc-string and
reformat code.
* doc/lispref/windows.texi (Buffer Display Action Alists):
Make docs on 'window-height', 'window-width' and
'preserve-size' entries more accurate.
Juri Linkov [Wed, 7 Nov 2018 22:52:50 +0000 (00:52 +0200)]
Support VC single file operations from Dired (bug#32596).
* lisp/vc/vc.el (vc-ensure-vc-buffer): Use dired-get-filename for dired-mode.
Move error-checking outside of the last branch of cond.
(vc-dired-deduce-fileset): Remove unused error signaling.
* lisp/vc/log-view.el (log-view-find-revision)
(log-view-annotate-version): Add condition to signal an error
when log-view-vc-fileset contains a directory.
Use user-error instead of error.
* lisp/dired.el (dired-get-file-for-visit):
* lisp/locate.el (locate-do-setup):
Use user-error instead of error.
Juri Linkov [Wed, 7 Nov 2018 22:27:58 +0000 (00:27 +0200)]
* lisp/files-x.el (modify-dir-local-variable): Use assoc-delete-all
instead of assq-delete-all for cases when mode is a subdirectory name.
(dir-locals-to-string): Call pp-to-string and string-trim-right
on values. (Bug#32817)
Juri Linkov [Mon, 5 Nov 2018 21:11:30 +0000 (23:11 +0200)]
Support lazy-highlight-buffer in Info (bug#29321, bug#29360).
* lisp/isearch.el (isearch-lazy-highlight-point-min)
(isearch-lazy-highlight-point-max): New variables.
(isearch-lazy-highlight-new-loop): When lazy-highlight-buffer is
non-nil, compare (point-min) with isearch-lazy-highlight-point-min,
and (point-max) with isearch-lazy-highlight-point-max, for buffers
like Info where narrowing changes the values point-min and point-max.
Glenn Morris [Sun, 4 Nov 2018 17:37:03 +0000 (09:37 -0800)]
Merge from origin/emacs-26
bd1d617 Avoid race in rcirc process filter (bug#33145) 88ef31a Avoid file-name errors when viewing PDF from Gnus c939042 Avoid crashes with remapped default face in Org mode 97660fa Doc fix for checkdoc-continue 96f055b Fix a typo in autoload.el
Michael Albinus [Sun, 4 Nov 2018 11:51:39 +0000 (12:51 +0100)]
Fix Bug#33194
* lisp/autorevert.el (auto-revert-notify-add-watch):
Handle buffers with same descriptor properly.
(auto-revert-notify-handler): Handle all buffers with same
descriptor. (Bug#33194)
Martin Rudalics [Sun, 4 Nov 2018 08:15:13 +0000 (09:15 +0100)]
Rewrite documentation of buffer display
* doc/emacs/windows.texi (Window Choice): Rewrite, replacing
references to older buffer display options with references to
and examples of buffer display actions.
(Temporary Displays): Rewrite display of *Completions*
example.
* doc/lispref/elisp.texi (Top): New Windows section
'Displaying Buffers'.
* doc/lispref/frames.texi (Child Frames): Adjust cross
reference.
* doc/lispref/windows.texi (Windows): New section 'Displaying
Buffers'. Move sections 'Choosing Window', 'Display Action
Functions' and 'Choosing Window Options' there and adjust
namings. Preferably write 'Buffer Display Action' instead of
'Display Action'. More consistently use @w{} to make key
binding specifications unsplittable.
(Displaying Buffers): New section.
(Choosing Window): Make it a subsection of 'Displaying
Buffers'. More explicitly describe how 'display-buffer'
compiles its list of action functions and the action alist.
(Buffer Display Action Functions): Rename from 'Display Action
Functions', make it a subsection of 'Displaying Buffers' and
rewrite it. Elide more detailed descriptions of action alist
entries; these are now in the new section 'Buffer Display
Action Functions'. Remove example.
(Buffer Display Action Alists): New subsection of 'Displaying
Buffers' giving a comprehensive description of recognized
action alist entries with appropriate indexing. Contents were
partially moved here from the old 'Display Action Functions'
section.
(Choosing Window Options): Make it a subsection of 'Displaying
Buffers'. Add examples of how to rewrite old buffer display
options with the help of buffer display actions.
(Precedence of Action Functions): New subsection of
'Displaying Buffers' explaining the execution order of action
functions with the help of a detailed example.
(The Zen of Buffer Display): New subsection of 'Displaying
Buffers' supplying guidelines on how to write and use buffer
display actions with examples.
(Side Windows, Displaying Buffers in Side Windows)
(Frame Layouts with Side Windows, Atomic Windows): Update
references to the 'Displaying Buffers' subsections.
Paul Eggert [Sat, 3 Nov 2018 20:11:26 +0000 (13:11 -0700)]
Improve time error reporting
* src/timefns.c (emacs_mktime_z): Remove; no longer needed.
(time_error): New function, replacing invalid_time.
All callers changed.
(decode_float_time, decode_ticks_hz, decode_time_components):
Return an error number instead of merely a boolean.
All callers changed.
(decode_lisp_time): Signal an error based on the error number,
instead of merely returning a boolean to the caller.
All callers changed.
(format_time_string, Fdecode_time, Fencode_time)
(Fcurrent_time_string):
Do not assume that a failure of a system time function
must be due to time overflow.
(Fencode_time): Don't report an error merely because mktime
returned ((time_t) -1), as that may be a valid time_t value.
Use a simpler error check. See:
https://www.sourceware.org/ml/libc-alpha/2018-11/msg00062.html
Eli Zaretskii [Sat, 3 Nov 2018 13:11:33 +0000 (15:11 +0200)]
Improve documentation of destructuring-binding macros
* lisp/emacs-lisp/pcase.el (pcase-dolist, pcase-let)
(pcase-let*): Improve the doc strings.
* doc/lispref/sequences.texi (Sequence Functions): Improve
wording and rename arguments of seq-let to be more
descriptive. Add a cross-reference to "Destructuring with
pcase Patterns".
* doc/lispref/control.texi (Pattern-Matching Conditional):
Improve wording and the menu.
(pcase Macro): Incorporate patch suggested by Paul Eggert
<eggert@cs.ucla.edu>. Reformat text.
(Destructuring with pcase Patterns): Rename from
"Destructuring patterns", and improve wording and indexing.
Eli Zaretskii [Sat, 3 Nov 2018 10:39:59 +0000 (12:39 +0200)]
Allow the fringe face to be remapped locally in a buffer
* src/fringe.c (draw_window_fringes): Switch to window's
buffer to get the local value of face-remapping-alist, if
necessary. (Bug#33244)
* src/xfaces.c (syms_of_xfaces) <Qface_remapping_alist>: New
DEFSYM.