1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

128462 commits

Author SHA1 Message Date
Stefan Monnier
fb997d30af * lisp/emacs-lisp/cl-generic.el (cl--generic-typeof-types): Add `atom'
remove entries whose car can't be returned by type-of.
(cl--generic-all-builtin-types): New var.
(cl-generic-generalizers): Use it to avoid requiring
extra entries in cl--generic-typeof-types.
2017-02-21 21:47:10 -05:00
Noam Postavsky
907bad07f2 Find macro binding for symbol-bound macros too (Bug#6848)
There are 2 ways to bind a macro: with global-set-key or
kmacro-bind-to-key.  The former binds a key to a symbol, while the
latter binds to a lambda.  In 2010-03-03 "Fix keyboard macro key
lookup (Bug#5481)", `insert-kbd-macro' was fixed to detect the lambda
case, but broke the symbol case.

* lisp/macros.el (insert-kbd-macro): Also check for bindings of
MACRONAME.
2017-02-21 21:44:54 -05:00
Stefan Monnier
3f1cd957ff * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Fix last change 2017-02-21 21:32:27 -05:00
Juri Linkov
cd191c8034 * lisp/isearch.el (lazy-highlight-max-at-a-time): Doc fix (bug#21092). 2017-02-22 02:16:06 +02:00
Juri Linkov
c5e66afa88 * lisp/isearch.el (isearch-lazy-highlight): New choice ‘all-windows’.
(isearch-lazy-highlight-update): Check it to decide whether to apply
overlays only on the selected window.

* lisp/follow.el (follow-mode): Set isearch-lazy-highlight to ‘all-windows’.
(Bug#17453, bug#21092)
2017-02-22 02:10:36 +02:00
Paul Eggert
17af43ca76 Minor weak hash table performance tweaks
* src/fns.c (make_hash_table): Omit unnecessary assignment to
h->next_weak when the hash table is not weak.
(copy_hash_table): Put the copy next to the original in the
weak_hash_tables list, as this should have better locality
when scanning the weak hash tables.
2017-02-21 15:39:17 -08:00
Paul Eggert
83c9c6fc1c Use float instead of Lisp_Object for rehash_size
* src/alloc.c (purecopy_hash_table):
* src/fns.c (maybe_resize_hash_table, Fmake_hash_table):
(Fhash_table_rehash_size):
* src/lisp.h (struct Lisp_Hash_Table.rehash_size):
The rehash_size member of struct Lisp_Hash_Table is now a
float, not a Lisp_Object.
* src/alloc.c (purecopy_hash_table): Assign members in order.
* src/fns.c (make_hash_table): Use EMACS_INT for size and
float for rehash_size, instead of Lisp_Object for both.
All callers changed.
* src/lisp.h (DEFAULT_REHASH_SIZE): Now float, not double,
and 1 smaller.
* src/print.c (print_object): Simplify by calling
Fhash_table_rehash_size and Fhash_table_rehash_threshold.
Avoid unnecessary NILP.
2017-02-21 15:39:17 -08:00
Paul Eggert
5cbdaa98f9 Use ptrdiff_t instead of Lisp_Object for collision
* src/alloc.c (purecopy_hash_table): Assign, don’t purecopy.
* src/fns.c (set_hash_next_slot, set_hash_index_slot): Hash index
arg is now ptrdiff_t index (or -1 if empty), not Lisp_Object
integer (or Qnil if empty).  All callers changed.
(larger_vecalloc): New static function.
(larger_vector): Use it.
(HASH_NEXT, HASH_INDEX): Move here from lisp.h.  Return ptrdiff_t
index (or -1) not Lisp_Object integer (or Qnil).  All callers changed.
* src/fns.c (make_hash_table, maybe_resize_hash_table, hash_lookup)
(hash_put, hash_remove_from_table, hash_clear, sweep_weak_table):
* src/profiler.c (evict_lower_half, record_backtrace):
-1, not nil, is now the convention for end of collision list.
* src/fns.c (maybe_resize_hash_table): Avoid double-initialization
of the free list.  Reallocate H->next last, in case other
reallocations exhaust memory.
* src/lisp.h (struct Lisp_Hash_Table): ‘next_free’ is now
ptrdiff_t, not Lisp_Object.  Adjust commentary for ‘next’ and
‘index’, which no longer contain nil.
(HASH_NEXT, HASH_INDEX): Move to src/fns.c.
2017-02-21 15:39:17 -08:00
Paul Eggert
7207b63c8e Hash table threshold is now float, not double
Change default from 0.8 to 0.8125 so it fits in float without
rounding glitches.
* doc/lispref/hash.texi (Creating Hash):
* doc/lispref/objects.texi (Hash Table Type):
* etc/NEWS:
Document change.
* src/fns.c (make_hash_table, maybe_resize_hash_table)
(Fmake_hash_table): Threshold is now float, not double.
Be consistent about how this is rounded.
* src/lisp.h (struct Lisp_Hash_Table.rehash_threshold):
Change back to float, now that the other code rounds consistently.
(DEFAULT_REHASH_THRESHOLD): Now float 0.8125 instead of double 0.8.
2017-02-21 15:39:17 -08:00
Juri Linkov
f2191691d4 Avoid flicker in lazy-highlight by doing all updates without redisplay.
* lisp/isearch.el (lazy-highlight-max-at-a-time):
Change default value from 20 to nil to not trigger redisplay
between updating iterations.
(lazy-highlight-cleanup): New arg ‘procrastinate’ to not remove
overlays when non-nil.
(isearch-lazy-highlight-new-loop): Call lazy-highlight-cleanup
with non-nil second arg when the search string is not empty.
Run timer with isearch-lazy-highlight-start instead of
isearch-lazy-highlight-update.
(isearch-lazy-highlight-start): New function. (Bug#25751)
2017-02-22 01:22:18 +02:00
Glenn Morris
217eaf6932 ; * lisp/custom.el: Comments. 2017-02-21 15:11:56 -05:00
Stefan Monnier
bac7de05e2 * lisp/emacs-lisp/autoload.el (make-autoload): Support cl-defgeneric
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Tweak for autoloading.
2017-02-21 13:51:12 -05:00
Stefan Monnier
e785c74d3a * lisp/emacs-lisp/cl-preloaded.el (cl-struct-define): Fix duplication
which resulted in incomplete list of parents in one copy of the
cl-structure-class class.
2017-02-21 13:48:30 -05:00
Glenn Morris
20dda6be76 Tweak recent custom-reevaluate-setting change
* lisp/custom.el (custom-reevaluate-setting):
Tweak previous change to avoid font-lock init issues.
2017-02-21 12:59:56 -05:00
Glenn Morris
96cea19842 Ensure delayed-init custom variables get marked special
* lisp/custom.el (custom-reevaluate-setting):
If the variable has never been set, defvar it.  (Bug#25770)
2017-02-20 18:30:40 -08:00
Glenn Morris
08c73cdc6e ; Add a new TODO item
* etc/TODO: Add a new entry for :set-after.
* lisp/startup.el: Related comment.
2017-02-20 18:08:48 -08:00
Mark Oteiza
bfd1afb3da Turn on lexical-binding in dunnet.el
* lisp/play/dunnet.el: Turn on lexical-binding.  Re-instate lexical
byte compile warnings.
2017-02-20 21:04:52 -05:00
Mark Oteiza
e91cc4e1e0 Make dunnet insertion functions n-ary
* lisp/play/dunnet.el (dun-mprinc, dun-mprincl, dun-minsert):
(dun-minsertl, dun-batch-mprinc, dun-batch-mprincl): Change to accept
any number of arguments.
(dun-parse, dun-describe-room, dun-quit, dun-inven, dun-shake):
(dun-take, dun-go, dun-move, dun-press, dun-score):
(dun-compile-save-out, dun-do-logfile): Collect arguments from
multiple insertion calls into less calls with more args.
2017-02-20 21:00:32 -05:00
Katsumi Yamaoka
18c476956d message-goto-body-1: Fix regexp so as not to match multi-line
* lisp/gnus/message.el (message-goto-body-1):
Fix regexp so as not to match multi-line.
2017-02-21 00:24:05 +00:00
Noam Postavsky
2f53c0c468 Simplify cl-get using `plist-member'
* lisp/emacs-lisp/cl-extra.el (cl-get, cl-getf, cl--set-getf): Use
`plist-member' instead of explicit loop.
* test/lisp/emacs-lisp/cl-extra-tests.el: New tests.
2017-02-20 16:53:14 -05:00
Paul Eggert
57a8346edf Verify xwidget USE_LSB_TAG assumption
* src/xwidget.c (Fxwidget_webkit_execute_script):
Add verification.  Problem reported by Andreas Schwab (Bug#25816#8).
2017-02-20 13:04:09 -08:00
Stefan Monnier
160bcfeed6 * src/insdel.c (make_gap): Improve comment. 2017-02-20 14:05:41 -05:00
Mark Oteiza
27a76829fe Do not use switch-to-buffer for working in a temp buffer
* lisp/play/dunnet.el (dunnet): Use pop-to-buffer-same-window instead,
cf. Bug#22244.
(dun-load-d, dun-eval, dun-save-game, dun-do-logfile): Use
with-temp-buffer instead.
2017-02-20 13:53:41 -05:00
Mark Oteiza
e546d3d967 Make dun-room-shorts a defconst
* lisp/play/dunnet.el (dun-room-shorts): Make defconst and collect
initial value into the declaration.
(dun-space-to-hyphen): Remove.
2017-02-20 13:33:48 -05:00
Paul Eggert
a6e76fc725 Port xwidget to -DCHECK_LISP_OBJECT_TYPE
* src/xwidget.c (webkit_javascript_finished_cb)
(Fxwidget_webkit_execute_script): Don't assume Lisp_Object is an
integer.  This fix is just a hack; I’ll file a bug report about
the underlying problem.
2017-02-20 08:58:50 -08:00
Eli Zaretskii
589bd0c22b ; * src/insdel.c: State file encoding explicitly. 2017-02-20 17:41:46 +02:00
Katsumi Yamaoka
b2b31596f8 mm-decode.el: Simplify regexp used to search html meta tag
* lisp/gnus/mm-decode.el (mm-add-meta-html-tag, mm-shr):
Simplify regexp used to search html meta tag.
2017-02-20 06:40:03 +00:00
Katsumi Yamaoka
851b38bcdf mm-shr: Ignore coding-system `ascii'
* lisp/gnus/mm-decode.el (mm-shr): Ignore coding-system `ascii'.
2017-02-20 06:17:20 +00:00
Tom Tromey
0a670690f1 vc-log-outgoing fixes for git; add binding to vc-dir
* lisp/vc/vc-dir.el (vc-dir-mode-map): Bind "O" to vc-log-outgoing.
* lisp/vc/vc-git.el (vc-git-log-outgoing, vc-git-log-incoming): Use
async execution.
(vc-git-log-view-mode): Also truncate lines for log-outgoing and
log-incoming.
* lisp/vc/vc.el (vc-log-incoming, vc-log-outgoing): Don't pass nil
as remote-location argument.
2017-02-19 21:01:28 -07:00
Tom Tromey
a4c3227230 Remove stale comments from vc-git and vc-hg
* lisp/vc/vc-git.el (vc-git-retrieve-tag): Remove comment.
* lisp/vc/vc-hg.el (vc-hg-retrieve-tag): Remove comment.
2017-02-19 20:59:35 -07:00
Mark Oteiza
e7b0dac113 Remove member clone
* lisp/play/dunnet.el (dun-answer): Use member instead.
(dun-members): Remove.
2017-02-19 22:19:57 -05:00
Mark Oteiza
2f605c3f89 Prefix global var
* lisp/play/dunnet.el (room): Rename to dun-room.
(dun-messages, dunnet, dun-describe-room, dun-drop, dun-move):
(dun-restore, dun-do-logfile, dun-batch-loop): Use new name.
2017-02-19 22:15:57 -05:00
Mark Oteiza
0db5ba48b2 Replace nested ifs with cond
* lisp/play/dunnet.el (dun-messages, dun-describe-room, dun-examine):
(dun-eat, dun-put-objs, dun-turn, dun-press, dun-ls, dun-cd): Use when
and cond where appropriate.
(dun-sauna-heat): Accept sauna level as an argument.  Use cond.
(dun-take): Use null and dun-mprincl.
(dun-inven-weight, dun-load-d): Reformat.
(dun-remove-obj-from-inven, dun-remove-obj-from-room): Nix setq to nil.
2017-02-19 22:00:10 -05:00
Paul Eggert
c8d14cfc6c Fix glitches in recent hash table changes
* src/fns.c (Fmake_hash_table): Simplify the machine code slightly
by using 0 rather than -1.
* src/lisp.h (struct Lisp_Hash_Table.pure): Now bool rather
than a bitfield, for speed (the bitfield did not save space).
(struct Lisp_Hash_Table.rehash_threshold): Now double rather than
float, since the float caused unwanted rounding errors, e.g.,
(hash-table-rehash-threshold (make-hash-table)) yielded
0.800000011920929 instead of the correct 0.8.
2017-02-19 12:23:19 -08:00
Stefan Monnier
5c1ebfc504 * src/insdel.c (make_gap): Increase enough to avoid O(N^2) behavior. 2017-02-19 13:12:16 -05:00
Eli Zaretskii
f03d936cd7 ; Minor fix of recent change in fringe.c
* src/fringe.c (init_fringe_bitmap) [HAVE_NTGUI]: Remove an
unnecessary #ifdef introduced in a recent change.
2017-02-19 18:40:52 +02:00
Eli Zaretskii
35acb3950f ; * src/fns.c (Fmake_hash_table): Prefer 'double' to 'float'. 2017-02-19 18:35:48 +02:00
Eli Zaretskii
b36f8a4d35 Avoid aborts during loadup
* src/emacs-module.c (syms_of_module):
* src/image.c (xpm_make_color_table_h): Update calls to
make_hash_table to adjust to a recent change in fns.c.
* src/fns.c (make_hash_table):
* src/lisp.h (make_hash_table): 4th arg is now of type double.
2017-02-19 18:32:51 +02:00
Michael Albinus
143bc75c41 Rework connection local variables
For connection local variables interface, `class' is renamed
to `profile'.  All arguments `criteria' are a plist now.

* doc/lispref/variables.texi (Connection Local Variables):
Rewrite.

* lisp/files-x.el (connection-local-profile-alist): Rename
from `connection-local-class-alist'.  Adapt docstring.
(connection-local-criteria-alist): Adapt docstring.
(connection-local-normalize-criteria): New defun.
(connection-local-get-profiles): Rename from
`connection-local-get-classes'.  Rewrite.
(connection-local-set-profiles): Rename from
`connection-local-set-classes'.  Rewrite.
(connection-local-get-profile-variables): Rename from
`connection-local-get-class-variables'.  Rewrite.
(connection-local-set-profile-variables): Rename from
`connection-local-set-class-variables'.  Rewrite.
(hack-connection-local-variables)
(hack-connection-local-variables-apply)): Rewrite.
(with-connection-local-profiles): Rename from
`ith-connection-local-classes'.  Rewrite.

* lisp/net/tramp.el (tramp-set-connection-local-variables):
Compute criteria.

* lisp/net/tramp-cmds.el (tramp-bug):
Use `connection-local-profile-alist'.

* test/lisp/files-x-tests.el (files-x-test--variables1)
(files-x-test--variables2, files-x-test--variables3)
(files-x-test--variables4, files-x-test--criteria1)
(files-x-test--criteria2): Make them a defconst.
(files-x-test--application)
(files-x-test--another-application, files-x-test--protocol)
(files-x-test--user, files-x-test--machine): New defconst.
(files-x-test--criteria): New defvar.
(files-x-test--criteria3): Remove.
(files-x-test-connection-local-set-profile-variables):
Rename from `files-x-test-connection-local-set-class-variables'.
Rewrite.
(files-x-test-connection-local-set-profiles): Rename from
`files-x-test-connection-local-set-classes'.  Rewrite.
(files-x-test-hack-connection-local-variables-apply)  Rewrite.
(files-x-test-with-connection-local-profiles): Rename from
`files-x-test-with-connection-local-classes'.  Rewrite.
2017-02-19 17:14:35 +01:00
Mark Oteiza
b6a1a74522 ; Fix previous change
Actually adjust the comment.
* lisp/play/dunnet.el: Change comment to refer to section, add page
break to better demarcate section.
2017-02-19 08:55:45 -05:00
Mark Oteiza
7455c2ad80 Set up combination and random item location
* lisp/play/dunnet.el (dun-combination): Make defconst.
(tloc, tcomb): Remove.  Replace with a top-level form.
2017-02-19 08:28:50 -05:00
Mark Oteiza
44931dafa9 Replace movement variables with an alist and accessor
* lisp/play/dunnet.el (north, south, east, west, northeast, southeast):
(northwest, southwest, up, down, in, out): Remove.
(dun-movement-alist): New constant.
(dun-movement): New function.
(dun-n, dun-s, dun-e, dun-w, dun-ne, dun-se, dun-nw, dun-sw, dun-up):
(dun-down, dun-in, dun-out): Use a symbol for indicating movement.
(dun-move, dun-special-move): Translate movement symbol to an
enumeration.
2017-02-19 08:25:41 -05:00
Mark Oteiza
48cb4a96f3 Change top-level setq forms to defvar or defconst
Also collect some code onto fewer lines and reindent.
* lisp/play/dunnet.el (dun-visited, dun-current-room, dun-exitf):
(dun-badcd, dun-computer, dun-floppy, dun-key-level, dun-hole):
(dun-correct-answer, dun-lastdir, dun-numsaves, dun-jar, dun-dead):
(room, dun-numcmds, dun-wizard, dun-endgame-question, dun-logged-in):
(dungeon-mode, dun-unix-verbs, dun-dos-verbs, dun-batch-mode):
(dun-cdpath, dun-cdroom, dun-uncompressed, dun-ethernet):
(dun-restricted, dun-ftptype, dun-endgame, dun-rooms):
(dun-light-rooms, dun-verblist, dun-inbus, dun-nomail, dun-ignore):
(dun-mode, dun-sauna-level, north, south, east, west, northeast):
(southeast, northwest, southwest, up, down, in, out, dungeon-map):
(dun-objnames, obj-special, dun-room-objects, dun-room-silents):
(dun-inventory, dun-objects, dun-object-lbs, dun-object-pts):
(dun-objfiles, dun-perm-objects, dun-physobj-desc, dun-permobj-desc):
(dun-diggables, dun-room-shorts, dun-endgame-questions): Change
declaration to use defvar or defconst.
(dun-doverb, dun-vparse, dun-vparse2, dun-batch-parse):
(dun-batch-parse2): Omit the dun- prefix from arguments dun-ignore
dun-verblist.  Those are now constants and the byte compiler doesn't
allow defconsts in lambda lists.
2017-02-19 08:20:58 -05:00
Mark Oteiza
33400529c6 Move all dunnet globals up to the top
* lisp/play/dunnet.el: Adjust comments to reflect moved forms.
(dun-visited, dun-current-room, dun-exitf):
(dun-badcd, dun-computer, dun-floppy, dun-key-level, dun-hole):
(dun-correct-answer, dun-lastdir, dun-numsaves, dun-jar, dun-dead):
(room, dun-numcmds, dun-wizard, dun-endgame-question, dun-logged-in):
(dungeon-mode, dun-unix-verbs, dun-dos-verbs, dun-batch-mode):
(dun-cdpath, dun-cdroom, dun-uncompressed, dun-ethernet):
(dun-restricted, dun-ftptype, dun-endgame, dun-rooms):
(dun-light-rooms, dun-verblist, dun-inbus, dun-nomail, dun-ignore):
(dun-mode, dun-sauna-level, north, south, east, west, northeast):
(southeast, northwest, southwest, up, down, in, out, dungeon-map):
(dun-objnames, obj-special, dun-room-objects, dun-room-silents):
(dun-inventory, dun-objects, dun-object-lbs, dun-object-pts):
(dun-objfiles, dun-perm-objects, dun-physobj-desc, dun-permobj-desc):
(dun-diggables, dun-room-shorts, dun-endgame-questions): Move to the
top of the file, before any uses.
2017-02-19 08:13:30 -05:00
Michael Albinus
938426d1ca Fix bug#25788
* lisp/net/tramp.el (tramp-autoload-file-name-handler):
Do not load tramp.el just for "/".  (Bug#25788)
2017-02-19 09:33:24 +01:00
YAMAMOTO Mitsuharu
e420e9f032 Fix fringe bitmap initialization on MS-Windows
* src/fringe.c (init_fringe_bitmap) [HAVE_NTGUI]: Fix initialization
of fb->bits.  (Bug#25673)
2017-02-19 13:42:05 +09:00
Stefan Monnier
fe927ecfe4 Change type of rehash_threshold' and pure' fields in hash-tables
* src/lisp.h (struct Lisp_Hash_Table): Change type of
`rehash_threshold' and `pure' fields and move them after `count'.
* src/fns.c (make_hash_table): Change type of `rehash_threshold' and `pure'.
(Fmake_hash_table, Fhash_table_rehash_threshold):
* src/category.c (hash_get_category_set):
* src/xterm.c (syms_of_xterm):
* src/profiler.c (make_log):
* src/print.c (print_object):
* src/alloc.c (purecopy_hash_table, purecopy): Adjust accordingly.
2017-02-18 22:37:05 -05:00
Paul Eggert
b2a83eed23 Use 'char *FOO' instead of 'char* FOO' 2017-02-18 18:17:03 -08:00
Mark Oteiza
7f89c208bf More json.el changes
* lisp/json.el (json-read-keyword, json-read-number, json-read-object):
(json-read-array): Just use = for char comparison.
2017-02-18 20:25:50 -05:00
Alan Mackenzie
861ff2ba2c Fix edebug-spec on c-lang-defvar.
This allows c-lang-defvars with the symbol 'dont-doc in the place of the
optional documentation to be instrumented for edebug.

lisp/progmodes/cc-langs.el (top-level): Amend the edebug-spec for
c-lang-defvar.
(c-opt-identifier-concat-key, c-decl-prefix-or-start-re): remove redundant
'dont-doc.
2017-02-18 16:01:15 +00:00