Alex Branham [Fri, 8 Sep 2017 09:36:59 +0000 (12:36 +0300)]
New variable 'dired-confirm-killing-deleted-buffers'
* lisp/dired-x.el (dired-clean-confirm-killing-deleted-buffers):
New variable.
* lisp/dired.el (dired-clean-up-after-deletion): Kill buffers
visiting deleted files without confirming if
dired-clean-confirm-killing-deleted-buffers is nil. (Bug#28373)
* etc/NEWS: Document the change.
Ken Olum [Fri, 8 Sep 2017 09:08:49 +0000 (12:08 +0300)]
Fix Rmail editing with reapplying encoding to message body
* lisp/mail/rmailedit.el (rmail-cease-edit): If no
content-type in edited headers, look for one in original
headers and add it to edited headers. (Bug #26918)
Use a marker to track start of new body, so that
content-transfer-encoding gets applied only to body. (Bug #27353).
Ensure blank line at end of message after encoding, not
before.
Tak Kunihiro [Fri, 8 Sep 2017 08:52:47 +0000 (11:52 +0300)]
Make mouse clicks in Dired more customizable
* lisp/dired.el (dired-mouse-find-file): Allow callers to
specify functions to visit file/directory.
(dired-mouse-find-file-other-window)
(dired-mouse-find-file-other-frame): New functions to visit
files in another window/frame. (Bug#27435)
Eli Zaretskii [Fri, 8 Sep 2017 08:00:34 +0000 (11:00 +0300)]
Avoid compiler warnings on MS-Windows with GCC 6 and 7
* src/w32font.c (SUBRANGE): Use unsigned arithmetic for
bit-shifting, to avoid compiler warnings.
(w32font_text_extents): Tell GCC NGLYPHS is non-negative, to avoid
a warning. For details of the warning, see
http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00093.html.
* src/term.c (keys) [WINDOWSNT]: Don't define, as it is not used
in that build.
* src/sound.c (sound_perror): Ifdef away on WINDOWSNT, as this
function is not used in that build.
* configure.ac: Disable -Wsuggest-attribute=format on MS-Windows.
Eli Zaretskii [Fri, 8 Sep 2017 07:51:14 +0000 (10:51 +0300)]
Fix 'directory-file-name' on DOS_NT systems as well
* src/fileio.c (directory_file_name) [DOS_NT]: Fix the DOS_NT case
to be consistent with last change.
* test/src/fileio-tests.el (fileio-tests--odd-symlink-chars):
Disable on MS-Windows.
(fileio-tests--directory-file-name-dos-nt)
(fileio-tests--file-name-as-directory-dos-nt): New tests.
Wilson Snyder [Fri, 8 Sep 2017 03:24:28 +0000 (23:24 -0400)]
Fix various verilog-mode.el issues.
* lisp/progmodes/verilog-mode.el (verilog-expand-dirnames): Fix expanding
"*/*", msg2284. Reported by Jonathan Ferguson.
(ignore-errors): Fix ignore-errors error on Emacs 22.3, bug1177. Reported
by Victor Lau.
(verilog-getopt, verilog-getopt-file) (verilog-library-flags,
verilog-substitute-file-name-path): Support -F in verilog getopt files,
bug1171. Reported by George Cuan.
(verilog-do-indent): Fix misindenting symbols starting with t,
bug1169. Reported by Hoai Tran.
(verilog-read-auto-template-middle): Fix slow template matching on
AUTOINST. Reported by Jeffrey Huynh.
(verilog-pretty-expr): The extra whitespace addition before "=" operators
is now done only if the whole assignment block contains the 2-character
"<=" operator. Remove the unused argument _myre. Use `unless',
`save-excursion' and `when' functions where possible. Internal variables
refactored for clarity. Follow elisp convention for closing parentheses.
By Kaushal Modi.
(verilog-get-lineup-indent-2): Update docstring. Internal variables
refactored for clarity. Earlier EDPOS argument was expected to be a
marker; it is now renamed to END and is now expected to be a position.
Use `when' instead of `if'. By Kaushal Modi.
(electric-verilog-terminate-line): Remove the unused second argument from
`verilog-pretty-expr' call. By Kaushal Modi.
(verilog-calc-1): Fix indentation of a virtual class definition after a
typedef class, bug1080. By Kaushal Modi.
Don't use summary window to visit group buffer (bugfix)
* lisp/gnus/gnus-sum.el (gnus-summary-jump-to-group): Make sure that
the window to open the group buffer doesn't visit the summary buffer.
This fixes a bug: `gnus-summary-next-article' sometimes causes an error
by trying to select nonexistent summary window.
Paul Eggert [Fri, 8 Sep 2017 00:46:12 +0000 (17:46 -0700)]
Fix bug: (directory-file-name "///") returned "//"
* src/fileio.c (directory_file_name): For "///" and longer,
return "/", not "//", as per POSIX.
* test/src/fileio-tests.el (fileio-tests--directory-file-name)
(fileio-tests--file-name-as-directory): New tests.
Paul Eggert [Thu, 7 Sep 2017 07:10:05 +0000 (00:10 -0700)]
autogen.sh: omit bogus chatter if no .git
Problem reported by Angelo Graziosi in:
http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00045.html
* autogen.sh (git_config): Do not execut 'git' if $do_git fails.
Skip emacsclient tests if --enable-profiling was used
* test/lib-src/emacsclient-tests.el
(emacsclient-test-call-emacsclient): Make it a macro.
Handle "Profiling timer expired" return from emacsclient. (Bug#28319)
(emacsclient-test-alternate-editor-allows-arguments)
(emacsclient-test-alternate-editor-allows-quotes): Update for above.
Eli Zaretskii [Wed, 6 Sep 2017 18:00:29 +0000 (21:00 +0300)]
Fix a minor markup problem in ELisp manual
* doc/lispref/functions.texi (Mapping Functions): Fix the order of
@example and @group. For the details, see
http://lists.gnu.org/archive/html/bug-texinfo/2017-09/msg00007.html.
Mark Oteiza [Wed, 6 Sep 2017 17:17:05 +0000 (13:17 -0400)]
Add XDG desktop file parsing and tests
* lisp/xdg.el: Add support for Desktop Entry Specification.
(xdg--user-dirs-parse-line): Check if file is readable.
(xdg-desktop-group-regexp, xdg-desktop-entry-regexp): New variables.
(xdg--desktop-parse-line, xdg-desktop-read-file, xdg-desktop-strings):
New functions.
* test/lisp/xdg-tests.el:
* test/data/xdg/test.desktop:
* test/data/xdg/wrong.desktop: New files.
Allow customizing line length of ert backtraces in batch mode
* lisp/emacs-lisp/ert.el (ert-batch-backtrace-right-margin):
Make it a user option.
(ert-run-tests-batch): Handle ert-batch-backtrace-right-margin nil.
John Wiegley [Tue, 5 Sep 2017 13:24:25 +0000 (14:24 +0100)]
Remove an opinionated section on "What Eshell is not"
I don't find this information to accurately reflect possible use cases
for Eshell; plus, it doesn't offer much in the way of information,
just opinion.
Ken Brown [Tue, 5 Sep 2017 01:46:05 +0000 (21:46 -0400)]
Fix configure test for Xpm
Problem reported by Ashish Shukla in
https://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00020.html.
* configure.ac (HAVE_XPM) [HAVE_X11]: Include X11/xpm.h instead of
noX/xpm.h in configure test.
Paul Eggert [Mon, 4 Sep 2017 19:08:55 +0000 (12:08 -0700)]
Revert recent float→double Motif change
Problem reported by Martin Rudalics in:
http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00014.html
* src/xterm.c (xm_scroll_callback, xaw_jump_callback)
(x_set_toolkit_scroll_bar_thumb)
(x_set_toolkit_horizontal_scroll_bar_thumb):
Go back to using ‘float’ temporaries rather than ‘double’.
Although quite possibly this masks an underlying bug,
we lack time to look into that now.
* lisp/net/tramp-smb.el (tramp-smb-errors):
Add "NT_STATUS_CONNECTION_DISCONNECTED" and
"NT_STATUS_OBJECT_PATH_SYNTAX_BAD".
(tramp-smb-file-name-handler-alist): Use `tramp-handle-file-truename'.
(tramp-smb-do-file-attributes-with-stat): Return non-nil only
if one of the attributes is non-nil.
(tramp-smb-handle-file-local-copy): Use `file-truename'.
(tramp-smb-handle-file-truename): Move to tramp.el.
(tramp-smb-handle-insert-directory): Show symlinks.
(tramp-smb-handle-make-symbolic-link): Improve.
(tramp-smb-read-file-entry): Handle extended file modes in Samba.
* lisp/net/tramp.el (tramp-handle-add-name-to-file)
(tramp-handle-file-truename): New defuns.
* test/lisp/net/tramp-tests.el (tramp-test21-file-links): Extend test.
(tramp--test-check-files): Make check for "smb".
Mark Oteiza [Mon, 4 Sep 2017 07:40:30 +0000 (03:40 -0400)]
Embed JSON readtable into json-read
Also unroll dispatch into a cond.
* lisp/json.el (json-readtable): Remove.
(json-readtable-dispatch): New macro. Assimilate json-readtable.
(json-read): Use the macro.
Mark Oteiza [Mon, 4 Sep 2017 00:42:01 +0000 (20:42 -0400)]
Hexify strings in EWW search queries
Previously, inputting "cats & dogs" would lose dogs because the
ampersand signifies a query parameter. Instead, hexify each word while
preserving quotes with split-string.
* lisp/net/eww.el (eww--dwim-expand-url): Join hexified words together
with + separators, instead of replacing whitespace with +.
Alan Mackenzie [Sun, 3 Sep 2017 11:01:21 +0000 (11:01 +0000)]
Correct the fontification of quote marks after buffer changes in CC Mode.
* lisp/progmodes/cc-defs.el
(c-search-forward-char-property-with-value-on-char): New macro.
* lisp/progmodes/cc-mode.el (c-parse-quotes-before-change)
(c-parse-quotes-after-change): Rewrite the functions, simplifying
considerably, and removing unnecessary optimisations. Invalidate two caches
after manipulating text properties.
Alan Mackenzie [Sun, 3 Sep 2017 09:40:31 +0000 (09:40 +0000)]
Fix fontification of "operator~" in C++ Mode.
* lisp/progmodes/cc-langs.el (c-ambiguous-overloadable-or-identifier-prefices)
(c-ambiguous-overloadable-or-identifier-prefix-re): New c-lang-defconsts/vars.
* lisp/progmodes/cc-engine.el (c-forward-name): Do not try to parse "~" (and
two other symbols) as a cast without good evidence. Prefer an overloaded
operator in ambiguous cases.
Improve error messages for improper plists (Bug#27726)
* src/fns.c (Fplist_put, Flax_plist_get, Flax_plist_put)
(Fplist_member, syms_of_fns): Use ‘plistp’ as pseudo-predicate for
improper plists instead of ‘listp.’
* test/src/fns-tests.el (plist-get/odd-number-of-elements)
(lax-plist-get/odd-number-of-elements)
(plist-put/odd-number-of-elements)
(lax-plist-put/odd-number-of-elements)
(plist-member/improper-list): Add unit tests.
Reuben Thomas [Fri, 1 Sep 2017 22:41:36 +0000 (23:41 +0100)]
Fix a mis-binding in a test
* test/lisp/progmodes/python-tests.el
(python-shell-calculate-process-environment-3): Fix binding of
process-environment. A level of parens was missing.
This was found after Glenn Morris noticed a similar problem with the
patch for Bug#28319.
Reuben Thomas [Fri, 1 Sep 2017 20:21:38 +0000 (21:21 +0100)]
Stop emacsclient tests hanging (Bug#28319)
* test/lib-src/emacsclient-tests.el
(emacsclient-test-alternate-editor-allows-arguments): Use a
non-existent file to communicate with server, so that any existing
default server will not be hijacked (in fact, the test does
not need a server).
(emacsclient-test-alternate-editor-allows-quotes): Likewise.
Mark Oteiza [Thu, 31 Aug 2017 21:22:39 +0000 (17:22 -0400)]
Make ucs-names a hash table (Bug#28302)
* etc/NEWS: Mention the type change.
* lisp/descr-text.el (describe-char): Use gethash to access ucs-names.
Hardcode BEL's name into the function instead of needlessly mapping
over the hash table in the spirit of rassoc.
* lisp/international/mule-cmds.el (ucs-names): Fix variable and
function docstrings. Initialize a hash table for ucs-names--the
number of entries is 42845 here. Switch to hash-table
getters/setters.
(mule--ucs-names-annotation): Use hash-table getter.
(char-from-name): Upcase the string if ignore-case is truthy.
* lisp/leim/quail/latin-ltx.el: Use maphash instead of dolist.
Alan Third [Thu, 31 Aug 2017 19:42:35 +0000 (20:42 +0100)]
Remove unneeded version checks (bug#28222)
* src/macfont.h (CGContextSetFontSmoothingStyle): Remove version
check.
* src/macfont.m (macfont_draw): Remove version check, and test for
existence of CGContextSetFontSmoothingStyle.
Alan Mackenzie [Thu, 31 Aug 2017 18:08:21 +0000 (18:08 +0000)]
Correct the fontification of C++ Mode enclosed declarations.
* lisp/progmodes/cc-fonts.el (c-font-lock-enclosing-decls): abolish the
spurious check that the character before the start of an enclosed declaration
must be ; or }. It might also be {.
Martin Rudalics [Thu, 31 Aug 2017 07:36:46 +0000 (09:36 +0200)]
Restrict fix of Bug#24963 and Bug#25887 to GTK builds
* src/xterm.c (handle_one_xevent): Restrict earlier fix of
Bug#24963 and Bug#25887 to avoid that a non-GTK Emacs won't
react to state changes received via ConfigureNotify.
Samuel Freilich [Wed, 23 Aug 2017 17:40:45 +0000 (13:40 -0400)]
Do not split line before width of fill-prefix
When auto-filling a paragraph, don't split a line before the width of the
fill-prefix, creating a subsequent line that is as long or longer (Bug#20774).
* lisp/simple.el (do-auto-fill): Only consider break-points that are later in
the line than the width of the fill-prefix. This is a more general solution
than the previous logic, which only skipped over the exact fill-prefix. The
fill-prefix doesn't necessarily match the prefix of the first line of a
paragraph in adaptive-fill-mode.
Noam Postavsky [Sat, 19 Aug 2017 14:29:05 +0000 (10:29 -0400)]
Support lazy loading for autogenerated usage docstrings too (Bug#27748)
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defmumble):
Consider any documentation that ended up in code as a docstring (e.g.,
autogenerated (fn ARG1 ARG2) type things), not just what the user
passed.
Paul Eggert [Wed, 30 Aug 2017 21:45:52 +0000 (14:45 -0700)]
Quote file-truename symlink to "../foo:bar:"
Problem reported by Michael Albinus (Bug#28264#19).
* lisp/files.el (files--splice-dirname-file): Fix bug where
a relative symlink to "../foo:bar:" did not quote the result.
Reuben Thomas [Thu, 1 Dec 2016 15:21:57 +0000 (15:21 +0000)]
Add support for arguments in emacsclient's ALTERNATE_EDITOR (Bug #25082)
* lib-src/emacsclient.c (fail): Parse ALTERNATE_EDITOR, or
corresponding command-line argument, into quote- or space-separated
tokens. If a token starts with a quote, then it naturally is expected
to end with a quote; escaping is not supported. This is enough to cope
with the typical case of requiring the initial path to be quoted,
common on Windows where it may contain spaces.
* etc/NEWS: Document.
* doc/emacs/misc.texi: Likewise.
* doc/man/emacsclient.1: Tweak to remove the implication that only an
editor can be specified (the manual already mentions a “command”).
Fix a small error where “EDITOR” is referred to rather than
“ALTERNATE_EDITOR”.
* test/lib-src/emacsclient-tests.el: Add tests.
* lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link):
Do not expand TARGET, it could be remote.
(tramp-sh-handle-file-truename): Check for cyclic symlink also
in case of readlink. Quote result if it looks remote.
(tramp-sh-handle-file-local-copy): Use `file-truename'.
* test/lisp/net/tramp-tests.el (tramp-test08-file-local-copy)
(tramp-test09-insert-file-contents): Test also file missing.
(tramp-test21-file-links): Extend test.
Noam Postavsky [Sun, 13 Aug 2017 14:06:45 +0000 (10:06 -0400)]
Minor simplification for byte-compile-constant-push
* lisp/emacs-lisp/bytecomp.el (byte-compile-constant): Move the meat
of the code from here...
(byte-compile-constant-push): ... to here. No need to bind
byte-compile--for-effect anymore.
Paul Eggert [Wed, 30 Aug 2017 02:17:54 +0000 (19:17 -0700)]
Prefer file-name-quote to concat "/:"
Suggested by Michael Albinus (Bug#28264#13).
* lisp/files.el (files--splice-dirname-file): Use file-name-quote
rather than attempting to do it by hand.
Paul Eggert [Tue, 29 Aug 2017 21:52:57 +0000 (14:52 -0700)]
Be more conservative in link time optimization doc
While testing --enable-link-time-optimization with GCC 7.1.1
I ran into a serious GCC code-generation bug which makes me
think that --enable-link-time-optimization should be
discouraged for typical installs (Bug#28213). See:
https://bugzilla.redhat.com/show_bug.cgi?id=1486455
Paul Eggert [Tue, 29 Aug 2017 21:35:37 +0000 (14:35 -0700)]
Make garbage collection more conservative
Check for a pointer anywhere within the object, as opposed to just
the start of the object. This is needed for gcc -Os -flto on
x86-64 (Bug#28213). This change means that the garbage collector
is more conservative, and will incorrectly keep objects that it
does not need to, but that is better than incorrectly discarding
objects that should be kept.
* src/alloc.c (ADVANCE, VINDEX): Now functions, not macros;
this is easier to debug.
(setup_on_free_list): Rename from SETUP_ON_FREE_LIST.
Now a function with two args, not a macro with three.
All callers changed.
(live_string_holding, live_cons_holding, live_symbol_holding)
(live_misc_holding, live_vector_holding, live_buffer_holding):
New functions, which check for any object containing the addressed
byte, not just for an object at the given address.
(live_string_p, live_cons_p, live_symbol_p, live_misc_p)
(live_vector_p, live_buffer_p):
Redefine in terms of the new functions.
(live_float_p): Refactor slightly to match the new functions.
(mark_maybe_object, mark_maybe_pointer): Use the new functions.
Don’t bother checking mark bits, as mark_object already does that,
and omitting the checks here simplifies the code. Although
mark_maybe_object can continue to insist that tagged pointers
still address the start of the object, mark_maybe_pointer now is
more conservative and checks for pointers anywhere into an object.
Paul Eggert [Tue, 29 Aug 2017 21:20:47 +0000 (14:20 -0700)]
Improve stack-top heuristic
This is needed for gcc -Os -flto on x86-64; otherwise, GC misses part
of the stack when scanning for heap roots, causing Emacs to crash
later (Bug#28213). The problem is that Emacs's hack for getting an
address near the stack top does not work when link-time optimization
moves stack variables around.
* configure.ac (HAVE___BUILTIN_FRAME_ADDRESS): New macro.
* lib-src/make-docfile.c (DEFUN_noinline): New constant.
(write_globals, scan_c_stream): Support noinline.
* src/alloc.c (NEAR_STACK_TOP): New macro.
(SET_STACK_TOP_ADDRESS): Use it.
(flush_stack_call_func, Fgarbage_collect): Now noinline.
Paul Eggert [Tue, 29 Aug 2017 19:49:22 +0000 (12:49 -0700)]
Align stack bottom properly.
This is needed for gcc -Os -flto on x86-64 (Bug#28213).
* src/emacs.c (main): Align stack-bottom variable as a pointer,
since mark_memory requires this.
Eli Zaretskii [Tue, 29 Aug 2017 16:39:15 +0000 (19:39 +0300)]
Document '--module-assertions'
* doc/emacs/cmdargs.texi (Initial Options): Document the
'--module-assertions' command-line option.
* doc/lispref/loading.texi (Dynamic Modules): Add a
cross-reference to the description of '--module-assertions'.
* etc/NEWS: Update the NEWS entry for --module-assertions.
Michael Albinus [Mon, 28 Aug 2017 16:08:16 +0000 (18:08 +0200)]
Further fixes in tramp-smb.el
* lisp/net/tramp-smb.el (tramp-smb-handle-file-truename): New defun.
(tramp-smb-file-name-handler-alist): Use it.
(tramp-smb-handle-make-symbolic-link): Unquote target.
* test/lisp/net/tramp-tests.el
(tramp--test-ignore-make-symbolic-link-error): New defmacro.
(tramp-test18-file-attributes, tramp-test21-file-links)
(tramp--test-check-files): Use it.