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.
Joakim Verona [Mon, 19 Jan 2015 23:48:41 +0000 (00:48 +0100)]
Implement native scrolling of the webkit xwidget
It is now possible to use native scrolling with the webkit view.
There is also a new function xwidget-set-adjustment,
which can manipulate the viewport.
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.
Stefan Monnier [Sat, 17 Jan 2015 04:48:26 +0000 (23:48 -0500)]
Don't enforce :protection in EIEIO objects any more
* doc/misc/eieio.texi (Slot Options): Document :protection as unsupported.
* lisp/emacs-lisp/eieio-core.el (eieio--scoped-class-stack): Remove var.
(eieio--scoped-class): Remove function.
(eieio--with-scoped-class): Remove macro. Replace uses with `progn'.
(eieio--slot-name-index): Don't check the :protection anymore.
(eieio-initializing-object): Remove var.
(eieio-set-defaults): Don't let-bind eieio-initializing-object.
* lisp/emacs-lisp/eieio-generic.el (call-next-method): Don't bother checking
eieio--scoped-class any more.
* test/automated/eieio-test-methodinvoke.el (eieio-test-method-store):
Use an explicit arg instead of eieio--scoped-class. Update all callers.
* test/automated/eieio-tests.el (eieio-test-25-slot-tests)
(eieio-test-26-default-inheritance, eieio-test-28-slot-protection)
(eieio-test-30-slot-attribute-override)
(eieio-test-31-slot-attribute-override-class-allocation): Don't check
that we enforce :protection since we don't any more.
Stefan Monnier [Sat, 17 Jan 2015 03:52:15 +0000 (22:52 -0500)]
Improve handling of doc-strings and describe-function for cl-generic
* lisp/help-fns.el (find-lisp-object-file-name): Accept any `type' as long
as it's a symbol.
(help-fns-short-filename): New function.
(describe-function-1): Use it. Use autoload-do-load.
* lisp/emacs-lisp/cl-generic.el (cl-generic-ensure-function): It's OK to
override an autoload.
(cl-generic-current-method-specializers): Replace dyn-bind variable
with a lexically-scoped macro.
(cl--generic-lambda): Update accordingly.
(cl-generic-define-method): Record manually in the load-history with
type `cl-defmethod'.
(cl--generic-get-dispatcher): Minor optimization.
(cl--generic-search-method): New function.
(find-function-regexp-alist): Add entry for `cl-defmethod' type.
(cl--generic-search-method): Add hyperlinks for methods. Merge the
specializers and the function's arguments.
* lisp/emacs-lisp/eieio-core.el (eieio--defalias): Move to eieio-generic.el.
(eieio-defclass-autoload): Don't record the superclasses any more.
(eieio-defclass-internal): Reuse the old class object if it was just an
autoload stub.
(eieio--class-precedence-list): Load the class if it's autoloaded.
* lisp/emacs-lisp/eieio-generic.el (eieio--defalias): Move from eieio-core.
(eieio--defgeneric-init-form): Don't throw away a previous docstring.
(eieio--method-optimize-primary): Don't mess with the docstring.
(defgeneric): Keep the `args' in the docstring.
(defmethod): Don't use the method's docstring for the generic
function's docstring.
* lisp/emacs-lisp/find-func.el: Use lexical-binding.
(find-function-regexp): Don't rule out `defgeneric'.
(find-function-regexp-alist): Document new possibility of including
a function instead of a regexp.
(find-function-search-for-symbol): Implement that new possibility.
(find-function-library): Don't assume that `function' is a symbol.
(find-function-do-it): Remove unused var `orig-buf'.
* test/automated/cl-generic-tests.el (cl-generic-test-8-after/before):
Rename from cl-generic-test-7-after/before.
(cl--generic-test-advice): New function.
(cl-generic-test-9-advice): New test.
Jorgen Schaefer [Sun, 7 Dec 2014 21:28:38 +0000 (22:28 +0100)]
Package archives now have priorities.
* lisp/package.el: Provide repository priorities.
(package-archive-priorities): New variable.
(package--add-to-alist): New function.
(package--add-to-archive-contents): Use it.
(package-menu--find-upgrades): Use it as well. Small clean up to
make the use of the package name here explicit.
(package-archive-priority): New function.
(package-desc-priority-version): New function.
Paul Eggert [Fri, 16 Jan 2015 04:37:05 +0000 (20:37 -0800)]
Give up on -Wsuggest-attribute=const
The attribute doesn't help performance significantly, and the
warning seems to be more trouble than it's worth. See the thread at:
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00361.html
* configure.ac (WERROR_CFLAGS): Don't use -Wsuggest-attribute=const.
* lib-src/make-docfile.c (write_globals):
Remove special hack for Fnext_read_file_uses_dialog_p.
* src/decompress.c (Fzlib_available_p):
* src/gnutls.c (Fgnutls_available_p):
* src/gtkutil.h (xg_uses_old_file_dialog):
* src/xdisp.c (Ftool_bar_height):
* src/xmenu.c (popup_activated):
No longer const, since it's not const on at lest some
configurations, and we shouldn't lie to the compiler.
Eli Zaretskii [Thu, 15 Jan 2015 15:50:50 +0000 (17:50 +0200)]
Add set-binary-mode primitive to switch a standard stream to binary I/O.
src/fileio.c: Include binary-io.h.
(Fset_binary_mode): New function.
(syms_of_fileio): Defsubr it.
(syms_of_fileio) <Qstdin, Qstdout, Qstderr>: DEFSYM them.
admin/unidata/unidata/uvs.el (uvs-print-table-ivd): Call set-binary-mode on
stdout.
doc/lispref/streams.texi (Input Functions): Document 'set-binary-mode'.
(Output Functions): Cross-reference to documentation of
'set-binary-mode'.
Ted Zlatanov [Thu, 15 Jan 2015 14:41:58 +0000 (09:41 -0500)]
Flag :unknown-ca and :self-signed SSL certs (Bug#19404)
Fixes: debbugs:19404
* gnutls.c (init_gnutls_functions): Import gnutls_x509_crt_check_issuer.
(Fgnutls_peer_status): Use it to set the :self-signed flag.
Rename the previous :self-signed to :unknown-ca.
(Fgnutls_peer_status_warning_describe): Explain :unknown-ca flag.
Stefan Monnier [Thu, 15 Jan 2015 05:19:44 +0000 (00:19 -0500)]
* lisp/emacs-lisp/eieio-core.el: Provide support for cl-generic.
(eieio--generic-tagcode): New function.
(cl-generic-tagcode-function): Use it.
(eieio--generic-tag-types): New function.
(cl-generic-tag-types-function): Use it.
(eieio-object-p): Tighten up the test.
* test/automated/eieio-test-methodinvoke.el (eieio-test-method-store): Add
keysym arg instead of relying on internal var eieio--generic-call-key.
Update all callers.
(eieio-test-cl-generic-1): New tests.
Stefan Monnier [Wed, 14 Jan 2015 19:37:10 +0000 (14:37 -0500)]
* lisp/emacs-lisp/cl-generic.el: New file.
* lisp/emacs-lisp/cl-macs.el (cl-flet): Allow (FUN EXP) forms.
(cl-load-time-value, cl-labels): Use closures rather than
backquoted lambdas.
(cl-macrolet): Use `eval' to create the function value, and support CL
style arguments in for the defined macros.
* test/automated/cl-generic-tests.el: New file.
Eli Zaretskii [Wed, 14 Jan 2015 18:51:33 +0000 (20:51 +0200)]
Fix crashes on MS-Windows due to pop-up menus (Bug#19596)
src/w32fns.c (w32_wnd_proc): Ignore MENUITEMINFO's dwItemData data
when FLAGS indicate the item is not highlighted, i.e. it's not our
help-echo string.
Stefan Monnier [Mon, 12 Jan 2015 18:07:52 +0000 (13:07 -0500)]
* lisp/net/eww.el: Use lexical-binding.
(eww-links-at-point): Remove unused arg.
(eww-mode-map): Inherit from special-mode-map.
(eww-mode): Derive from special-mode. Don't use `setq' on a hook.
Dmitry Antipov [Wed, 14 Jan 2015 12:56:46 +0000 (15:56 +0300)]
Never move gap in make_buffer_string_both.
* editfns.c (make_buffer_string_both): If requested range intersects
the gap, don't move the latter but copy in two regions, thus avoiding
unnecessary relocation of buffer data.