]> git.eshelyaron.com Git - emacs.git/log
emacs.git
7 years agoModify `beginning-of-defun-comments'
Noam Postavsky [Tue, 9 May 2017 07:38:49 +0000 (09:38 +0200)]
Modify `beginning-of-defun-comments'

* lisp/emacs-lisp/lisp.el (beginning-of-defun-comments): Try not to stop
in the middle of a multiline comment.

7 years agoFix elisp-tests-with-temp-buffer compilation
Noam Postavsky [Thu, 27 Apr 2017 21:13:33 +0000 (17:13 -0400)]
Fix elisp-tests-with-temp-buffer compilation

* test/lisp/emacs-lisp/lisp-tests.el (elisp-tests-with-temp-buffer):
Don't refer to the =!NAME= as "markers" since they produce variables
with just plain positions, not marker objects.  Explicitly specify
that CONTENTS is evaluated at compile time.  Don't re-evaluate
CONTENTS at runtime.  Fix debug specification.  Suppress warnings due
to BODY not using =!NAME= variables.
(elisp-test-point-position-regex): Rename from
`elisp-test-point-marker-regex'.
(mark-defun-test-buffer): Wrap in `eval-and-compile'.

7 years ago* lisp/emacs-lisp/lisp.el (mark-defun): Simplify moving the point.
Noam Postavsky [Thu, 20 Apr 2017 12:07:19 +0000 (14:07 +0200)]
* lisp/emacs-lisp/lisp.el (mark-defun): Simplify moving the point.

7 years agoFix Bug#21072 and rework `mark-defun'
Marcin Borkowski [Fri, 31 Mar 2017 11:06:06 +0000 (13:06 +0200)]
Fix Bug#21072 and rework `mark-defun'

* test/lisp/progmodes/elisp-mode-tests.el (mark-defun-test-buffer):
  New variable
(mark-defun-no-arg-region-inactive)
(mark-defun-no-arg-region-active)
(mark-defun-arg-region-active)
(mark-defun-pos-arg-region-inactive)
(mark-defun-neg-arg-region-inactive, mark-defun-bob): Add tests for
the new `mark-defun'.

* lisp/emacs-lisp/lisp.el (beginning-of-defun--in-emptyish-line-p):
  New function.
(beginning-of-defun-comments): New function.
(mark-defun): Fix bug#21072, also rewrite large parts of `mark-defun'
to accept a numerical prefix argument.

7 years agoAdd elisp-tests-with-temp-buffer, a new testing macro
Marcin Borkowski [Tue, 14 Feb 2017 10:30:36 +0000 (11:30 +0100)]
Add elisp-tests-with-temp-buffer, a new testing macro

* test/lisp/emacs-lisp/lisp-tests.el
(elisp-test-point-marker-regex) New variable.
(elisp-tests-with-temp-buffer): New macro to help test functions
moving the point and/or mark.

7 years agoAvoid infinite loop in redisplay when header-line-format is invalid
Eli Zaretskii [Fri, 21 Apr 2017 08:10:14 +0000 (11:10 +0300)]
Avoid infinite loop in redisplay when header-line-format is invalid

