Stefan Monnier [Mon, 4 Dec 2017 22:03:32 +0000 (17:03 -0500)]
* lisp/calendar/diary-lib.el: Use lexical-binding
(diary-pull-attrs): Avoid let...setq.
(diary-list-entries-2, diary-mark-entries-1)
(diary-font-lock-date-forms, diary-fancy-date-pattern):
Use calendar-dlet* around uses of diary-date-forms.
(list-only, number, date, entry): Don't declare globally.
(diary-including): Declare.
(diary-saved-point, date-string): Move before first use.
(diary-list-entries): Use calendar-dlet* around
diary-nongregorian-listing-hook and 'diary-list-entries-hook.
(displayed-year, displayed-month): Move before first use.
(diary-sexp-entry): Use calendar-let* around evaluation of the sexp.
(diary-remind): Use calendar-let* around evaluation of sexp.
Paul Eggert [Mon, 4 Dec 2017 02:17:00 +0000 (18:17 -0800)]
allocate_vectorlike minor cleanup
* src/alloc.c (allocate_vectorlike): Move a bit of code out of the
critical section. Although this doesn’t really help performance,
it cleans up the code a bit and should make it easier to add
pointer bounds checking.
* lisp/net/shr.el (shr-image-from-data): Don't bug out on
image data: URLs that have no base64 encoding like
(shr-image-from-data
"text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E").
Alan Third [Sun, 3 Dec 2017 17:39:03 +0000 (17:39 +0000)]
Add image resizing and rotation to NS port
* lisp/image.el (image--get-imagemagick-and-warn): Bypass imagemagick
check when using NS.
* src/nsimage.m (ns_load_image): Add rotation and resizing
functionality. Move the getMetaData call to before the resize/rotation
so it returns correct metadata.
(EmacsImage::setSizeFromSpec, EmacsImage::rotate): New functions.
* src/nsterm.h (EmacsImage): Add new function prototypes.
(NSCompositingOperationCopy): Add define to older equivalent for
GNUstep and pre-10.12 macOS.
* configure.ac: Don't use libjpeg on Cocoa.
Noam Postavsky [Thu, 23 Nov 2017 02:59:35 +0000 (21:59 -0500)]
Disable history expansion in eshell (Bug#29157)
History expansion is not so useful since interactive history commands
are already provided. It can produce surprising errors when the user
is not aware of the history designator syntax.
* lisp/eshell/em-hist.el (eshell-hist-initialize): Don't add
eshell-expand-history-references to eshell-expand-input-functions.
* etc/NEWS: Announce it.
Noam Postavsky [Fri, 1 Dec 2017 01:51:07 +0000 (20:51 -0500)]
; Tracing for eieio-test random failure (Bug#24503)
* test/Makefile.in [EMACS_HYDRA_CI]: Always show log for eieio-tests.
* test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (top-level): Trace
cl-generic functions.
(eieio-test-dump-trace): New function.
(eieio-test-37-obsolete-name-in-constructor): Use it.
Noam Postavsky [Fri, 1 Dec 2017 13:20:29 +0000 (08:20 -0500)]
Fix faceup tests when run from elc
String literals may be shared by the compiler, so the test string
needs to be copied before adding properties to it. For single
properties, just use a string literal with properties.
* test/lisp/emacs-lisp/faceup-tests/faceup-test-basics.el
(faceup-markup): Split into...
(faceup-markup-basics, faceup-markup-escaping, faceup-markup-plain)
(faceup-markup-plain-full-text, faceup-markup-anonymous-face)
(faceup-markup-anonymous-face-2keys, faceup-markup-anonymous-nested)
(faceup-markup-nested, faceup-markup-overlapping)
(faceup-markup-multi-face, faceup-markup-multi-property): New tests.
Paul Eggert [Sun, 3 Dec 2017 05:38:05 +0000 (21:38 -0800)]
Merge from origin/emacs-26
04e5b28ff1 Fix bug in i18n/l10n optimization 8227087194 Let autoload-compute-prefix be set file-locally (Bug#29471) 98ca7d5f26 Improve edit-kbd-macro prompting in case of remapped keys ... c02c1f6be7 Add tests on electric-indentation and Python multiline str... 946bb6d225 Disable electric indent for python strings (Bug#29305) 35f1ed10e4 ; ChangeLog.2: Fix bug reference. ac316634e4 Fix buffer overflow in fontname conversion (Bug#29523) bf9b972843 Fix byte compilation of files with leading directories ac144dc835 * lisp/files.el (make-backup-file-name-1): Fix scoping error. 1b351c8a47 Revert Tramp commit from 2017-11-20 77cf972592 Improve documentation of buffer-list commands and features 66ec92af00 Fix backing up remote files in local directories on MS-Win... 7e61e74da7 * doc/emacs/mule.texi (Output Coding): Clarify sendmail co... 1e25cd79ff Revert "Fix backing up remote files in local directories o... f52d79500b Fix a typo in ELisp manual bf26fc3656 * lisp/composite.el (find-composition): Fix a typo in the ...
Paul Eggert [Sun, 3 Dec 2017 05:38:05 +0000 (21:38 -0800)]
Merge from origin/emacs-26
8c8b673288 Fix backing up remote files in local directories on MS-Win... 8eb6870be6 Fix vertical cursor motion in pixel-scroll.el 625e84f156 Fix typos in doc strings of message.el 9292276a44 Fix a typo in the Emacs manual 42509c0649 Improve the documentation of 'table-insert-sequence' 93dc7ae4a4 Port better to QNX ad99550610 Make tramp-test42-auto-load more robust af0ce33d08 ; * lisp/composite.el (find-composition): Fix a typo in la... bdbcdbac43 Avoid assertions in find-composition
Paul Eggert [Sun, 3 Dec 2017 05:31:24 +0000 (21:31 -0800)]
Fix bug in i18n/l10n optimization
This fixes a off-by-one buffer overrun bug introduced in
2017-06-04T15:39:37Z!eggert@cs.ucla.edu. Problem uncovered by an
experimental version of Emacs built with -fcheck-pointer-bounds
and running on Intel MPX hardware.
* src/editfns.c (styled_format): Avoid overrunning internal buffers.
Noam Postavsky [Mon, 27 Nov 2017 00:16:16 +0000 (19:16 -0500)]
Improve edit-kbd-macro prompting in case of remapped keys (Bug#29399)
* lisp/edmacro.el (edit-kbd-macro): Use substitute-command-keys to
present the current bindings in the prompt. Check the the
non-remapped binding of the entered key sequence as well.
Eli Zaretskii [Sat, 2 Dec 2017 11:29:39 +0000 (13:29 +0200)]
Fix byte compilation of files with leading directories
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Pass basename
of target-file to make-temp-file, in case target-file includes a
leading directory that might not exist under TMPDIR. See
http://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00680.html
for the details.
Michael Albinus [Sat, 2 Dec 2017 11:09:57 +0000 (12:09 +0100)]
Revert Tramp commit from 2017-11-20
* lisp/net/tramp.el (tramp-drop-volume-letter)
(tramp-handle-find-backup-file-name): Revert change from
2017-11-20. Emacs' `make-backup-file-name-1' handles this
case now.
Eli Zaretskii [Sat, 2 Dec 2017 10:56:45 +0000 (12:56 +0200)]
Improve documentation of buffer-list commands and features
* doc/emacs/buffers.texi (List Buffers): Add a cross-reference to
"Several Buffers", to establish a relation between the two
sections.
(Buffer Menus): Expand on customizability of alternative buffer
menu offered by bs.el. Mention IBuffer.
Suggested by Alex Branham <alex.branham@gmail.com> in
emacs-manual-bugs@gnu.org.
Alan Mackenzie [Sat, 2 Dec 2017 10:00:56 +0000 (10:00 +0000)]
For help commands, ensure all keys of a mouse sequence are reported.
This solves the problem where read_key_sequence initializes and uses a global
buffer raw_keybuf, yet is called recusrsively. The initialization is now done
elsewhere, avoiding the reinitialization of that global buffer.
* src/keyboard.c (command_loop_1, read_key_sequence_vs): Initialize
raw_event_count before calling read_key_sequence.
(read_char_x_menu_prompt): Call x_popup_menu_1 in place of Fx_popup_menu.
(init_raw_keybuf_count): New function.
(read_key_sequence): Remove initialization of raw_event_count. Add a missing
GROW_RAW_KEYBUF invocation.
* src/keyboard.h: (init_raw_keybuf_count): New declaration.
* src/menu.c: (x_popup_menu_1): New function with the functionality of the
former Fx_popup_menu.
(Fx_popup_menu): Replace with function which initializes raw_event_count then
calls x_popup_menu_1.
Eli Zaretskii [Sat, 2 Dec 2017 08:57:15 +0000 (10:57 +0200)]
Fix backing up remote files in local directories on MS-Windows
* lisp/files.el (make-backup-file-name-1): Support remote file
names correctly when they are backed up into a local directory on
MS-Windows and MS-DOS. (Bug#29440)
Vibhav Pant [Sat, 2 Dec 2017 05:38:34 +0000 (11:08 +0530)]
lisp/erc/erc.el: Use inline-letevals for when args are buffer local.
* lisp/erc/erc.el: (erc-get-server-user, erc-add-server-user,
erc-remove-server-user): Use inline-letevals for when the arguments
refer to buffer-local variables.
* admin/gitmerge.el (gitmerge-default-branch): Make it a variable,
defaulting to nil.
(gitmerge-emacs-version, gitmerge-default-branch): New functions.
(gitmerge): Guess the branch to merge from.
Eli Zaretskii [Fri, 1 Dec 2017 10:40:26 +0000 (12:40 +0200)]
Fix backing up remote files in local directories on MS-Windows
* lisp/files.el (make-backup-file-name-1): Support remote file
names correctly when they are backed up into a local directory on
MS-Windows and MS-DOS. (Bug#29440)
Tak Kunihiro [Fri, 1 Dec 2017 08:54:37 +0000 (10:54 +0200)]
Fix vertical cursor motion in pixel-scroll.el
* lisp/pixel-scroll.el (pixel-scroll-up): Move cursor down
regardless of whether EOB is shown at the top.
(pixel-scroll-down) Move cursor up regardless of whether BOB
is shown at the top. (Bug#29374)
* lisp/emacs-lisp/thunk.el (thunk-let, thunk-let*): New macros.
* test/lisp/emacs-lisp/thunk-tests.el:
(thunk-let-basic-test, thunk-let*-basic-test)
(thunk-let-bound-vars-cant-be-set-test)
(thunk-let-laziness-test, thunk-let*-laziness-test)
(thunk-let-bad-binding-test): New tests for `thunk-let' and
`thunk-let*.
* doc/lispref/eval.texi (Deferred Eval): New section.
* doc/lispref/elisp.texi: Update menu.
Paul Eggert [Thu, 30 Nov 2017 23:22:46 +0000 (15:22 -0800)]
Port better to QNX
Problem reported by Elad Lahav on emacs-devel.
* configure.ac: On QNX, default CC to qcc (a GCC wrapper),
and default LDFLAGS to -N2MB so that the initial stack size
is not too small. Also, fix misspelling of ‘qnxnto’.
Glenn Morris [Thu, 30 Nov 2017 17:40:46 +0000 (12:40 -0500)]
Make truncate-lines permanently local (bug#15396)
Width of lines relative to display is rarely a function of major mode.
* src/buffer.c (init_buffer_once) <truncate-lines>:
Flag as permanently local.
* lisp/bindings.el (truncate-lines): Add permanent-local property.
* test/lisp/net/tramp-tests.el (tramp-test06-directory-file-name):
Extend test.
(tramp-test17-insert-directory): Make check more robust.
(tramp-test42-auto-load): Combine several let forms.
(tramp-test42-delay-load, tramp-test42-recursive-load)
(tramp-test42-remote-load-path, tramp-test43-unload): Rename.
Glenn Morris [Wed, 29 Nov 2017 00:58:32 +0000 (19:58 -0500)]
Remove some bogus definition-prefixes from loaddefs
* lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads):
Don't register a definition prefix from define-erc-module,
which adds an erc- prefix to its argument.
Kaushal Modi [Tue, 28 Nov 2017 17:17:48 +0000 (19:17 +0200)]
Update documentation of '.dir-locals-2.el'
See https://lists.gnu.org/r/emacs-devel/2017-11/msg00649.html
for more details.
* lisp/files.el (dir-locals-file-2): Remove unused constant.
* lisp/files.el (dir-locals-file): Mention ".dir-locals-2.el" in
the doc string.
* doc/lispref/variables.texi (Directory Local Variables): Mention
".dir-locals-2.el".
* etc/NEWS: Replace `dir-locals-file-2' mention with
`dir-locals-file'.
Glenn Morris [Mon, 27 Nov 2017 22:55:53 +0000 (17:55 -0500)]
Fix probable typo in elisp-mode constant name
* lisp/progmodes/elisp-mode.el (emacs-lisp-byte-code-comment-re):
Rename from emacs-list-byte-code-comment-re. Add doc string.
(elisp--byte-code-comment, elisp-byte-code-syntax-propertize):
Update for the above.
Stefan Monnier [Mon, 27 Nov 2017 20:33:30 +0000 (15:33 -0500)]
* lisp/emacs-lisp/cl-macs.el: Fix bug#26073.
* lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand):
Implement Common-Lisp's behavior for symbol-macro's let-rebindings.
(cl--letf, cl-letf): Don't get fooled into using a plain `let` for
symbol-macros.
* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-symbol-macrolet-hide):
New test.
Michael Albinus [Mon, 27 Nov 2017 12:31:53 +0000 (13:31 +0100)]
Fix Bug#29163
* lisp/net/tramp.el (tramp-autoload-file-name-regexp):
Do not use "\\'" in regexp. (Bug#29163)
(top) Do not run (tramp-register-autoload-file-name-handlers)
when loading tramp.el.
* test/lisp/net/tramp-tests.el (tramp--test-mock-p): New defun.
(tramp-test32-environment-variables-and-port-numbers)
(tramp-test41-asynchronous-requests): Use it.
(tramp-test42-auto-load): New test.
(tramp-test43-recursive-load, tramp-test44-remote-load-path)
(tramp-test45-delay-load, tramp-test46-unload): Rename.
Paul Eggert [Mon, 27 Nov 2017 04:13:16 +0000 (20:13 -0800)]
Pacify --enable-gcc-warnings on Ubuntu 17.10 x86-64
* src/process.c (Fmake_network_process):
Avoid duplicate test of NILP (host), which apparently confuses
GCC into thinking that portstringlen might be used uninitialized.
Paul Eggert [Mon, 27 Nov 2017 03:15:14 +0000 (19:15 -0800)]
Harden exec_byte_code against redefining 'error'
Problem discovered by configuring with --enable-gcc-warnings on
Ubuntu 17.10 x86-64 with gcc (Ubuntu 7.2.0-8ubuntu3).
* src/bytecode.c (exec_byte_code): Call the C error function
instead of the Lisp one, so that the Emacs interpreter does not go
haywire if the user redefines the Lisp error function.
Gemini Lasswell [Mon, 6 Nov 2017 05:36:58 +0000 (21:36 -0800)]
Fix Edebug specs for if-let* and and-let* (Bug#29236)
* test/lisp/emacs-lisp/subr-x.el (if-let*, if-let): Change Edebug
spec to cause Edebug to instrument tests the results of which are
not bound to symbols (the (VALUEFORM) case).
(and-let*): Change Edebug spec to allow empty body.
*test/lisp/emacs-lisp/subr-x-tests.el:
(subr-x-and-let*-test-group-1): Add missing quote to erroneous
form so Edebug will work on this test.
Gemini Lasswell [Thu, 2 Nov 2017 04:13:02 +0000 (21:13 -0700)]
Fix Edebug's handling of dotted specs (bug#6415)
* lisp/emacs-lisp/cl-macs.el (cl-destructuring-bind): Use
cl-macro-list1 instead of cl-macro-list in Edebug spec.
* lisp/emacs-lisp/edebug.el (edebug-after-dotted-spec): Delete
unused variable.
(edebug-dotted-spec): Add docstring.
(edebug-match-specs): Allow &optional and &rest specs to
match nothing at the tail of a dotted form. Handle matches of
dotted form tails which return non-lists.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-dotted-forms):
New test.
* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el:
(edebug-test-code-use-destructuring-bind): New function.
Eli Zaretskii [Sun, 26 Nov 2017 18:23:15 +0000 (20:23 +0200)]
Improve documentation of "constant" symbols
* src/font.c (syms_of_font) <font-weight-table, font-slant-table>
<font-width-table>:
* src/data.c (syms_of_data) <most-positive-fixnum>
<most-negative-fixnum>:
* src/buffer.c (syms_of_buffer) <enable-multibyte-characters>:
Mention in the doc strings that these variables are read-only.
* doc/lispref/variables.texi (Creating Buffer-Local): Document
that making a constant variable buffer-local signals an error.
* doc/lispref/variables.texi (Constant Variables):
* doc/lispref/errors.texi (Standard Errors): More accurate and
up-to-date documentation of which symbols cannot be assigned
values.
Paul Eggert [Sun, 26 Nov 2017 06:55:35 +0000 (22:55 -0800)]
Merge from origin/emacs-26
a89f0b6f33 maint: shorten https://lists.gnu.org/archive/html/... links 8be3aee281 Merge from Gnulib 265cee553f Work around GCC bug 80776 on Fedora 27 x86 dc7a97fb84 Tweak copy-file, rename-file doc cfa2a944d4 Change font-lock-extend-region-multiline handling in mhtml... a8664cc998 Minor cleanup in tramp-gvfs-handle-file-local-copy 55c5b12fa0 Add test for Bug#29423 in Tramp. 3198a1646e Avoid jumbled order in HTML rendered by shr.el 23bfc2d2db Make sure 'dired-filename' property is always put by ls-lisp f7fdaea4c0 A better solution for bug#29347 86e6ed8521 ; * src/thread.c (acquire_global_lock): Fix thinko in last... f300852037 Avoid a hang after C-g while sit-for on a Unix TTY d7fc719ff1 Improve the doc string of 'list-packages' b4f67ebb92 Improve discoverability of 'defvar' for suppressing warnings 8a2b204e64 Improve discoverability of 'read-buffer-completion-ignore-... eea4e9194c Improve documentation of self-insert-uses-region-functions e6e41dac87 Reflect changes in copy-file and rename-file in doc strings 0ec534070f * lisp/progmodes/cc-vars.el (c-offsets-alist): Doc fix. (... 1d0dbdff6c Reorder type predicates in ELisp manual b081ec9dd7 Fix backward scrolling in buffers with header-line 8e40429c96 ; Fix some doc typos ed2c542920 * lisp/bindings.el (buffer-file-coding-system): Add explic... d82474e452 * src/fns.c (syms_of_fns) <overriding-plist-environment>: ... 292c09ff6d Fix incorrect interaction of drag/drop and double click (b... d6fadb1d26 * lisp/menu-bar.el (menu-bar-options-save): Add display-li... daa959efbc * lisp/menu-bar.el (menu-bar-options-save): Add global-dis... 17fc74d1b9 * lisp/follow.el (follow-mode): Restore mode line lighter.... f20c2e2f3d ; Compare process status against 127 exactly 2d203ffb7e Extract the common part of ruby-flymake-simple and ruby-fl... 09944d499a Add Rubocop Flymake backend c65a0ae7c4 ; Fix a typo 7ab7603125 Update nt/INSTALL.W64 (Bug#28601) 11db253c08 Remove incorrect NEWS item about VC state indicator (Bug#2... 2fdc01c036 * lisp/emacs-lisp/byte-run.el (defsubst): Doc fix. 735c8b516e Make c-defun-name analyze more thoroughly a function type ... 92f0c4cd56 Avoid bogus abbreviated file names if HOME changes 8d450453fa * lisp/emacs-lisp/byte-run.el (inline): Give it a doc. 37a3b4ea40 Fix erc keep-place module with new defaults (Bug#29111) 6c312605bf Add window divider faces to NS (bug#29353)
Paul Eggert [Sun, 26 Nov 2017 00:11:43 +0000 (16:11 -0800)]
Work around GCC bug 80776 on Fedora 27 x86
* src/buffer.c (Fgenerate_new_buffer_name): Pacify GCC 7.2.1 20170915 (Red Hat 7.2.1-2) on i686 with -Wformat-overflow -O2 by
using XINT rather than XFASTINT and by adding an eassume. This
works around GCC bug 80776.