Sam Steingold [Tue, 27 Jan 2015 18:20:57 +0000 (13:20 -0500)]
minor tweaks for `python-check'
* lisp/progmodes/python.el (python-check-custom-command): Buffer local
because it usually includes the buffer name.
(python-check-command): Set to epylint when pyflakes is not available.
Paul Eggert [Tue, 27 Jan 2015 06:34:25 +0000 (22:34 -0800)]
Port autogen.sh hook creation to Apple Git
* autogen.sh: Do not assume that the hook samples exist.
This ports to git version 1.9.3 (Apple Git-50).
For some reason Apple decided to populate the git hooks directory
in a different way from the way that standard Git does it.
The downside is that patch applications won't be checked on Apple,
but that's better than autogen.sh failing.
Problem reported by Sam Steingold in:
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00898.html
Stefan Monnier [Mon, 26 Jan 2015 16:43:06 +0000 (11:43 -0500)]
* lisp/emacs-lisp/cl-generic.el (cl--generic-method): New struct.
(cl--generic): The method-table is now a (list-of cl--generic-method).
(cl--generic-member-method): New function.
(cl-generic-define-method): Use it.
(cl--generic-build-combined-method, cl--generic-cache-miss):
Adapt to new method-table.
(cl--generic-no-next-method-function): Add `method' argument.
(cl-generic-call-method): Adapt to new method representation.
(cl--generic-cnm-sample, cl--generic-nnm-sample): Adjust.
(cl-find-method, cl-method-qualifiers): New functions.
(cl--generic-method-info): Adapt to new method representation.
Return a string for the qualifiers.
(cl--generic-describe):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-class): Adjust accordingly.
(eieio-all-generic-functions, eieio-method-documentation):
Adjust to new method representation.
* lisp/emacs-lisp/eieio-compat.el (eieio--defmethod): Use cl-find-method.
* test/automated/cl-generic-tests.el: Try and make sure cl-lib is not
required at run-time.
Stefan Monnier [Mon, 26 Jan 2015 14:04:55 +0000 (09:04 -0500)]
* lisp/emacs-lisp/cl-generic.el: Add a method-combination hook.
(cl-generic-method-combination-function): New var.
(cl--generic-lambda): Remove `with-cnm' arg.
(cl-defmethod): Change accordingly.
(cl-generic-define-method): Don't check qualifiers validity.
Preserve all qualifiers in `method-table'.
(cl-generic-call-method): New function.
(cl--generic-nest): Remove (morph into cl-generic-call-method).
(cl--generic-build-combined-method): Adjust to new format of method-table
and use cl-generic-method-combination-function.
(cl--generic-standard-method-combination): New function, extracted from
cl--generic-build-combined-method.
(cl--generic-cnm-sample): Adjust to new format of method-table.
* lisp/emacs-lisp/eieio-compat.el (eieio--defmethod): Use () qualifiers
instead of :primary.
Avoid a crash when the daved ptr is at the end of the list (= when it's
before the first one). Also use `eq' to compare the value so the saved
list indicator appears when a value was retrieved from the list rather
than an equal result is shown.
Stefan Monnier [Sun, 25 Jan 2015 16:09:53 +0000 (11:09 -0500)]
* lisp/emacs-lisp/cl-generic.el: Fix next-method-p test
Fixes: debbugs:19672
* lisp/emacs-lisp/cl-generic.el (cl--generic-no-next-method-function): New.
(cl--generic-build-combined-method, cl--generic-nnm-sample): Use it.
(cl--generic-typeof-types): Add support for `sequence'.
(cl-defmethod): Add non-keywords in the qualifiers.
Paul Eggert [Sun, 25 Jan 2015 02:05:33 +0000 (18:05 -0800)]
Use gnustep-config if available
* configure.ac (--with-gnustep): Document this.
(NS_GNUSTEP_CONFIG): New variable, set if gnustep-config works.
If gnustep-config works, use 'gnustep-config --objc-flags' and
'gnustep-config --gui-libs' to compute GNUstep configuration
variables, instead of attempting to infer them individually.
* etc/NEWS: Document this.
* src/emacs.c [NS_IMPL_GNUSTEP]: Don't include <GNUstepBase/GSConfig.h>.
It doesn't appear to be needed, and the inclusion breaks on
Ubuntu 14.10 when 'configure' uses 'gnustep-config'. Fixes: bug#19507
Paul Eggert [Sat, 24 Jan 2015 00:08:12 +0000 (16:08 -0800)]
Fix a couple of AM_V_GEN bugs
* admin/unidata/Makefile.in (unifiles):
Use AM_V_at instead of AM_V_GEN, since this doesn't generate a file.
* lib-src/Makefile.in (AM_V_GEN, am__v_GEN_, am__v_GEN_0, am__v_GEN_1)
(AM_V_at, am__v_at_, am__v_at_0, am__v_at_1):
New macros, copied from ../src/Makefile.in.
Ulrich Müller [Thu, 22 Jan 2015 07:24:42 +0000 (08:24 +0100)]
Don't fail if chown or chgrp for 'update-game-score' is unsuccessful.
* lib-src/Makefile.in ($(DESTDIR)${archlibdir}): Don't fail if the
chown or chgrp command is unsuccessful; the 'update-game-score'
program has a fallback for this at runtime.
Stefan Monnier [Thu, 22 Jan 2015 04:16:45 +0000 (23:16 -0500)]
Avoid generating invalid usage info for pathological function
Fixes: debbugs:19645
* lisp/help.el (help-make-usage): Don't turn a "_" arg into an empty-string.
* lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): Don't confuse a string
body with a docstring.
Paul Eggert [Thu, 22 Jan 2015 04:01:10 +0000 (20:01 -0800)]
Better isolate code that assumes NIL_IS_ZERO
Suggested by Stefan Monnier in:
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00588.html
* alloc.c (allocate_pseudovector):
Use memclear, not memsetnil, to remove a 'verify'.
* callint.c (Fcall_interactively):
* dispnew.c (realloc_glyph_pool):
* xdisp.c (init_iterator):
Use memclear, not memset, to remove a 'verify'.
* lisp.h (memclear): Rename from memsetnil, and take a byte
count rather than a word count. All callers changed.
Dmitry Gutov [Thu, 22 Jan 2015 02:09:23 +0000 (04:09 +0200)]
xref: Input history and minor tweaks
* lisp/progmodes/xref.el (xref--current): Rename from `xref--selected'.
(xref--inhibit-mark-current): Rename from
`xref--inhibit-mark-selected'. Update the usages.
(xref-quit): Reword the docstring. Kill buffers after quitting
windows instead of before.
(xref--insert-xrefs): Tweak help-echo.
(xref--read-identifier-history, xref--read-pattern-history):
New variables.
(xref--read-identifier, xref-find-apropos): Use them.
Ulrich Müller [Fri, 16 Jan 2015 08:25:25 +0000 (09:25 +0100)]
Allow update-game-score to run sgid instead of suid.
* configure.ac (gamegroup): New AC_SUBST.
(--with-gameuser): Allow to specify a group instead of a user.
In the default case, check at configure time if a 'games' user
exists.
* lib-src/update-game-score.c: Allow the program to run sgid
instead of suid, in order to match common practice for most games.
(main): Check if we are running sgid. Pass appropriate file
permission bits to 'write_scores'.
(write_scores): New 'mode' argument, instead of hardcoding 0644.
(get_prefix): Update error message.
* lib-src/Makefile.in (gamegroup): New variable, set by configure.
($(DESTDIR)${archlibdir}): Handle both suid or sgid when
installing the 'update-game-score' program.
* lisp/play/gamegrid.el (gamegrid-add-score-with-update-game-score):
Allow the 'update-game-score' helper program to run suid or sgid.
Stefan Monnier [Wed, 21 Jan 2015 19:39:06 +0000 (14:39 -0500)]
* lisp/emacs-lisp/eieio*.el: Fix up warnings and improve compatibility
Fixes: debbugs:19645
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Add support for `declare'.
(cl--generic-setf-rewrite): Setup the setf expander right away.
(cl-defmethod): Make sure the setf expander is setup before we expand
the body.
(cl-defmethod): Silence byte-compiler warnings.
(cl-generic-define-method): Shuffle code to change return value.
(cl--generic-method-info): New function, extracted from
cl--generic-describe.
(cl--generic-describe): Use it.
* lisp/emacs-lisp/eieio-speedbar.el:
* lisp/emacs-lisp/eieio-datadebug.el:
* lisp/emacs-lisp/eieio-custom.el:
* lisp/emacs-lisp/eieio-base.el: Use cl-defmethod.
* lisp/emacs-lisp/eieio-compat.el (eieio--defmethod): Avoid no-next-method
errors when there's a `before' but no `primary'.
(next-method-p): Return nil rather than signal an error.
(eieio-defgeneric): Remove bogus (fboundp 'method).
* lisp/emacs-lisp/eieio-opt.el: Adapt to cl-generic.
(eieio--specializers-apply-to-class-p): New function.
(eieio-all-generic-functions): Use it.
(eieio-method-documentation): Use it as well as cl--generic-method-info.
Change format of return value.
(eieio-help-class): Adapt accordingly.
* lisp/emacs-lisp/eieio.el: Use cl-defmethod.
(defclass): Generate cl-defmethod calls; use setf methods for :accessor.
(eieio-object-name-string): Declare as obsolete.
* test/automated/cl-generic-tests.el (setf cl--generic-2): Make sure
the setf can be used already in the body of the method.
Dmitry Gutov [Wed, 21 Jan 2015 07:20:04 +0000 (09:20 +0200)]
Remap quit-window to xref-quit in xref buffers
Fixes: debbugs:19466
* lisp/progmodes/xref.el (xref--xref-buffer-mode-map): Define before
the major mode. Remap `quit-window' to `xref-quit'.
(xref--xref-buffer-mode): Inherit from special-mode.
Dmitry Gutov [Wed, 21 Jan 2015 06:43:39 +0000 (08:43 +0200)]
xref: Keep track of temporary buffers
Fixes: debbugs:19466
xref: Keep track of temporary buffers.
* lisp/progmodes/xref.el (xref--temporary-buffers, xref--selected)
(xref--inhibit-mark-selected): New variables.
(xref--mark-selected): New function.
(xref--show-location): Maybe add the buffer to
`xref--temporary-buffers', add `xref--mark-selected' to
`buffer-list-update-hook' there.
(xref--window): Add docstring.
(xref-quit): Rename from `xref--quit'. Update both references.
Add KILL argument. When it's non-nil, kill the temporary buffers
that haven't been selected by the user.
(xref--show-xref-buffer): Change the second argument to alist,
extract the values for `xref--window' and
`xref--temporary-buffers' from it. Add `xref--mark-selected' to
`buffer-list-update-hook' to each buffer in the list.
(xref--show-xrefs): Move the logic of calling `xref-find-function'
here. Save the difference between buffer lists before and after
it's called as "temporary buffers", and `pass it to
`xref-show-xrefs-function'.
(xref--find-definitions, xref-find-references)
(xref-find-apropos): Update accordingly.
Paul Eggert [Tue, 20 Jan 2015 21:56:14 +0000 (13:56 -0800)]
Undo port to hypothetical nonzero Qnil case
This mostly undoes the previous change in this area. See:
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00570.html
* alloc.c (allocate_pseudovector):
* callint.c (Fcall_interactively):
* dispnew.c (realloc_glyph_pool):
* fringe.c (init_fringe):
* lisp.h (memsetnil):
* xdisp.c (init_iterator):
Simplify by assuming that Qnil is zero, but verify the assumption.
* lisp.h (NIL_IS_ZERO): Revert back to this symbol, removing
NIL_IS_NONZERO. All uses changed.
Stefan Monnier [Tue, 20 Jan 2015 20:40:29 +0000 (15:40 -0500)]
lisp/emacs-lisp/eieio*.el: Rewrite our generics on top of cl-generic
* lisp/emacs-lisp/eieio-generic.el: Remove.
(defgeneric, defmethod): Move to eieio-compat.el. Mark obsolete.
* lisp/emacs-lisp/eieio-compat.el: New file.
* lisp/emacs-lisp/eieio.el: Don't require eieio-generic any more.
* lisp/emacs-lisp/eieio-core.el (eieio--slot-originating-class-p):
Remove unused function.
(eieio-defclass): Move to eieio-compat.el.
* lisp/emacs-lisp/macroexp.el (macroexp-macroexpand): New function.
(macroexp--expand-all): Use it.
* lisp/emacs-lisp/bytecomp.el (byte-compile-recurse-toplevel): Here too.
paragraphs: update sentence-end-base :version after changing the default
The default value of the `sentence-end-base' defcustom has been changed
in ‘recognise more Unicode characters as end of sentence’ commit but
:version has not been updated accordingly. Fix that.
eldoc: modify `eldoc-documentation-function' using `add-function'
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-function): Describe how
major modes should use `add-function' to alter value of the variable.
* lisp/hexl.el (hexl-mode): Set `eldoc-documentation-function' using
`add-function' so the default value is always used.
* lisp/ielm.el (inferior-emacs-lisp-mode): Set
`eldoc-documentation-function' using `add-function' so the default
value is always used.
* lisp/progmodes/cfengine.el (cfengine3-mode): Set
`eldoc-documentation-function' using `add-function' so the default
value is always used.
* lisp/progmodes/elisp-mode (emacs-lisp-mode): Set
`eldoc-documentation-function' using `add-function' so the default
value is always used.
* lisp/progmodes/octave.el (octave-mode): Set
`eldoc-documentation-function' using `add-function' so the default
value is always used.
* lisp/progmodes/python.el (python-mode): Set
`eldoc-documentation-function' using `add-function' so the default
value is always used.
* lisp/simple.el (read--expression): Set `eldoc-documentation-function'
using `add-function' so the default value is always used.
descr-text: add `describe-char-eldoc' describing character at point
* lisp/descr-text.el (describe-char-eldoc): New function returning
basic Unicode codepoint information (e.g. name) about character
at point. It is meant to be used as a default value of the
`eldoc-documentation-function' variable.
(describe-char-eldoc--format, describe-char-eldoc--truncate):
New helper functions for `describe-char-eldoc' function.
* tests/automated/descr-text-test.el: New file with tests for
`describe-char-eldoc--truncate', `describe-char-eldoc--format',
and `describe-char-eldoc'.
paragraphs: recognise more Unicode characters as end of sentence
* lisp/textmodes/paragraphs.el (sentence-end-base): Include an
ellipsis (…) and interrobang (‽) characters as end of a sentence,
and a closing single quote (’) as an end of a quote.
* lisp/textmodes/tildify.el (tildify-double-space-undos): A new
variable specifying whether pressing space in `tildify-mode' after
a space has been replaced with hard space undos the substitution.
(tildify-space): Add code branch for handling `tildify-doule-space'.
* tests/automated/tildify-tests.el (tildify-space-undo-test--test):
A new helper function for testing `tildify-double-space-undos'
behaviour in the `tildify-space' function.
(tildify-space-undo-test-html, tildify-space-undo-test-html-nbsp)
(tildify-space-undo-test-xml, tildify-space-undo-test-tex): New
tests for `tildify-doule-space-undos' behaviour.
* lisp/textmodes/tildify.el (tildify-space): A new function
which can be used as a `post-self-insert-hook' to automatically
convert spaces into hard spaces.
(tildify-space-pattern): A new variable specifying pattern where
`tildify-space' should take effect.
(tildify-space-predicates): A new variable specifying list of
predicate functions that all must return non-nil for
`tildify-space' to take effect.
(tildify-space-region-predicate): A new functions meant to be
used as a predicate in `tildify-space-predicates' list.
(tildify-mode): A new minor mode enabling `tildify-space' as a
`post-self-insert-hook'
* tests/automated/tildify-tests.el (tildify-space-test--test):
A new helper function for testing `tildify-space' function.
(tildify-space-test-html, tildify-space-test-html-nbsp)
(tildify-space-test-xml, tildify-space-test-tex): New tests for
`tildify-space' function.
Dmitry Gutov [Tue, 20 Jan 2015 02:28:50 +0000 (04:28 +0200)]
Use etags-goto-tag-location in etags xref backend
* progmodes/etags.el (xref-etags-location): New class.
(xref-make-etags-location): New function.
(etags--xref-find-definitions): Use it.
(xref-location-marker): New method implementation.
* lisp/progmodes/xref.el: Mention that xref-location is an EIEIO class.
Paul Eggert [Tue, 20 Jan 2015 00:49:11 +0000 (16:49 -0800)]
Port to hypothetical case where Qnil is nonzero
* alloc.c (allocate_pseudovector):
* callint.c (Fcall_interactively):
* coding.c (syms_of_coding):
* dispnew.c (realloc_glyph_pool):
* fringe.c (init_fringe):
* lisp.h (memsetnil):
* xdisp.c (init_iterator):
Port to the currently-hypothetical case where Qnil is nonzero.
* dispnew.c (adjust_glyph_matrix): Remove unnecessary verification,
as there are no Lisp_Object values in the data here.
* lisp.h (NIL_IS_NONZERO): New symbol, replacing NIL_IS_ZERO.
All uses changed. Define only if not already defined, so that one
can debug with -DNIL_IS_NONZERO.
* xdisp.c (init_iterator): Remove unnecessary initializations to 0.
Eli Zaretskii [Mon, 19 Jan 2015 17:22:17 +0000 (19:22 +0200)]
Verify that Qnil is zero before relying on that in redisplay.
src/dispnew.c (adjust_glyph_matrix, realloc_glyph_pool): Verify that
Qnil is represented as zero, before using that to initialize parts
of the glyph structure.
src/xdisp.c (init_iterator): Verify that Qnil is represented as
zero, before using that to initialize parts of the iterator
structure.
Jonas Bernoulli [Mon, 19 Jan 2015 11:54:14 +0000 (13:54 +0200)]
Set up ido keymaps only once
* lisp/ido (ido-common-completion-map)
(ido-file-dir-completion-map)
(ido-file-completion-map, ido-buffer-completion-map): Set up key
bindings when each variable is defined.
(ido-completion-map): Move definition.
(ido-init-completion-maps): Noop.
(ido-common-initialization): Don't call it.
(ido-setup-completion-map): Improve doc-string, cleanup.
Dmitry Gutov [Mon, 19 Jan 2015 02:19:32 +0000 (04:19 +0200)]
Use quit-window to hide buffers temporarily displayed by xref
* lisp/progmodes/xref.el (xref--display-history): New variable.
(xref--window-configuration): Remove.
(xref--save-to-history): New function.
(xref--display-position): Use it. Add new argument.
(xref--restore-window-configuration): Remove.
(xref--show-location, xref-show-location-at-point): Update
accordingly.
(xref--xref-buffer-mode): Don't use `pre-command-hook'.
(xref--quit): New command.
(xref-goto-xref): Use it.
(xref--xref-buffer-mode-map): Bind `q' to it.
Stefan Monnier [Sun, 18 Jan 2015 19:08:13 +0000 (14:08 -0500)]
* lisp/emacs-lisp/eieio-core.el: Add `subclass' specializer for cl-generic.
(eieio--generic-subclass-tagcode, eieio--generic-subclass-tag-types):
New functions.
(cl-generic-tagcode-function, cl-generic-tag-types-function): Use them.
* test/automated/eieio-test-methodinvoke.el (eieio-test-cl-generic-1):
Test `subclass' specializer.
Stefan Monnier [Sun, 18 Jan 2015 17:24:43 +0000 (12:24 -0500)]
EIEIO&cl-generic: Add obsolescence warnings and fix corner case
* lisp/emacs-lisp/cl-generic.el (cl-generic-define-method): Correctly handle
introduction of a new dispatch argument.
(cl--generic-cache-miss): Handle dispatch on an argument which was not
considered as dispatchable for this method.
(cl-defmethod): Warn when adding a method to an obsolete generic function.
(cl--generic-lambda): Make sure it works if cl-lib is not yet loaded.
* lisp/emacs-lisp/eieio-generic.el (eieio--defgeneric-init-form):
Use autoloadp.
* lisp/emacs-lisp/eieio.el (defclass): Add obsolescence warning for the
`newname' argument.
* test/automated/cl-generic-tests.el (cl-generic-test-10-weird): New test.
Rename other tests to preserve ordering.
Stefan Monnier [Sun, 18 Jan 2015 03:50:50 +0000 (22:50 -0500)]
* lisp/emacs-lisp/cl-generic.el: Add support for cl-next-method-p.
(cl-defmethod): Add edebug spec.
(cl--generic-build-combined-method): Fix call to
cl-no-applicable-method.
(cl--generic-nnm-sample, cl--generic-cnm-sample): New constant.
(cl--generic-isnot-nnm-p): New function.
(cl--generic-lambda): Use it to add support for cl-next-method-p.
(cl-no-next-method, cl-no-applicable-method): Simplify arg list.
(cl-next-method-p): New function.
Ulrich Müller [Sat, 17 Jan 2015 23:06:13 +0000 (00:06 +0100)]
Fix mistake in rebase/merge conflict resolution.
Remove lines from lisp/vc/vc-bzr.el again that were accidentally
restored in commit 2015-01-17T09:56:45!ulm@gentoo.org.
(Previously removed in commit 2014-12-01T13:24:27Z!esr@thyrsus.com.)
Ivan Shmakov [Sat, 17 Jan 2015 19:02:00 +0000 (19:02 +0000)]
Fix dir-locals handling for non-file buffers.
* lisp/files.el (dir-locals-collect-variables): Use default-directory
in place of the file name while working on non-file buffers, just
like hack-dir-local-variables already does.