Commit graph

5255 commits

Author SHA1 Message Date
Nicolas Petton
c856843f6b New macro seq-let, providing destructuring support to seq.el
* lisp/emacs-lisp/seq.el (seq-let): New macro.  `seq-let' is similar
to `cl-destructuring-bind' but works on all sequence types supported
by `seq.el'.  Bump version number to 1.6.
* test/automated/seq-tests.el: Add tests for seq-let.
* doc/lispref/sequences.texi: Add documentation for seq-let.
2015-05-01 19:33:40 +02:00
Przemysław Wojnowski
7e7fd3010b ; Add class name to error message
* lisp/emacs-lisp/eieio-core.el (eieio-oref): Add class name to error
  message to ease finding offending code.
2015-05-01 13:10:26 -04:00
Glenn Morris
b0481de73b * lisp/emacs-lisp/ert.el (ert--special-operator-p): Fix previous. 2015-05-01 08:29:18 -07:00
Artur Malabarba
9b909c4265 * lisp/emacs-lisp/bytecomp.el: Revert "Silence noninteractive compilations"
This reverts commit 9a7ddde977.
This reverts commit 3c0ea587da.
With message: "* lisp/emacs-lisp/bytecomp.el: Use `inhibit-message'".
(Bug#20445).
2015-05-01 15:25:02 +01:00
Glenn Morris
55496af138 * lisp/emacs-lisp/ert.el (ert--special-operator-p):
Update for 2015-02-08 change to indirect-function.
2015-04-30 21:18:52 -04:00
Glenn Morris
e22f333ddb Silence some compilation warnings
* lisp/emacs-lisp/check-declare.el (compilation-forget-errors):
* lisp/emulation/cua-base.el (delete-active-region):
* lisp/net/net-utils.el (w32-get-console-output-codepage):
* lisp/term/ns-win.el (ns-own-selection-internal)
(ns-disown-selection-internal, ns-selection-owner-p)
(ns-selection-exists-p, ns-get-selection):
Declare for compiler..
2015-04-30 20:09:02 -04:00
Glenn Morris
ce7ff436ff Function declaration updates prompted by 'make check-declare'
* lisp/emacs-lisp/package.el (lm-homepage):
* lisp/gnus/gnus-util.el (iswitchb-read-buffer):
* lisp/gnus/mm-decode.el (libxml-parse-html-region):
* lisp/gnus/mml.el (libxml-parse-html-region):
* lisp/gnus/nnrss.el (libxml-parse-html-region):
* lisp/net/eww.el (libxml-parse-html-region):
* lisp/net/shr.el (libxml-parse-html-region):
* lisp/vc/vc-bzr.el (vc-annotate-convert-time):
* lisp/vc/vc-cvs.el (vc-annotate-convert-time):
* lisp/vc/vc-git.el (vc-annotate-convert-time):
* lisp/vc/vc-hg.el (vc-annotate-convert-time):
* lisp/vc/vc-mtn.el (vc-annotate-convert-time):
* lisp/vc/vc-rcs.el (vc-annotate-convert-time):
Update declaration.
2015-04-30 20:06:15 -04:00
Artur Malabarba
f4ad42936e * lisp/emacs-lisp/package.el: Some speed optimizations on menu refresh
(package-menu--print-info): Obsolete.
(package-menu--print-info-simple): New function.
(package-menu--refresh): Use it, simplify code, and improve
performance.

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print-entry):
Tiny performance improvement.
2015-04-30 09:35:20 +01:00
Artur Malabarba
5b6c58395d * lisp/emacs-lisp/package.el (package--message): inhibit-message 2015-04-30 09:35:20 +01:00
Artur Malabarba
c1d30c4b13 * lisp/emacs-lisp/package.el: Use pushnew for downloads in progress
(package--download-and-read-archives): Use pushnew instead of
append.  If something terrible happened during a previous
download, simply refreshing should now make things work again.
2015-04-30 00:59:26 +01:00
Nicolas Petton
a5237a0499 Faster implementation of map-empty-p
* lisp/emacs-lisp/map.el (map-empty-p): Faster implementation using
specific tests depending on the type of the map.
2015-04-29 19:05:44 +02:00
Nicolas Petton
12a3ea52c4 * lisp/emacs-lisp/map.el: Better docstrings. 2015-04-29 19:01:40 +02:00
Artur Malabarba
3c0ea587da * lisp/emacs-lisp/bytecomp.el: Use `inhibit-message'
(byte-compile--message): Use `inhibit-message' instead of hiding
the previous message with (message nil).
2015-04-29 09:48:07 +01:00
Artur Malabarba
301514f2bf * lisp/emacs-lisp/package.el: Fix priority-hiding corner case
(package-menu--refresh): Delegate obsolete-hiding to
`package--remove-hidden'.
(package--remove-hidden): Disregard high-priority package if it is
older than the installed one.
2015-04-28 22:29:50 +01:00
Artur Malabarba
fecd155703 * lisp/emacs-lisp/package.el: Skip space and comments in init file
(package--ensure-init-file): Insert snippet at first
non-whitespace non-comments line.  Respects local-vars at the top
of the file.
2015-04-28 11:08:40 +01:00
Nicolas Petton
66fec8bec4 Bump version of seq.el to 1.5
* lisp/emacs-lisp/seq.el (seq-doseq): Remove undocumented return value
  from seq-doseq.  Bump version number of seq.el.
2015-04-27 23:26:33 +02:00
Artur Malabarba
f3b43fca47 * lisp/emacs-lisp/package.el: Small improvements
(package--with-work-buffer-async): More informative error.
(package-install-user-selected-packages): Rename to
`package-install-selected-packages'.
2015-04-27 22:06:32 +01:00
Stefan Monnier
d320ec576d * lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Fix last
* lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Fix last change.
(eieio--class-make): Remove leftover `tag'.
2015-04-27 16:01:39 -04:00
Stefan Monnier
d92e0c58e8 * lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Reuse oldc. 2015-04-27 15:33:43 -04:00
Stefan Monnier
0b72388293 lisp/emacs-lisp/package.el: Move variables to silence byte-compiler
Remove redundant ":group 'package".
2015-04-26 17:03:21 -04:00
Artur Malabarba
c576ab54b5 * lisp/emacs-lisp/map.el (map-pairs): Dump redundant lambda 2015-04-25 17:27:13 +01:00
Artur Malabarba
864573cafe * lisp/emacs-lisp/package.el (package-all-keywords): Don't cache
(package--all-keywords): Deleted variable.
2015-04-25 17:04:02 +01:00
Nicolas Petton
5e52b0a076 * lisp/emacs-lisp/map.el (map--elt-list): Better docstring. 2015-04-25 16:56:19 +02:00
Nicolas Petton
40a8a12a26 * lisp/emacs-lisp/map.el (map--elt-list): Minor refactoring. 2015-04-25 16:53:09 +02:00
Nicolas Petton
62879799ea Fix a false negative in `map-elt' with alists and values being nil
* lisp/emacs-lisp/map.el (map-elt): If map is an alist and key is
found but its associated value is nil, do not return the default
value.

