5 years agoFix shr.el/image build problem master origin/HEAD
Lars Ingebrigtsen [Wed, 20 Jul 2016 14:47:24 +0000 (16:47 +0200)]
Fix shr.el/image build problem

Fixes: bug#24035

* lisp/net/shr.el: Require image, since some builds seem to
break without it (bug#24035).

5 years agoBring the Gnus Cloud package into working order.
Ted Zlatanov [Mon, 11 Jul 2016 15:01:26 +0000 (11:01 -0400)]
Bring the Gnus Cloud package into working order.

* lisp/gnus/gnus-sync.el: Removed in favor of gnus-cloud.el.

* lisp/gnus/gnus-cloud.el: Autoload EPG functions. Change storage format to
simplify non-file data.
(gnus-cloud-storage-method): New defcustom to support nil, Base64,
Base64+gzip, or EPG encoding on the Gnus Cloud IMAP server. Defaults to
EPG if that's available, Base64+gzip otherwise.
(gnus-cloud-interactive): New defcustom to make Gnus Cloud operations
interactive, defaults to enabled.
(gnus-cloud-group-name): New variable for the Gnus Cloud group name.
(gnus-cloud-make-chunk): Tag with "Gnus-Cloud-Version" instead of just
(gnus-cloud-insert-data): Simplify and support :newsrc-data entries.
(gnus-cloud-encode-data, gnus-cloud-decode-data): Support various
storage methods as per gnus-cloud-storage-method.
(gnus-cloud-parse-chunk): Look for "Gnus-Cloud-Version" marker.
(gnus-cloud-parse-version-1): Fix parsing loop bug. Handle :newsrc-data
(gnus-cloud-update-all): Handle :newsrc-data entries and dispatch to
file and data handlers.
(gnus-cloud-update-newsrc-data): New function to handle :newrsc-data
(gnus-cloud-update-file): Rework to support gnus-cloud-interactive and
be more careful.
(gnus-cloud-delete-file): Remove; merged into gnus-cloud-update-file.
(gnus-cloud-file-covered-p, gnus-cloud-all-files)
(gnus-cloud-files-to-upload, gnus-cloud-ensure-cloud-group)
(gnus-cloud-add-timestamps, gnus-cloud-available-chunks)
(gnus-cloud-prune-old-chunks): Fix indentation.
(gnus-cloud-timestamp): New function to make a standard Gnus Cloud
(gnus-cloud-file-new-p): Use it.
(gnus-cloud-upload-all-data): Add interactive convenience function to
upload all data.
(gnus-cloud-upload-data): Make interactive; collect files and newsrc
data separately; refresh Gnus Cloud group after insert.
(gnus-cloud-download-all-data): Add interactive convenience function to
download all data.
(gnus-cloud-download-data): Rework to support "Gnus-Cloud-Version"
marker and different storage methods.
(gnus-cloud-host-server-p): New function to check if a server is the
Gnus Cloud host.
(gnus-cloud-collect-full-newsrc): Tag entries with :newsrc-data.
(gnus-cloud-host-acceptable-method-p): New function so
other code can check if a server method can host the Gnus cloud.
(gnus-cloud-storage-method): Use 'radio instead of 'choice for better UI.
(gnus-cloud-method): Make this a defcustom and note how to set it.

* lisp/gnus/gnus-group.el (gnus-group-cloud-map): Add Gnus Cloud autoloaded
keybindings under the `~' prefix.

* lisp/gnus/gnus-srvr.el (gnus-server-mode-map, gnus-server-make-menu-bar)
(gnus-server-cloud, gnus-server-cloud-host)
(gnus-server-font-lock-keywords, gnus-server-insert-server-line)
(gnus-server-toggle-cloud-method-server): Support Gnus Cloud
synchronized servers and synchronization host server toggling (`i' and
`I') and visual display.
(gnus-server-toggle-cloud-method-server): Use
(gnus-server-toggle-cloud-method-server): Use custom-set-variables to
set the gnus-cloud-method. Ask the user if it's OK to upload the data
right now.

* doc/misc/gnus.texi: Document Gnus Cloud package.

5 years agoRemove CHECK_FRAME_FONT cruft from bytecode.c
Paul Eggert [Tue, 12 Jul 2016 23:16:10 +0000 (01:16 +0200)]
Remove CHECK_FRAME_FONT cruft from bytecode.c

* src/bytecode.c [CHECK_FRAME_FONT]: Do not include frame.h, xterm.h.
Remove some old ‘#if 0’ code.

5 years agoWork around GCC bug 54561 in a better way
Paul Eggert [Wed, 20 Jul 2016 08:31:33 +0000 (10:31 +0200)]
Work around GCC bug 54561 in a better way

The new approach is less selective, but also less intrusive on C code.
* src/bytecode.c, src/image.c, src/keyboard.c: Ignore -Wclobbered.
* src/conf_post.h (NONVOLATILE): Remove.  All uses removed.

5 years agoFix port to glibc 2.24 (pre-release) + ppc64
Paul Eggert [Wed, 20 Jul 2016 07:16:49 +0000 (09:16 +0200)]
Fix port to glibc 2.24 (pre-release) + ppc64

* src/callproc.c (child_setup): Use emacs_exec_file
so that ASLR is enabled in the child process.
* src/emacs.c: Move some personality details into sys/sysdep.c.
Do not include <sys/personality.h>.
(main): Disable ASLR earlier, so that we don’t chdir twice.
* src/lisp.h (disable_address_randomization): New decl.
* src/sysdep.c (disable_address_randomization)
[HAVE_PERSONALITY_ADDR_NO_RANDOMIZE]: Move personality details
here from emacs.c.
(emacs_exec_file): New function.

5 years agoPrevent bar cursor overwriting next glyph (bug#16856)
Alan Third [Sun, 17 Jul 2016 13:44:52 +0000 (14:44 +0100)]
Prevent bar cursor overwriting next glyph (bug#16856)

* src/nsterm.m (ns_draw_window_cursor): Test glyph width vs cursor width
before setting final size.

5 years ago; Spelling fix
Paul Eggert [Tue, 19 Jul 2016 16:51:46 +0000 (18:51 +0200)]
; Spelling fix

5 years agoFix 'transpose-regions' when LEAVE-MARKERS arg is non-nil
Eli Zaretskii [Tue, 19 Jul 2016 15:59:41 +0000 (18:59 +0300)]
Fix 'transpose-regions' when LEAVE-MARKERS arg is non-nil

* src/insdel.c (adjust_markers_bytepos): New function.
* src/lisp.h (adjust_markers_bytepos): Add prototype.
* src/insdel.c (replace_range, replace_range_2):
* src/editfns.c (Ftranspose_regions): Call
adjust_markers_bytepos.  (Bug#5131)

* test/src/editfns-tests.el (transpose-test-reverse-word)
(transpose-test-get-byte-positions): New functions.
(transpose-nonascii-regions-test-2): New tests.

5 years agoMake gif animation work (bug#24004)
Katsumi Yamaoka [Tue, 19 Jul 2016 07:34:54 +0000 (07:34 +0000)]
Make gif animation work (bug#24004)

* lisp/image.el (image-animate-timeout): Fix the logic that tests if
an animation is too big (bug#24004).

5 years ago* lisp/simple.el (undo-amalgamate-change-group): New function
Stefan Monnier [Tue, 19 Jul 2016 01:04:39 +0000 (21:04 -0400)]
* lisp/simple.el (undo-amalgamate-change-group): New function

* lisp/emulation/viper-cmd.el (viper-adjust-undo): Use it.
(viper-set-complex-command-for-undo): Save current state with
* lisp/emulation/viper-init.el (viper-undo-needs-adjustment)
(viper-buffer-undo-list-mark): Remove.

5 years agoKeep w32 environment settings internal only
Noam Postavsky [Wed, 29 Jun 2016 22:52:57 +0000 (18:52 -0400)]
Keep w32 environment settings internal only

* src/emacs.c (main) [WINDOWSNT]: Move init_environment calls after the
set_initial_environment call.  This prevents Emacs' modifications to the
environment from contaminating Vprocess_environment and
Vinitial_environment (Bug #10980).
* src/callproc.c (getenv_internal) [WINDOWSNT]: Consult Emacs' internal
environment in as a fallback to Vprocess_environment.
* test/src/callproc-tests.el (initial-environment-preserved): New Test.

5 years agoBetter documentation for cl-reduce (bug#24014)
Nicolas Petton [Mon, 18 Jul 2016 12:12:50 +0000 (14:12 +0200)]
Better documentation for cl-reduce (bug#24014)

* lisp/emacs-lisp/cl-seq.el (cl-reduce): Explain what reducing means.

5 years ago; Revert "Replace eldoc-documentation-function with a hook"
Dmitry Gutov [Sun, 17 Jul 2016 23:22:24 +0000 (02:22 +0300)]
; Revert "Replace eldoc-documentation-function with a hook"

This reverts commit 5811404f0b86c9fa92c3e0b22505a9bb05f04145.

It doesn't have the consensus, as evidenced by

5 years ago; Revert "Use eldoc-documentation-functions"
Dmitry Gutov [Sun, 17 Jul 2016 23:17:06 +0000 (02:17 +0300)]
; Revert "Use eldoc-documentation-functions"

This reverts commit 001d88b62ecb8163a148656acb103b354ce7613a.

It doesn't have the consensus, as evidenced by

5 years agoRemove separate pool for popup dialogs (bug#23856)
Alan Third [Wed, 29 Jun 2016 19:17:18 +0000 (20:17 +0100)]
Remove separate pool for popup dialogs (bug#23856)

* src/nsmenu.m (pop_down_menu, ns_popup_dialog): Remove references to
autorelease pool and Popdown_data struct.

5 years agoUse eldoc-documentation-functions
Mark Oteiza [Sun, 17 Jul 2016 16:49:57 +0000 (12:49 -0400)]
Use eldoc-documentation-functions

* lisp/hexl.el (hexl-mode):
* lisp/ielm.el (inferior-emacs-lisp-mode):
* lisp/progmodes/cfengine.el (cfengine3-mode):
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode):
* lisp/progmodes/octave.el (octave-mode, inferior-octave-mode):
* lisp/progmodes/python.el (python-mode):
* lisp/simple.el (read--expression): Add buffer-locally to hook

5 years agoOptimize ucs-normalize.el compilation
Noam Postavsky [Sat, 16 Jul 2016 02:10:33 +0000 (22:10 -0400)]
Optimize ucs-normalize.el compilation

* lisp/international/ucs-normalize.el (ucs-normalize-combining-chars-regexp):
(quick-check-list-to-regexp): Use regexp-opt-charset instead of
* lisp/international/ucs-normalize.el (quick-check-list): Reuse a single
temp buffer for the whole loop.

5 years agoAdd tests for ucs-normalize.el
Noam Postavsky [Sat, 16 Jul 2016 01:18:08 +0000 (21:18 -0400)]
Add tests for ucs-normalize.el

Some tests are marked as expected to fail.

* test/lisp/international/ucs-normalize-tests.el: New tests.
* admin/unidata/NormalizationTest.txt: Add data for tests.
* admin/unidata/README: Add URL for NormalizationTest.txt.
* admin/notes/unicode: Add note about running (and updating the data
for) the new tests.  Remove note about normalization being unsupported.

5 years agoFix cursor display (bug#23993)
Alan Third [Fri, 15 Jul 2016 20:02:47 +0000 (21:02 +0100)]
Fix cursor display (bug#23993)

* src/xdisp.c (get_phys_cursor_geometry): Fix invalid C operator.

5 years agoStop worrying about Alliant in bytecode.c
Paul Eggert [Fri, 15 Jul 2016 20:15:43 +0000 (22:15 +0200)]
Stop worrying about Alliant in bytecode.c

* src/bytecode.c (PUSH): Remove workaround for long-obsolete compiler.

5 years agoRemove BYTE_MAINTAIN_TOP
Paul Eggert [Fri, 15 Jul 2016 20:15:42 +0000 (22:15 +0200)]

It is no longer needed now that we assume GC_MARK_STACK ==
* src/bytecode.c (BYTE_MAINTAIN_TOP): Remove.
All uses removed, and code simplified accordingly.
are always no-ops now.  All uses removed.
(MAYBE_GC): Remove.  All uses replaced by maybe_gc,
since it is now equivalent.

5 years agoRemove now-inaccurate bytecode comments
Paul Eggert [Fri, 15 Jul 2016 20:15:42 +0000 (22:15 +0200)]
Remove now-inaccurate bytecode comments

* src/bytecode.c: Remove comments that are no longer accurate.
Most of these are actually old ChangeLog entries.

5 years agoPort to glibc 2.24 (pre-release) + ppc64
Paul Eggert [Fri, 15 Jul 2016 11:07:09 +0000 (13:07 +0200)]
Port to glibc 2.24 (pre-release) + ppc64

Inspired by a suggestion by Florian Weimer in:
Rename from HAVE_PERSONALITY_LINUX32, and check for
ADDR_NO_RANDOMIZE (the crucial thing) instead of for LINUX32.
All uses changed.
Use ADDR_NO_RANDOMIZE from personality.h rather than inventing the
flag ourselves.  Just set that flag, rather than also setting the
persona.  When doing it, avoid functions like putenv that may
allocate memory.

5 years agoRevert "Add a couple cells to lisp-prettify-symbols-alist"
Mark Oteiza [Thu, 14 Jul 2016 22:23:40 +0000 (18:23 -0400)]
Revert "Add a couple cells to lisp-prettify-symbols-alist"

This reverts commit bdda4855c635ecf4135e23321bdba023e9ae65c9.

5 years ago* lisp/simple.el (shell-command): Add save-match-data comment
Stefan Monnier [Thu, 14 Jul 2016 13:45:05 +0000 (09:45 -0400)]
* lisp/simple.el (shell-command): Add save-match-data comment

5 years agoCC Mode: correct incorrect invocation of parse-partial-sexp.
Alan Mackenzie [Thu, 14 Jul 2016 12:42:17 +0000 (12:42 +0000)]
CC Mode: correct incorrect invocation of parse-partial-sexp.

Fixes bug #23944.

* lisp/progmodes/cc-engine.el (c-literal-limits): make the sixth argument of
an invocation of parse-partial-sexp 'syntax-table, not the fourth.

5 years agoFix configure summary for hybrid malloc configurations
Andreas Schwab [Thu, 14 Jul 2016 08:26:24 +0000 (10:26 +0200)]
Fix configure summary for hybrid malloc configurations

* ("$hybrid_malloc" = yes): Set GNU_MALLOC to no,
parenthesize value of GNU_MALLOC_reason.

5 years agoFix delete-duplicate-lines
Stephen Berman [Thu, 14 Jul 2016 07:55:28 +0000 (09:55 +0200)]
Fix delete-duplicate-lines

* lisp/sort.el (delete-duplicate-lines): Delete duplicate
first line when operating backward (bug#23863).

5 years agoRemove unused SHEAP_OBJ
Andreas Schwab [Thu, 14 Jul 2016 07:29:17 +0000 (09:29 +0200)]
Remove unused SHEAP_OBJ

* (base_obj): Remove $(SHEAP_OBJ).

5 years ago* lisp/gnus/mm-decode.el (mm-convert-shr-links):
Katsumi Yamaoka [Thu, 14 Jul 2016 02:19:24 +0000 (02:19 +0000)]
* lisp/gnus/mm-decode.el (mm-convert-shr-links):
Use shr-image-map instead of shr-map (bug#23964).

5 years ago* lisp/mouse.el (mouse): Consolidate group definition here
Stefan Monnier [Wed, 13 Jul 2016 15:08:21 +0000 (11:08 -0400)]
* lisp/mouse.el (mouse): Consolidate group definition here

* lisp/cus-edit.el (mouse): Remove both group definitions.

5 years agoInclude versioned preloaded libraries in `package--builtin-versions'
Chris Feng [Wed, 13 Jul 2016 11:52:10 +0000 (19:52 +0800)]
Include versioned preloaded libraries in `package--builtin-versions'

* lisp/emacs-lisp/autoload.el (update-directory-autoloads): Do not
exclude preloaded libraries or remove entries generated for them.
(autoload-generate-file-autoloads): Do not generate autoload
statements for preloaded libraries.

5 years agoOmit unnecessary #includes from xwidget.c
Paul Eggert [Wed, 13 Jul 2016 08:15:42 +0000 (10:15 +0200)]
Omit unnecessary #includes from xwidget.c

* src/xwidget.c: Remove #include directives that are not needed.
Also, don’t conditionalize #includes on HAVE_X_WINDOWS, since this
file is compiled only if the X interface is available.

5 years agoPort xwidget.c to GCC 6 with --enable-gcc-warnings
Paul Eggert [Wed, 13 Jul 2016 07:56:50 +0000 (09:56 +0200)]
Port xwidget.c to GCC 6 with --enable-gcc-warnings

* src/xwidget.c (x_draw_xwidget_glyph_string, xwidget_end_redisplay):
Adjust to pacify GCC.  Add a couple of FIXME comments, suggesting
possible bugs found by GCC.

5 years agoEscape meta chars in commands processed by shell
Tino Calancha [Wed, 13 Jul 2016 04:27:33 +0000 (13:27 +0900)]
Escape meta chars in commands processed by shell

* lisp/progmodes/grep.el (grep-compute-defaults): Quote braces
in all commands to be passed to a shell (Bug#23959).

5 years agoRevert "Cleanup tooltips"
John Wiegley [Tue, 12 Jul 2016 22:27:25 +0000 (15:27 -0700)]
Revert "Cleanup tooltips"

This reverts commit 20038f8ab75dd1551412a43cd58520c483c22921.

I am reverting this change because it was applied without prior discussion
on emacs-devel, and has been found to break the NS port.  It needs more
testing and review before it should be applied here.

5 years ago* lisp/emacs-lisp/cl-macs.el (cl--prog): New function
Stefan Monnier [Tue, 12 Jul 2016 16:05:01 +0000 (12:05 -0400)]
* lisp/emacs-lisp/cl-macs.el (cl--prog): New function

(cl-prog, cl-prog*): New macros.

5 years ago* cl-generic.el (cl-defmethod): Make docstring dynamic
Stefan Monnier [Tue, 12 Jul 2016 16:04:01 +0000 (12:04 -0400)]
* cl-generic.el (cl-defmethod): Make docstring dynamic

* lisp/emacs-lisp/cl-generic.el (cl-defmethod): Make docstring dynamic.
(cl--generic-make-defmethod-docstring): New function for that.
(cl-defmethod, cl-generic-generalizers): Tweak docstrings accordingly.
(cl-generic-define-method, cl--generic-describe): Change `load-history'
format of cl-defmethods, so as not to confused methods with equal
specializers but different qualifiers.
* lisp/emacs-lisp/eieio-core.el (cl-generic-generalizers): Provide docstrings.

5 years agoMerge branch 'master' of
Eli Zaretskii [Tue, 12 Jul 2016 13:19:18 +0000 (16:19 +0300)]
Merge branch 'master' of

5 years agoDon't install keyboard hook when debugged on MS-Windows
Eli Zaretskii [Tue, 12 Jul 2016 13:18:06 +0000 (16:18 +0300)]
Don't install keyboard hook when debugged on MS-Windows

* src/w32fns.c (setup_w32_kbdhook): Don't install the keyboard
hook if we are being debugged.  This avoids hosing the debugger,
because the hook is global, and is called in the context of the
thread which installed it, and that thread is stopped when GDB has
control.  Reported by Fabrice Popineau <>.

5 years agoAmend CC Mode to handle big C++ raw strings correctly.
Alan Mackenzie [Tue, 12 Jul 2016 13:16:02 +0000 (13:16 +0000)]
Amend CC Mode to handle big C++ raw strings correctly.

Problems were caused by such a string spanning jit-lock chunks, and by a flaw
in the +-500 bytes boundaries imposed for macros.

* lisp/progmodes/cc-mode.el (c-extend-region-for-CPP): Check the +-500 byte
macro boundaries here.
(c-extend-font-lock-region-for-macros): Remove the check on the +-500 byte
lower boundary.  Fix the check on the upper boundary.

* lisp/progmodes/cc-fonts.el (c-font-lock-raw-strings): Handle the starting
point already being within a raw string.

* lisp/progmodes/cc-engine.el (c-raw-string-pos)
(c-depropertize-raw-strings-in-region, c-after-change-re-mark-raw-strings):
Modify regexp element "\\{,16\\}" to "\\{0,16\\}" for greater compatibility
with other Emacsen.

5 years ago* lisp/mouse.el (mouse-select-region-move-to-beginning): Add :group.
Stephen Berman [Tue, 12 Jul 2016 08:43:24 +0000 (10:43 +0200)]
* lisp/mouse.el (mouse-select-region-move-to-beginning): Add :group.

5 years agoCleanup tooltips
Dmitry Antipov [Tue, 12 Jul 2016 06:16:26 +0000 (09:16 +0300)]
Cleanup tooltips

* src/dispextern.h (toplevel): Remove 'tip_frame' and 'tip_window' decls.
* src/frame.h (struct frame): New bitfield to indicate tooltip frame.
(FRAME_TOOLTIP_P): New macro.
* src/frame.c (make_frame): Mark new frame as regular frame by default.
(Fframe_list, delete_frame): Redesign to use FRAME_TOOLTIP_P.
(syms_of_frame): Don't DEFSYM 'Qtooltip' but use 'Qtooltip_timer'
and 'Qtooltip_parameters' instead.
* src/gtkutil.h (toplevel): Add 'xg_hide_tip' decl.
* src/gtkutil.c (xg_hide_tip): New function.
(xg_hide_tooltip): Adjust to cancel GTK event loop timeout if needed.
* src/menu.c (Fx_popup_menu): Adjust call to Fx_hide_tip.
* src/nsfns.c (toplevel): Remove 'tip_frame' leftover.
* src/w32fns.c (unwind_create_tip_frame): Remove.
(w32_display_monitor_attributes_list_fallback): Use FRAME_TOOLTIP_P.
(toplevel): Remove 'tip_frame', 'tip_window' and 'last_show_tip_args'.
(x_create_tip_frame): Use do_unwind_create_frame.  Mark new frame
as a tooltip frame and record it using appropriate display info.
(x_hide_tooltip): Add frame arg.
(Fx_show_tip): Adjust to avoid globals, store tooltip parameters among
base frame parameters, store tooltip hide timer among tooltip frame
(Fx_hide_tip): Add frame arg, hide tooltips on all displays by default.
(syms_of_w32fns): Don't DEFSYM 'Qtip_frame', don't initialize
and GC-protect 'tip_timer', 'tip_frame' and 'last_show_tip_args'.
* src/w32term.c (w32_read_socket): Extract tooltip window id from
per-display data.  Use FRAME_TOOLTIP_P where appropriate.
(x_new_font): Use FRAME_TOOLTIP_P.
(x_free_frame_resources): Reset pointer to tooltip frame.
* src/w32term.h (struct w32_display_info): New member 'w32_tooltip_frame'.
* src/xdisp.c (init_iterator, x_consider_frame_title, prepare_menu_bars):
* src/xfns.c (x_make_monitor_attribute_list)
(Fx_display_monitor_attributes_list): Likewise.
(unwind_create_tip_frame): Remove.
(toplevel): Remove 'tip_frame', 'tip_window' and 'last_show_tip_args'.
(x_create_tip_frame): Use do_unwind_create_frame.  Mark new frame
as a tooltip frame and record it using appropriate display info.
(x_hide_tooltip): Add frame arg.
(Fx_show_tip): Adjust to avoid globals, store tooltip parameters among
base frame parameters, store tooltip hide timer among tooltip frame
parameters.  To hide GTK system tooltip, use timeout hooked into GTK
event loop.
(Fx_hide_tip): Add frame arg, hide tooltips on all displays by default.
(syms_of_xfns): Don't DEFSYM 'Qtip_frame', don't initialize
and GC-protect 'tip_timer', 'tip_frame' and 'last_show_tip_args'.
* src/xterm.c (handle_one_xevent): Extract tooltip window id from
per-display data.  Use FRAME_TOOLTIP_P where appropriate.
(x_new_font, x_set_window_size): Use FRAME_TOOLTIP_P.
(x_free_frame_resources): Reset pointer to tooltip frame.
* src/xterm.h (struct x_display_info): New member 'x_tooltip_frame'.
(struct x_output) [USE_GTK_TOOLTIP]: New member 'ttip_timeout'.

5 years ago* src/fns.c (syms_of_fns): Leave `features' lexically scoped
Stefan Monnier [Tue, 12 Jul 2016 01:33:43 +0000 (21:33 -0400)]
* src/fns.c (syms_of_fns): Leave `features' lexically scoped

5 years agoTest mapcan
Mario Lang [Mon, 11 Jul 2016 19:43:48 +0000 (21:43 +0200)]
Test mapcan

* test/src/fns-tests.el (fns-tests-mapcan): New test.

5 years ago; Remove parens from sentence in docstring.
Mark Oteiza [Mon, 11 Jul 2016 18:37:54 +0000 (14:37 -0400)]
; Remove parens from sentence in docstring.

5 years agoPrevent to apply funcall on t
Stefan Monnier [Mon, 11 Jul 2016 15:55:04 +0000 (00:55 +0900)]
Prevent to apply funcall on t

* lisp/vc/ediff-util.el (ediff-really-quit): Ignore the global part of
'ediff-after-quit-hook-internal' hook (Bug#23933).

5 years agoIgnore angle mode while simplifying units
Tino Calancha [Mon, 11 Jul 2016 15:38:14 +0000 (00:38 +0900)]
Ignore angle mode while simplifying units

* lisp/calc/calc-forms.el (math-to-hms, math-from-hms):
Ignore value of 'calc-angle-mode' when 'math-simplifying-units'
is non-nil (Bug#23889).
* lisp/calc/calc-math.el (math-to-radians, math-from-radians)
(math-from-radians-2, math-to-radians-2): Idem.

5 years agoMerge branch 'master' of
Eli Zaretskii [Mon, 11 Jul 2016 14:19:40 +0000 (17:19 +0300)]
Merge branch 'master' of

5 years agoFix display of composed characters
Eli Zaretskii [Mon, 11 Jul 2016 14:18:11 +0000 (17:18 +0300)]
Fix display of composed characters

* src/xdisp.c (x_produce_glyphs): Fix off-by-one error in
iteration through composition glyphs.  (Bug#23938)

5 years agoFix composition bug caused by off-by-1 typo
Paul Eggert [Mon, 11 Jul 2016 14:14:33 +0000 (16:14 +0200)]
Fix composition bug caused by off-by-1 typo

* src/xdisp.c (x_produce_glyphs): Fix off-by-one typo when
computing composition glyph (Bug#23938).

5 years agoDired always read file system
Tino Calancha [Mon, 11 Jul 2016 05:34:49 +0000 (14:34 +0900)]
Dired always read file system

* dired.el (dired-always-read-filesystem): Add new option.
(dired-mark-files-containing-regexp): Use it (Bug#22694).
* doc/emacs/dired.texi: Mention it in the manual.
* test/lisp/dired-tests.el (dired-test-bug22694): Add test.
;* etc/NEWS: Add entry for this change.

5 years ago* src/macfont.m (mac_font_shape): Make sure that total_advance is increasing.
YAMAMOTO Mitsuharu [Mon, 11 Jul 2016 04:35:57 +0000 (13:35 +0900)]
* src/macfont.m (mac_font_shape): Make sure that total_advance is increasing.

5 years agoAvoid 'unused var' 'not left unused var' warnings
Tino Calancha [Mon, 11 Jul 2016 02:30:48 +0000 (11:30 +0900)]
Avoid 'unused var' 'not left unused var' warnings

* lisp/ibuffer.el (ibuffer-locked-buffer-p): Remove unused var 'char'.
Rename used var '_buffer' to 'cbuffer'.

* lisp/ibuf-ext.el (ibuffer-unmark-all): Rename used var '_mark'
to cmark'.

5 years ago* lisp/simple.el (shell-command, shell-command-on-region): Fix doc strings
Tino Calancha [Sun, 10 Jul 2016 17:47:28 +0000 (02:47 +0900)]
* lisp/simple.el (shell-command, shell-command-on-region): Fix doc strings

5 years agoAdd a note how to use `tramp-own-remote-path'
Michael Albinus [Sun, 10 Jul 2016 15:03:48 +0000 (17:03 +0200)]
Add a note how to use `tramp-own-remote-path'

* doc/misc/tramp.texi (Inline methods, External methods)
(Remote shell setup, Android shell setup)
(Frequently Asked Questions, Frequently Asked Questions):
Use @command and @samp consequently.
(Remote programs): The remote shell must support the -l
argument, in order to use `tramp-own-remote-path'.  (Bug#23914)

5 years agoRemove App Nap setting from Info.plist (bug#22993)
Alan Third [Sun, 10 Jul 2016 09:18:40 +0000 (10:18 +0100)]
Remove App Nap setting from Info.plist (bug#22993)

* nextstep/templates/ Remove LSAppNapIsDisabled key since
it doesn't actually disable app nap.

5 years agoAn efficient built-in mapcan
Mario Lang [Sat, 9 Jul 2016 23:18:47 +0000 (01:18 +0200)]
An efficient built-in mapcan

A built-in version of `mapcan' avoids consing up (and GC'ing) the
intermediate list.

* src/fns.c (Fmapcan): New built-in.
(syms_of_fns): Define.

* lisp/emacs-lisp/cl.el (mapcan): Remove defalias.

* lisp/emacs-lisp/cl-extra.el (cl-mapcan): Use built-in `mapcan'
if only one sequence is provided.

* lisp/progmodes/hideif.el (hif-delimit):
* lisp/dired-aux.el (dired-do-find-regexp):
* lisp/woman.el (woman-parse-colon-path): Use `mapcan' instead of

* lisp/woman.el (eval-when-compile): Require 'cl-lib only when

* lisp/mouse.el (mouse-buffer-menu-map):
* lisp/net/pop3.el (pop3-uidl-dele):
* lisp/progmodes/gud.el (gud-jdb-build-source-files-list):
* lisp/cedet/semantic/db-find.el (semanticdb-fast-strip-find-results):
* lisp/cedet/semantic/symref/grep.el (semantic-symref-derive-find-filepatterns):
* lisp/gnus/nnmail.el (nnmail-split-it):
* lisp/gnus/gnus-sum.el (gnus-articles-in-thread):
* lisp/gnus/gnus-registry.el (gnus-registry-sort-addresses):
* lisp/gnus/gnus-util.el (gnus-mapcar): Use `mapcan'.

5 years agoDetect aliases to built-in functions
Tino Calancha [Sat, 9 Jul 2016 13:56:25 +0000 (22:56 +0900)]
Detect aliases to built-in functions

* lisp/help-fns.el (describe-function-1): Check for aliases
defined with (defalias alias (symbol-function built-in)) (Bug#23887).

* test/lisp/help-fns-tests.el (help-fns-test-bug23887): Untag as
failing this test.

5 years agoAvoid recursive detection of remote uid and gid in tramp-gvfs.el
Michael Albinus [Sat, 9 Jul 2016 12:20:07 +0000 (14:20 +0200)]
Avoid recursive detection of remote uid and gid in tramp-gvfs.el

* lisp/net/tramp-gvfs.el (tramp-gvfs-get-remote-uid-gid-in-progress):
New variable.
(tramp-gvfs-maybe-open-connection): Use it.

* test/lisp/net/tramp-tests.el (tramp-test18-file-attributes):
Reorder test.

5 years agoWrap around error in coreutil's ls
Jürgen Hötzel [Sat, 9 Jul 2016 12:19:12 +0000 (14:19 +0200)]
Wrap around error in coreutil's ls

* lisp/net/tramp-sh.el (tramp-sh-handle-insert-directory): Add switch
"--quoting-style=literal" if remote host supports quoting style.
Recent versions of coreutils changed default quoting style to

5 years agoMinor tweaks of copying text properties when padding strings
Eli Zaretskii [Sat, 9 Jul 2016 08:01:17 +0000 (11:01 +0300)]
Minor tweaks of copying text properties when padding strings

* src/editfns.c (styled_format): Don't include padding on the left
in the properties at the beginning of the string.  (Bug#23897)

* test/src/editfns-tests.el (format-properties): Add tests for
faces when the string is padded on the left or on the right.

5 years agoMerge branch 'master' of
Mario Lang [Sat, 9 Jul 2016 05:06:53 +0000 (07:06 +0200)]
Merge branch 'master' of

5 years agoNo need to require the same feature twice.
Mario Lang [Sat, 9 Jul 2016 05:05:50 +0000 (07:05 +0200)]
No need to require the same feature twice.

* lisp/dired-aux.el (require 'cl-lib): Remove.

5 years agoTurn on lexical binding
Mark Oteiza [Sat, 9 Jul 2016 01:49:52 +0000 (21:49 -0400)]
Turn on lexical binding

* lisp/net/secrets.el (secrets-collection-handler): Use cl-pushnew.
(secrets-search-items, secrets-create-item): Use append.
(secrets-show-secrets): Remove unused binding.
(secrets-expand-item, secrets-tree-widget-after-toggle-function):
Ignore unused arguments.

5 years agoDerive secrets-mode from special-mode
Mark Oteiza [Sat, 9 Jul 2016 01:10:32 +0000 (21:10 -0400)]
Derive secrets-mode from special-mode

* lisp/net/secrets.el: Remove top-level secrets-mode hack.
(secrets-mode-map): New variable.  Add key bindings to n and p for
navigating lines.
(secrets-mode): Derive from special-mode.  Remove keymap code and
initialization code.  Do not record undo information.  Make
secrets-show-collections the local revert-buffer-function.
(secrets-show-collections): Change signature to satisfy revert-buffer.

5 years agoAdd a couple cells to lisp-prettify-symbols-alist
Mark Oteiza [Fri, 8 Jul 2016 21:12:54 +0000 (17:12 -0400)]
Add a couple cells to lisp-prettify-symbols-alist

* lisp/emacs-lisp/lisp-mode.el (lisp-prettify-symbols-alist): Add
"sqrt" and "not".

5 years agoDetect remote uid and gid in tramp-gvfs.el
Michael Albinus [Fri, 8 Jul 2016 20:44:11 +0000 (22:44 +0200)]
Detect remote uid and gid in tramp-gvfs.el

* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name)
Make "default-location" a connection property.
(tramp-gvfs-get-remote-uid, tramp-gvfs-get-remote-gid): New defuns.
(tramp-gvfs-maybe-open-connection): Use them.

5 years agoYet another fix for copying properties by 'format'
Eli Zaretskii [Fri, 8 Jul 2016 19:34:34 +0000 (22:34 +0300)]
Yet another fix for copying properties by 'format'

* src/textprop.c (extend_property_ranges): Accept an additional
argument OLD_END, and only extend the end of a property range if
its original end is at OLD_END; all the other ranges are left
intact.  (Bug#23897)
* src/editfns.c (styled_format): Pass the original length of the
string to 'extend_property_ranges'.
* src/intervals.h (extend_property_ranges): Adjust prototype.

* test/src/editfns-tests.el (format-properties): Add tests for

5 years agoAllow selecting region with mouse to move point to beginning
Stephen Berman [Fri, 8 Jul 2016 15:36:55 +0000 (17:36 +0200)]
Allow selecting region with mouse to move point to beginning

* etc/NEWS: Mention new user option

* doc/emacs/frames.texi (Mouse Commands): Add cross-reference
to the following.
(Word and Line Mouse): Describe how double-clicking mouse-1 to
activate region and `mouse-select-region-move-to-beginning'
affect point.

* lisp/mouse.el (mouse-select-region-move-to-beginning): New defcustom.
(mouse-set-point): Use it.  (Bug#23478)

5 years agoFix menu bar breakage
Stephen Berman [Fri, 8 Jul 2016 15:22:14 +0000 (17:22 +0200)]
Fix menu bar breakage

* lisp/menu-bar.el (menu-bar-showhide-scroll-bar-menu): Use backquoting
to prevent void variable errors, and fix typo (bug#23918).

5 years agoCopy buffer names to kill ring
Tino Calancha [Fri, 8 Jul 2016 08:22:56 +0000 (17:22 +0900)]
Copy buffer names to kill ring

* ibuf-ext.el (ibuffer-copy-buffername-as-kill): New command.
* lisp/ibuffer (ibuffer-mode-map): Bound it to 'B'.
;* etc/NEWS: Add entry for this new feature.

5 years agoRemove just input mark
Tino Calancha [Fri, 8 Jul 2016 02:22:34 +0000 (11:22 +0900)]
Remove just input mark

* lisp/ibuffer.el (ibuffer-unmark-all): When MARK is not ?\r remove
just MARK.

5 years agoIbuffer change marks
Tino Calancha [Fri, 8 Jul 2016 01:55:22 +0000 (10:55 +0900)]
Ibuffer change marks

* lisp/ibuffer.el (ibuffer-change-marks): New command.
(ibuffer-mode-map): Bind it to '* c'.
(ibuffer-mode-groups-popup): Update menus.
(ibuffer-mode): Update mode doc.
; * etc/NEWS: Add entry for this new feature.

5 years agoPrevent NS event loop being re-entered (bug#11049)
Alan Third [Sat, 25 Jun 2016 23:10:50 +0000 (00:10 +0100)]
Prevent NS event loop being re-entered (bug#11049)

* nsterm.m (ns_read_socket, ns_select): Return -1 if already in event
loop instead of aborting.

5 years agoFix some deprecated functions
Alan Third [Thu, 7 Jul 2016 19:42:11 +0000 (20:42 +0100)]
Fix some deprecated functions

* src/nsterm.m (firstRectForCharacterRange): In OS X >10.6 replace
convertBaseToScreen with convertRectToScreen.
* src/nsmenu.m (ns_update_menubar): Remove attachedMenu, deprecated in
OS X 10.2, and always seems to return nil.

5 years agoDisable App Nap (bug#22993)
Aaron Jensen [Thu, 7 Jul 2016 18:46:57 +0000 (19:46 +0100)]
Disable App Nap (bug#22993)

* nextstep/templates/ Insert AppNap disable code.

Copyright-paperwork-exempt: yes

5 years agoMerge branch 'master' of
Michael Albinus [Thu, 7 Jul 2016 16:51:00 +0000 (18:51 +0200)]
Merge branch 'master' of

5 years agoFix an error in Tramp for rsync
Michael Albinus [Thu, 7 Jul 2016 16:50:24 +0000 (18:50 +0200)]
Fix an error in Tramp for rsync

* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band):
Make it work for "rsync".
(tramp-make-copy-program-file-name): Apply `directory-file-name'.

5 years agoIbuffer: Mark locked buffers
Tino Calancha [Thu, 7 Jul 2016 16:34:35 +0000 (01:34 +0900)]
Ibuffer: Mark locked buffers

* lisp/ibuf-ext.el (ibuffer-locked-buffer-p): New defun.
(ibuffer-mark-by-locked): New command.
(ibuffer-mode-map): Bind it to '% L'; update menus.
(ibuffer-mode): Update mode doc.
;* etc/NEWS: Add NEWS entry for these changes and previous two commits.

5 years ago* lisp/ibuffer.el: Add face for locked buffers
Tino Calancha [Thu, 7 Jul 2016 16:15:54 +0000 (01:15 +0900)]
* lisp/ibuffer.el: Add face for locked buffers

5 years ago* lisp/ibuffer.el: Add mark for locked buffers
Tino Calancha [Thu, 7 Jul 2016 16:13:55 +0000 (01:13 +0900)]
* lisp/ibuffer.el: Add mark for locked buffers

5 years ago;* etc/NEWS (Ibuffer): Update entry according with last commit
Tino Calancha [Thu, 7 Jul 2016 15:57:40 +0000 (00:57 +0900)]
;* etc/NEWS (Ibuffer): Update entry according with last commit

5 years agoRemove duplicate binding
Tino Calancha [Thu, 7 Jul 2016 14:59:45 +0000 (23:59 +0900)]
Remove duplicate binding

* lisp/ibuffer.el (ibuffer-mode-map): 'ibuffer-mark-by-content-regexp'
just bound to '% g'.
As suggested in:

5 years agoIbuffer: Drop needless binding
Tino Calancha [Thu, 7 Jul 2016 08:49:02 +0000 (17:49 +0900)]
Ibuffer: Drop needless binding

* lisp/ibuffer.el (ibuffer-mark-interactive): 'inhibit-read-only'
already bound to 't' inside 'ibuffer-set-mark'.

5 years agoRun tests from non-byte compiled files
Phillip Lord [Mon, 27 Jun 2016 20:36:44 +0000 (21:36 +0100)]
Run tests from non-byte compiled files

* test/ Eval non-byte-compiled files for tests.

5 years agoReplace eldoc-documentation-function with a hook
Mark Oteiza [Thu, 7 Jul 2016 03:16:32 +0000 (23:16 -0400)]
Replace eldoc-documentation-function with a hook

* lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions): New hook.
(eldoc-documentation-function): Make into obsolete alias.
(eldoc-echo-area-use-multiline-p, eldoc-highlight-function-argument):
(eldoc-argument-case, global-eldoc-mode): Update docstrings.
(eldoc-print-current-symbol-info): Use run-hook-with-args-until-success
on eldoc-documentation-functions.
(eldoc-supported-p): New function.
(eldoc-mode, global-eldoc-mode, eldoc-schedule-timer): Use eldoc-supported-p.
* etc/NEWS: Mention eldoc-documentation-functions.
* doc/lispref/modes.texi: Update reference.

5 years agoComplete "initial" and "unset" in CSS mode
Simen Heggestøyl [Wed, 6 Jul 2016 17:25:10 +0000 (19:25 +0200)]
Complete "initial" and "unset" in CSS mode

* lisp/textmodes/css-mode.el (css--complete-property-value): Make
"initial" and "unset" completion candidates for all CSS properties,
just like "inherit".

* test/lisp/textmodes/css-mode-tests.el
(css-test-complete-property-value): Update test to reflect the above

5 years ago* lisp/net/tramp-gvfs.el (tramp-gvfs-mount-spec): Fix typo.
Michael Albinus [Wed, 6 Jul 2016 15:33:00 +0000 (17:33 +0200)]
* lisp/net/tramp-gvfs.el (tramp-gvfs-mount-spec): Fix typo.

5 years agoSimplify rfc1345.el a bit
Paul Eggert [Wed, 6 Jul 2016 14:10:13 +0000 (16:10 +0200)]
Simplify rfc1345.el a bit

* lisp/leim/quail/rfc1345.el: Omit commented-out codes for ASCII
that would no longer parse.  Replace control characters with
escapes in character constants.  Omit unnecessary \ after ?.
This does not change behavior.

5 years agoPrefer 'frame-parameter' where it is expected to be a bit faster
Dmitry Antipov [Tue, 5 Jul 2016 05:33:29 +0000 (08:33 +0300)]
Prefer 'frame-parameter' where it is expected to be a bit faster

* lisp/international/mule-diag.el (mule-diag):
* lisp/menu-bar.el (menu-bar-showhide-scroll-bar-menu):
* lisp/mouse.el (mouse-drag-line, font-menu-add-default):
* lisp/scroll-bar.el (toggle-scroll-bar, toggle-horizontal-scroll-bar):
* lisp/faces.el (x-resolve-font-name): Use 'frame-parameter'.

5 years agoReduce consing caused by vertical motion commands
Dmitry Antipov [Wed, 6 Jul 2016 03:03:12 +0000 (06:03 +0300)]
Reduce consing caused by vertical motion commands

* src/frame.c (Fframe_parameter): Avoid call to Fframe_parameters for the
parameters frequently requested by calls to 'next-line' and 'previous-line'.

5 years agoMake all Tramp tests pass for "gdrive" method
Michael Albinus [Tue, 5 Jul 2016 19:16:25 +0000 (21:16 +0200)]
Make all Tramp tests pass for "gdrive" method

* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory)
* lisp/net/tramp-compat.el (tramp-compat-copy-directory)
* lisp/net/tramp-smb.el (tramp-smb-handle-delete-directory):
Use `directory-files-no-dot-files-regexp'.

* lisp/net/tramp-gvfs.el (tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-send-command): Call `tramp-flush-file-property' in
case of problems.

* test/lisp/net/tramp-tests.el (tramp--instrument-test-case):
Adapt docstring.
(tramp-test14-delete-directory): Make further tests.

5 years agoFix redisplay with window-start on continuation lines
Eli Zaretskii [Tue, 5 Jul 2016 16:33:01 +0000 (19:33 +0300)]
Fix redisplay with window-start on continuation lines

* src/xdisp.c (pos_visible_p): Return false if the window starts
after CHARPOS.
(compute_window_start_on_continuation_line): Don't return
window-start position that is after point in the buffer, as the
callers don't expect this to happen, and will generally display an
empty window with the cursor in its middle.  (Bug#23871)

5 years agoAdd :expected-result :failed for unfixed bug test
Tino Calancha [Tue, 5 Jul 2016 16:10:22 +0000 (01:10 +0900)]
Add :expected-result :failed for unfixed bug test

* test/lisp/help-fns-tests.el (help-fns-test-bug23887):

5 years ago* test/lisp/help-fns-tests.el: Add several tests for 'describe-function'.
Tino Calancha [Tue, 5 Jul 2016 07:16:11 +0000 (16:16 +0900)]
* test/lisp/help-fns-tests.el: Add several tests for 'describe-function'.

5 years agoDon’t create unnecessary marker in ‘delete-trailing-whitespace’
Michal Nazarewicz [Wed, 22 Jun 2016 17:06:57 +0000 (19:06 +0200)]
Don’t create unnecessary marker in ‘delete-trailing-whitespace’

* lisp/simple.el (delete-trailing-whitespace): If END argument is nil,
there is no need for the end-marker to be created.

5 years agoSimplify ‘delete-trailing-whitespace’ by not treating \n as whitespace
Michal Nazarewicz [Tue, 21 Jun 2016 14:46:52 +0000 (16:46 +0200)]
Simplify ‘delete-trailing-whitespace’ by not treating \n as whitespace

* lisp/simple.el (delete-trailing-whitespace): Set newline’s character
syntax to non-whitespace so that ‘\s-’ regular expression does not match

This simplifies the loop slightly since a simple ‘\s-+$’ can be used and
as a consequence ‘line-beginning-position’ function does not need to be
called any longer.

Furthermore, when newline has whitespace syntax, ‘\s-$’ regular
expression ends up matching empty lins since ‘\s-’ matches newline
characetr of proceeding line.  This leads to needless loop iterations.

Since previous change to ‘delete-trailing-whitespace’ already introduced
‘with-syntax-table’, take advantage of it and also overwrite newline’s
character syntax.

5 years agoMake ‘delete-trailing-whitespace’ delete spaces after form feed
Michal Nazarewicz [Tue, 21 Jun 2016 14:52:52 +0000 (16:52 +0200)]
Make ‘delete-trailing-whitespace’ delete spaces after form feed

* lisp/simple.el (delete-trailing-whitespace): Treat form fead as
a non-whitespace character (regradless of whether it’s character syntax
is whitespace) and delete any whitespace following it instead of leaving
lines with form feeds completely unchanged.  I.e. a line like "\f " will
now became "\f".

5 years agoCleanup XEditRes hack
Dmitry Antipov [Mon, 4 Jul 2016 17:05:06 +0000 (20:05 +0300)]
Cleanup XEditRes hack

_XEditResCheckMessages is declared in X11/Xmu/Editres.h and may be
linked with -lXmu.  This should work with any non-ancient Xmu library.
* xfns.c (toplevel): Remove old cruft.
* xterm.c (toplevel): Remove old cruft.
(handle_one_xevent): Use X_TOOLKIT_EDITRES.
* xterm.h (toplevel): Include X11/Xmu/Editres.h if X_TOOLKIT_EDITRES.