Eric Ludlam [Thu, 2 Jan 2014 01:44:55 +0000 (20:44 -0500)]
Add test files
* test/manual/cedet/integ_src/globalref/src/Manager.cc: These test
files contributed by Barry OReilly, modified for use in the automated
tests for CEDET, and with additional comments. inc/Util.hh,
src/Util.cc: Search symbol both in and outside of namespaces.
Eric Ludlam [Wed, 26 Nov 2014 19:27:10 +0000 (14:27 -0500)]
Test friends
* test/manual/cedet/cedet/semantic/tests/testfriends.cpp:
(Af): Add a friend of C w/out the CLASS token. (C): New. (scA, scB,
scC, scD): New test classes. (main): New (scA::PublicMethod,
scB::b_pub_method, scC::c_pub_method) (scD::d_pub_method): New.
David Engster [Thu, 1 Dec 2011 19:13:55 +0000 (20:13 +0100)]
Fix unit testing for several tests and do better error checking.
* semantic/lex-spp-utests.el (semantic-lex-spp-write-utest):
* tests/cedet-utests.el (cedet-utest-eieio-classloader): Throw
error if we cannot locate test files.
* semantic/utest-c.el (semantic-utest-c-compare)
(semantic-utest-c-conditionals):
* semantic/lex-spp-utest.el (semantic-lex-spp-write-utest): Adapt
to new directory structure and do better error checking to avoid
silent failures in the future.
* src/gnutls.c (emacs_gnutls_handle_error): Demote the normal
peer-closed-connection "The TLS connection was non-properly
terminated" message to a lower level so that it isn't shown to
the user by default.
Avoid having eww unexpectedly open external browsers
* lisp/net/eww.el (eww-render): Instead of opening unsupported
content types like audio/mpeg directly in an external browser
(which can be very confusing especially when something
redirects to a file like that), just display a simple
interstitial that people can choose to click on or not
(bug#22671).
When opening new eww buffers, use buffer names based on the host name
* lisp/net/eww.el (eww-browse-url): When opening in a new
window, use a buffer name based on the host name (bug#23738).
(eww--dwim-expand-url): Refactored out into its own function
for easier reuse.
David Engster [Tue, 24 Jan 2017 21:47:53 +0000 (22:47 +0100)]
xml: Fix parsing of default namespace with quoted names
* lisp/xml.el (xml-parse-attlist): Properly extract namespace when
parsing is done with quoted symbol names (bug#23440).
* test/lisp/xml-tests.el (xml-parse-test--default-namespace-qnames)
(xml-parse-test-default-namespace-qnames): Test for the above.
Noam Postavsky [Sun, 18 Dec 2016 05:00:30 +0000 (00:00 -0500)]
Fix comment detection on open parens
Characters having both open paren syntax and comment start syntax were
being detected as open parens even when they should have been part a
comment starter (Bug#24870).
* src/syntax.c (in_2char_comment_start): New function, extracted from
`scan_sexps_forward'.
(scan_sexps_forward): Add check for a 2-char comment starter before the
loop. Inside the loop, do that check after incrementing the 'from'
character index. Move the single char comment syntax cases into the
switch instead of special casing them before.
* test/src/syntax-tests.el (parse-partial-sexp-paren-comments):
(parse-partial-sexp-continue-over-comment-marker): New tests.
Alan Mackenzie [Mon, 23 Jan 2017 19:00:49 +0000 (19:00 +0000)]
Give , and .@ doc strings. Fixes bug #24561.
Also make *Help* links to ``' possible. Also make usable as such doc strings
on the function-documentation property of a symbol.
* lisp/emacs-lisp/backquote.el (top-level): Give , and '@ doc strings on the
function-documentation property. Also give these symbols a reader-construct
property.
* lisp/help-fns.el (describe-function): Allow the function-documentation
property to work. Use princ rather than prin1 to print the function's name
when it has a reader-construct property.
(help-fns-signature): Don't insert `high-usage' for a reader-construct.
(describe-function-1): Adapt to process documentation on the
function-documentation property. Print "a reader construct" when appropriate.
* lisp/help-mode.el (help-xref-symbol-regexp): Amend this regexp also to match
``'.
Paul Eggert [Sun, 22 Jan 2017 08:18:40 +0000 (00:18 -0800)]
Improve uses of CHECK_LIST etc.
* src/eval.c (FletX): Report an error for invalid constructs like
‘(let* (a . 0))’, so that ‘let*’ is more consistent with ‘let’.
(lambda_arity): Use plain CHECK_CONS.
* src/fns.c (CHECK_LIST_END): Move from here to lisp.h.
(Fcopy_alist): Remove unnecessary CHECK_LIST call, since
concat does that for us.
(Fnthcdr, Fmember, Fmemql, Fdelete, Fnreverse):
Use CHECK_LIST_END, not CHECK_LIST_CONS. This hoists a
runtime check out of the loop.
(Fmemq): Simplify and use CHECK_LIST_END instead of CHECK_LIST.
(Fassq, Fassoc, Frassq, Frassoc):
Simplify and use CHECK_LIST_END instead of CAR.
(assq_no_quit, assoc_no_quit): Simplify and assume proper list.
(Fnconc): Use plain CHECK_CONS, and do-while instead of while loop.
* src/fontset.c (Fnew_fontset):
* src/frame.c (Fmodify_frame_parameters):
Use CHECK_LIST_END at end, rather than CHECK_LIST at start, for a
more-complete check.
* src/gfilenotify.c (Fgfile_add_watch):
Omit unnecessary CHECK_LIST, since Fmember does that for us.
* src/lisp.h (lisp_h_CHECK_LIST_CONS, CHECK_LIST_CONS):
Remove; no longer used.
(CHECK_LIST_END): New inline function.
Alan Mackenzie [Sat, 21 Jan 2017 15:14:15 +0000 (15:14 +0000)]
Fix low-level handling of (big) C macros.
In particular, ensure that a comment detected by its syntax is not a CPP
construct marked with generic comment delimiter syntax-table text
properties.
* lisp/progmodes/cc-engine.el (c-beginning-of-macro, c-end-of-macro): Set
c-macro-cache-syntactic to nil when the cached macro changes.
(c-syntactic-end-of-macro, c-no-comment-end-of-macro)
(c-state-semi-pp-to-literal, c-state-full-pp-to-literal)
(c-state-pp-to-literal, c-parse-ps-state-to-cache)
(c-state-cache-non-literal-place, c-literal-limits, c-literal-start)
(c-determine-limit): When checking a parse syntax for a comment, check that
we're not in a CPP construct marked by syntax-table generic comment delimiter
text property.
(c-state-pp-to-literal): Change from a defsubst to a defun.
* lisp/progmodes/cc-mode.el (c-neutralize-syntax-in-and-mark-CPP): Check a
parse syntax as described above under cc-engine.el.
Noam Postavsky [Sat, 14 Jan 2017 00:47:22 +0000 (19:47 -0500)]
Don't wait for frame to become visible
* src/xterm.c (x_make_frame_visible): Remove code that waits for the
frame to become visible. We have to deal with invisible frames anyway,
the loop could sometimes before the frame turned visible, and for some
window managers (e.g., XMonad, i3wm) it caused Emacs to get stuck in a
busy loop (Bug#24091).
Tino Calancha [Sat, 21 Jan 2017 02:54:55 +0000 (11:54 +0900)]
diff-hunk-kill independent of point inside headers
Make diff-apply-hunk and diff-hunk-kill independent of the point
position in a diff header (Bug#17544).
This change allows to apply hunks in order. It also makes possible to
press M-k repeatedly to kill hunks in the order they appear in the buffer.
See discussion on #Bug25105.
* lisp/vc/diff-mode.el (diff-file-junk-re):
Move definition before it's used.
(diff--at-diff-header-p): New predicate; return non-nil when point
is inside a hunk header, a file header, or within a line
matching diff-file-junk-re.
(diff-beginning-of-hunk): Use it.
Check if the point is inside a diff header, in the middle of a hunk,
or before the first hunk.
(diff-apply-hunk): Call diff-beginning-of-hunk with non-nil arg
before apply the hunk.
(diff-hunk-kill, diff-file-kill):
Call diff-beginning-of-hunk with non-nil arg after kill the hunks.
(diff-post-command-hook): Call diff-beginning-of-hunk with non-nil argument.
Noam Postavsky [Sat, 14 Jan 2017 06:47:52 +0000 (01:47 -0500)]
Fix free var FOO-mode-{syntax,abbrev}-table warnings
* lisp/emacs-lisp/derived.el (define-derived-mode): Unconditionally
defvar the syntax and abbrev tables so that the compiler will know that
they are dynamically bound variables (Bug#25446).
Philipp Stephani [Wed, 18 Jan 2017 18:49:58 +0000 (19:49 +0100)]
Check that variable lists are actually lists
'let' and 'let*' document that their first argument has to be a list,
but don't check for that; instead, they allow (and silently ignore)
other types. Introduce an explicit type check.
* src/eval.c (Flet, FletX): Check that the variable list is indeed a
list.
* test/src/eval-tests.el: Add unit tests.
Noam Postavsky [Fri, 13 Jan 2017 04:32:44 +0000 (23:32 -0500)]
Avoid inefficient regex in diff-refine-hunk (Bug#25410)
* lisp/vc/diff-mode.el (diff--forward-while-leading-char): New function.
(diff-refine-hunk): Use it instead of trying to match multiple lines
with a single lines.
Eli Zaretskii [Wed, 18 Jan 2017 16:06:42 +0000 (18:06 +0200)]
Fix a bug with signaling a thread that waits for condvar
* src/thread.c (lisp_mutex_lock_for_thread): New function,
with all the guts of lisp_mutex_lock.
(lisp_mutex_lock): Call lisp_mutex_lock_for_thread.
(condition_wait_callback): Don't call post_acquire_global_lock
before locking the mutex, as that could cause a signaled thread to
exit prematurely, because the condvar's mutex is recorded to be
not owned by any thread, and with-mutex wants to unlock it as part
of unwinding the stack in response to the signal.
Tom Tromey [Mon, 16 Jan 2017 21:02:45 +0000 (14:02 -0700)]
Fix JS regexp literal syntax propertization in expressions
Bug#25465:
* lisp/progmodes/js.el (js-syntax-propertize): Recognize a regexp
literal after "!", "&", and "|".
test/lisp/progmodes/js-tests.el (js-mode-regexp-syntax): New test.
Mark Oteiza [Tue, 17 Jan 2017 05:48:00 +0000 (00:48 -0500)]
Nix some uses of eval
* lisp/play/dunnet.el: Fix triple negative.
(dun-doverb): Use funcall instead of eval.
(dun-echo): Just call dun-mprinc.
(dun-save-val): Just bind value without eval.
Noam Postavsky [Sun, 8 Jan 2017 23:19:32 +0000 (18:19 -0500)]
Improve ffap-gopher-at-point handling of long lines
* lisp/ffap.el (ffap-gopher-regexp): Only match the KEY part. Note
setting to nil is now supported.
(ffap--gopher-var-on-line): New function.
(ffap-gopher-at-point): Use it instead of the old ffap-gopher-regexp
which could overflow the regexp stack on long lines (Bug#25391). Use
`let-alist' instead of calling `set' on local variables.
* test/lisp/ffap-tests.el (ffap-gopher-at-point): New test.
Alan Mackenzie [Sat, 14 Jan 2017 12:38:43 +0000 (12:38 +0000)]
Correct c-parse-state-get-strategy for moving HERE backward into a macro.
* list/progmodes/c-engine.el (c-parse-state-get-strategy): When HERE is below
its previous value, we chose strategy 'forward, and the new HERE is in a
(different) macro, ensure the returned START-POINT is not above the start of
the macro.
Eli Zaretskii [Sat, 14 Jan 2017 08:55:16 +0000 (10:55 +0200)]
Include "Date:" in mail messages filed by 'sendmail-send-it'
* lisp/mail/sendmail.el (mail-do-fcc): Insert a 'Date:' header
into the filed message. In the outgoing message, sendmail will
add the date, but the composed message body doesn't have it.
(Bug#25436)