]> git.eshelyaron.com Git - emacs.git/log
emacs.git
7 years agoFix find-library-name for load-history entries with nil FILE-NAME (Bug#26355)
Noam Postavsky [Sun, 26 Mar 2017 02:41:34 +0000 (22:41 -0400)]
Fix find-library-name for load-history entries with nil FILE-NAME (Bug#26355)

* lisp/emacs-lisp/find-func.el (find-library--from-load-history):
Rename from find-library--from-load-path.  Check for `load-history'
entries with nil FILE-NAMEs.  Simplify by not double
checking for suffixes and making use of `locate-file'.

7 years agoUse vfork if possible on Darwin (bug#26397)
Alan Third [Sun, 9 Apr 2017 19:10:33 +0000 (20:10 +0100)]
Use vfork if possible on Darwin (bug#26397)

Co-authored-by: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* src/conf_post.h (HAVE_WORKING_VFORK): Don't undef.
(vfork): Don't define.
* src/process.c (create_process) [DARWIN_OS]: Use fork if pty_flag is
set, otherwise vfork.
* src/callproc.c (call_process) [DARWIN_OS]: Use TIOCNOTTY to detach
the controlling terminal instead of setsid.

7 years agoSmall erc-kill-channel fix (bug#23700)
Fran Litterio [Tue, 18 Apr 2017 00:30:40 +0000 (20:30 -0400)]
Small erc-kill-channel fix (bug#23700)

* lisp/erc/erc.el (erc-kill-channel): Handle null erc-default-target.

7 years agoediff: use user-error rather than debug-ignored-errors
Glenn Morris [Tue, 18 Apr 2017 00:16:15 +0000 (20:16 -0400)]
ediff: use user-error rather than debug-ignored-errors

* lisp/vc/ediff-diff.el (ediff-prepare-error-list):
* lisp/vc/ediff-help.el (ediff-help-for-quick-help):
* lisp/vc/ediff-init.el (ediff-barf-if-not-control-buffer)
(ediff-check-version):
* lisp/vc/ediff-merg.el (ediff-shrink-window-C):
* lisp/vc/ediff-mult.el (ediff-draw-dir-diffs, ediff-show-dir-diffs)
(ediff-append-custom-diff, ediff-meta-show-patch)
(ediff-filegroup-action, ediff-show-meta-buffer, ediff-show-registry)
(ediff-get-meta-info, ediff-patch-file-form-meta):
* lisp/vc/ediff-ptch.el (ediff-patch-file-internal):
* lisp/vc/ediff-util.el (ediff-toggle-autorefine)
(ediff--check-ancestor-exists, ediff-toggle-read-only)
(ediff-toggle-wide-display, ediff-toggle-multiframe)
(ediff-toggle-use-toolbar, ediff-toggle-show-clashes-only)
(ediff-next-difference, ediff-previous-difference)
(ediff-pop-diff, ediff-read-file-name, ediff-verify-file-buffer)
(ediff-save-buffer):
* lisp/vc/ediff-wind.el (ediff-make-wide-display):
* lisp/vc/ediff.el (ediff-find-file, ediff-buffers-internal)
(ediff-directories-internal, ediff-directory-revisions-internal)
(ediff-regions-wordwise, ediff-regions-linewise)
(ediff-load-version-control): Use user-error.
(debug-ignored-errors): No longer modify.

7 years agomh-e: use user-error rather than debug-ignored-errors
Glenn Morris [Tue, 18 Apr 2017 00:10:28 +0000 (20:10 -0400)]
mh-e: use user-error rather than debug-ignored-errors

* lisp/mh-e/mh-alias.el (mh-alias-grab-from-field):
* lisp/mh-e/mh-utils.el (mh-get-msg-num): Use user-error.
(debug-ignored-errors): No longer modify.

7 years agoispell.el: use user-error rather than debug-ignored-errors
Glenn Morris [Tue, 18 Apr 2017 00:09:27 +0000 (20:09 -0400)]
ispell.el: use user-error rather than debug-ignored-errors

* lisp/textmodes/ispell.el (ispell-get-word): Use user-error.
(debug-ignored-errors): No longer modify.

7 years ago; Spelling fix
Paul Eggert [Mon, 17 Apr 2017 18:22:34 +0000 (11:22 -0700)]
; Spelling fix

7 years ago* src/xterm.c (x_fill_rectangle): Now static.
Paul Eggert [Mon, 17 Apr 2017 18:13:56 +0000 (11:13 -0700)]
* src/xterm.c (x_fill_rectangle): Now static.

7 years agoTighten recently-added UTF-8 check
Paul Eggert [Mon, 17 Apr 2017 17:19:39 +0000 (10:19 -0700)]
Tighten recently-added UTF-8 check

* src/coding.c (encode_coding_utf_8): Now extern.
* src/terminal.c (terminal_glyph_code) [HAVE_STRUCT_UNIPAIR_UNICODE]:
Check for UTF-8, not just for multibyte.

7 years agoxml: Properly handle symbol-qnames for attribute parsing
David Engster [Mon, 17 Apr 2017 14:52:08 +0000 (16:52 +0200)]
xml: Properly handle symbol-qnames for attribute parsing

* lisp/xml.el (xml-parse-attlist): Do not strip 'symbol-qnames from
  xml-ns argument (reverts aea67018) (Bug#26533).
  (xml-maybe-do-ns): Properly handle default namespace by not
  interning new symbol when 'special' flag is set.

* tests/lisp/xml-tests.el (xml-parse-test--namespace-attribute-qnames)
  (xml-parse-namespace-attribute-qnames): Add test for Bug#26533.

7 years ago* src/lisp.h (STRING_SET_CHARS): Simplify assertion.
Paul Eggert [Mon, 17 Apr 2017 14:56:08 +0000 (07:56 -0700)]
* src/lisp.h (STRING_SET_CHARS): Simplify assertion.

7 years agoFix assertion violations when displaying thread-related error
Eli Zaretskii [Mon, 17 Apr 2017 06:47:39 +0000 (09:47 +0300)]
Fix assertion violations when displaying thread-related error

* src/process.c (Faccept_process_output): Don't assume a thread's
name is always a string.

7 years agodired ‘M’ should not complain about ‘.’ and ‘..’
Paul Eggert [Mon, 17 Apr 2017 06:36:26 +0000 (23:36 -0700)]
dired ‘M’ should not complain about ‘.’ and ‘..’

* lisp/dired-aux.el (dired-do-redisplay):
Allow redisplay of ‘.’ and ‘..’ (Bug#26528).

7 years agoRemove unused coding enums
Paul Eggert [Mon, 17 Apr 2017 06:07:33 +0000 (23:07 -0700)]
Remove unused coding enums

* src/coding.h (enum coding_system_type, enum end_of_line_type):
Remove; unused.

7 years agoWork around bug with unibyte Linux consoles
Paul Eggert [Mon, 17 Apr 2017 05:50:02 +0000 (22:50 -0700)]
Work around bug with unibyte Linux consoles

* src/terminal.c (terminal_glyph_code): Skip the UTF-8 stuff if
the terminal's coding system is unibyte (Bug#26396).

7 years ago; Fix typo in error messages (Bug#26034)
Christian Garbs [Wed, 8 Mar 2017 20:13:57 +0000 (21:13 +0100)]
; Fix typo in error messages (Bug#26034)

Copyright-paperwork-exempt: yes

7 years agoFix org-agenda's command for calendar-lunar-phases
Teemu Likonen [Sun, 16 Apr 2017 13:14:22 +0000 (16:14 +0300)]
Fix org-agenda's command for calendar-lunar-phases

Function org-agenda-phases-of-moon tries to call a non-existing
function calendar-phases-of-moon. The correct function is
calendar-lunar-phases.

7 years agoTuning for `separate' Tramp syntax
Michael Albinus [Sun, 16 Apr 2017 14:51:24 +0000 (16:51 +0200)]
Tuning for `separate' Tramp syntax

* lisp/net/tramp.el (tramp-method-regexp): Fix it for `separate' syntax.
(tramp-completion-file-name-regexp-separate): Simplify.

* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect-separate):
Extend test.

7 years agoFix bug #26529: C-h k errors with a lambda function bound to a key.
Alan Mackenzie [Sun, 16 Apr 2017 10:01:09 +0000 (10:01 +0000)]
Fix bug #26529: C-h k errors with a lambda function bound to a key.

* lisp/help-fns.el (help-fns--signature, describe-function-1): Check
`function' is a symbol before trying to get property `reader-construct' from
it.

7 years agoFix highlighting of short selectors in CSS mode
Simen Heggestøyl [Sun, 16 Apr 2017 09:55:33 +0000 (11:55 +0200)]
Fix highlighting of short selectors in CSS mode

* lisp/textmodes/css-mode.el (css--font-lock-keywords): Highlight
selectors where the part before a colon is only one character long,
such as `a:hover'.

7 years agoFix redisplay performance problems with some fonts
Eli Zaretskii [Sun, 16 Apr 2017 07:43:22 +0000 (10:43 +0300)]
Fix redisplay performance problems with some fonts

* src/font.c (font_list_entities): Revert part of the changes
introduced on Apr 2, 2014 to fix bug#17125.  It turns out having
zero_vector in the font-cache is an important indication that
cannot be removed.  (Bug#21028)

7 years agoAdd assertion to STRING_SET_CHARS
Eli Zaretskii [Sun, 16 Apr 2017 07:27:23 +0000 (10:27 +0300)]
Add assertion to STRING_SET_CHARS

* src/lisp.h (STRING_SET_CHARS): Add an assertion and commentary
to prevent incorrect usage.  For details, see this discussion:
http://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00412.html.

7 years agoAvoid compilation warnings on MS-Windows
Eli Zaretskii [Sun, 16 Apr 2017 07:12:42 +0000 (10:12 +0300)]
Avoid compilation warnings on MS-Windows

* src/w32term.c (w32_read_socket): Avoid compiler warnings about
parentheses around assignment.
* src/w32fns.c (w32_createwindow): Remove unused variable
dwStyle.  Use "|=" where appropriate.

7 years agoMerge from gnulib
Paul Eggert [Sun, 16 Apr 2017 05:22:49 +0000 (22:22 -0700)]
Merge from gnulib

This incorporates:
2017-04-14 intprops: try to avoid tickling similar bugs
2017-04-14 intprops: port to Oracle Studio 12.3 x86
* doc/misc/texinfo.tex, lib/intprops.h: Copy from gnulib.

7 years agoFix bugs in `with-displayed-buffer-window' and `fit-window-to-buffer'
Martin Rudalics [Sat, 15 Apr 2017 14:16:26 +0000 (16:16 +0200)]
Fix bugs in `with-displayed-buffer-window' and `fit-window-to-buffer'

* lisp/window.el (with-displayed-buffer-window): When a
'window-height' action alist entry specifies a function, call
`temp-buffer-window-show' with a '(window-height . t)' dummy
entry so `window--try-to-split-window' will bind
`window-combination-limit' to t and that function does not
resize any other window but the one we split this one off
(Bug#25055, Bug#25179).
(fit-window-to-buffer): Call `window-max-delta' with NOUP t so
we steal space only from windows in the same combination.
Stealing space from other windows would not allow us to return
that space later when this window is deleted (Bug#25055,
Bug#25179).

7 years agoAvoid userlock queries hanging forever in batch mode
Glenn Morris [Sat, 15 Apr 2017 01:18:07 +0000 (21:18 -0400)]
Avoid userlock queries hanging forever in batch mode

* lisp/userlock.el (ask-user-about-lock)
(ask-user-about-supersession-threat): Abort in batch mode.

7 years ago; Spelling and minor wording fixes
Paul Eggert [Fri, 14 Apr 2017 19:42:03 +0000 (12:42 -0700)]
; Spelling and minor wording fixes

7 years agoFix segfault when calling frame_ancestor_p (Bug#26493)
Martin Rudalics [Fri, 14 Apr 2017 10:14:09 +0000 (12:14 +0200)]
Fix segfault when calling frame_ancestor_p (Bug#26493)

* src/xterm.c (handle_one_xevent): Check that hf was not reset
before calling frame_ancestor_p (Bug#26493).

7 years agoA few additional copy-edits in documentation of frames
Martin Rudalics [Fri, 14 Apr 2017 07:26:03 +0000 (09:26 +0200)]
A few additional copy-edits in documentation of frames

* doc/lispref/frames.texi (Frame Layout)
(Implied Frame Resizing): Windows -> MS-Windows.
(Deleting Frames): Fix typo.

7 years agoUse user-error for some ert.el errors
Glenn Morris [Fri, 14 Apr 2017 01:17:09 +0000 (21:17 -0400)]
Use user-error for some ert.el errors

* lisp/emacs-lisp/ert.el (ert-read-test-name, ert-delete-all-tests)
(ert-results-find-test-at-point-other-window, ert-describe-test):
Use user-error.

7 years agoUse user-error for customize's "invalid face" error
Glenn Morris [Fri, 14 Apr 2017 00:17:08 +0000 (20:17 -0400)]
Use user-error for customize's "invalid face" error

* lisp/cus-edit.el (customize-face): Use user-error.
(debug-ignored-errors): No more need to add "Invalid face".

7 years agoRemove duplicate lisp-eval-defun definition
Glenn Morris [Fri, 14 Apr 2017 00:15:34 +0000 (20:15 -0400)]
Remove duplicate lisp-eval-defun definition

* lisp/emacs-lisp/lisp-mode.el (lisp-eval-defun):
Autoload rather than defining a stub.

7 years ago* lisp/Makefile.in (check-defun-dups): Ignore obsolete files.
Glenn Morris [Fri, 14 Apr 2017 00:14:01 +0000 (20:14 -0400)]
* lisp/Makefile.in (check-defun-dups): Ignore obsolete files.

7 years agoCreate generated lisp files before main loaddefs.el
Glenn Morris [Fri, 14 Apr 2017 00:12:02 +0000 (20:12 -0400)]
Create generated lisp files before main loaddefs.el

This should improve reproducibility of lisp/loaddefs.el.
* lisp/Makefile.in (gen-lisp): New phony target.
($(lisp)/loaddefs.el, compile-main): Depend on gen-lisp.
* src/Makefile.in ($(leimdir)/leim-list.el): Depend on all of ../leim.
* lisp/cedet/semantic.el (semantic-mode):
* lisp/cedet/semantic/fw.el (top-level):
* lisp/emacs-lisp/eieio-core.el (top-level):
Robustify to generated input files maybe not yet existing.

7 years agoFix minor quoting issues in Makefile.in
Paul Eggert [Thu, 13 Apr 2017 22:37:07 +0000 (15:37 -0700)]
Fix minor quoting issues in Makefile.in

* Makefile.in (install-arch-dep, uninstall):
Quote EMACS and EMACS_NAME more consistently.

7 years ago* Makefile.in (install-etc): Use existing Makefile variables.
Glenn Morris [Thu, 13 Apr 2017 17:52:09 +0000 (13:52 -0400)]
* Makefile.in (install-etc): Use existing Makefile variables.

7 years agoMinor copyedits of recent changes in documentation
Eli Zaretskii [Thu, 13 Apr 2017 17:52:30 +0000 (20:52 +0300)]
Minor copyedits of recent changes in documentation

* doc/lispref/frames.texi (Frame Layout, Frame Position)
(Frame Size, Frame Interaction Parameters, Input Focus)
(Raising and Lowering, Child Frames): Improve wording and indexing.
* doc/emacs/cmdargs.texi (Borders X): Improve indexing.

7 years agoSmall src/Makefile simplification
Glenn Morris [Thu, 13 Apr 2017 17:44:35 +0000 (13:44 -0400)]
Small src/Makefile simplification

* src/Makefile.in ($(lispsource)/international/ucs-normalize.elc)
($(lispsource)/term/ns-win.elc): Combine rules.

7 years ago; Update NEWS for frame and window changes
Martin Rudalics [Thu, 13 Apr 2017 16:59:37 +0000 (18:59 +0200)]
; Update NEWS for frame and window changes

7 years agoAdd grid layout module to CSS property list
Simen Heggestøyl [Thu, 13 Apr 2017 16:54:19 +0000 (18:54 +0200)]
Add grid layout module to CSS property list

* lisp/textmodes/css-mode.el (css-property-alist)
(css-value-class-alist): Add new properties and value classes from CSS
Grid Layout Module.

7 years agoDescribe recent frame and window changes in manuals
Martin Rudalics [Thu, 13 Apr 2017 15:45:12 +0000 (17:45 +0200)]
Describe recent frame and window changes in manuals

* doc/emacs/emacs.texi (Top):
* doc/emacs/cmdargs.texi (Borders X): Clearly separate the terms
"outer border" (for the X border which can be set from within
Emacs) and "external border" (for the border which is added by
the window manager).
* doc/lispref/display.texi (Tooltips): Clarify slightly.
* doc/lispref/elisp.texi (Top): Update node and section names.
* doc/lispref/frames.texi (Frames): Describe difference between
top-level and child frames.
(Frame Layout): Describe outer border.  Add more details about
how Emacs obtains the outer size and position of a frame and
about menu bar/tool bar wrapping.  Add references to new frame
parameters.
(Size and Position): Remove subsection.
(Frame Position): New subsection excerpted from the earlier Size
and Position subsection.  Clarify positioning concepts and
some of their shortcomings.  Describe `move-frame-functions'.
(Frame Size): New subsection excerpted from the earlier Size
and Position subsection.  Describe how to track frame size
changes and the new function `frame-size-changed-p'.
(Position Parameters): Describe child frame positioning.  Warn
about negative offsets.  Describe 'z-group' parameter.
(Size Parameters): Describe 'text-pixels' specification
facility and new 'min-width' and 'min-height' parameters.
(Layout Parameters): Clarify description of 'tool-bar-lines' and
'menu-bar-lines' parameters.
(Frame Interaction Parameters): New subsubsection describing
'parent-frame', 'delete-before', 'mouse-wheel-frame' and
'no-other-frame' parameters.
(Management Parameters): Describe 'skip-taskbar',
'no-focus-on-map', 'no-accept-focus', 'undecorated' and
'override-redirect' parameters.
(Deleting Frames): Describe handling of 'delete-before'
parameter and child frames for `delete-frame' and
`delete-other-frames'.
(Finding All Frames): Describe `frame-list-z-order' and handling
of 'no-other-frame' parameter by `next-frame'.
(Minibuffers and Frames): Minor clarifications.
(Input Focus): Document `x-focus-frame'.  Clarify descriptions
of `focus-in-hook', `focus-out-hook' and `focus-follows-mouse'.
(Visibility of Frames): Describe mapping and how the visibility
of a parent frame affects that of its child frames.
(Raising and Lowering): Describe restacking of frames and
z-groups.
(Child Frames): New section.
* doc/lispref/windows.texi (Selecting Windows): Describe
additional semantics of NORECORD argument of `select-window' and
how `buffer-list-update-hook' can emulate a "select window
hook".
(Mouse Window Auto-selection): New section.

7 years agoFix imenu--sort-by-position for non-pairs parameters (bug#26457)
Damien Cassou [Wed, 12 Apr 2017 05:35:56 +0000 (07:35 +0200)]
Fix imenu--sort-by-position for non-pairs parameters (bug#26457)

* lisp/imenu.el (imenu--sort-by-position): Fix to accept lists beyond
  pairs.
* test/lisp/imenu-tests.el: Add 2 tests for `imenu--sort-by-position`.

7 years agoAvoid unnecessary regeneration of the entire loaddefs.el
Eli Zaretskii [Thu, 13 Apr 2017 07:03:09 +0000 (10:03 +0300)]
Avoid unnecessary regeneration of the entire loaddefs.el

* lisp/Makefile.in (autoloads .PHONY): Add commentary explaining
why $(lisp)/loaddefs.el is a dependency of '.PHONY'.
($(lisp)/loaddefs.el): Copy an existing loaddefs.el to
loaddefs.tmp before running 'batch-update-autoloads' on it, to
avoid slow regeneration of the full contents.  (Bug#26459)
Use 'move-if-change' instead of 'mv', to avoid producing a new
Emacs binary when not necessary.

7 years agoHandle indentation of nested ternary operators in JS
Dmitry Gutov [Thu, 13 Apr 2017 00:50:41 +0000 (03:50 +0300)]
Handle indentation of nested ternary operators in JS

* lisp/progmodes/js.el (js--looking-at-operator-p):
Handle nested ternary operators.

7 years agoDon't call 'kill-this-buffer' outside of menus
Eli Zaretskii [Wed, 12 Apr 2017 20:14:20 +0000 (23:14 +0300)]
Don't call 'kill-this-buffer' outside of menus

* lisp/simple.el (kill-current-buffer): New function.
(completion-list-mode-map): Use it instead of kill-this-buffer.
* lisp/type-break.el (type-break-mode):
* lisp/term/ns-win.el (global-map):
* lisp/progmodes/gdb-mi.el (gdb-memory-mode-map)
(gdb-disassembly-mode-map, gdb-frames-mode-map)
(gdb-locals-mode-map, gdb-registers-mode-map):
* lisp/org/org-mhe.el (org-mhe-follow-link):
* lisp/net/secrets.el (secrets-mode-map):
* lisp/net/eudc.el (eudc-mode-map):
* lisp/net/eudc-hotlist.el (eudc-hotlist-mode-map): Use
kill-current-buffer instead of kill-this-buffer.  (Bug#26466)

7 years agoNew internal-border face and args for select-window and x-focus-frame
Martin Rudalics [Wed, 12 Apr 2017 16:22:44 +0000 (18:22 +0200)]
New internal-border face and args for select-window and x-focus-frame

Add `internal-border' face and handle it whenever clearing the
internal border.  If NORECORD equals the symbol
'mark-for-redisplay', `select-window' will not record the window
but still mark it for redisplay.  The new argument NOACTIVATE
for `x-focus-frame' tries to not activate FRAME when set.

* lisp/faces.el (internal-border): New face.
* lisp/mwheel.el (mwheel-scroll): Select window to scroll with
`mark-for-redisplay'.
* lisp/scroll-bar.el (scroll-bar-drag)
(scroll-bar-horizontal-drag, scroll-bar-scroll-down)
(scroll-bar-scroll-up, scroll-bar-toolkit-scroll)
(scroll-bar-toolkit-horizontal-scroll): Select window to scroll
with `mark-for-redisplay'.
* lisp/window.el (handle-select-window): When
`focus-follows-mouse' is not 'auto-raise' try to not activate
FRAME.
* src/dispextern.h (face_id): Add INTERNAL_BORDER_FACE_ID.
* src/frame.c (Fx_focus_frame): New argument NOACTIVATE.
* src/frame.h (x_focus_frame): Update extern declaration.
* src/gtkutil.c (xg_clear_under_internal_border): Remove
function.
(xg_frame_resized, xg_frame_set_char_size): Call
x_clear_under_internal_border.
(xg_tool_bar_callback): Adapt x_focus_frame call.
* src/gtkutil.h (xg_clear_under_internal_border): Remove
declaration.
* src/nsfns.m (x_focus_frame): Add argument NOACTIVATE.
* src/w32fns.c (x_clear_under_internal_border): Fill border
with internal-border background if specified.
* src/w32term.h (x_clear_under_internal_border): Add extern
declaration.
* src/w32term.c (x_after_update_window_line): Fill border
with internal-border background if specified.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar)
(x_scroll_bar_clear, w32_read_socket): Call
x_clear_under_internal_border.
(x_focus_frame): New argument NOACTIVATE.
* src/window.c (select_window): Mark WINDOW for redisplay when
NORECORD equals 'mark-for-redisplay'.
(Fselect_window): Update doc-string.
(syms_of_window): Define Qmark_for_redisplay.
* src/xdisp.c (clear_garbaged_frames, echo_area_display)
(redisplay_internal): Call x_clear_under_internal_border.
* src/xfaces.c (lookup_basic_face): Handle `window-divider'
and `internal-border' faces.
(realize_basic_faces): Realize `internal-border' face.
(syms_of_xfaces): Define Qinternal_border.
* src/xfns.c (x_set_internal_border_width): Remove call for
xg_clear_under_internal_border.
(x_focus_frame): New argument NOACTIVATE.  When non-nil try to not
activate frame.
* src/xterm.c (x_fill_rectangle): No more static.
(x_clear_under_internal_border, x_after_update_window_line):
Fill border with internal-border background if specified.
(xt_horizontal_action_hook): Rewrite.
(handle_one_xevent): Call x_clear_under_internal_border.
* src/xterm.h (x_fill_rectangle): Add extern declaration.

7 years agoPort recent frame changes to --enable-gcc-warnings
Paul Eggert [Wed, 12 Apr 2017 14:27:23 +0000 (07:27 -0700)]
Port recent frame changes to --enable-gcc-warnings

* src/frame.c (next_frame, prev_frame):
Remove now-redundant assertions.
* src/frame.h (FOR_EACH_FRAME): Assume Vframe_list is nonempty.

7 years agoScroll right and left using wheel-right and wheel-left.
Tak Kunihiro [Wed, 12 Apr 2017 13:29:35 +0000 (16:29 +0300)]
Scroll right and left using wheel-right and wheel-left.

These changes also make use of touchpad and trackpad (Bug#26347).

* doc/emacs/frames.texi (Mouse Commands): Document horizontal
scrolling using the mouse wheel.

* lisp/mwheel.el (mwheel-scroll): Respond to wheel-right and wheel-left.
(mwheel-tilt-scroll-p, mwheel-flip-direction)
(mwheel-scroll-left-function, mwheel-scroll-right-function): New
defcustoms.
(mouse-wheel-left-event, mouse-wheel-right-event): New variables,
events that calls wheel-left/right.

* etc/NEWS: Mention horizontal scrolling using the mouse wheel.

7 years ago* lisp/Makefile.in (autoloads-force): Fix usage of ".PHONY".
Eli Zaretskii [Wed, 12 Apr 2017 09:01:48 +0000 (12:01 +0300)]
* lisp/Makefile.in (autoloads-force): Fix usage of ".PHONY".

7 years agoAdd new frame parameters and associated functions
Martin Rudalics [Wed, 12 Apr 2017 08:38:25 +0000 (10:38 +0200)]
Add new frame parameters and associated functions

Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'.  Add new
functions `frame-restack' and `frame-list-z-order'.

* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters.  Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite.  Try to not ignore errors.  Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite.  Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame.  Try to handle the `no-accept-focus' parameter.  Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially.  Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions.  If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped.  When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'.  Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.

7 years agoUpdate a package test for hydra
Glenn Morris [Tue, 11 Apr 2017 15:42:54 +0000 (08:42 -0700)]
Update a package test for hydra

* test/lisp/emacs-lisp/package-tests.el (with-package-test):
Also bind package-gnupghome-dir, see eg
http://hydra.nixos.org/build/51462182 .

7 years agoFrame movement, focus and hook related changes
Martin Rudalics [Tue, 11 Apr 2017 10:37:26 +0000 (12:37 +0200)]
Frame movement, focus and hook related changes

New hook `move-frame-functions'.  Run `focus-in-hook'
after switching to frame that gets focus.  Don't run
XMoveWindow for GTK.

* lisp/frame.el (handle-move-frame, frame-size-changed-p): New
functions.

* src/frame.c (do_switch_frame): Simplify code.
(Fhandle_switch_frame): Switch frame before running
`handle-focus-in'.
(Vfocus_in_hook, Vfocus_out_hook): Clarify doc-strings.
(Vmove_frame_functions): New hook variable.
* src/keyboard.c (kbd_buffer_get_event): Handle
MOVE_FRAME_EVENT.  Handle SELECT_WINDOW_EVENT separately.
(head_table): Add Qmove_frame entry.
(syms_of_keyboard): Add Qmove_frame.
(keys_of_keyboard): Define key for `move-frame'.
* src/termhooks.h (event_kind): Add MOVE_FRAME_EVENT.
* src/w32term.c (w32_read_socket): Create MOVE_FRAME_EVENT.
* src/window.c (run_window_size_change_functions): Record size of
FRAME's minibuffer window too.
* src/xterm.c (handle_one_xevent): Create MOVE_FRAME_EVENT.
(x_set_offset): For GTK call gtk_widget_move instead of
XMoveWindow.

7 years agoAvoid abort in ftfont.c due to faulty fonts
Werner LEMBERG [Tue, 11 Apr 2017 10:06:30 +0000 (13:06 +0300)]
Avoid abort in ftfont.c due to faulty fonts

* src/ftfont.c (ftfont_get_metrics): Try loading the font without
hinting, before aborting.  (Bug#25945)

7 years agoIntroduce customizable variable 'package-gnupghome-dir'
Jens Lechtenboerger [Tue, 11 Apr 2017 09:27:37 +0000 (12:27 +0300)]
Introduce customizable variable 'package-gnupghome-dir'

* lisp/emacs-lisp/package.el (package-import-keyring)
(package--check-signature-content, package-check-signature):
Use new variable package-gnupghome-dir to control which GnuPG
homedir to use.
* doc/emacs/package.texi: Mention package-gnupghome-dir.
* etc/NEWS: Mention package-gnupghome-dir.

7 years agoSet x_gtk_use_window_move by default for fixing bug#25851 and bug#25943
Martin Rudalics [Tue, 11 Apr 2017 06:29:41 +0000 (08:29 +0200)]
Set x_gtk_use_window_move by default for fixing bug#25851 and bug#25943

This activates a change that was installed a few weeks ago but whose
ChangeLog was inadvertently dropped during its commit.  The proper
ChangeLog is included below as part of the present commit.

* src/gtkutil.c (xg_set_geometry): When x_gtk_use_window_move
is set avoid calling x_gtk_parse_geometry (Bug#25851).
(x_wm_set_size_hint): When x_gtk_use_window_move is set, set
PPosition, USPosition and USSize flags if requested.
* src/xterm.c (x_set_offset): With GTK when
x_gtk_use_window_move is set, leave it entirely to
gtk_window_move to position the window and skip any
post-adjustments (Bug#25851 and Bug#25943).
(x_gtk_use_window_move): New variable.

7 years agoFix a loop in C Mode caused by inadequate analysis of comments.
Alan Mackenzie [Mon, 10 Apr 2017 21:01:38 +0000 (21:01 +0000)]
Fix a loop in C Mode caused by inadequate analysis of comments.

After M-;, and the insertion of the opening "/*", the CC Mode after-change
function got confused, since the new comment opener matched the end of a
subsequent comment, but moving back over that comment did not come back to the
starting point.  Fix this.

* lisp/progmodes/cc-engine.el (c-end-of-macro): Add a limit parameter, wherer
point is left if no end-of-macro is found before it.
(c-forward-sws): Change the `safe-start' mechanism.  Now `safe-start' is
non-nil except where we have an unclosed block comment at the end of a macro.
This enables us to populate the cache more fully, at the cost of some run
time.

7 years agoAdd PVSIZE function to return the size of a pseudovector.
Lars Brinkhoff [Mon, 3 Apr 2017 06:42:18 +0000 (08:42 +0200)]
Add PVSIZE function to return the size of a pseudovector.

* src/lisp.h (PVSIZE): New function.

* src/chartab.c (copy_char_table):
* src/data.c (Ftype_of, Finteractive_form, Faref, Faset):
* src/doc.c (Fdocumentation, store_function_docstring):
* src/eval.c (Fcommandp, funcall_lambda, lambda_arity, Ffetch_bytecode):
* src/fns.c (Flength, Fcopy_sequence):
* src/font.h (FONT_SPEC_P, FONT_ENTITY_P, FONT_OBJECT_P):
* src/lread.c (substitute_object_recurse):
* src/src/print.c (print_object):
  Use it.

7 years agoAdd Tramp tests
Michael Albinus [Mon, 10 Apr 2017 15:22:13 +0000 (17:22 +0200)]
Add Tramp tests

* lisp/net/tramp.el (tramp-syntax): Adapt docstring.

* test/lisp/net/tramp-tests.el
(tramp-test01-file-name-syntax-simplified)
(tramp-test01-file-name-syntax-separate)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate): New tests.

7 years agoMake sure that `shell' makes BUFFER current
Martin Rudalics [Mon, 10 Apr 2017 08:21:44 +0000 (10:21 +0200)]
Make sure that `shell' makes BUFFER current

* lisp/shell.el (shell): Restrict scope of recently added
`with-current-buffer' to make sure that BUFFER is current when
`shell' returns.

7 years ago; Add a FIXME about handing a missing find or grep program
Dmitry Gutov [Mon, 10 Apr 2017 03:22:55 +0000 (06:22 +0300)]
; Add a FIXME about handing a missing find or grep program

7 years agoDefault to PCRE syntax when reading .hgignore
Jim Blandy [Mon, 10 Apr 2017 02:52:09 +0000 (05:52 +0300)]
Default to PCRE syntax when reading .hgignore

* lisp/vc/vc-hg.el (vc-hg--slurp-hgignore-1):
Default to the PCRE syntax (bug#26249).

7 years agoDocument Tramp changes
Michael Albinus [Sun, 9 Apr 2017 11:28:24 +0000 (13:28 +0200)]
Document Tramp changes

* doc/misc/tramp.texi (Change file name syntax): New node.

* etc/NEWS: Mention `tramp-change-syntax'.

* lisp/net/tramp.el (tramp-file-name-regexp): Reinsert it.
External packages uses it.
(tramp-syntax): Set also `tramp-file-name-regexp'.

7 years agoMerge from gnulib (Bug#26398)
Paul Eggert [Sun, 9 Apr 2017 07:53:27 +0000 (00:53 -0700)]
Merge from gnulib (Bug#26398)

This incorporates:
2017-04-08 getopt: prefer - to _ in new file names
2017-04-08 getopt: port recent getopt changes to macOS
* .gitignore: Add lib/getopt-cdefs.h.
* lib/getopt-cdefs.in.h: Rename from lib/getopt_cdefs.in.h.
* lib/getopt-core.h: Rename from lib/getopt_core.h.
* lib/getopt-ext.h: Rename from lib/getopt_ext.h.
* lib/getopt-pfx-core.h: Rename from lib/getopt_pfx_core.h.
* lib/getopt-pfx-ext.h: Rename from lib/getopt_pfx_ext.h.
* lib/getopt.in.h, lib/unistd.in.h, m4/getopt.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.

7 years agoWrite updated loaddefs to a temporary file and rename into place.
Ken Raeburn [Sun, 9 Apr 2017 06:13:43 +0000 (02:13 -0400)]
Write updated loaddefs to a temporary file and rename into place.

In a parallel build, byte compilation can be running at the same times
as loaddefs.el is being regenerated.  However, in a CANNOT_DUMP build,
loaddefs.el is read at startup and must always be in a usable state.

* lisp/Makefile.in ($(lisp)/loaddefs.el): Write generated output to
loaddefs.el.new and then rename it to loaddefs.el.

7 years agoIn the manual, mention pops and imaps
Glenn Morris [Sun, 9 Apr 2017 02:35:38 +0000 (19:35 -0700)]
In the manual, mention pops and imaps

* doc/emacs/rmail.texi (Movemail, Remote Mailboxes):
Mention pops and imaps protocols.

7 years ago* doc/emacs/rmail.texi: Prefer @command to @code for movemail.
Glenn Morris [Sun, 9 Apr 2017 02:24:13 +0000 (19:24 -0700)]
* doc/emacs/rmail.texi: Prefer @command to @code for movemail.

7 years agoFix rmail handling of movemail protocols (bug#18278)
Sergey Poznyakoff [Sun, 9 Apr 2017 01:40:53 +0000 (18:40 -0700)]
Fix rmail handling of movemail protocols (bug#18278)

* lisp/mail/rmail.el (rmail-remote-proto-p): New function.
(rmail-parse-url): Return protocol in second list element.
Only use passwords with remote mailboxes.
(rmail-insert-inbox-text): Handle non-simple local
mailboxes (maildir, MH, etc.).

7 years agoFix typos in manual re movemail local mailboxes
Glenn Morris [Sun, 9 Apr 2017 01:10:10 +0000 (18:10 -0700)]
Fix typos in manual re movemail local mailboxes

* doc/emacs/rmail.texi (Movemail, Other Mailbox Formats):
Fix examples of local mailbox urls.

7 years ago* lisp/gnus/nnmail.el (nnmail-crosspost-link-function): Simplify.
Glenn Morris [Sat, 8 Apr 2017 20:45:55 +0000 (13:45 -0700)]
* lisp/gnus/nnmail.el (nnmail-crosspost-link-function): Simplify.

7 years agoRemove references to OS/2 in code, doc, and comments
Glenn Morris [Sat, 8 Apr 2017 20:16:08 +0000 (13:16 -0700)]
Remove references to OS/2 in code, doc, and comments

* lisp/gnus/nnheader.el (nnheader-read-timeout)
(nnheader-file-name-translation-alist): Remove OS/2 case, and simplify.
* lisp/emulation/viper-util.el (viper-color-defined-p):
* lisp/net/pop3.el (pop3-read-timeout):
* lisp/net/imap.el (imap-read-timeout):
* lisp/url/url-privacy.el (url-setup-privacy-info): Remove OS/2 case.
* lisp/emulation/viper-ex.el (viper-glob-function):
* lisp/vc/ediff-util.el (ediff-submit-report): Doc fix.
* lisp/cus-edit.el (custom-display): Remove "pm" (OS/2).
* doc/emacs/msdos-xtra.texi (MS-DOS):
* doc/misc/gnus.texi (Various Various):
* doc/misc/viper.texi (Rudimentary Changes): Remove mentions of OS/2.
; * lisp/url/url.el, lisp/url/url-vars.el:
; * lisp/progmodes/cperl-mode.el: Remove old comments.

7 years agoTune Tramp syntax
Michael Albinus [Sat, 8 Apr 2017 16:35:06 +0000 (18:35 +0200)]
Tune Tramp syntax

* lisp/net/tramp-cmds.el (tramp-change-syntax):
Use `tramp-syntax-values'.

* lisp/net/tramp-compat.el (tramp-compat-tramp-syntax): New defsubst.

* lisp/net/tramp.el (tramp-syntax): Rename possible values.
(tramp-syntax-values): New defun.
(tramp-prefix-format, tramp-method-regexp)
(tramp-postfix-method-format, tramp-prefix-ipv6-format)
(tramp-postfix-ipv6-format, tramp-postfix-host-format)
(tramp-completion-file-name-regexp): Use `tramp-compat-tramp-syntax'
and changed values.
(tramp-completion-file-name-regexp-default): Rename from
`tramp-completion-file-name-regexp-unified'.  Adapt docstring.
(tramp-completion-file-name-regexp-simplified): Rename from
`tramp-completion-file-name-regexp-old-style'.  Adapt docstring.
(tramp-initial-completion-file-name-regexp):
Use `tramp-completion-file-name-regexp-default'.
(tramp-run-real-handler): Do not autoload any longer.

7 years agoReplace more nested ifs with cond
Mark Oteiza [Sat, 8 Apr 2017 15:34:17 +0000 (11:34 -0400)]
Replace more nested ifs with cond

This is a continuation of d526047 "Replace more nested ifs with cond".
* lisp/play/dunnet.el (dun-firstword, dun-firstwordl, dun-cat): Use
when and cond where appropriate.

7 years agoAdjust the edebug spec of if-let*
Mark Oteiza [Sat, 8 Apr 2017 15:30:36 +0000 (11:30 -0400)]
Adjust the edebug spec of if-let*

This was fixed in Bug#24748, but now looking more closely, using gate in
the spec seems correct.  See (info "(elisp) Backtracking").
* lisp/emacs-lisp/subr-x.el (if-let*): Use gate in edebug spec.

7 years agoReplace some uses of cl-member-if with apply
Mark Oteiza [Sat, 8 Apr 2017 15:27:17 +0000 (11:27 -0400)]
Replace some uses of cl-member-if with apply

From the mhtml-mode series.  Some of the uses of cl-lib are not
necessary.
* lisp/align.el: Don't require cl-lib.
(align-region): Use apply instead of cl-member-if.
* lisp/emulation/viper.el: Don't require cl-lib.
(viper-mode, this-major-mode-requires-vi-state): Use apply instead of
cl-member-if.

7 years agoValidate SPEC of `dolist', cf. Bug#25477.
Philipp Stephani [Sun, 26 Mar 2017 18:53:43 +0000 (20:53 +0200)]
Validate SPEC of `dolist', cf. Bug#25477.

* lisp/subr.el (dolist): Test type and length of SPEC.
* test/lisp/subr-tests.el (subr-tests--dolist--wrong-number-of-args):
Add unit test.

7 years agoAdd unit test for Bug#26378
Philipp Stephani [Sat, 8 Apr 2017 14:55:56 +0000 (16:55 +0200)]
Add unit test for Bug#26378

* test/lisp/vc/ediff-diff-tests.el
(ediff-diff-tests--ediff-exec-process--nil): New unit test.

7 years agoFix circular read syntax for records.
Lars Brinkhoff [Sat, 8 Apr 2017 05:07:32 +0000 (07:07 +0200)]
Fix circular read syntax for records.

* lread.c (substitute_object_recurse): Work with records.

* lread-tests.el (lread-record-1): New test.

7 years agoDeprecate copy-record in favor of copy-sequence
Paul Eggert [Sat, 8 Apr 2017 01:54:40 +0000 (18:54 -0700)]
Deprecate copy-record in favor of copy-sequence

Since copy-sequence seems to be needed anyway for records, have it
work on records, and remove copy-record as being superfluous.
* doc/lispref/records.texi (Records, Record Functions):
* lisp/emacs-lisp/cl-macs.el (cl-defstruct):
* lisp/emacs-lisp/eieio.el (make-instance, clone):
* test/src/alloc-tests.el (record-3):
Use copy-sequence, not copy-record, to copy records.
* doc/lispref/sequences.texi (Sequence Functions)
(Array Functions): Document that aref and copy-sequence
work on records.
* etc/NEWS: Omit copy-record.
* src/alloc.c (Fcopy_record): Remove.
* src/data.c (Faref): Document that arg can be a record.
* src/fns.c (Fcopy_sequence): Copy records, too.

7 years agoFix dependency checking in src/Makefile.in
Paul Eggert [Sat, 8 Apr 2017 01:54:40 +0000 (18:54 -0700)]
Fix dependency checking in src/Makefile.in

* src/Makefile.in (AUTO_DEPEND, DEPDIR, DEPFLAGS): Move includes of
dependency files until after ALLOBJS is defined, since it uses ALLOBJS.
Otherwise, some dependencies will be missed.

7 years agoMinor tuneup of write-region change
Paul Eggert [Sat, 8 Apr 2017 01:54:39 +0000 (18:54 -0700)]
Minor tuneup of write-region change

* src/fileio.c (write_region): Use SCHARS, not Flength,
on a value known to be a string.

7 years agoAdjust write-region so file name is at the beginning again
Noam Postavsky [Fri, 7 Apr 2017 23:54:11 +0000 (19:54 -0400)]
Adjust write-region so file name is at the beginning again

* lisp/epa-file.el (epa-file-write-region):
* lisp/gnus/mm-util.el (mm-append-to-file):
* lisp/jka-compr.el (jka-compr-write-region):
* lisp/net/ange-ftp.el (ange-ftp-write-region):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* src/fileio.c (write_region): Put file name at the beginning and move
number of characters to the end of the message.

7 years agoCheck that file argument is a string
Kaushal Modi [Wed, 5 Apr 2017 21:16:33 +0000 (17:16 -0400)]
Check that file argument is a string

* lisp/vc/ediff-diff.el (ediff-exec-process): Check that the argument
  passed to `file-local-copy' is a string (Bug#26378).  Also fix
  the existing comment for this function, and convert it to its
  doc-string.

7 years agoFix handling of non-integer START param to write-region
Noam Postavsky [Fri, 7 Apr 2017 22:24:35 +0000 (18:24 -0400)]
Fix handling of non-integer START param to write-region

The previous patch for Bug#354 incorrectly assumed that START would
always be an integer.

* lisp/epa-file.el (epa-file-write-region):
* lisp/jka-compr.el (jka-compr-write-region):
* lisp/net/ange-ftp.el (ange-ftp-write-region):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* src/fileio.c (write_region): Handle nil and string values of START.

7 years ago* lisp/textmodes/rst.el (rst-package-emacs-version-alist): Fixes.
Glenn Morris [Fri, 7 Apr 2017 17:42:58 +0000 (13:42 -0400)]
* lisp/textmodes/rst.el (rst-package-emacs-version-alist): Fixes.

7 years agoAdd Tramp versions to `customize-package-emacs-version-alist'
Michael Albinus [Fri, 7 Apr 2017 16:43:25 +0000 (18:43 +0200)]
Add Tramp versions to `customize-package-emacs-version-alist'

* lisp/net/trampver.el (customize-package-emacs-version-alist):
Add Tramp versions to `customize-package-emacs-version-alist'.

7 years ago* lisp/textmodes/rst.el (rst-toc-link-keymap): Move before first use.
Tom Tromey [Fri, 7 Apr 2017 15:43:42 +0000 (09:43 -0600)]
* lisp/textmodes/rst.el (rst-toc-link-keymap): Move before first use.

7 years ago* records.texi (Record Functions): fix typo.
Lars Brinkhoff [Fri, 7 Apr 2017 04:56:52 +0000 (06:56 +0200)]
* records.texi (Record Functions): fix typo.

7 years agoMore casefiddle minor fixes
Paul Eggert [Fri, 7 Apr 2017 03:02:15 +0000 (20:02 -0700)]
More casefiddle minor fixes

* src/casefiddle.c (case_character_impl): Omit unnecessary casts.
(case_character_impl): Avoid reevaluation of CHAR_TABLE_REF.
(GREEK_CAPITAL_LETTER_SIGMA): Fix typo in my previous change.

7 years ago; Spelling and punctuation fixes
Paul Eggert [Fri, 7 Apr 2017 02:26:28 +0000 (19:26 -0700)]
; Spelling and punctuation fixes

7 years agoOutput number of characters added to file (Bug#354)
Jeff Clough [Fri, 27 Feb 2015 13:52:12 +0000 (08:52 -0500)]
Output number of characters added to file (Bug#354)

* fileio.c (write_region):
* epa-file.el (epa-file-write-region):
* jka-compr.el (jka-compr-write-region):
* ange-ftp.el (ange-ftp-write-region):
* tramp-gvfs.el (tramp-gvfs-handle-write-region):
* tramp-sh.el (tramp-sh-handle-write-region):
* mm-util.el (mm-append-to-file): Functions now output
characters written in addition to file name.
* files.texi: Added documentation to write-region and
append-to-file describing their output.

7 years agoFix ‘!NILP (Vpurify_flag)’ assertion failure during temacs bootstrap
Noam Postavsky [Fri, 7 Apr 2017 01:45:27 +0000 (03:45 +0200)]
Fix ‘!NILP (Vpurify_flag)’ assertion failure during temacs bootstrap

The recent changes to src/casefiddle.c cause build failure as seen
below:

    Starting program: /home/npostavs/src/emacs/emacs-bootstrapping/src/temacs
--batch --load loadup bootstrap
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/usr/lib/libthread_db.so.1".
    Loading loadup.el (source)...
    Using load-path (/home/npostavs/src/emacs/emacs-bootstrapping/lisp
/home/npostavs/src/emacs/emacs-bootstrapping/lisp/emacs-lisp
/home/npostavs/src/emacs/emacs-bootstrapping/lisp/language
/home/npostavs/src/emacs/emacs-bootstrapping/lisp/international
/home/npostavs/src/emacs/emacs-bootstrapping/lisp/textmodes
/home/npostavs/src/emacs/emacs-bootstrapping/lisp/vc)
    Loading emacs-lisp/byte-run (source)...
    Loading emacs-lisp/backquote (source)...
    Loading subr (source)...
    Loading version (source)...
    Loading widget (source)...
    Loading custom (source)...
    Loading emacs-lisp/map-ynp (source)...
    Loading international/mule (source)...
    Loading international/mule-conf (source)...

    lread.c:3914: Emacs fatal error: assertion failed: !NILP (Vpurify_flag)

    Breakpoint 1, terminate_due_to_signal at emacs.c:363
    363   signal (sig, SIG_DFL);
    (gdb) bt
    #0  0x0000000000579826 in terminate_due_to_signal at emacs.c:363
    #1  0x000000000060ec33 in die at alloc.c:7352
    #2  0x000000000066db40 in intern_c_string_1 at lread.c:3914
    #3  0x0000000000576884 in intern_c_string at lisp.h:3790
    #4  0x00000000005dc84f in prepare_casing_context at casefiddle.c:69
    #5  0x00000000005dd37f in casify_object at casefiddle.c:311
    #6  0x00000000005dd47f in Fcapitalize at casefiddle.c:356
    #7  0x00000000006325ac in eval_sub at eval.c:2219
    #8  0x0000000000632368 in eval_sub at eval.c:2184
    #9  0x000000000063446c in apply_lambda at eval.c:2875
    #10 0x00000000006329af in eval_sub at eval.c:2294
    #11 0x000000000062d462 in Fprogn at eval.c:449
    #12 0x000000000062d4cf in prog_ignore at eval.c:461
    #13 0x000000000062f19c in Fwhile at eval.c:982
    #14 0x00000000006321f4 in eval_sub at eval.c:2172
    #15 0x000000000062d462 in Fprogn at eval.c:449
    #16 0x000000000062f0c4 in Flet at eval.c:963
    #17 0x00000000006321f4 in eval_sub at eval.c:2172
    #18 0x0000000000632963 in eval_sub at eval.c:2290
    #19 0x000000000062d462 in Fprogn at eval.c:449
    #20 0x000000000062f0c4 in Flet at eval.c:963
    #21 0x00000000006321f4 in eval_sub at eval.c:2172
    #22 0x0000000000668caa in readevalloop at lread.c:1927
    #23 0x0000000000667253 in Fload at lread.c:1332
    #24 0x0000000000632683 in eval_sub at eval.c:2233
    #25 0x0000000000668caa in readevalloop at lread.c:1927
    #26 0x0000000000667253 in Fload at lread.c:1332
    #27 0x0000000000632683 in eval_sub at eval.c:2233
    #28 0x0000000000631be5 in Feval at eval.c:2041
    #29 0x000000000057e1af in top_level_2 at keyboard.c:1121
    #30 0x000000000062ffc7 in internal_condition_case at eval.c:1324
    #31 0x000000000057e1f0 in top_level_1 at keyboard.c:1129
    #32 0x000000000062f51e in internal_catch at eval.c:1091
    #33 0x000000000057e0ea in command_loop at keyboard.c:1090
    #34 0x000000000057d6d5 in recursive_edit_1 at keyboard.c:697
    #35 0x000000000057d8b4 in Frecursive_edit at keyboard.c:768
    #36 0x000000000057b55b in main at emacs.c:1687

    Lisp Backtrace:
    "capitalize" (0xffffcf70)
    "format" (0xffffd130)
    "define-charset" (0xffffd370)
    "while" (0xffffd560)
    "let" (0xffffd7c0)
    "dolist" (0xffffd910)
    "let" (0xffffdb70)
    "load" (0xffffdfe0)
    "load" (0xffffe4a0)

* src/casefiddle.c (syms_of_casefiddle): Declare four new symbols:
Qtitlecase, Qspecial_uppercase, Qspecial_lowercase and
Qspecial_titlecase.
(prepare_casing_context): Use aforementioned symbols.

7 years agoMerge from gnulib
Paul Eggert [Thu, 6 Apr 2017 23:29:36 +0000 (16:29 -0700)]
Merge from gnulib

This merges some getopt fixes from Zack Weinberg, and affects only
non-GNUish platforms.  It incorporates:
2017-04-06 getopt-gnu: omit some duplicate code
2017-04-06 getopt-posix: use angle-bracket include
2017-04-06 getopt: annotate files with relationship to glibc
2017-04-06 getopt: split up getopt.in.h and eliminate __need_getopt
2017-04-06 getopt: better handling of ambiguous options
2017-04-06 getopt: refactor long-option handling
2017-04-06 getopt: tidy up _getopt_initialize a bit
2017-04-06 getopt: merge from glibc: repetition reduction
2017-04-06 getopt: clean up error reporting
2017-04-06 getopt: fix fencepost error in ambiguous-W-option handling
2017-04-06 getopt: clean up getopt.c and getopt1.c file headers
2017-04-06 getopt: harmonize comments with glibc
2017-04-06 getopt: remove USE_NONOPTION_FLAGS
2017-04-06 getopt: tabify, in preparation for merge with glibc
2017-04-06 md5, sha1, sha256, sha512: Add comments re correctness
* build-aux/config.sub, doc/misc/texinfo.tex, lib/getopt.c:
* lib/getopt.in.h, lib/getopt1.c, lib/getopt_int.h, lib/md5.c:
* lib/md5.h, lib/sha1.c, lib/sha1.h, lib/sha256.c, lib/sha256.h:
* lib/sha512.c, lib/sha512.h, lib/unistd.in.h, m4/getopt.m4:
Copy from gnulib.
* lib/getopt_cdefs.in.h, lib/getopt_core.h, lib/getopt_ext.h:
* lib/getopt_pfx_core.h, lib/getopt_pfx_ext.h:
New files, taken from gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4:
Regenerate.

7 years agoMinor casefiddle.c cleanups
Paul Eggert [Thu, 6 Apr 2017 22:05:13 +0000 (15:05 -0700)]
Minor casefiddle.c cleanups

* src/casefiddle.c: Redo recent changes to match GNU style,
and prefer C99-style decls within blocks.
(GREEK_CAPITAL_LETTER_SIGMA): Rename from CAPITAL_SIGMA, so that
we are merely using the Unicode name, and make it a constant
rather than a macro.  All uses changed.
(SMALL_SIGMA): Remove; unused.
(GREEK_SMALL_LETTER_FINAL_SIGMA): Rename from SMALL_FINAL_SIGMA,
and make it a constant rather than a macro.  All uses changed.
(do_casify_multibyte_string): Use ‘verify’ rather than an
unportable static_assertion local.

7 years ago* lisp/international/README: Update to match current list.
Paul Eggert [Thu, 6 Apr 2017 21:59:37 +0000 (14:59 -0700)]
* lisp/international/README: Update to match current list.

7 years agoFix 'make clean' in lib subdirectory
Paul Eggert [Thu, 6 Apr 2017 20:41:30 +0000 (13:41 -0700)]
Fix 'make clean' in lib subdirectory

* lib/Makefile.in (clean): Remove *-t files.
(mostlyclean): Remove MOSTLYCLEANFILES that are not *-t files.
This removes files like lib/getopt.h that should be removed
even if this configuration did not need to build them.
(maintainer-clean): Remove TAGS here, not in distclean,
to be consistent with ../src/Makefile.in.

7 years agoAdd new Tramp syntax
Michael Albinus [Thu, 6 Apr 2017 19:00:29 +0000 (21:00 +0200)]
Add new Tramp syntax

* lisp/net/tramp-cmds.el (tramp-change-syntax): New defun.

* lisp/net/tramp.el (tramp-syntax): Change default to `def'.
Add :set function.
(tramp-prefix-port-format): Simplify.
(tramp-file-name-regexp-separate): Remove.
(tramp-initial-file-name-regexp)
(tramp-completion-file-name-regexp-old-style)
(tramp-initial-completion-file-name-regexp): New defconst.
(tramp-prefix-format, tramp-prefix-regexp)
(tramp-method-regexp, tramp-postfix-method-format)
(tramp-postfix-method-regexp, tramp-prefix-ipv6-format)
(tramp-prefix-ipv6-regexp, tramp-postfix-ipv6-format)
(tramp-postfix-ipv6-regexp)
(tramp-postfix-host-format, tramp-postfix-host-regexp)
(tramp-remote-file-name-spec-regexp)
(tramp-file-name-structure, tramp-file-name-regexp)
(tramp-completion-file-name-regexp)
(tramp-rfn-eshadow-update-overlay-regexp): Change them to be defuns.
(tramp-tramp-file-p, tramp-find-method)
(tramp-dissect-file-name, tramp-make-tramp-file-name)
(tramp-completion-make-tramp-file-name)
(tramp-rfn-eshadow-update-overlay)
(tramp-register-autoload-file-name-handlers)
(tramp-register-file-name-handlers)
(tramp-unload-file-name-handlers)
(tramp-completion-handle-file-name-all-completions)
(tramp-completion-dissect-file-name, tramp-clear-passwd):
* lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler):
* lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered)
(tramp-compute-multi-hops): Use them.

7 years agoImplement special sigma casing rule (bug#24603)
Michal Nazarewicz [Sun, 18 Sep 2016 22:52:47 +0000 (00:52 +0200)]
Implement special sigma casing rule  (bug#24603)

In Greek, a sigma character has two lower case forms which depend on
their position in the word.  Implement logic determining it.

* src/casefiddle.c (struct casing_context, case_character_impl): Don’t
assume inword is true when flag is CASE_UP and false when flag is
CASE_DOWN.  For final sigma detection we need this information tracked
reliably;.
(CAPITAL_SIGMA, SMALL_SIGMA, SMALL_FINAL_SIGMA): New macros defining
Unicode code point of different forms of sigma letter.
(case_character): Implement support for final sigma casing.
(do_casify_multibyte_string, do_casify_multibyte_region): Update after
changes to case_character.

* test/src/casefiddle-tests.el (casefiddle-tests-casing): Add test
cases for final sigma.

7 years agoSupport casing characters which map into multiple code points (bug#24603)
Michal Nazarewicz [Tue, 4 Oct 2016 22:06:01 +0000 (00:06 +0200)]
Support casing characters which map into multiple code points  (bug#24603)

Implement unconditional special casing rules defined in Unicode standard.

Among other things, they deal with cases when a single code point is
replaced by multiple ones because single character does not exist (e.g.
‘fi’ ligature turning into ‘FL’) or is not commonly used (e.g. ß turning
into SS).

* admin/unidata/SpecialCasing.txt: New data file pulled from Unicode
standard distribution.
* admin/unidata/README: Mention SpecialCasing.txt.

* admin/unidata/unidata-get.el (unidata-gen-table-special-casing,
unidata-gen-table-special-casing--do-load): New functions generating
‘special-uppercase’, ‘special-lowercase’ and ‘special-titlecase’
character Unicode properties built from the SpecialCasing.txt Unicode
data file.

* src/casefiddle.c (struct casing_str_buf): New structure for
representing short strings used to handle one-to-many character
mappings.

(case_character_imlp): New function which can handle one-to-many
character mappings.
(case_character, case_single_character): Wrappers for the above
functions.  The former may map one character to multiple (or no)
code points while the latter does what the former used to do (i.e.
handles one-to-one mappings only).

(do_casify_natnum, do_casify_unibyte_string,
do_casify_unibyte_region): Use case_single_character.
(do_casify_multibyte_string, do_casify_multibyte_region): Support new
features of case_character.
* (do_casify_region): Updated to reflact do_casify_multibyte_string
changes.

(casify_word): Handle situation when one character-length of a word
can change affecting where end of the word is.

(upcase, capitalize, upcase-initials): Update documentation to mention
limitations when working on characters.

* test/src/casefiddle-tests.el (casefiddle-tests-char-properties):
Add test cases for the newly introduced character properties.
(casefiddle-tests-casing): Update test cases which are now passing.

* test/lisp/char-fold-tests.el (char-fold--ascii-upcase,
char-fold--ascii-downcase): New functions which behave like old ‘upcase’
and ‘downcase’.
(char-fold--test-match-exactly): Use the new functions.  This is needed
because otherwise fi and similar characters are turned into their multi-
-character representation.

* doc/lispref/strings.texi: Describe issue with casing characters versus
strings.
* doc/lispref/nonascii.texi: Describe the new character properties.

7 years agoSplit up casify_region function (bug#24603)
Michal Nazarewicz [Sun, 18 Sep 2016 23:47:34 +0000 (01:47 +0200)]
Split up casify_region function  (bug#24603)

No functional changes at this time but splitting casify_region into
a function dealing with multibyte and another dealing with unibyte
buffers will make future code changes slightly easier.

* src/casefiddle.c (casify_region): Move most of the code into two
new functions:
(do_casify_multibyte_region, do_casify_unibyte_region): new functions.

7 years agoAdd support for title-casing letters (bug#24603)
Michal Nazarewicz [Thu, 11 Aug 2016 23:38:49 +0000 (01:38 +0200)]
Add support for title-casing letters  (bug#24603)

* src/casefiddle.c (struct casing_context, prepare_casing_context): Add
titlecase_char_table member.  It’s set to the ‘titlecase’ Unicode
property table if capitalisation has been requested.
(case_character): Make use of the titlecase_char_table to title-case
initial characters when capitalising.

* test/src/casefiddle-tests.el (casefiddle-tests--characters,
casefiddle-tests-casing): Update test cases which are now passing.