Juri Linkov [Thu, 22 Nov 2018 22:02:56 +0000 (00:02 +0200)]
Add Isearch commands for going to absolute occurrence of matches (bug#29321)
* lisp/isearch.el (isearch-mode-map): Bind 'M-s M-<' to
'isearch-beginning-of-buffer' and 'isearch-end-of-buffer' to 'M-s M->'.
(isearch-beginning-of-buffer, isearch-end-of-buffer): New commands.
Paul Eggert [Thu, 22 Nov 2018 17:21:22 +0000 (09:21 -0800)]
emacsclient: sockaddr portability fixes
* lib-src/emacsclient.c (get_server_config, set_tcp_socket)
(set_local_socket): Initialize any platform-specific extensions
of struct to zero, just in case.
(set_tcp_socket, set_local_socket): Don’t assume struct
layout details that POSIX does not specify.
Use union to sidestep some problems with strict aliasing.
Remove unnecessary casts.
Michael Albinus [Thu, 22 Nov 2018 15:29:25 +0000 (16:29 +0100)]
Some minor Tramp cleanups
* lisp/net/tramp-adb.el (tramp-adb-file-name-p):
* lisp/net/tramp-ftp.el (tramp-ftp-file-name-p):
* lisp/net/tramp-smb.el (tramp-smb-file-name-p): Make it more robust.
* lisp/net/tramp.el (tramp-handle-file-truename): Cache only the
localname.
Paul Eggert [Wed, 21 Nov 2018 22:47:53 +0000 (14:47 -0800)]
emacsclient: omit EXTRA_SPACE guesswork
* lib-src/emacsclient.c: Include <intprops.h>.
(EXTRA_SPACE): Remove; code no longer guesses this is enough.
(open_config): New function.
(get_server_config): Use it.
(set_local_socket): Compute upper bound of buffer size
instead of guessing via EXTRA_SPACE.
Paul Eggert [Wed, 21 Nov 2018 18:50:38 +0000 (10:50 -0800)]
emacsclient: fix unlikely crash with "&"
* lib-src/emacsclient.c (quote_argument):
Mention *DATA in comment so it’s clear DATA must be non-null.
(quote_argument, unquote_argument): Simplify.
(unquote_argument): Don’t crash if the string ends in "&".
Eric Abrahamsen [Mon, 19 Nov 2018 18:03:16 +0000 (10:03 -0800)]
Fix "Allow use of Gnus search groups as notmuch path: search term"
* lisp/gnus/nnir.el (nnir-notmuch-filter-group-names-function):
Default to nil -- getting correct behavior requires user
intervention too often to have this enabled by default.
* lisp/gnus/nnir.el (nnir-run-notmuch): If the user has turned this
on, then also hardcode `gnus-group-short-name' as a filter -- things
will never work without it. Also move leading space to before the
opening parenthesis.
* doc/misc/gnus.texi: Document option.
Eric Abrahamsen [Tue, 20 Nov 2018 18:28:10 +0000 (10:28 -0800)]
Check Gnus group names when reading from browse server
* lisp/gnus/gnus-srvr.el (gnus-browse-read-group): If the group in
question belongs to the native server, the name has to be shortened
before we check it with `gnus-get-info'. It might work otherwise
with nntp, but for backends like nnmaildir that have their own
accounting system, creating an ephemeral group won't work.
Stefan Monnier [Tue, 20 Nov 2018 21:09:35 +0000 (16:09 -0500)]
calc.el, calc-(ext|poly), calccomp: Use lexical-binding
* lisp/calc/calc-ext.el: Use lexical-binding, silence warnings.
(calc-init-extensions): Remove a few functions which can't be called
directly since they depend on dynamically scoped vars.
(calc-embedded-quiet): Declare.
(math-defcache): Use 'declare'.
(math-normalize-a): Remove declaration.
(math-normalize-nonstandard): Receive 'a' as arg instead.
(math-defintegral): Use 'declare'.
(math-exp-pos, math-exp-old-pos, math-exp-keep-spaces, math-rb-h2)
(math-read-big-baseline, math-read-big-h2, math-read-big-err-msg)
(math-exp-token, math-expr-data, math-exp-str): Declare.
(math-map-tree, math-read-expr): Avoid dynvars as formal arguments.
* lisp/calc/calc-poly.el: Use lexical-binding, silence warnings.
Turn some comments into docstrings.
(math-poly-div): Avoid dynvars as formal arguments.
(math-poly-base-top-expr): Move declaration before first use.
(calcFunc-factors, math-factor-expr, math-factor-expr-try)
(calcFunc-factor): Avoid dynvars as formal arguments.
* lisp/calc/calc.el: Use lexical-binding, silence warnings.
(math-normalize-a): Remove.
(math-normalize): Use lexical var 'a' instead.
(math-svo-c): Remove.
(math-stack-value-offset): Pass 'c' explicitly as arg to
math-stack-value-offset-fancy instead.
* lisp/calc/calccomp.el: Use lexical-binding, silence warnings.
(math-svo-c): Remove.
(math-stack-value-offset-fancy): Use new arg 'c' instead.
(math-comp-to-string-flat): Avoid dynvars as formal arguments.
Glenn Morris [Tue, 20 Nov 2018 17:38:42 +0000 (09:38 -0800)]
Merge from origin/emacs-26
070e82b ; * src/window.c (window_scroll): Improve commentary. 60457d7 Improve documentation of the window tree ea1a014 Fix window scrolling on TTY frames when there's no mode line df7ed10 Fix decoding XML files encoded in ISO-8859 7851ae8 (tag: emacs-26.1.90) ; ChangeLog.3 update 1958808 * etc/AUTHORS: Update. 7252507 Fix description of some window hooks 88762b4 Run 'window--adjust-process-windows' when frame size changes ... d6542ea Avoid errors in zone.el when there's overlay at EOB
Stefan Monnier [Tue, 20 Nov 2018 15:37:46 +0000 (10:37 -0500)]
* lisp/calc/calc-alg.el: Use lexical-binding and silence warnings
* lisp/calc/calc-alg.el: Use lexical-binding and silence warnings.
(math-defsimplify): Let-bind 'expr' instead of math-simplify-expr.
Adjust all users.
(math-simplify-expr): Don't declare any more.
(math--simplify-divide-expr): New dynbound var.
(math-simplify-divide): Bind it when needed.
(math-simplify-divisor): Use it instead of math-simplify-expr.
(math-simplify-divisor): Only bind math-simplify-divisor-[nd]over
around the calls to math-simplify-one-divisor.
(math-expr-subst, math-is-polynomial): Don't use dynbound vars as
formal arguments.
(math-polynomial-base): Move binding of math-poly-base-pred.
Don't bind math-poly-base-top-expr any more...
* lisp/calc/calc-poly.el (math-total-polynomial-base): Bind it here instead!
* lisp/calc/calc-units.el: Use lexical-binding and silence warnings.
Adjust to the new 'expr' name in math-defsimplify.
(math-find-base-units, math-to-standard-units, math-convert-units):
Don't use dynbound vars as formal arguments.
(math-simplify-expr): Don't declare any more.
Stephen Berman [Mon, 19 Nov 2018 22:12:52 +0000 (23:12 +0100)]
Fix two Edebug defcustoms (bug#33428)
* lisp/emacs-lisp/edebug.el (edebug-print-length)
(edebug-print-level): Fix customization type to allow setting
the documented valid value nil via the Customize interface.
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.
Eli Zaretskii [Mon, 19 Nov 2018 18:12:04 +0000 (20:12 +0200)]
Fix window scrolling on TTY frames when there's no mode line
* src/window.c (window_internal_height): Remove tests for
next, prev, and parent pointers, as they are unrelated to
whether a window has a mode line. (Bug#33363)
Eli Zaretskii [Mon, 19 Nov 2018 16:36:42 +0000 (18:36 +0200)]
Fix decoding XML files encoded in ISO-8859
* lisp/international/mule.el (sgml-xml-auto-coding-function):
Avoid signaling an error from coding-system-equal when the XML
encoding tag specifies an encoding whose type is 'charset'.
(Bug#33429)
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.
Martin Rudalics [Sun, 18 Nov 2018 08:24:10 +0000 (09:24 +0100)]
Fix description of some window hooks
* doc/lispref/windows.texi (Window Hooks): Remove text that
warns against using 'save-window-excursion' while running
'window-size-change-functions', it's no more relevant.
Clarify description of 'window-configuration-change-hook'.
Gary Fredericks [Sun, 18 Nov 2018 08:15:00 +0000 (09:15 +0100)]
Run 'window--adjust-process-windows' when frame size changes (Bug#32720)
* lisp/window.el (window-size-change-functions): Run
'window--adjust-process-windows' from
'window-size-change-functions' too (Bug#32720, "another issue"
in Bug#33230).
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.