* src/xdisp.c (handle_invisible_prop): Avoid inflooping when the
string has an invalid %-construct in it and is displayed as part
of mode-line or header-line.  (Bug#26586)

7 years agoAdd tests to check image scaling functionality
Lars Ingebrigtsen [Fri, 21 Apr 2017 04:12:53 +0000 (06:12 +0200)]
Add tests to check image scaling functionality

This is in preparation to doing further work in this area to avoid
regressions.

* test/data/image/blank-200x100.png: New file for testing
image scaling.

* test/manual/image-size-tests.el: New file.

7 years agoAllow svg-image to take all create-image PROPS
Lars Ingebrigtsen [Thu, 20 Apr 2017 21:23:59 +0000 (23:23 +0200)]
Allow svg-image to take all create-image PROPS

* lisp/svg.el (svg-image): Allow passing in PROPS when
creating an image for convenience.

7 years agoTreat non-erroring lisp call as successful eshell command (Bug#26161)
George D. Plymale II [Thu, 20 Apr 2017 18:05:11 +0000 (14:05 -0400)]
Treat non-erroring lisp call as successful eshell command (Bug#26161)

This lets a compound command like 'cd .. && echo ok' print 'ok',
similar to how most other shells behave.

* lisp/eshell/esh-cmd.el (eshell-exit-success-p): Only check if the
last exit code was zero, rather than first checking whether the last
command returned nil.
(eshell-exec-lisp): Set `eshell-last-command-status' to 1 on error.

Copyright-paperwork-exempt: yes

7 years agoFix reading of tab settings in whitespace-mode
Reuben Thomas [Thu, 2 Mar 2017 12:50:06 +0000 (12:50 +0000)]
Fix reading of tab settings in whitespace-mode

lisp/whitespace.el (whitespace-indent-tabs-mode)
whitespace-tab-width): Remove these variables. The underlying
variables `indent-tabs-mode' and `tab-width' are already buffer-local
when needed, and whitespace-mode never changes them.
(whitespace-ensure-local-variables): Remove this function, which only
existed to set the above variables.
(whitespace-cleanup-region, whitespace-regexp)
(whitespace-indentation-regexp, whitespace-report-region)
(whitespace-turn-on, whitespace-color-on): Adjust these functions to
use `indent-tabs-mode' and `tab-width' directly, and not call
`whitespace-ensure-local-variables'.

7 years ago* lisp/vc/vc-hg.el (vc-hg-state-fast): Fix compiler warning
Stefan Monnier [Thu, 20 Apr 2017 21:38:21 +0000 (17:38 -0400)]
* lisp/vc/vc-hg.el (vc-hg-state-fast): Fix compiler warning

by simplifying ascii-test.

7 years agobytecomp: Don't inline functions that use byte-switch (Bug#26518)
Vibhav Pant [Thu, 20 Apr 2017 15:29:15 +0000 (20:59 +0530)]
bytecomp: Don't inline functions that use byte-switch (Bug#26518)

* lisp/emacs-lisp/bytecomp.el (byte-compile-unfold-bcf): Don't inline
  FORM if the bytecode uses the byte-switch instruction. It is
  impossible to guess the correct stack depth while inlining such
  bytecode, resulting in faulty code.

7 years agoDon't register "def" as an autoload prefix (Bug#26412)
Noam Postavsky [Thu, 20 Apr 2017 03:01:43 +0000 (23:01 -0400)]
Don't register "def" as an autoload prefix (Bug#26412)

* lisp/emacs-lisp/autoload.el (autoload--make-defs-autoload): Don't
accept "def" as a prefix.

7 years agoUse substring completion for Info menus and index
Stefan Monnier [Thu, 20 Apr 2017 00:43:41 +0000 (20:43 -0400)]
Use substring completion for Info menus and index

* lisp/info.el (Info-complete-menu-item): Add `category' metadata.
(Info-menu): Simplify now that we use the `default' arg of completing-read.
* lisp/minibuffer.el (completion-category-defaults): Use substring
completion for `info-menu`.

7 years agoRemove some explicit runtime loads of pcase
Glenn Morris [Wed, 19 Apr 2017 20:32:04 +0000 (16:32 -0400)]
Remove some explicit runtime loads of pcase

Pcase is macros, so these should have used eval-when-compile.
Anyway, pcase entry points are autoloaded, so the compiler handles it.
* lisp/profiler.el, lisp/emacs-lisp/eieio-core.el:
* lisp/emacs-lisp/generator.el, lisp/emacs-lisp/subr-x.el:
* lisp/progmodes/xref.el: No need to require pcase.

7 years agoStop cl-lib loading pcase at runtime
Glenn Morris [Wed, 19 Apr 2017 20:28:48 +0000 (16:28 -0400)]
Stop cl-lib loading pcase at runtime

The cause was an unexpanded pcase-defmacro in cl-loaddefs.
* lisp/emacs-lisp/autoload.el (make-autoload):
Treat pcase-defmacro like defmacro.

7 years agoNote frame documentation exceptions for NS builds
Alan Third [Wed, 19 Apr 2017 19:36:40 +0000 (20:36 +0100)]
Note frame documentation exceptions for NS builds

* doc/lispref/frames.texi (Management Parameters, Child Frames): Note
NS differences.

7 years agoFix bug introduced by my last commit
Alan Third [Wed, 19 Apr 2017 16:58:49 +0000 (17:58 +0100)]
Fix bug introduced by my last commit

* src/nsterm.m (ns_draw_fringe_bitmap): Revert key-mashing accident.

7 years agoAdd new frame functionality to NS port
Alan Third [Fri, 14 Apr 2017 09:02:38 +0000 (10:02 +0100)]
Add new frame functionality to NS port

* lisp/frame.el (frame-restack): Call ns-frame-restack.
* src/keyboard.c (kbd_buffer_get_event) [HAVE_NS]: Enable
MOVE_FRAME_EVENT handling.
* src/frame.h:
* src/frame.c: Enable 'z-group', 'undecorated' and 'parent' frame
definitions.
* src/nsfns.m: Add x_set_z_group, x_set_parent_frame and
x_set_undecorated (Cocoa only) to handler struct.
(Fx_create_frame): Handle 'z-group', 'parent-frame' and 'undecorated'
frame parameter.
(Fns_frame_restack): New function.
* src/nsmenu.m (free_frame_tool_bar, update_frame_tool_bar):
FRAME_TOOLBAR_HEIGHT is no longer a variable.
* src/nsterm.h (NS_PARENT_WINDOW_LEFT_POS, NS_PARENT_WINDOW_TOP_POS):
Add #defines to find the screen position of the parent frame.
(NS_TOP_POS): Remove defun.
(EmacsView): Remove redundant toolbar variables and add createToolbar
method.
(FRAME_NS_TITLEBAR_HEIGHT, FRAME_TOOLBAR_HEIGHT): Always calculate the
values instead of storing them in a variable.
* src/nsterm.m (x_set_offset, windowDidMove): Take parent frame
position into account when positioning frames.
(initFrameFromEmacs): Remove toolbar creation code and handle new
frame parameters.
(x_set_window_size): Remove toolbar height calculation.
(x_set_z_group):
(x_set_parent_frame):
(x_set_undecorated) [NS_IMPL_COCOA]: New function.
(x_destroy_window): Detach parent if child closes.
(updateFrameSize): Change NSTRACE message to reflect new reality and
no longer reset frame size.
(windowWillResize): Don’t change NS window name when the titlebar
is invisible.
(createToolbar): Move toolbar creation code into it’s own method.
(toggleFullScreen): FRAME_TOOLBAR_HEIGHT and FRAME_NS_TITLEBAR_HEIGHT
are no longer variables.
(windowDidMove): Fire MOVE_FRAME_EVENT Emacs event.

7 years agoTweak bytecomp's loading of cl-extra
Glenn Morris [Wed, 19 Apr 2017 00:52:22 +0000 (20:52 -0400)]
Tweak bytecomp's loading of cl-extra

* lisp/emacs-lisp/bytecomp.el: Don't force load of cl-extra in a
post-bootstrap emacs where cl-loaddefs does exist.

7 years agoAvoid unnecessary loading of subr-x at run-time
Glenn Morris [Tue, 18 Apr 2017 23:07:28 +0000 (19:07 -0400)]
Avoid unnecessary loading of subr-x at run-time

* lisp/doc-view.el, lisp/filenotify.el, lisp/info-look.el:
* lisp/svg.el, lisp/emacs-lisp/byte-opt.el, lisp/net/shr.el:
* lisp/textmodes/sgml-mode.el, test/lisp/dom-tests.el:
No need to load subr-x at run-time.
* lisp/gnus/nnheader.el: No need to load subr-x.
; * lisp/emacs-lisp/subr-x.el, lisp/gnus/message.el, lisp/net/nsm.el:
; Comments.

7 years agoUse iteration in math-factorial-iter
michael schuldt [Tue, 18 Apr 2017 18:24:37 +0000 (11:24 -0700)]
Use iteration in math-factorial-iter

* lisp/calc/calc-comb.el (math-factorial-iter):
Use iteration instead of recursion to avoid max-specpdl-size problem.
Copyright-paperwork-exempt: yes

7 years ago* test/lisp/kmacro-tests.el: Require seq, for seq-concatenate.
Glenn Morris [Tue, 18 Apr 2017 17:02:02 +0000 (13:02 -0400)]
* test/lisp/kmacro-tests.el: Require seq, for seq-concatenate.

7 years agoAvoid ert test failures
Glenn Morris [Tue, 18 Apr 2017 16:52:33 +0000 (12:52 -0400)]
Avoid ert test failures

* lisp/emacs-lisp/ert.el (ert--expand-should-1):
Avoid errors related to undefined byte-compile-macro-environment.
Somehow masked until very recently because loading seq (eg)
loads bytecomp.  http://hydra.nixos.org/build/51730765

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.