Paul Eggert [Mon, 19 Nov 2018 19:36:50 +0000 (11:36 -0800)]
emacsclient.c: file name component fixes
* lib-src/emacsclient.c: Include <dosname.h>.
(file_name_absolute_p): Remove, as a code duplicate.
All uses replaced by IS_ABSOLUTE_FILE_NAME.
(set_local_socket): Don’t treat \ as a file name separator
on GNU and POSIX hosts.
Paul Eggert [Mon, 19 Nov 2018 17:51:57 +0000 (09:51 -0800)]
emacsclient.c: use bool for boolean
* lib-src/emacsclient.c (nowait, quiet, suppress_output, eval, tty)
(decode_options, file_name_absolute_p, get_server_config)
(strprefix, find_tty, set_socket, main):
Use bool for boolean.
(create_frame): New static var, replacing the old current_frame
and with inverted sense, as this is clearer.
Ulrich Müller [Mon, 19 Nov 2018 15:29:56 +0000 (07:29 -0800)]
Update the calc units table
On 2018-11-16, the 26th meeting of the General Conference on Weights
and Measures (CGPM) has redefined the International System of Units by
adopting fixed values for the Planck constant, the elementary charge,
the Boltzmann constant, and the Avogadro constant:
https://www.bipm.org/utils/en/pdf/CGPM/Draft-Resolution-A-EN.pdf
* lisp/calc/calc-units.el (math-standard-units): Update according
to redefinition of the SI in 2018.
Stefan Monnier [Mon, 19 Nov 2018 02:15:06 +0000 (21:15 -0500)]
Remove uses of obsolete 'CUA' symbol property
* lisp/emulation/cua-base.el (cua-scroll-up, cua-scroll-down):
* lisp/progmodes/subword.el (subword-forward, subword-backward):
* lisp/obsolete/crisp.el (crisp-home, crisp-end):
Remove 'CUA' prop; not used any more.
Juri Linkov [Sat, 17 Nov 2018 21:31:52 +0000 (23:31 +0200)]
Don't exit Isearch while resizing windows with mouse (bug#32990)
* lisp/isearch.el (isearch-mouse-leave-buffer): New function.
(isearch-mode): Use isearch-mouse-leave-buffer instead of
isearch-done for mouse-leave-buffer-hook.
(isearch-done): Remove isearch-mouse-leave-buffer from
mouse-leave-buffer-hook.
(enlarge-window-horizontally, shrink-window-horizontally)
(shrink-window, mouse-drag-mode-line, mouse-drag-vertical-line):
Put property isearch-scroll with t.
(isearch-mode): Reset isearch-pre-scroll-point and
isearch-pre-move-point to nil for the case when Isearch exits
between isearch-pre-command-hook (that sets these values) and
isearch-post-command-hook (that used to reset them).
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.