Paul Eggert [Tue, 12 Dec 2017 20:59:57 +0000 (12:59 -0800)]
Reimplement Lisp_Object as pointer-to-incomplete
This makes Lisp_Object values opaque pointers instead of integers,
which helps avoid the same sort of typos that
CHECK_LISP_OBJECT_TYPE helps to avoid, without having to wrap
pointers inside structures. This also looks forward to supporting
-fcheck-pointer-bounds.
* etc/DEBUG:
* src/.gdbinit (Lisp_Object_Printer.to_string):
Lisp_Object can be a pointer type now.
* src/alloc.c (macro_XPNTR, XPNTR):
* src/emacs-module.c (value_to_lisp_bits, lisp_to_value_bits):
* src/lisp.h (lisp_h_XLI, lisp_h_XIL):
(lisp_h_XUNTAG) [USE_LSB_TAG]:
(XUNTAG) [!USE_LSB_TAG]:
(Lisp_Object, TAG_PTR, make_lisp_symbol):
Support new Lisp_Object implementation as a pointer to an
incomplete type. Keep pointers pointers, as much as possible.
* src/alloc.c (macro_XPNTR_OR_SYMBOL_OFFSET, XPNTR_OR_SYMBOL_OFFSET):
Remove. All uses replaced by plain XPNTR.
* src/emacs-module.c: Work around GCC bug 83162.
* src/lisp.h (LISP_WORDS_ARE_POINTERS, lisp_h_XLP, lisp_h_XPL):
(XLP, XPL) [DEFINE_KEY_OPS_AS_MACROS]:
New macros.
(Lisp_Word, untagged_ptr, Lisp_Word_tag): New types.
(XLP, XPL): New inline functions.
(TAG_PTR): Now expands to an initializer, not an expression.
All uses changed.
(TAG_SYMOFFSET, XLI_BUILTIN_LISPSYM): Remove. All uses removed.
(LISPSYM_INITIALLY): Redo in terms of the new TAG_PTR.
(NIL_IS_ZERO): Redo without XLI_BUILTIN_LISPSYM.
* src/xwidget.c (webkit_javascript_finished_cb): Use XPL
instead of XIL with a non-EMACS_INT arg.
(Fxwidget_webkit_execute_script): Use XLP instead of XLI
followed by two conversions.
Ted Zlatanov [Tue, 12 Dec 2017 19:46:54 +0000 (14:46 -0500)]
Rename gnus-cloud method setter
* lisp/gnus/gnus-srvr.el (gnus-server-set-cloud-method-server)
(gnus-server-make-menu-bar, gnus-server-mode-map): Rename
`gnus-server-toggle-cloud-method-server' to
`gnus-server-set-cloud-method-server' (Bug#28845).
(gnus-server-toggle-cloud-server): Use "toggle" in docstring.
* lisp/net/tramp-cache.el (tramp-flush-file-properties)
(tramp-flush-directory-properties, tramp-flush-connection-properties):
Rename from `tramp-flush-file-property',`tramp-flush-directory-property'
and `tramp-flush-connection-property', respectively.
(tramp-flush-file-property, tramp-flush-connection-property):
New defuns.
Stefan Monnier [Tue, 12 Dec 2017 14:11:17 +0000 (09:11 -0500)]
* lisp/subr.el (run-mode-hooks): Set parse-sexp-lookup-properties
if syntax-propertize-function is set (bug#24749).
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/textmodes/texinfo.el (texinfo-mode):
* lisp/textmodes/mhtml-mode.el (mhtml-mode):
* lisp/progmodes/js.el (js-mode): Don't set parse-sexp-lookup-properties.
Eli Zaretskii [Sun, 10 Dec 2017 16:36:37 +0000 (18:36 +0200)]
Support dynamic loading of libjansson on MS-Windows
* src/json.c [WINDOWSNT]: Define fn_* function pointers to jansson
functions.
(json_delete) [WINDOWSNT]: A wrapper around fn_json_delete, needed
by json_decref.
(init_json_functions) [WINDOWSNT]: New function.
(Fjson_serialize, Fjson_insert, Fjson_parse_string)
(Fjson_parse_buffer) [WINDOWSNT]: Call init_json_functions if
needed, and record JSON in Vlibrary_cache.
* src/emacs.c (main): Don't call init_json on WINDOWSNT.
* src/w32fns.c (syms_of_w32fns): DEFSYM "json".
* lisp/term/w32-win.el (dynamic-library-alist): Add JSON DLL to
the list.
* configure.ac (HAVE_JSON): Empty JSON_LIBS for MinGW.
* nt/INSTALL.W64:
* nt/INSTALL: Add information about libjansson.
Wilfred Hughes [Sun, 10 Dec 2017 13:34:06 +0000 (13:34 +0000)]
Ensure that we can find definitions when buffer is narrowed
find-function-search-for-symbol will reuse the existing buffer if
we've already opened the file that contains this symbol. However, if
the user has narrowed that buffer, we can't find definitions outside
the narrowed area.
Instead, search the whole file to find definitions, and teach the help
buttons to widen if necessary.
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol):
Search the whole buffer for the target symbol.
* lisp/help-mode.el: Help buttons now widen the target buffer, if
narrowing is in effect and the target position is not in that range.
* src/lisp.h: Declaration for init_json and syms_of_json.
* src/emacs.c (main): Enable JSON functions.
* src/eval.c (internal_catch_all, internal_catch_all_1): New helper
functions to catch all signals.
(syms_of_eval): Add uninterned symbol to signify out of memory.
* src/Makefile.in (JSON_LIBS, JSON_CFLAGS, JSON_OBJ, EMACS_CFLAGS)
(base_obj, LIBES): Compile json.c if --with-json is enabled.
* test/src/json-tests.el (json-serialize/roundtrip)
(json-serialize/object, json-parse-string/object)
(json-parse-string/string, json-serialize/string)
(json-parse-string/incomplete, json-parse-string/trailing)
(json-parse-buffer/incomplete, json-parse-buffer/trailing): New unit
tests.
* doc/lispref/text.texi (Parsing JSON): New manual section.
Raise an error when detecting old-style backquotes.
They have been deprecated for a decade now.
* src/lread.c (Fload): Don't use record_unwind_protect to warn about
old-style backquotes any more. They now generate a hard error.
(read1): Signal an error when detecting old-style backquotes. Remove
unused label.
(syms_of_lread): Remove unused internal variable
'lread--old-style-backquotes'.
(load_error_old_style_backquotes): Rename from
'load_warn_oldstyle_backquotes'. Signal an error.
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Remove check
from byte compiler. It isn't triggered any more.
* test/src/lread-tests.el (lread-tests--old-style-backquotes): Adapt
unit test.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--old-style-backquotes)
(bytecomp-tests-function-put): Adapt unit tests.
Michael Albinus [Sat, 9 Dec 2017 12:22:52 +0000 (13:22 +0100)]
Sync with Tramp 2.4.0-pre
* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.4.0-pre".
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
Use `tramp-handle-file-directory-p'.
(tramp-adb-parse-device-names)
(tramp-adb-handle-expand-file-name)
(tramp-adb-handle-file-truename, tramp-adb-handle-process-file):
Adapt `tramp-make-tramp-file-name' call.
(tramp-adb-handle-file-directory-p): Remove.
(tramp-adb-maybe-open-connection): Do not set
tramp-current-*.
* lisp/net/tramp-cmds.el (tramp-cleanup-connection): Do not set
tramp-current-*.
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist):
Use `tramp-handle-file-directory-p'.
(tramp-gvfs-dbus-event-error): Trace with verbosity 6.
(tramp-gvfs-do-copy-or-rename-file): Use `file-truename'.
(tramp-gvfs-handle-file-directory-p): Remove.
(tramp-gvfs-handler-askpassword): Do not set tramp-current-*.
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band)
(tramp-sh-handle-start-file-process)
(tramp-maybe-open-connection, tramp-get-remote-path): Do not
set tramp-current-*.
(tramp-maybe-open-connection): Set "password-vector" property.
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Use `tramp-handle-file-accessible-directory-p' and
`tramp-handle-file-directory-p'.
(tramp-smb-handle-copy-directory, tramp-smb-handle-file-acl)
(tramp-smb-handle-set-file-acl)
(tramp-smb-maybe-open-connection): Do not set tramp-current-*.
(tramp-smb-handle-file-directory-p): Remove.
(tramp-smb-handle-make-symbolic-link):
Use `tramp-get-connection-buffer' rather than `buffer-name'.
* lisp/net/tramp.el (tramp-current-method, tramp-current-user)
(tramp-current-domain, tramp-current-host)
(tramp-current-port): Remove.
(tramp-dissect-file-name): No special handling of localname anymore.
(tramp-make-tramp-file-name): Reimplemnt with new signature.
(tramp-completion-make-tramp-file-name): Fix docstring.
(tramp-get-buffer, tramp-handle-file-name-as-directory)
(tramp-handle-file-name-directory)
(tramp-check-cached-permissions, tramp-local-host-p)
(tramp-get-remote-tmpdir, tramp-clear-passwd):
Adapt `tramp-make-tramp-file-name' call.
(tramp-completion-handle-file-name-all-completions)
(tramp-action-login, tramp-read-passwd): Do not set
tramp-current-*.
(tramp-handle-file-directory-p): New defun.
(tramp-handle-verify-visited-file-modtime): Remove superfluous
`with-parsed-tramp-file-name'.
(tramp-process-actions, tramp-read-passwd):
Use "password-vector" property.
(tramp-call-process, tramp-call-process-region): No special
setting of vec.
(tramp-read-passwd): Handle "login-as" property.
* test/lisp/net/tramp-tests.el (tramp-test21-file-links):
Special code for "smb".
Michael Albinus [Wed, 6 Dec 2017 19:49:30 +0000 (20:49 +0100)]
Fix Bug#29579
* lisp/files.el (file-name-non-special):
Inhibit `file-name-handler-alist' only for some operations.
Add missing operations. (Bug#29579)
* lisp/net/tramp-compat.el (tramp-compat-file-name-quote):
Do not quote if it is quoted already.
* lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory):
Use `copy-tree' but `copy-sequence'.
* lisp/net/tramp.el (tramp-handle-file-truename): Handle several
trailing slashes correctly.
* test/lisp/net/tramp-tests.el (tramp-test11-copy-file)
(tramp-test12-rename-file, tramp-test24-file-acl)
(tramp-test25-file-selinux, tramp--test-check-files):
Handle also quoted file names.
(tramp-test21-file-links): Fix file name quoting test.
(tramp-test24-file-acl): Be more robust for "smb" method.
(tramp-test35-make-auto-save-file-name): Enable hidden test cases.
Michael Albinus [Sat, 9 Dec 2017 09:13:02 +0000 (10:13 +0100)]
Merge from origin/emacs-26
1fdac2d65c Don't add newlines in minibuffer history de68f337e3 modhelp.py: Support Python 3 (Bug#24954) afb04f7f3c Use forward slashes for python w32 config example (Bug#21656)
Paul Eggert [Fri, 8 Dec 2017 20:11:25 +0000 (12:11 -0800)]
Fix daylight-saving inference for Irish time
* lisp/calendar/cal-dst.el (calendar-dst-find-data): Do not assume
that daylight-saving time has a greater UT offset than standard
time. The reverse is true in Ireland, where standard time "IST"
is UTC +01 in summer and daylight-saving time "GMT" is UTC +00 in
winter. The current Irish rules are given by the POSIX setting
TZ='IST-1GMT0,M10.5.0,M3.5.0/1'.
Paul Eggert [Fri, 8 Dec 2017 02:07:54 +0000 (18:07 -0800)]
Fix zero-padding bug with (format "%#08x" n)
Problem reported by Gustaf Waldemarson (Bug#29609).
* src/editfns.c (styled_format):
Put zero padding after a leading "0x", not before.
* test/src/editfns-tests.el (format-sharp-0-x): New test.
Michael Albinus [Wed, 6 Dec 2017 19:49:30 +0000 (20:49 +0100)]
Fix Bug#29579
* lisp/files.el (file-name-non-special):
Inhibit `file-name-handler-alist' only for some operations.
Add missing operations. (Bug#29579)
* lisp/net/tramp-compat.el (tramp-compat-file-name-quote):
Do not quote if it is quoted already.
* lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory):
Use `copy-tree' but `copy-sequence'.
* lisp/net/tramp.el (tramp-handle-file-truename): Handle several
trailing slashes correctly.
* test/lisp/net/tramp-tests.el (tramp-test11-copy-file)
(tramp-test12-rename-file, tramp-test24-file-acl)
(tramp-test25-file-selinux, tramp--test-check-files):
Handle also quoted file names.
(tramp-test21-file-links): Fix file name quoting test.
(tramp-test24-file-acl): Be more robust for "smb" method.
(tramp-test35-make-auto-save-file-name): Enable hidden test cases.
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").
* 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.