Aurélien Aptel [Tue, 2 Dec 2014 21:17:10 +0000 (16:17 -0500)]
Add external modules
* configure.ac: Add libtool support and module Makefiles.
* src/Makefile.in: Support libtool.
* src/alloc.c (mark_object): Mark the doc field of Lisp_Subr as object.
* src/doc.c (doc_is_from_module_p, get_doc_string, reread_doc_file)
(store_function_docstring, build_file_p, Fsnarf_documentation):
Support docstrings for external modules.
* src/lisp.h: Make the doc field of Lisp_Subr a Lisp_Object.
* src/lread.c (Fget_load_suffixes, Fload_module, string_suffixes_p)
(string_suffix_p, Fload, intern_c_string_1, defsubr)
(syms_of_lread): Add loading of external modules and the
docstrings of their functions.
Eli Zaretskii [Tue, 2 Dec 2014 14:13:47 +0000 (16:13 +0200)]
Allow to search for characters whose bidi directionality was overridden.
src/bidi.c (bidi_find_first_overridden): New function.
src/xdisp.c (Fbidi_find_overridden_directionality): New function.
(syms_of_xdisp): Defsubr it.
src/dispextern.h (bidi_find_first_overridden): Add prototype.
Eric S. Raymond [Tue, 2 Dec 2014 13:01:46 +0000 (08:01 -0500)]
Eliminate an unuted function argument.
* vc.el, all backends: API simplification: Remove 4th 'default-state'
argument from vc-dir-status files and its backend methods - no backend
method ever set it. It was used only in the fallback method to to set
a default of 'up-to-date, though a convoluted call chain obscured
this.
Eric S. Raymond [Tue, 2 Dec 2014 04:49:35 +0000 (23:49 -0500)]
Remove clear-headers from VC's public method set.
* vc/vc.el and all backends: API simplification; clear-headers is no
longer a public method. It is now local to the one place it's used,
in the RCS steal-lock method.
Stefan Monnier [Mon, 1 Dec 2014 20:06:49 +0000 (15:06 -0500)]
Merge some of the differences from the standalone CC-mode.
The main change is to only use the `category' text-property only when
available. For that many calls are changed to use c-get-char-property,
c-next-single-property-change, c-sc-scan-lists,
c-sc-parse-partial-sexp, c-unmark-<->-as-paren.
* lisp/progmodes/cc-align.el (c-lineup-respect-col-0): New function.
* lisp/progmodes/cc-cmds.el (c-forward-into-nomenclature)
(c-backward-into-nomenclature): Use cc-subword if subword-mode is
not available.
(c-beginning-of-defun, c-end-of-defun, c-mark-function)
(c-indent-line-or-region): Use c-region-is-active-p.
* lisp/progmodes/cc-defs.el (c-version): Bump up to 5.33.
(c-use-category): New const.
(c-next-single-property-change): New macro.
(c-region-is-active-p): Prefer region-active-p when available.
(c-search-backward-char-property): Fix old min/max typo; probably
a copy/paste error.
(c-mark-<-as-paren, c-mark->-as-paren, c-unmark-<->-as-paren):
Turn them into macros that obey c-use-category.
(c-sc-scan-lists-no-category+1+1, c-sc-scan-lists-no-category+1-1)
(c-sc-scan-lists-no-category-1+1, c-sc-scan-lists-no-category-1-1)
(c-sc-scan-lists, c-sc-parse-partial-sexp)
(c-looking-at-non-alphnumspace): New macros.
(c-sc-parse-partial-sexp-no-category): New function.
(c-emacs-features): Add `category-properties' element.
* lisp/progmodes/cc-engine.el (c-invalidate-state-cache, c-parse-state):
Handle the case where categories are not available.
(c-record-parse-state-state, c-replay-parse-state-state):
Handle marker values.
(c-before-change-check-<>-operators): Look for the `syntax-table'
property rather than for the corresponding `category'.
(c-looking-at-decl-block): Remove unused var
`c-disallow-comma-in-<>-arglists'.
(c-forward-<>-arglist-recur): Remove unused var
`orig-record-found-types'.
* lisp/progmodes/cc-langs.el (c-modified-constant): New lang var.
(c-known-type-key): Don't make a list just to throw it away.
* lisp/progmodes/cc-bytecomp.el (cc-bytecomp-unbound-variables)
(cc-bytecomp-original-functions, cc-bytecomp-original-properties)
(cc-bytecomp-loaded-files): Re-set each time the file is loaded.
(cc-bytecomp-obsolete-var, cc-bytecomp-ignore-obsolete)
(cc-bytecomp-obsolete-fun): Delete unused functions.
* lisp/progmodes/cc-mode.el (c-just-done-before-change): New var.
(c-basic-common-init): Initialize it.
(c-common-init): Only use mode-require-final-newline when available.
(c-before-change): Check and set c-just-done-before-change.
(c-after-change): Re-set c-just-done-before-change.
(c-advise-fl-for-region): New macro.
(lazy-lock-defer-rest-after-change, lazy-lock-defer-line-after-change)
(font-lock-after-change-function, jit-lock-after-change):
Advise if needed.
Stefan Monnier [Mon, 1 Dec 2014 18:15:28 +0000 (13:15 -0500)]
* lisp/vc: Fix use of find-conflicted-file in Git.
* lisp/vc/vc.el (vc-find-conflicted-file): Look for conflicted files in the
current "project" rather than just the current directory.
* lisp/vc/vc-git.el (vc-git-conflicted-files): Clarify in which directory
the file names make sense.
Ulf Jasper [Mon, 1 Dec 2014 18:14:54 +0000 (19:14 +0100)]
newsticker: Prevent multiple "Could not download..." messages. Fixes bug#19166.
* lisp/net/newst-backend.el (newsticker--get-news-by-url-callback):
Pass correct status to `newsticker--sentinel-work'.
(newsticker--sentinel-work): Use "newsticker--download-error" as
guid in order to prevent multiple "Could not download..."
messages. Fixes bug#19166.
* lisp/net/newst-treeview.el (newsticker--treeview-item-show): Check
window liveliness before measuring its width.
Eric S. Raymond [Mon, 1 Dec 2014 16:41:45 +0000 (11:41 -0500)]
Refactor VC merging to fix a layer violation.
* vc/vc.el, vc/vc-cvs.el, vc/vc-rcs.el, vc/vc-svn.el: The 'merge'
backend method of RCS/CVS/SVN is now 'merge-file', to contrast with
'merge-branch'. Prompting for merge revisions is pushed down to the
back ends; this fixes a layering violation that caused bad behavior
with SVN.
Eric S. Raymond [Mon, 1 Dec 2014 15:47:27 +0000 (10:47 -0500)]
Finish vc-stay-local containment.
* vc/vc.el, vc-hooks.el, and all backends: API simplification;
vc-stay-local-p and repository-hostname are no longer public
methods. Only the CVS and SVN backends used these, and the SVN
support was conditioned out because svn status -v is too slow.
The CVS back end retaiin this machibery and the vc-stay-local
configuration variable now only affects it.
Eric S. Raymond [Mon, 1 Dec 2014 14:41:54 +0000 (09:41 -0500)]
Remove vc-state-heuristic from the set of public methods.
* vc/vc.el, vc-hooks.el, and all backends: API simplification;
vc-state-heuristic is no longer a public method, having been removed
where it is redundant, unnecessary, or known buggy. This eliminated
all backends except CVS. Eliminates bug#7850.
Eric S. Raymond [Mon, 1 Dec 2014 14:08:26 +0000 (09:08 -0500)]
The vc-mistrust-permissions configuration variable is gone.
* vc/vc-cvs.el, vc/vc-hooks.el, vc/vc-rcs.el, vc/vc-sccs.el: Eliminate
vc-mistrust-permissions. It was only relevant to the RCS and SCCS
back ends and defaulted to t. Code now always mistrusts permissions -
by actual measurement the effect on performance is negligible. As a
side effect bug#11490 is now irrelevant.
Eric S. Raymond [Mon, 1 Dec 2014 13:24:27 +0000 (08:24 -0500)]
API simplification: remove vc-workfile-unchanged-p from pubic methods.
* vc/vc.el, vc-hooks.el, and all backends: API simplification;
vc-workfile-unchanged-p is no longer a public method (but the RCS and
SCCS back ends retain it as a private method used in state
computation). This method was redundant with vc-state and usually
implemented as a trivial call to same. Fixes the failure mode
described in bug#694.
Paul Eggert [Sun, 30 Nov 2014 07:30:22 +0000 (23:30 -0800)]
Port better to AddressSanitizer.
These changes suffice for temacs on x86-64 with GCC 4.9.2 and
-fsanitize=address.
* alloc.c (valid_pointer_p) [ADDRESS_SANITIZER]:
Return -1 or 0, as the pipe trick doesn't work.
* alloc.c (relocatable_string_data_p, mark_object, sweep_symbols):
* data.c (Ffset):
* print.c (print_object):
When a pointer-check primitive returns -1, do not assume this
means the pointer is valid or that the underlying system has failed.
It could just be that addresses are being sanitized so Emacs can't
test for pointer validity.
* lisp.h (defined_GC_CHECK_STRING_BYTES): New constant.
(USE_STACK_STRING) [GC_CHECK_STRING_BYTES]: Now false, since the
string validity checker doesn't work on stack-based strings.
Paul Eggert [Sat, 29 Nov 2014 07:38:41 +0000 (23:38 -0800)]
Improve clarity of USE_LSB_TAG definition.
Problem reported by Lee Duhem. Suggestion by Andreas Schwab in:
http://lists.gnu.org/archive/html/emacs-devel/2014-11/msg02222.html
* lisp.h (USE_LSB_TAG): Define in terms of the (simpler)
VAL_MAX / 2 rather than in terms of the (more complicated)
EMACS_INT_MAX >> GCTYPEBITS, and adjust commentary to match.
Martin Rudalics [Fri, 28 Nov 2014 17:12:32 +0000 (18:12 +0100)]
Fix two issues around help-window-select. (Bug#11039) (Bug#19012)
* help.el (help-window-old-frame): New variable.
(help-window-select): Default to nil (Bug#11039). Rewrite
doc-string.
(help-window-setup): When the help window appears on another
frame and `help-window-select' is non-nil, give that frame input
focus too (Bug#19012).
(with-help-window): Store selected frame in
help-window-old-frame.
Daiki Ueno [Fri, 28 Nov 2014 06:59:23 +0000 (15:59 +0900)]
epg: Use epg-context-set-*-callback for extra treatment of args
* epa.el (epa-sign-file, epa-encrypt-file, epa-decrypt-region)
(epa-sign-region, epa-encrypt-region): Use
`epg-context-set-{passphrase,progress}-callback', instead of
`setf'. This partially reverts commit 9e48a95c (bug#19150).
Reported by José A. Romero L.
Ulf Jasper [Thu, 27 Nov 2014 17:37:47 +0000 (18:37 +0100)]
newsticker: Change wording of confirmation prompt regarding obsolete variable `newsticker-groups-filename'.
Fixes: debbugs:19165
* lisp/net/newst-treeview.el (newsticker-groups-filename): Change
default value to nil. Point out that variable is obsolete in doc
string.
(newsticker--treeview-load): Change wording of the questions the
user is asked when `newsticker-groups-filename' is found to be
used and we offer to read and remove the groups file.
Eli Zaretskii [Thu, 27 Nov 2014 16:35:27 +0000 (18:35 +0200)]
Fix bug #19201 with after-strings not being displayed.
src/xdisp.c (handle_single_display_spec): When ignoring a fringe
bitmap display, reset the ignore_overlay_strings_at_pos_p flag.
(next_element_from_buffer): When done with overlays, reset the
ignore_overlay_strings_at_pos_p flag.
Stephen Berman [Thu, 27 Nov 2014 10:03:58 +0000 (11:03 +0100)]
outline.el: Fix subtree movement.
Fixes: debbugs:19102 Co-authored-by: Stefan Monnier <monnier@iro.umontreal.ca>
* outline.el (outline-move-subtree-down): Make sure we can move
forward to find the end of the subtree and the insertion point.
Leonard Randall [Thu, 27 Nov 2014 08:38:21 +0000 (09:38 +0100)]
Backport regexp stack overflow fix from emacs-24.
* textmodes/reftex-parse.el (reftex-using-biblatex-p): Make search
for comment lines non-greedy and stopping at newlines to fix stack
overflows with large files. [Backport]
* lisp/progmodes/python.el (python-shell-completion-setup-code): Use
__builtin__ module (or builtins in Python 3) and catch all errors
when importing readline and rlcompleter.
Stephen Berman [Wed, 26 Nov 2014 22:17:41 +0000 (23:17 +0100)]
todo-mode.el: Handle calling revert-buffer.
Fixes: debbugs:19187
* calendar/todo-mode.el: (todo-revert-buffer): New function.
(todo-modes-set-1): Use it as the buffer-local value of
revert-buffer-function.
* dom.el (dom-by-tag): Use `equal' for comparisons so that tags
can be strings.
(dom-elements): Protect against non-text nodes.
(dom-non-text-children): New function.