* test/automated/map-tests.el: Add a regression test.
2015-04-25 12:07:12 +02:00
Paul Eggert
2f5da6d45a Spelling fixes 2015-04-24 23:19:59 -07:00
Nicolas Petton
7ecda8a221 * lisp/emacs-lisp/seq.el (seq-doseq): Fix the macro. 2015-04-24 23:12:50 +02:00
Stefan Monnier
e224c9465d * lisp/emacs-lisp/seq.el (seq-doseq): Tighten the code
(seq-doseq): Fix out-of-scope binding.
Don't call `seq-length at every iteration.
Reduce `if's from 3 to 2 per iteration.
(emacs-lisp-mode-hook): Don't tweak in Emacs≥25.
2015-04-24 16:11:35 -04:00
Nicolas Petton
eea2e83138 * lisp/emacs-lisp/map.el (map--dispatch): Improve the docstring. 2015-04-24 19:33:18 +02:00
Nicolas Petton
d75151a671 Do not signal an error when trying to delete a key from an array
* lisp/emacs-lisp/map.el (map-delete): When map is an array, check if
the key is present to avoid signaling an error.

* test/automated/map-tests.el: Add a test for deleting non-existing
keys from maps.
2015-04-24 19:29:59 +02:00
Nicolas Petton
79d9757c23 * lisp/emacs-lisp/map.el: Better docstring. 2015-04-24 19:15:23 +02:00
Nicolas Petton
f37e265ea9 Minor improvement in map-elt.
* lisp/emacs-lisp/map.el (map-elt): Do not use `ignore-errors' when
doing a lookup in arrays, but check the boundaries of the array
instead.

