Glenn Morris [Sat, 18 Feb 2017 00:06:15 +0000 (19:06 -0500)]
Ensure that user-mail-address always has a value
* lisp/startup.el (user-mail-address): Initialize in the normal way.
(command-line): Reset user-mail-address if needed using
standard custom machinery.
* lisp/mail/feedmail.el (feedmail-fiddle-from):
* lisp/mail/rmail.el (rmail-unknown-mail-followup-to):
* lisp/mail/rmailsum.el (rmail-header-summary):
Simplify now that user-mail-address is always set.
; * doc/lispref/os.texi (System Environment): Remove fixme comment.
Mark Oteiza [Sat, 18 Feb 2017 00:01:11 +0000 (19:01 -0500)]
Turn on lexical-binding in ruby-mode
* lisp/progmodes/ruby-mode.el: Turn on lexical-binding.
(ruby-font-lock-syntax-table): Use make-syntax-table.
(ruby-mode): 'define-derived-mode' writes the keys for us.
Mark Oteiza [Fri, 17 Feb 2017 23:52:12 +0000 (18:52 -0500)]
Turn on lexical-binding in elint.el
* lisp/emacs-lisp/elint.el: Quote entry point commands in commentary.
(elint-running, elint-current-pos): Move these dynamic vars to toward
the top of the file.
(elint-check-quote-form): Ignore unused argument.
(elint-check-conditional-form): Remove unused binding.
Fix build failure caused by ‘Generate upcase and downcase tables from Unicode’
The [5ec3a584: Generate upcase and downcase tables from Unicode data]
commit broke bootstrap from a truly clean tree (e.g. a fresh clone or
one created with ‘make extraclean’), see
<http://hydra.nixos.org/build/48774928>.
The failure was caused by characters.el trying to read Unicode
property tables which aren’t available so early in the build process.
Wrap the part that requires Unicode property tables in a condition
checking if those are available. If they aren’t they case and syntax
tables won’t be fully set but later on, the characters.el file will be
evaluated again and this time with Unicode properties available so
final Emacs ends up with the exact same case and syntax tables.
Katsumi Yamaoka [Fri, 17 Feb 2017 09:52:09 +0000 (09:52 +0000)]
mm-shr: Prefer charset specified in html meta tag
* lisp/gnus/mm-decode.el (mm-shr): Prefer charset specified in html
meta tag than mail-parse-charset in the case there is no charset spec
in MIME header.
Vibhav Pant [Thu, 16 Feb 2017 14:48:55 +0000 (20:18 +0530)]
bytecomp.el: Avoid unnecessary calculation for jump table addresses.
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode): Don't do
redundant operations while calculating the correct jump addresses
from TAGs in jump tables.
Mark Oteiza [Thu, 16 Feb 2017 01:43:55 +0000 (20:43 -0500)]
Minor changes in json.el
* lisp/json.el (json-advance): Simpler docstring.
(json-read-escaped-char): Use xdigit subform in rx expression.
(json-read-string): Just use = for char comparison.
Glenn Morris [Thu, 16 Feb 2017 01:23:07 +0000 (20:23 -0500)]
Handle user-mail-address being the empty string
* lisp/mail/feedmail.el (feedmail-fiddle-from):
* lisp/mail/rmail.el (rmail-unknown-mail-followup-to):
* lisp/mail/rmailsum.el (rmail-header-summary):
Belated update for 2002-09-29 startup.el change, 680ebfa, where
the value of user-mail-address during initialization was changed
from nil to the empty string.
Michael Albinus [Wed, 15 Feb 2017 18:42:34 +0000 (19:42 +0100)]
Continue to fix bug#25607
* lisp/ido.el (ido-complete): Let-bind `non-essential' to nil.
(ido-file-name-all-completions-1): Do not bind `non-essential'.
* lisp/net/tramp.el: (tramp-completion-file-name-handler):
Improve autoloaded version.
(tramp-completion-file-name-handler): Remove old compat code.
Check only for `tramp-completion-mode-p'.
(tramp-completion-mode-p): Autoload. Do not check any longer
for `last-input-event'.
(tramp-completion-handle-expand-file-name): Simplify. (Bug#25607)
casing: don’t assume letters are *either* upper- or lower-case (bug#24603)
A compatibility digraph characters, such as Dž, are neither upper- nor
lower-case. At the moment however, those are reported as upper-case¹
despite the fact that they change when upper-cased.
Stop checking if a character is upper-case before trying to up-case it
so that title-case characters are handled correctly. This fixes one of
the issues mentioned in bug#24603.
¹ Because they change when converted to lower-case. Notice an asymmetry
in that for a character to be considered lower-case it must not be
upper-case (plus the usual condition of changing when upper-cased).
* src/buffer.h (upcase1): Delete.
(upcase): Change to upcase character unconditionally just like downcase
does it. This is what upcase1 was.
* src/casefiddle.c (casify_object, casify_region): Use upcase instead
of upcase1 and don’t check !uppercasep(x) before calling upcase.
* src/keyboard.c (read_key_sequence): Don’t check if uppercase(x), just
downcase(x) and see if it changed.
* test/src/casefiddle-tests.el (casefiddle-tests--characters,
casefiddle-tests-casing): Update test cases which are now passing.
Generate upcase and downcase tables from Unicode data (bug#24603)
Use Unicode data to generate case tables instead of mostly repeating
them in lisp code. Do that in a way which maps ‘Dz’ (and similar)
digraph to ‘dz’ when down- and ‘DZ’ when upcasing.
https://debbugs.gnu.org/cgi/bugreport.cgi?msg=89;bug=24603 lists all
changes to syntax table and case tables introduced by this commit.
* lisp/international/characters.el: Remove case-pairs defined with
explicit Lisp code and instead use Unicode character properties.
* test/src/casefiddle-tests.el (casefiddle-tests--characters,
casefiddle-tests-casing): Update test cases which are now working
as they should.
Fixes cases marked FIXME upcoming in followup commits.
* test/src/casefiddle-tests.el (casefiddle-tests-char-properties,
casefiddle-tests-case-table, casefiddle-tests-casing-character,
casefiddle-tests-casing, casefiddle-tests-casing-byte8,
casefiddle-tests-casing-byte8-with-changes): New tests.
(casefiddle-tests--test-casing): New helper function for runnig
some of the tests.
Some of the files in oldXMenu use functions from string.h without
including that header which results in compile warnings:
ChgPane.c:46:5: warning: implicit declaration of function ‘strlen’
ChgPane.c:46:20: warning: incompatible implicit declaration of
built-in function ‘strlen’
ChgSel.c:62:2: warning: implicit declaration of function ‘strlen’
ChgSel.c:62:17: warning: incompatible implicit declaration of built-in
function ‘strlen’
Create.c:220:5: warning: implicit declaration of function ‘strcmp’
InsPane.c:65:5: warning: implicit declaration of function ‘strlen’
InsPane.c:65:20: warning: incompatible implicit declaration of
built-in function ‘strlen’
InsSel.c:68:5: warning: implicit declaration of function ‘strlen’
InsSel.c:68:20: warning: incompatible implicit declaration of built-in
function ‘strlen’
InsSel.c:75:5: warning: implicit declaration of function ‘strcmp’
Richard Stallman [Wed, 15 Feb 2017 15:45:51 +0000 (07:45 -0800)]
Rmail fix
* lisp/mail/rmail.el (rmail-epa-decrypt-1): Include the just-decrypted text
as element 4 of the value.
(rmail-epa-decrypt): Take the text to insert from that element.
Vibhav Pant [Wed, 15 Feb 2017 15:33:05 +0000 (21:03 +0530)]
bytecomp-tests.el: Store all test forms in one constant.
* test/lisp/emacs-lisp/bytecomp-tests.el: Store all test expressions
in a single constant (byte-opt-testsuite-arith-data), add new forms
which generate lapcode with adjacent/redundant tags.
Noam Postavsky [Sun, 12 Feb 2017 04:15:13 +0000 (23:15 -0500)]
Test comment-multi-line = nil auto fill case too
* test/lisp/progmodes/js-tests.el (js-mode-auto-fill): Test with
`comment-multi-line' both nil and non-nil.
* lisp/newcomment.el (comment-multi-line): Mark safe if it's a
boolean.
* etc/NEWS: Mention that `js-mode' now sets `comment-multi-line'.
Katsumi Yamaoka [Wed, 15 Feb 2017 01:26:59 +0000 (01:26 +0000)]
Don't delete leading and trailing space from CJK word (bug#25685)
* lisp/textmodes/fill.el (fill-delete-newlines):
Don't delete leading and trailing space from CJK word.
(fill-separate-heterogeneous-words-with-space):
New user option that controls it (bug#25685).
Juri Linkov [Tue, 14 Feb 2017 23:28:15 +0000 (01:28 +0200)]
‘M-s w RET word C-s’ repeats incremental search.
* lisp/isearch.el (isearch-new-nonincremental): New variable.
(with-isearch-suspended): Bind isearch-new-nonincremental to
isearch-nonincremental, and restore it afterwards.
(isearch-forward-exit-minibuffer, isearch-reverse-exit-minibuffer):
Set isearch-new-nonincremental to nil. (Bug#25562)
Tom Tromey [Tue, 14 Feb 2017 01:09:36 +0000 (18:09 -0700)]
Make vc-git detect conflict state for vc-dir
* lisp/vc/vc-git.el (vc-git-dir-status-state): New struct.
(vc-git-dir-status-update-file): New function.
(vc-git-after-dir-status-stage, vc-git-dir-status-goto-stage): Use
vc-git-dir-status-state; add 'ls-files-conflict state.
(vc-git-dir-status-files): Create a vc-git-dir-status-state.
Vibhav Pant [Tue, 14 Feb 2017 16:17:59 +0000 (21:47 +0530)]
byte-opt: Replace merged tags in jump tables too. (bug#25716)
* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode): While merging
adjacent tags, make sure that the old tag is replaced in all jump
tables, if any. This fixes the bytecode VM jumping to the wrong
address in compiled cond forms where the body of a clause was a loop
of any sort.
Glenn Morris [Tue, 14 Feb 2017 07:36:17 +0000 (23:36 -0800)]
Remove overly broad element from default mail-dont-reply-to-names
* lisp/mail/mail-utils.el (mail-dont-reply-to):
Do not include just "user@" in mail-dont-reply-to-names, and simplify.
Ref: lists.gnu.org/archive/html/help-gnu-emacs/2017-02/msg00049.html
* lisp/gnus/message.el (message-dont-reply-to-names): Doc fix.
* doc/misc/message.texi (Wide Reply): Tiny fix re dont-reply-to-names.
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.