Stefan Monnier [Mon, 26 Mar 2018 13:01:30 +0000 (09:01 -0400)]
* src/marker.c: Try and speed up byte<->char conversion with many markers.
When considering markers (to find a starting point for the conversion),
typically one of the two bounds is nearby (coming from
cached_(byte|char)pos) but the other is far (point-min or point-max),
so change the exit condition so we stop as soon as *one* of the bounds
is near.
(BYTECHAR_DISTANCE_INITIAL, BYTECHAR_DISTANCE_INCREMENT): New constants.
(buf_charpos_to_bytepos, buf_bytepos_to_charpos): Use them to try and
reduce the number of markers we consider.
Eric Skoglund [Fri, 16 Mar 2018 13:49:56 +0000 (14:49 +0100)]
Make eshell/kill handle -<signal> and -<SIGNALNAME> (Bug#29156)
* lisp/eshell/esh-proc.el (eshell/kill): Handle the argument parsing
and numeric conversion in function in order to parse -signal and
-SIGNALNAME correctly.
* doc/misc/eshell.texi (kill): Update docs to reflect new function
behaviour.
* etc/NEWS: Mention new eshell/kill behaviour.
Noam Postavsky [Sat, 20 Jan 2018 16:27:23 +0000 (11:27 -0500)]
Allow `&rest' or `&optional' without following variable (Bug#29165)
This is sometimes convenient when writing macros, so that the empty
variable case doesn't need to be handled specially. Older versions of
Emacs accepted this in some cases (especially the interpreter in Emacs
25 and below was very accepting).
Vibhav Pant [Sun, 25 Mar 2018 05:52:50 +0000 (11:22 +0530)]
Fix byte-optimize-memq incorrectly optimizing some memq forms.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-memq): Call
byte-optimize-and only for memq forms that can be optimized, use
byte-optimize-predicate to optimize the final form.
Glenn Morris [Sat, 24 Mar 2018 00:01:26 +0000 (20:01 -0400)]
Remove some unused gnus-registry variables
* lisp/gnus/gnus-registry.el (gnus-registry-clean-empty)
(gnus-registry-use-long-group-names)
(gnus-registry-max-track-groups, gnus-registry-entry-caching)
(gnus-registry-trim-articles-without-groups):
Remove variables labeled as obsolete since 23.4 that do nothing.
Glenn Morris [Fri, 23 Mar 2018 23:52:09 +0000 (19:52 -0400)]
Remove variables labeled as obsolete that do nothing
* lisp/allout.el (allout-passphrase-verifier-string)
(allout-passphrase-hint-string):
* lisp/w32-vars.el (w32-list-proportional-fonts):
Remove variables that are unused since Emacs 23.x.
Glenn Morris [Fri, 23 Mar 2018 20:28:24 +0000 (16:28 -0400)]
Remove some declare-function stub definitions
* lisp/emulation/viper-cmd.el, lisp/emulation/viper-keym.el:
* lisp/emulation/viper-util.el, lisp/net/newst-plainview.el:
* lisp/net/newst-treeview.el, lisp/ps-def.el, lisp/vc/ediff.el:
* lisp/vc/ediff-util.el, lisp/vc/ediff-wind.el:
Remove stub declare-function definitions.
It exists since Emacs 22.2, released 10 years ago.
Most of these files are using even newer features, such as
lexical-binding and cl-lib anyway, making the stubs pointless.
Glenn Morris [Fri, 23 Mar 2018 20:14:26 +0000 (16:14 -0400)]
Replace some uses of cl with cl-lib
* lisp/progmodes/idlw-toolbar.el: No need for cl.
* lisp/progmodes/antlr-mode.el, lisp/progmodes/idlw-shell.el:
* lisp/progmodes/idlwave.el: Replace cl with cl-lib.
Paul Eggert [Fri, 23 Mar 2018 19:57:39 +0000 (12:57 -0700)]
Avoid Fortran-style floating-point optimization
When optimizing arithmetic operations, avoid optimizations that
are valid for mathematical numbers but invalid for floating-point.
For example, do not optimize (+ 1 v 0.5) to (+ v 1.5), as they may
not be the same due to rounding errors. In general,
floating-point numbers cannot be constant-folded, since that would
make .elc files platform-dependent.
* lisp/emacs-lisp/byte-opt.el (byte-optimize-associative-math):
Do not optimize floats.
(byte-optimize-nonassociative-math, byte-optimize-approx-equal)
(byte-optimize-delay-constants-math, byte-compile-butlast)
(byte-optimize-logmumble):
Remove; no longer used.
(byte-optimize-minus): Do not optimize (- 0 x) to (- x).
(byte-optimize-multiply): Do not optimize (* -1 x) to (- x).
(byte-optimize-divide): Do not optimize (/ x -1) to (- x).
(logand, logior, logxor): Optimize with byte-optimize-predicate
instead of with byte-optimize-logmumble.
* test/lisp/emacs-lisp/bytecomp-tests.el:
(byte-opt-testsuite-arith-data): Add a couple of test cases.
Stefan Monnier [Fri, 23 Mar 2018 15:29:06 +0000 (11:29 -0400)]
Fix bug#30846, along with misc cleanups found along the way
* test/src/data-tests.el (data-tests-kill-all-local-variables): New test.
* src/buffer.c (swap_out_buffer_local_variables): Remove.
Fuse the body of its loop into that of reset_buffer_local_variables.
(Fkill_buffer, Fkill_all_local_variables): Don't call it any more.
(reset_buffer_local_variables): Make sure the buffer's local binding
is swapped out before removing it from the alist (bug#30846).
Call watchers before actually killing the var.
* src/data.c (Fmake_local_variable): Simplify.
Use swap_in_global_binding to swap out any local binding, instead of
a mix of find_symbol_value followed by messing with where&found.
Don't call swap_in_symval_forwarding since the currently swapped
binding is never one we've modified.
(Fkill_local_variable): Use swap_in_global_binding rather than messing
with where&found to try and trick find_symbol_value into doing the same.
* src/alloc.c (mark_localized_symbol): 'where' can't be a frame any more.
Stefan Monnier [Fri, 23 Mar 2018 15:09:54 +0000 (11:09 -0400)]
* src/alloc.c: Avoid O(N²) complexity when unchaining markers (bug#24548).
Unchain all dead markers with a single scan of the markers list,
instead of calling the O(N) 'unchain_marker' N times.
(unchain_dead_markers): New function.
(sweep_buffers): Use it.
(gc_sweep): Sweep buffers before markers.
(sweep_misc): Check that markers have been unchained when reclaiming them.
Noam Postavsky [Sat, 10 Feb 2018 19:06:05 +0000 (14:06 -0500)]
Explain more about (defvar foo) form (Bug#18059)
* doc/lispref/variables.texi (Defining Variables)
(Using Lexical Binding):
* doc/lispref/compile.texi (Compiler Errors): Emphasize that omitting
VALUE for `defvar' marks the variable special only locally.
* doc/lispref/variables.texi (Using Lexical Binding): Add example of
using `defvar' without VALUE.
Paul Eggert [Thu, 22 Mar 2018 18:25:42 +0000 (11:25 -0700)]
Fix byte-opt lists of pure functions etc.
This fixes a bug where a byte-compiler running on 64-bit Emacs
optimized (lsh -1 -1) to #x1fffffffffffffff, an optimization
that is incorrect for .elc files intended for either 32- or
64-bit Emacs. While I was in the neighborhood, I noticed other
glitches in the lists of pure and side-effect-free functions, and
fixed the errors that I found.
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns):
Move some functions here from side-effect-and-error-free-fns,
since they can now signal errors. The affected functions are
current-time-string, current-time-zone,
line-beginning-position, line-end-position. Rename langinfo
to locale-info. Add logcount. Remove string-to-int.
(side-effect-and-error-free-fns): Remove minibuffer-window, a
function that can signal errors, and that is already in
side-effect-free-fns.
(pure-fns): Remove ash, lsh, and logb, since they are
platform-dependent and .elc files should be
platform-independent. Add %, logand, logcount. Sort.
Clarify what is meant by “pure”.
Paul Eggert [Thu, 22 Mar 2018 16:32:50 +0000 (09:32 -0700)]
Port emacs-module-tests to 32-bit Emacs
Fix a portability bug when emacs-module-tests.el is byte-compiled
with a 32-bit Emacs (where #x20000000 evaluates to a
floating-point number) and then is run on a 64-bit Emacs (where
the floating-point number causes a test failure).
* test/src/emacs-module-tests.el (mod-test-sum-test):
Don’t assume #x20000000 can be represented as an Emacs integer.
* lisp/net/tramp.el (tramp-handle-substitute-in-file-name): Drop volume
letter of localname substitution. Reported by Chris Zheng
<chriszheng99@gmail.com>.
Michael Albinus [Thu, 22 Mar 2018 08:43:44 +0000 (09:43 +0100)]
Tag tramp-test39-utf8* as :unstable
* test/lisp/net/tramp-tests.el (tramp-test39-utf8)
(tramp-test39-utf8-with-stat, tramp-test39-utf8-with-perl)
(tramp-test39-utf8-with-ls): Tag the tests as :unstable.
Eric Abrahamsen [Sat, 30 Dec 2017 18:12:22 +0000 (10:12 -0800)]
Adjust eieio persistence tests for expected failure
* test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el
(eieio-test-persist-hash-and-vector,
eieio-test-persist-interior-lists): Persistence does not currently
handle deeply-nested objects. Expect current failures, and mark for
future fixes.
Eric Abrahamsen [Fri, 29 Dec 2017 02:14:47 +0000 (18:14 -0800)]
Let eieio-persistent-read read what object-write has written
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value):
`object-write' may quote lists inside hash tables and vectors, so
unquote those lists here.
This patch allows the eieio-persistent write/restore process to
perform a clean round trip. It only handles a very specific and
limited range of object structures, but at least the write and read
procedures match.
Eric Abrahamsen [Tue, 19 Dec 2017 22:56:13 +0000 (14:56 -0800)]
Handle possible classtype values in eieio-persistent-read
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-validate/fix-slot-value):
The function `eieio-persistent-slot-type-is-class-p' could return
either a single class, or a list of classes.
* test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el:
(hash-equal): New comparison test for hash-tables.
(persist-test-save-and-compare): Use test for hash-tables.
(eieio-test-persist-hash-and-vector,
eieio-test-persist-interior-lists): New tests.
Paul Eggert [Wed, 21 Mar 2018 23:08:27 +0000 (16:08 -0700)]
Port data-tests-popcnt to 32-bit Emacs
* test/src/data-tests.el (data-tests-popcnt):
Don’t assume Emacs integers can represent 32-bit quantities.
Change to a simple and straightforward approach, since runtime
performance is not important here.
* lisp/vc/vc-git.el (vc-git-stash-read-history)
(vc-git-stash-read): New history variable and function.
(vc-git-stash-show, vc-git-stash-apply, vc-git-stash-pop): Update
their interactive specifications.
Glenn Morris [Wed, 21 Mar 2018 18:13:53 +0000 (14:13 -0400)]
Quieten eieio-test compilation
* test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el:
* test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el:
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el:
Remove obsolete name args where not being explicitly tested.
Alan Mackenzie [Wed, 21 Mar 2018 17:36:34 +0000 (17:36 +0000)]
Firm up documentation of generalized variables
* doc/lispref/variables.texi (Generalized Variables)
(Setting Generalized Variables): Define a generalized variable as something
setf can write to. Remove the insinuation that hackers have poor memories.
State explicitly that the list of GVs given is complete. Remove the
suggestion that `setf' has superseded, or is in the process of superseding,
`setq'. Make minor corrections to the English.
Eli Zaretskii [Wed, 21 Mar 2018 16:57:41 +0000 (18:57 +0200)]
Improve documentation of Auto-Revert mode
* doc/emacs/files.texi (Reverting): Mention that Aut-Revert
applies to Dired buffers as well. Suggested by Michael Albinus
<michael.albinus@gmx.de> in emacs-manual-bugs@gnu.org.
Eli Zaretskii [Wed, 21 Mar 2018 16:49:29 +0000 (18:49 +0200)]
Improvements in dired.texi
* doc/emacs/dired.texi (Dired): Mention that Dired works with
remote directories.
(Dired Enter): ls-lisp is used on some remote systems as well.
(Dired Navigation): Mention and index the command names.
(Dired Deletion): Document the 'always' value of
dired-recursive-deletes. Mention the alternative deletion method.
(Marks vs Flags): Fix spelling of Auto-Revert mode. Document what
marking does on a subdirectory header line.
(Operating on Files): Document that 'Z' uses gzip or compress.
(Comparison in Dired): Mention ediff-files.
(Misc Dired Features): Fix a typo. Suggested by Michael Albinus
<michael.albinus@gmx.de> in emacs-manual-bugs@gnu.org.
Noam Postavsky [Tue, 20 Mar 2018 23:18:33 +0000 (19:18 -0400)]
Revert "Support all perl variable declarators and prefixes"
It highlights normal variable names in perl programs (Bug#30812).
* lisp/progmodes/perl-mode.el (perl-imenu-generic-expression)
(perl-font-lock-keywords-2): Restore values prior to Bug#27613 fix.
Don't merge to master, we will fix Bug#27613 properly there (it's too
close to release to do that on emacs-26).
Paul Eggert [Tue, 20 Mar 2018 16:54:20 +0000 (09:54 -0700)]
Port to 32-bit sparc64
Backport from master.
Problem reported by Ulrich Mueller; fix suggested by Eli Zaretskii
and Andreas Schwab (Bug#30855).
* src/alloc.c (mark_memory): Call mark_maybe_object only on
pointers that are properly aligned for Lisp_Object.
Paul Eggert [Tue, 20 Mar 2018 16:54:20 +0000 (09:54 -0700)]
Port to 32-bit sparc64
Problem reported by Ulrich Mueller; fix suggested by Eli Zaretskii
and Andreas Schwab (Bug#30855).
* src/alloc.c (mark_memory): Call mark_maybe_object only on
pointers that are properly aligned for Lisp_Object.
Paul Eggert [Tue, 20 Mar 2018 15:59:39 +0000 (08:59 -0700)]
Merge from origin/emacs-26
23527013c7 ; Rewrap doc string 4328d5f744 Correct Info link markup 2fb52abd9e Improve documentation of 'with-help-window' ec08c62f03 Minor improvements in building.texi 663aafe1ff * lisp/textmodes/bibtex.el (bibtex-mark-entry): activate mark 05781b2e88 ; Spelling fix aa40014ba3 * doc/emacs/building.texi (Starting GUD): Mention 'guiler'. 23072e468f Yet more proofreading of the Emacs manual ba5a372540 * doc/emacs/rmail.texi: Fix broken link. 6b2210cc29 ; Spelling fix 067c8c4f5b Fix recently-added POP doc glitch fb3dc0e8aa More proofreading of the Emacs manual a776ce7be6 Fix typo in the Emacs manual's VC chapter 7f27d42f0b Pass json-readtable-error data as a list (bug#30489) 10bd3b3af8 Improve word motion docs (Bug#30815) 2b8507fbdc Replace "carriage-return" by "carriage return" in manuals 2616cd94f1 Minor copyedits in mule.texi 36a1d52814 Fix problems caused by fontconfig-2.13.0
Nick Helm [Sun, 18 Mar 2018 08:05:44 +0000 (21:05 +1300)]
Improve documentation of 'with-help-window'
* doc/lispref/help.texi (Help Functions): Change variable name
to 'buffer-or-name'.
* lisp/help.el (with-help-window): Change variable name to
'buffer-or-name' and rewrite the doc string, adding reference
to 'help-window-setup'. (Bug#30792)
Eli Zaretskii [Tue, 20 Mar 2018 09:34:14 +0000 (11:34 +0200)]
Minor improvements in building.texi
* doc/emacs/building.texi (Compilation Shell): Mention that this
section is for local compilation buffers.
(Compilation, Compilation Mode): Mention that 'g' is bound to
'recompile' in compilation buffers.
(Grep Searching): Add a cross-reference to "Compilation Mode".
Suggested by Michael Albinus <michael.albinus@gmx.de> in
emacs-manual-bugs@gnu.org.
Paul Eggert [Mon, 19 Mar 2018 23:49:09 +0000 (16:49 -0700)]
Improve port to NetBSD tzalloc
Problem reported by Valery Ushakov (Bug#30738#22).
* src/editfns.c (HAVE_TZALLOC_BUG): New macro.
(tzlookup): Use it. Compile on all platforms, not just on NetBSD.
Eli Zaretskii [Mon, 19 Mar 2018 19:53:52 +0000 (21:53 +0200)]
Yet more proofreading of the Emacs manual
* doc/emacs/building.texi (Compilation, Grep Searching)
(Debuggers, GUD Customization, Source Buffers)
(Breakpoints Buffer, Threads Buffer): Minor fixes and updates.
Suggested by Michael Albinus <michael.albinus@gmx.de> in
emacs-manual-bugs@gnu.org.