* test/automated/map-tests.el: Adds a test for `map-elt' with arrays
and a negative integer as key.
2015-04-24 19:10:45 +02:00
Artur Malabarba
8991937a74 * lisp/emacs-lisp/package.el: Hide lower-priority packages in menu
(package-menu-hide-low-priority): New variable, see its doc.
(package-archive-priorities): Update doc.
(package-desc-priority): New function.
(package-desc-priority-version): Use it.
(package--remove-hidden): New function.
(package-menu--refresh): Use it.
2015-04-22 11:27:47 +01:00
Artur Malabarba
c3b41c6448 * lisp/emacs-lisp/package.el: Implement displaying obsolete packages
(package-menu--hide-obsolete): New variable.
(package--remove-hidden): Use it.
(package-menu-hide-obsolete): New interactive function to toggle
the variable.
(package--quick-help-keys): Document it.
(package-menu-async): Add :version tag.
(package-menu-mode-map): Bind package-menu-hide-obsolete.
(package-desc-status): Indicate non-installed obsolete packages as
avail-obso.
(package-menu-mark-install): Allow installation of avail-obso.
(package-menu--status-predicate): Sort avail-obso with available.
2015-04-22 11:27:47 +01:00
Stefan Monnier
c9a75a4030 Fix byte-compiler warnings about looking-back.
* lisp/vc/log-view.el (log-view-end-of-defun-1):
* lisp/textmodes/tex-mode.el (latex-forward-sexp-1):
* lisp/textmodes/reftex-ref.el (reftex-goto-label):
* lisp/textmodes/bibtex.el (bibtex-insert-kill):
* lisp/progmodes/sh-script.el (sh--maybe-here-document):
* lisp/progmodes/ruby-mode.el (ruby-end-of-defun):
* lisp/progmodes/ada-mode.el (ada-in-numeric-literal-p):
* lisp/org/org.el (org-insert-heading, org-sort-entries):
* lisp/org/org-mouse.el (org-mouse-end-headline)
(org-mouse-context-menu):
* lisp/org/org-clock.el (org-clock-cancel):
* lisp/man.el (Man-default-man-entry):
* lisp/mail/rmail.el (rmail-get-new-mail, rmail-insert-inbox-text)
(rmail-ensure-blank-line):
* lisp/mail/footnote.el (Footnote-delete-footnote):
* lisp/mail/emacsbug.el (report-emacs-bug):
* lisp/info.el (Info-follow-reference, Info-fontify-node):
* lisp/info-look.el (info-lookup-guess-custom-symbol):
* lisp/help-fns.el (help-fns--key-bindings):
* lisp/files.el (hack-local-variables):
* lisp/emulation/viper-ex.el (viper-get-ex-token, ex-cmd-complete)
(viper-get-ex-pat, ex-expand-filsyms, viper-get-ex-file)
(viper-complete-filename-or-exit):
* lisp/emulation/viper-cmd.el (viper-backward-indent):
* lisp/emacs-lisp/lisp-mode.el (calculate-lisp-indent):
* lisp/emacs-lisp/elint.el (elint-get-top-forms):
* lisp/cus-edit.el (custom-face-edit-value-create):
* lisp/calendar/todo-mode.el (todo-set-item-priority)
(todo-filter-items-1, todo-convert-legacy-files)
(todo-prefix-overlays): Add explicit second arg to looking-back.
2015-04-20 21:55:00 -04:00
Artur Malabarba
b7a015f5e0 * lisp/emacs-lisp/package.el: Filter by multiple keywords and cache keywords
(package-menu-filter): Accept a list of keywords.

(package--all-keywords): New variable to cache known keywords.
(package-all-keywords): Populate it if necessary.
(package-refresh-contents): Reset it.
2015-04-20 20:47:18 +01:00
Artur Malabarba
fad6b8a093 * lisp/emacs-lisp/package.el: Make archive and status pseudo-keywords
(package--has-keyword-p): Understand "arc:xxxx" and "status:xxxx"
as special keywords which match agains package archive and status
respectively.

* etc/NEWS: Document it.
2015-04-20 20:47:18 +01:00
Steve Purcell
4155619aac Assume package archive-contents are UTF8-encoded
* lisp/emacs-lisp/package.el (package--read-archive-file):
Set `coding-system-for-read' explicitly to 'utf-8 when reading the
downloaded and cached archive-contents files, so that non-ASCII
characters in package descriptions are displayed correctly in the
`list-packages' menu. (Bug#20231)

Co-authored-by: Steve Purcell <steve@sanityinc.com>
2015-04-19 17:56:46 +01:00
Nicolas Petton
9760c6cde3 * lisp/emacs-lisp/seq.el (seq-concatenate, seq-into): Better error messages. 2015-04-18 20:10:27 +02:00
Nicolas Petton
a76628fd56 * lisp/emacs-lisp/map.el (map-into): Better error message. 2015-04-18 20:07:34 +02:00
Nicolas Petton
924ea3ff9d * lisp/emacs-lisp/map.el: Removes byte-compilation warnings. 2015-04-18 20:04:17 +02:00
Nicolas Petton
35c27cd581 Throw an error when converting a map into an unknown map type
* lisp/emacs-lisp/map.el (map-into): Throw an error if type is not valid.
* test/automated/map-test.el: Add a regression test.
2015-04-18 16:35:43 +02:00
Nicolas Petton
c3acb3258d New library map.el similar to seq.el but for mapping data structures.
* test/automated/map-test.el: New file.
* lisp/emacs-lisp/map.el: New file.
2015-04-18 16:22:16 +02:00
Paul Eggert
3074a9fad1 '[:graph:]' now excludes whitespace, not just ' '
* doc/lispref/searching.texi (Char Classes):
* lisp/emacs-lisp/rx.el (rx): Document [:graph:] to be [:print:]
sans whitespace (not sans space).
* src/character.c (graphicp): Exclude all Unicode whitespace chars,
not just space.
* src/regex.c (ISGRAPH): Exclude U+00A0 (NO-BREAK SPACE).
2015-04-15 23:47:01 -07:00
Stefan Monnier
c0c57f8b36 Move some Elisp-specific code from lisp-mode.el to elisp-mode.el
* lisp/emacs-lisp/lisp-mode.el (lisp--el-font-lock-flush-elisp-buffers):
Move to elisp-mode.el.
(lisp-mode-variables): (Re)move elisp-specific settings.

* lisp/progmodes/elisp-mode.el (emacs-lisp-mode): Add settings removed
from lisp-mode-variables.
(elisp--font-lock-flush-elisp-buffers): New function, moved from
lisp-mode.el.
2015-04-15 16:50:17 -04:00
Stefan Monnier
59fd76c178 * lisp/emacs-lisp/lisp-mode.el (lisp--el-non-funcall-position-p):
Avoid pathological slowdown at top-level in large file.
2015-04-15 16:39:18 -04:00
Nicolas Petton
a5dbb543cb Define cl-concatenate as an alias to seq-concatenate
* lisp/emacs-lisp/cl-extra.el (cl-concatenate): Removes duplicated
  code by making cl-concatenate an alias to seq-concatenate.
2015-04-15 18:29:15 +02:00
Paul Eggert
a122a0276b Make [:graph:] act like [:print:] sans space
In POSIX [[:print:]] is equivalent to [ [:graph:]], so change
[:graph:] so that it matches everything that [:print:] does,
except for space.
* doc/lispref/searching.texi (Char Classes):
* etc/NEWS:
* lisp/emacs-lisp/rx.el (rx):
Document [:graph:] to be [:print:] sans ' '.
* src/character.c, src/character.h (graphicp): New function.
* src/regex.c (ISGRAPH) [emacs]: Use it.
(BIT_GRAPH): New macro.
(BIT_PRINT): Increase to 0x200, to make room for BIT_GRAPH.
(re_wctype_to_bit) [! WIDE_CHAR_SUPPORT]:
Return BIT_GRAPH for RECC_GRAPH.
(re_match_2_internal) [emacs]: Use ISGRAPH if BIT_GRAPH,
and ISPRINT if BIT_PRINT.
2015-04-15 00:27:18 -07:00
Stefan Monnier
5de3427203 * lisp/emacs-lisp/eieio-core.el (eieio--class): Derive from cl--class
(eieio--class-p): Remove, provided by cl-defstruct.
2015-04-14 23:04:45 -04:00
Nicolas Petton
17d667b387 Add seq-intersection and seq-difference to the seq library
* lisp/emacs-lisp/seq.el (seq-intersection, seq-difference): New
functions.

* test/automated/seq-tests.el: Add tests for seq-intersection and
seq-difference.

* doc/lispref/sequences.texi: Add documentation for seq-intersection
and seq-difference.
2015-04-15 01:55:03 +02:00