Glenn Morris [Mon, 13 Feb 2017 03:02:56 +0000 (19:02 -0800)]
Fix recent bootstrap issue by moving string-to-list
* lisp/international/mule-util.el (string-to-list, string-to-vector):
Move from here...
* lisp/subr.el (string-to-list, string-to-vector): ...to here.
The implementation is trivial and at least string-to-list
has ended up being needed early during bootstrap.
Glenn Morris [Mon, 13 Feb 2017 01:36:33 +0000 (17:36 -0800)]
Doc fix for vhdl-mode re mail-host-address
* lisp/progmodes/vhdl-mode.el (vhdl-file-header): Doc fix.
(mail-host-address): Do not add to vhdl-related custom group,
since vhdl-template-replace-header-keywords doesn't use it.
and char-displayable-p test to query-replace-read-from.
Add choice nil to disable this feature.
(query-replace-read-from): Don't reevaluate custom setting.
Use char-displayable-p to test the first non-whitespace character
in query-replace-from-to-separator, use " -> " when fails.
Add prompt for the case when separator is nil but
query-replace-defaults is non-nil.
Remove unused test for regexp-flag.
Thanks to Thierry Volpiatto <thierry.volpiatto@gmail.com>
Karl Fogel [Sun, 12 Feb 2017 23:21:06 +0000 (17:21 -0600)]
Convert more uses of `looking-at' to `following-char'
This follows up to Mark Oteiza's commit of 12 Feb 2017, 14:46:03 UTC
(commit 91478f46238a) with more of the same.
* lisp/bookmark.el (bookmark-send-edited-annotation):
(bookmark-bmenu-execute-deletions): Replace instances of looking-at
with char comparisons using following-char.
Paul Eggert [Sun, 12 Feb 2017 20:55:11 +0000 (12:55 -0800)]
Fix typos in tests for lax-plist-get etc.
Problem reported by Eli Zaretskii (Bug#25606#62).
* test/src/fns-tests.el (test-cycle-lax-plist-get)
(test-cycle-plist-put, test-cycle-lax-plist-put):
Fix tests to match behavior.
Sam Steingold [Fri, 10 Feb 2017 19:53:02 +0000 (14:53 -0500)]
Extract grep-find-ignored-directories processing from rgrep-default-command
(rgrep-find-ignored-directories): Extract from `rgrep-default-command'.
Some Emacs packages use `grep-find-ignored-directories' to ignore some
directories, so will use this function instead of custom code.
(rgrep-default-command): Use `rgrep-find-ignored-directories'.
Vibhav Pant [Fri, 10 Feb 2017 17:55:42 +0000 (23:25 +0530)]
src/bytecode.c: Avoid comparing values unnecessarily in Bswitch
* src/bytecode.c: (exec_byte_code) While linear searching the jump
table, compare the value's hash table first to avoid calling
h->test.cmpfn every time.
* lisp/progmodes/bat-mode.el (bat-font-lock-keywords): Match
word and symbol constituents when looking for variable names
to fontify; also, correct the syntax table and mark the equal
sign (=) character as punctuation. Improve fontification
accuracy of iteration/positional variables.
(bat-mode): Set comment-start-skip. (Bug#25541)
* test/lisp/progmodes/bat-mode-tests.el: New file, tests for
bat-mode.el.
Juri Linkov [Thu, 9 Feb 2017 22:35:22 +0000 (00:35 +0200)]
* lisp/isearch.el (isearch-search-fun-default): Set isearch-adjusted
to t to display "Pending" in the search prompt for lax
word/symbol search (bug#25562). Don't use lax for lazy-highlighting
when 'bound' is non-nil.
(word-search-regexp, isearch-symbol-regexp): Don't depend on lax
at the beginning of regexp (bug#22589).
* lisp/info.el (Info-isearch-search):
Use isearch--lax-regexp-function-p.
* doc/emacs/search.texi (Word Search, Symbol Search):
Mention "Pending" prompt for lax word/symbol search.
Vibhav Pant [Thu, 9 Feb 2017 13:13:31 +0000 (18:43 +0530)]
bytecode.c (exec_byte_code): don't check hash code in linear search.
* src/bytecode.c (exec_byte_code): Don't check that the hash code is
not nil when linear scanning the jump table. Hash tables for are
declared with :size as the exact number of cases, so each entry i
should have a hash code. When BYTE_CODE_SAFE, do it as a sanity
check.
Tino Calancha [Thu, 9 Feb 2017 09:14:10 +0000 (18:14 +0900)]
Ibuffer: Erase output buffer before shell commands
* lisp/ibuf-macs.el (define-ibuffer-op): Add keyword arguments
BEFORE and AFTER; they are forms to run before/after the operation.
* lisp/ibuf-ext.el (ibuffer--maybe-erase-shell-cmd-output):
New defun; if shell-command-dont-erase-buffer is nil, then
erase shell command output buffer.
(ibuffer-do-shell-command-pipe, ibuffer-do-shell-command-file): Use it.
Tino Calancha [Thu, 9 Feb 2017 09:13:59 +0000 (18:13 +0900)]
Ibuffer: Don't truncate shell command output
* lisp/ibuf-ext.el (ibuffer-do-shell-command-pipe)
(ibuffer-do-shell-command-pipe-replace)
Use 'call-shell-region' (Bug#22679).
(ibuffer-do-shell-command-file): Use call-process-shell-command.
If FILE, the file that the buffer object is visiting,
exists and the buffer is up-to-date, then use
FILE instead of creating a temporary file (Bug#22679).
Vibhav Pant [Thu, 9 Feb 2017 06:48:54 +0000 (12:18 +0530)]
Improve byte-switch execution.
* lisp/emacs-lisp/byte-opt.el,
lisp/emacs-lisp/bytecomp.el (byte-decompile-bytecode-1),
(byte-compile-lapcode): Calculate the actual jump address while
compiling, store it in the jump table.
* src/bytecode.c: Jump to the looked up value directly, do a linear
search when the number of elements is <= 5.
Noam Postavsky [Thu, 2 Feb 2017 14:19:43 +0000 (09:19 -0500)]
Make sure eshell pipelines don't drop data
* lisp/eshell/esh-proc.el (eshell-sentinel): If called while still
handling output of the process, make sure to close the pipes only later,
so that the next process in the pipeline recieves EOF only after getting
all its input (Bug#25549).
Stephen Berman [Wed, 8 Feb 2017 21:38:39 +0000 (22:38 +0100)]
describe-char: unambiguous name for inserting ASCII 7
* lisp/descr-text.el (describe-char): Make the input
suggestion for inserting ASCII character 7 by name use the
unambiguous name "BELL (BEL)" (bug#25641).
Paul Eggert [Tue, 7 Feb 2017 02:00:13 +0000 (18:00 -0800)]
Do not trick info/dir’s timestamp
* Makefile.in (${srcdir}/info/dir): When making this file, do not
do anything special about its timestamp. Previously this rule
used move-if-change, which meant that this file’s timestamp could
end up being older than the files it depends on, and this caused
‘make --question info’ to fail, which caused ‘make-dist’ to fail
now that ‘make-dist’ invokes ‘make --question info’.
Paul Eggert [Tue, 7 Feb 2017 01:15:14 +0000 (17:15 -0800)]
Make FOR_EACH_TAIL more like other FOR_EACH macros
See comments by Stefan Monnier in:
http://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00181.html
and by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2017-02/msg00207.html
* src/fns.c (internal_equal): Do not bypass check for depth
overflow when tail-recursing via a dotted list tail or an overlay
plist, to avoid a rare infloop.
* src/lisp.h (FOR_EACH_TAIL, FOR_EACH_TAIL_SAFE): Take TAIL as an
arg, and update it at each iteration, rather than have callers
access it.tail. All callers changed.
(FOR_EACH_TAIL): Do not check for dotted lists, as this is now
the caller’s responsibility. All callers changed.
(FOR_EACH_TAIL_CONS): Remove. All callers changed.
(struct for_each_tail_internal.tail): Remove; no longer needed.
(FOR_EACH_TAIL_INTERNAL): Remove dotted arg, and set the tail
arg each time through the loop. All callers changed.
Paul Eggert [Sun, 5 Feb 2017 22:07:11 +0000 (14:07 -0800)]
Port to clang 3.8.0
It does not allow a for-loop's control var to be an anonymous struct.
* src/lisp.h (struct for_each_tail_internal): New type.
(FOR_EACH_TAIL_INTERNAL): Use it.
Paul Eggert [Sun, 5 Feb 2017 21:25:37 +0000 (13:25 -0800)]
FOR_EACH_TAIL now checks for quit
As per Eli Zaretskii (Bug#25606#20). Although these calls to
maybe_quit are unnecessary in practice, Eli was not convinced
that the calls are unnecessary.
* src/lisp.h (FOR_EACH_TAIL, FOR_EACH_TAIL_CONS):
Call maybe_quit every so often.
(FOR_EACH_TAIL_INTERNAL): New arg CHECK_QUIT. All callers changed.
Paul Eggert [Sun, 5 Feb 2017 21:25:37 +0000 (13:25 -0800)]
Signal list cycles in ‘length’ etc.
Use macros like FOR_EACH_TAIL instead of maybe_quit to
catch list cycles automatically instead of relying on the
user becoming impatient and typing C-g (Bug#25606).
* src/fns.c (Flength, Fmember, Fmemq, Fmemql, Fassq, Fassoc, Frassq)
(Frassoc, Fdelete, Freverse):
Use FOR_EACH_TAIL instead of maybe_quit.
(Fnreverse): Use simple EQ to check for circular list instead
of rarely_quit, as this suffices in this unusual case.
(Fplist_put, Flax_plist_put, Flax_plist_put):
Use FOR_EACH_TAIL_CONS instead of maybe_quit.
(internal_equal): Use FOR_EACH_TAIL_CONS to check lists, instead
of by-hand tail recursion that did not catch cycles.
* src/fns.c (Fsafe_length, Fplist_get):
* src/xdisp.c (display_mode_element):
Use FOR_EACH_TAIL_SAFE instead of by-hand Floyd’s algorithm.
* src/lisp.h (QUIT_COUNT_HEURISTIC): Remove; no longer needed.
(rarely_quit): Simply count toward USHRT_MAX + 1, since the
fancier versions are no longer needed.
(FOR_EACH_TAIL_CONS, FOR_EACH_TAIL_SAFE)
(FOR_EACH_TAIL_INTERNAL): New macros, the last with definiens
mostly taken from FOR_EACH_TAIL.
(FOR_EACH_TAIL): Rewrite in terms of FOR_EACH_TAIL_INTERNAL.
Paul Eggert [Sun, 5 Feb 2017 21:25:37 +0000 (13:25 -0800)]
Simplify use of FOR_EACH_TAIL
* src/data.c (circular_list): New function.
* src/lisp.h (FOR_EACH_TAIL): Use Brent’s algorithm and C99 for-loop
decl, to eliminate the need for the args TAIL, TORTOISE and N, and
to speed things up a bit on typical hosts with optimization.
All uses changed (Bug#25605).
Vibhav Pant [Sun, 5 Feb 2017 17:02:21 +0000 (22:32 +0530)]
bytecomp.el: Use macroexp-const-p instead of bc-cond-valid-obj2-p.
* lisp/emacs-lisp/bytecomp.el (byte-compile-cond-vars): Use
(macroexp-cons-p) instead of (byte-compile-cond-valid-obj2-p) to
make sure that obj1/obj2 can be compared with `eq'.
* lisp/emacs-lisp/bytecomp.el (byte-compile-inline-lapcode):
Restore value of byte-compile-depth after emitting a jump to a tag
in a jump table, or default/done tags.
Set the depth of final tags for byte-switch to nil after emitting
any jumps to them.
Vibhav Pant [Sun, 5 Feb 2017 13:19:24 +0000 (18:49 +0530)]
byte-opt.el: Replace jump tables while decompiling correctly.
* lisp/emacs-lisp/byte-opt.el (byte-decompile-bytecode-1):
Don't make a copy of the constant vector, as it isn't used with
the decompiled lapcode.
Make sure that the correct lapcode pair/list is being modified while
replacing the jump table.
Vibhav Pant [Sun, 5 Feb 2017 10:07:43 +0000 (15:37 +0530)]
bytecomp.el: Don't store non-keyword symbols in jump-tables.
* lisp/emacs-lisp/bytecomp.el (byte-compile-cond-valid-obj2-p) return
nil when OBJ is a non-keyword symbol (i.e a variable), as the jump
table can only be used when comparing variables with constant values.
* lisp/textmodes/css-mode.el (css-smie-grammar): Give colons belonging
to properties higher precedence.
(css--colon-inside-selector-p, css--colon-inside-funcall): New
functions for helping SMIE during tokenization.
(css-smie--forward-token, css-smie--backward-token): Distinguish
colons belonging to properties from other colons.
* test/manual/indent/css-mode.css: Add tests for the changes above.
* doc/lispref/edebug.texi (Checking Whether to Stop): Mention
edebug-max-depth and index it. Add cross-references for
max-lisp-eval-depth and max-specpdl-size.
Eli Zaretskii [Sat, 4 Feb 2017 10:02:55 +0000 (12:02 +0200)]
Support options with embedded whitespace in 'dired-listing-switches'
* lisp/dired.el (dired-listing-switches): Document how to quote
options with embedded whitespace.
* lisp/files.el (insert-directory): Use split-string-and-unquote
to support dired-listing-switches that specify command-line
options with embedded spaces. (Bug#25485)
Mark Oteiza [Sat, 4 Feb 2017 02:42:42 +0000 (21:42 -0500)]
Rename to if-let* and when-let*
Make the existing if-let and when-let aliases.
* lisp/emacs-lisp/subr-x.el (if-let*, when-let*): New macros. Rewrite
docstrings, incorporating that from let* and the existing if-let.
(if-let, when-let, and-let*): Alias them.
Paul Eggert [Fri, 3 Feb 2017 05:28:45 +0000 (21:28 -0800)]
Re-port alloc.c to Solaris sparc and simplify
alloc.c had bitrotted a bit, and used an undefined symbol
stack_base when Emacs was built on Solaris sparc, leading to
compilation failures. Also, code related to __builtin_unwind_init
was unnecessarily duplicated. Fix the bitrot and remove some
duplication.
* src/alloc.c: Remove uses of GC_SAVE_REGISTERS_ON_STACK, since it
is never defined.
(test_setjmp) [!HAVE___BUILTIN_UNWIND_INIT && GC_SETJMP_WORKS]:
Define a no-op dummy, to simplify use.
(test_setjmp) [!GC_SETJMP_WORKS]: Test setjmp_tested_p here rather
than in the caller, to simplify use.
(stacktop_sentry): New type.
(__builtin_unwind_init) [!HAVE___BUILTIN_UNWIND_INIT]: New macro.
(SET_STACK_TOP_ADDRESS): New macro, containing code that was duplicated.
(flush_stack_call_func, Fgarbage_collect): Use it.
(init_alloc): Omit unnecessary initialization.
After dumping, Emacs need not re-test setjmp.
Noam Postavsky [Sat, 21 Jan 2017 18:24:47 +0000 (13:24 -0500)]
Fix scrolling with partial lines
* src/xdisp.c (partial_line_height): New function.
(try_scrolling):
* src/window.c (window_scroll_pixel_based): Use it for calculating the
pixel scroll margin correctly in a window with partial lines.
* src/xdisp.c (maximum-scroll-margin): New variable.
* lisp/cus-start.el: Make it customizable.
* etc/NEWS: Mention it.
* doc/emacs/display.texi (Auto Scrolling):
* doc/lispref/windows.texi (Textual Scrolling): Document it.
* src/window.c (window_scroll_pixel_based): Use it instead of hardcoding
division by 4 (Bug #5718).
Dmitry Gutov [Fri, 3 Feb 2017 01:10:30 +0000 (03:10 +0200)]
(xref-collect-matches): Use '-E' together with '-e'
* lisp/progmodes/xref.el (xref-collect-matches): Use '-E'
together with '-e', as suggested by Noam Postavsky
(http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00780.html).