1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00
Commit Graph

128990 Commits

Author SHA1 Message Date
Noam Postavsky
0397f85c6f * lisp/emacs-lisp/lisp.el (mark-defun): Simplify moving the point. 2017-05-12 11:36:45 +02:00
Marcin Borkowski
22fc91704b 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.
2017-05-12 11:36:27 +02:00
Marcin Borkowski
6d58dda40a 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.
2017-05-09 14:26:08 +02:00
Eli Zaretskii
72d7961d67 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)
2017-04-21 11:10:14 +03:00
Lars Ingebrigtsen
b1fe497a44 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.
2017-04-21 06:13:06 +02:00
Lars Ingebrigtsen
0ca61907cf Allow svg-image to take all create-image PROPS
* lisp/svg.el (svg-image): Allow passing in PROPS when
creating an image for convenience.
2017-04-21 06:13:06 +02:00
George D. Plymale II
e8875bcbe0 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
2017-04-20 23:03:10 -04:00
Reuben Thomas
a6b375ba4b 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'.
2017-04-20 22:39:15 -04:00
Stefan Monnier
d490770dd0 * lisp/vc/vc-hg.el (vc-hg-state-fast): Fix compiler warning
by simplifying ascii-test.
2017-04-20 17:38:21 -04:00
Vibhav Pant
b389379c87 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.
2017-04-20 21:23:08 +05:30
Noam Postavsky
4364a769b4 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.
2017-04-19 23:11:44 -04:00
Stefan Monnier
cd56490fef 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`.
2017-04-19 20:43:41 -04:00
Glenn Morris
992e2019d3 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.
2017-04-19 16:32:04 -04:00
Glenn Morris
41a5b76f79 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.
2017-04-19 16:28:48 -04:00
Alan Third
3533623c4a Note frame documentation exceptions for NS builds
* doc/lispref/frames.texi (Management Parameters, Child Frames): Note
NS differences.
2017-04-19 20:48:13 +01:00
Alan Third
21fa90b048 Fix bug introduced by my last commit
* src/nsterm.m (ns_draw_fringe_bitmap): Revert key-mashing accident.
2017-04-19 17:58:49 +01:00
Alan Third
aca21d42d3 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.
2017-04-19 17:17:35 +01:00
Glenn Morris
b6a57fb80c 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.
2017-04-18 20:52:22 -04:00
Glenn Morris
0f83433946 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.
2017-04-18 19:07:28 -04:00
michael schuldt
d831312d66 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
2017-04-18 11:25:13 -07:00
Glenn Morris
0c98dec5c9 * test/lisp/kmacro-tests.el: Require seq, for seq-concatenate. 2017-04-18 13:02:02 -04:00
Glenn Morris
491531b20d 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
2017-04-18 12:52:33 -04:00
Noam Postavsky
861824dbec 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'.
2017-04-18 07:54:28 -04:00
Alan Third
a13eaddce2 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.
2017-04-18 11:42:30 +01:00
Fran Litterio
4ad6be65f6 Small erc-kill-channel fix (bug#23700)
* lisp/erc/erc.el (erc-kill-channel): Handle null erc-default-target.
2017-04-17 20:30:40 -04:00
Glenn Morris
2d42bf7f5e 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.
2017-04-17 20:16:15 -04:00
Glenn Morris
2e3a33659f 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.
2017-04-17 20:10:28 -04:00
Glenn Morris
d0397f4a57 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.
2017-04-17 20:09:27 -04:00
Paul Eggert
d5ead735a0 ; Spelling fix 2017-04-17 11:22:52 -07:00
Paul Eggert
b8e0d203fe * src/xterm.c (x_fill_rectangle): Now static. 2017-04-17 11:14:40 -07:00
Paul Eggert
932698b789 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.
2017-04-17 10:20:39 -07:00
David Engster
09eaf661eb 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.
2017-04-17 17:17:00 +02:00
Paul Eggert
630df0587e * src/lisp.h (STRING_SET_CHARS): Simplify assertion. 2017-04-17 07:56:29 -07:00
Eli Zaretskii
edc63bf94f 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.
2017-04-17 09:47:39 +03:00
Paul Eggert
4712229552 dired ‘M’ should not complain about ‘.’ and ‘..’
* lisp/dired-aux.el (dired-do-redisplay):
Allow redisplay of ‘.’ and ‘..’ (Bug#26528).
2017-04-16 23:37:29 -07:00
Paul Eggert
750721c394 Remove unused coding enums
* src/coding.h (enum coding_system_type, enum end_of_line_type):
Remove; unused.
2017-04-16 23:07:55 -07:00
Paul Eggert
1cad610301 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).
2017-04-16 22:50:39 -07:00
Christian Garbs
c68cce94c4
; Fix typo in error messages (Bug#26034)
Copyright-paperwork-exempt: yes
2017-04-17 07:07:12 +03:00
Teemu Likonen
8750a4546a
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.
2017-04-16 22:06:48 +03:00
Michael Albinus
8d96feae07 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.
2017-04-16 16:51:24 +02:00
Alan Mackenzie
92879a1b03 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.
2017-04-16 10:01:09 +00:00
Simen Heggestøyl
bdd0c8600f 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'.
2017-04-16 11:55:33 +02:00
Eli Zaretskii
58430f2996 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)
2017-04-16 10:43:22 +03:00
Eli Zaretskii
f3b24e90dc 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.
2017-04-16 10:27:23 +03:00
Eli Zaretskii
1bf7ca623b 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.
2017-04-16 10:12:42 +03:00
Paul Eggert
0ef7f64407 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.
2017-04-15 22:23:05 -07:00
Martin Rudalics
23d3eeb798 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).
2017-04-15 16:16:26 +02:00
Glenn Morris
28718c4449 Avoid userlock queries hanging forever in batch mode
* lisp/userlock.el (ask-user-about-lock)
(ask-user-about-supersession-threat): Abort in batch mode.
2017-04-14 21:18:07 -04:00
Paul Eggert
e6750596ef ; Spelling and minor wording fixes 2017-04-14 12:42:31 -07:00
Martin Rudalics
fc05d4fec9 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).
2017-04-14 12:14:09 +02:00