Stefan Monnier [Fri, 9 Nov 2012 22:20:47 +0000 (17:20 -0500)]
Provide new `defalias-fset-function' symbol property.
* src/lisp.h (AUTOLOADP): New macro.
* src/eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
* src/data.c (Ffset): Remove special ad-advice-info handling.
(Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
(Fsubr_arity): CSE.
(Finteractive_form): Simplify.
(Fquo): Don't insist on having at least 2 arguments.
(Qdefalias_fset_function): New var.
* lisp/emacs-lisp/advice.el (ad-set-advice-info): Set defalias-fset-function.
(ad--defalias-fset): New function.
(ad-safe-fset): Remove.
(ad-make-freeze-definition): Use cl-letf*.
Dmitry Antipov [Fri, 9 Nov 2012 11:38:31 +0000 (15:38 +0400)]
Tweak last vectorlike_header change.
* alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
vectorlike object on the free list. This is introduced to avoid
some (but not all) pointer casting and aliasing problems, see
http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
* .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
objects.
(xvectype, xvecsize): Use them to examine Lisp_Object values.
Chong Yidong [Fri, 9 Nov 2012 08:34:17 +0000 (16:34 +0800)]
More updates for the URL library manual.
* url.texi (Introduction): Move url-configuration-directory to
Customization node.
(Parsed URIs): Split into its own node.
(URI Encoding): New node.
(Defining New URLs): Remove empty chapter.
(Retrieving URLs): Add an introduction. Doc fix for url-retrieve.
Improve docs for url-queue-*.
(Supported URL Types): Copyedits. Delete empty subnodes.
* ses.el: Use hash map for getting named cells coordinates.
symbol to coordinate mapping is made by symbol property
`ses-cell'. This means that the same mapping is done for all SES
sheets. That is good enough for cells with standard A1 names, but
not for named cell. So a hash map is added for those
latter.
(defconst ses-localvars): added local variable ses--named-cell-hashmap
(ses-sym-rowcol): Use hashmap for named cell.
(ses-is-cell-sym-p): New defun.
(ses-decode-cell-symbol): New defun.
(ses-create-cell-variable): Add cell to hashmap when name is not A1-like.
(ses-rename-cell): Check that cell new name is not already in
spreadsheet with the use of ses-is-cell-sym-p
(ses-rename-cell): Use hash map for named cells, but accept also
renaming back to A1-like.
Stefan Monnier [Fri, 9 Nov 2012 04:10:16 +0000 (23:10 -0500)]
New property dynamic-docstring-function for docstrings.
* src/doc.c (Fdocumentation): Handle new property
dynamic-docstring-function to replace the old ad-advice-info.
* lisp/emacs-lisp/advice.el: Use new dynamic docstrings.
(ad-make-advised-definition-docstring, ad-advised-definition-p):
Use dynamic-docstring-function instead of ad-advice-info.
(ad--make-advised-docstring): New function extracted from
ad-make-advised-docstring.
(ad-make-advised-docstring): Use it.
* lisp/progmodes/sql.el (sql--make-help-docstring): New function, extracted
from sql-help.
(sql-help): Use it with dynamic-docstring-function.
Stefan Monnier [Thu, 8 Nov 2012 21:58:55 +0000 (16:58 -0500)]
* src/lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
* src/fns.c (hashfn_eq, hashfn_eql, sxhash):
* src/profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
* src/buffer.c (compare_overlays): Use XLI rather than XHASH.
Paul Eggert [Thu, 8 Nov 2012 21:43:34 +0000 (13:43 -0800)]
Use same hash function for hashfn_profiler as for hash_string etc.
* fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
* lisp.h (sxhash_combine): New inline function, with the contents
of the old SXHASH_COMBINE.
* profiler.c (hashfn_profiler): Use it, instead of having a
special hash function containing a comparison that always yields 1.
Stefan Monnier [Thu, 8 Nov 2012 19:44:52 +0000 (14:44 -0500)]
* lisp/progmodes/js.el: Prefer advice to cl-letf's sneaky rebinding.
(c-forward-sws, c-backward-sws, c-beginning-of-macro): Advise.
(js--filling-paragraph): New var.
(js-c-fill-paragraph): Bind it instead of letf-ing the functions.
Stefan Monnier [Thu, 8 Nov 2012 19:12:23 +0000 (14:12 -0500)]
Use ad-hoc comparison function for the profiler's hash-tables.
* src/profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
(make_log): Use them.
(handle_profiler_signal): Don't inhibit quit any longer since we don't
call Fequal any more.
(Ffunction_equal): New function.
(cmpfn_profiler, hashfn_profiler): New functions.
(syms_of_profiler): Initialize them.
* src/lisp.h (struct hash_table_test): New struct.
(struct Lisp_Hash_Table): Use it.
* src/alloc.c (mark_object): Mark hash_table_test fields of hash tables.
* src/fns.c (make_hash_table): Take a struct to describe the test.
(cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
(hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
(hash_lookup, hash_remove_from_table): Move assertion checking of
hashfn result here. Check hash-equality before calling cmpfn.
(Fmake_hash_table): Adjust call to make_hash_table.
(hashtest_eq, hashtest_eql, hashtest_equal): New structs.
(syms_of_fns): Initialize them.
* src/emacs.c (main): Move syms_of_fns earlier.
* src/xterm.c (syms_of_xterm):
* src/category.c (hash_get_category_set): Adjust call to make_hash_table.
* src/print.c (print_object): Adjust to new hash-table struct.
* src/composite.c (composition_gstring_put_cache): Adjust to new hashfn.
Stefan Monnier [Thu, 8 Nov 2012 15:35:32 +0000 (10:35 -0500)]
* lisp/progmodes/perl-mode.el (perl-prettify-symbols): New defcustom.
(perl--prettify-symbols-alist): New const.
(perl--font-lock-compose-symbol, perl--font-lock-symbols-keywords): New funs.
(perl-font-lock-keywords-2): Use them.
(perl-electric-noindent-p): New function.
(perl-mode): Use it to set up electric-indent-mode.
(perl-electric-terminator, perl-indent-command): Mark obsolete.
(perl-mode-map): Remove bindings for them.
(perl-imenu-generic-expression, perl-outline-level):
Match functions&packages in column>0.
Stefan Monnier [Thu, 8 Nov 2012 15:10:08 +0000 (10:10 -0500)]
* lisp/env.el (env--substitute-vars-regexp): New const.
(substitute-env-vars): Use it. Add `only-defined' arg.
* lisp/net/tramp.el (tramp-replace-environment-variables): Use it.
Dmitry Antipov [Thu, 8 Nov 2012 14:10:28 +0000 (18:10 +0400)]
Shrink struct vectorlike_header to the only size field.
* lisp.h (enum pvec_type): Avoid explicit enum member values.
Adjust comment.
(enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
PVEC_TYPE_MASK to arrange new bitfield in the vector header.
(PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
(PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
information from the vector header. Adjust comment.
(XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
(PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
layout.
(XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
(struct vectorlike_header): Remove next member. Adjust comment.
(struct Lisp_Subr): Add convenient header. Adjust comment.
(allocate_pseudovector): Adjust prototype.
* alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
(sweep_string, lisp_malloc): Remove useless prototypes.
(enum mem_type): Adjust comment.
(NEXT_IN_FREE_LIST): New macro.
(SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
(Fmake_bool_vector): Likewise.
(struct large_vector): New type to represent allocation unit for
the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
(large_vectors): Change type to struct large_vector.
(allocate_vector_from_block): Simplify.
(PSEUDOVECTOR_NBYTES): Replace with...
(vector_nbytes): ...new function. Adjust users.
(sweep_vectors): Adjust processing of large vectors.
(allocate_vectorlike): Likewise.
(allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
Add easserts. Adjust XSETPVECTYPESIZE usage.
(allocate_buffer): Use BUFFER_PVEC_INIT.
(live_vector_p): Adjust to match large vector.
* buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
* buffer.h (struct buffer): Add next member.
(BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
New macros.
(FOR_EACH_BUFFER): Adjust to match struct buffer change.
* fns.c (internal_equal): Adjust to match enum pvec_type change.
(copy_hash_table): Adjust to match vector header change.
* lread.c (defsubr): Use XSETPVECTYPE.
* .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
(xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
(xvecsize): New command.
Dmitry Antipov [Thu, 8 Nov 2012 09:26:40 +0000 (13:26 +0400)]
* keyboard.c (event_to_kboard): Do not dereference
frame_or_window field of SELECTION_REQUEST_EVENT
and SELECTION_CLEAR_EVENT events (Bug#12814).
* xterm.h (struct selection_input_event): Adjust comment.
Michael Albinus [Thu, 8 Nov 2012 07:50:43 +0000 (08:50 +0100)]
* os.texi (Notifications): Update descriptions of
notifications-notify, notifications-close-notification and
notifications-get-capabilities according to latest code changes.
Add notifications-get-server-information.
Eli Zaretskii [Wed, 7 Nov 2012 21:12:25 +0000 (23:12 +0200)]
A (hopefully) better fix for bug #1280.
src/w32fns.c (modifier_set): Don't report modifiers from toggle key,
such as Scroll Lock, if the respective keys are treated as
function keys, not as modifiers. This avoids destroying non-ASCII
keyboard input when Scroll Lock is toggled ON.
Chong Yidong [Wed, 7 Nov 2012 20:43:38 +0000 (04:43 +0800)]
Fix and docfix for the minibuffer-eldef-shorten-default feature.
* lisp/minibuf-eldef.el (minibuffer-eldef-shorten-default): Convert to
a defcustom with an appropriate :set function.
(minibuffer-default--in-prompt-regexps): New function.
* doc/emacs/mini.texi (Basic Minibuffer): New node. Document
minibuffer-electric-default-mode.
* doc/emacs/display.texi (Visual Line Mode): Fix index entry.
Eli Zaretskii [Wed, 7 Nov 2012 16:44:48 +0000 (18:44 +0200)]
Fix bug #1280 with non-ASCII keyboard input on MS-Windows.
src/w32fns.c (w32_wnd_proc): Don't directly handle key chords
including modifiers from toggle key, such as Scroll Lock, if the
respective keys are treated as function keys, not as modifiers.
This avoids destroying non-ASCII keyboard input when Scroll Lock
is toggled ON.
Martin Rudalics [Wed, 7 Nov 2012 09:41:52 +0000 (10:41 +0100)]
Fix and rewrite doc on window recombining facilities.
* window.c (Fsplit_window_internal): Set combination limit of
new parent window to t iff Vwindow_combination_limit is t;
fixing a regression introduced with the change from 2012-09-22.
(Fwindow_combination_limit, Fset_window_combination_limit): Fix
doc-strings.
* elisp.texi (Top): Add Recombining Windows to menu.
* windows.texi (Recombining Windows): New subsection.
(Splitting Windows): Rewrite text on handling of window
combinations and move it to new subsection.
Chong Yidong [Wed, 7 Nov 2012 06:54:43 +0000 (14:54 +0800)]
Doc improvements for Buffer Menu.
* buffers.texi (Several Buffers): List Buffer Menu command anmes,
and index the keybindings. Document tabulated-list-sort.
(Kill Buffer): Capitalize Buffer Menu.
Paul Eggert [Tue, 6 Nov 2012 20:48:35 +0000 (12:48 -0800)]
Restore some duplicate definitions.
This undoes part of the 2012-11-03 changes. Some people build
with plain -g rather than with -g3, and they need the duplicate
definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
* lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
Define as macros, as well as as enums or as constants.
Paul Eggert [Tue, 6 Nov 2012 17:40:07 +0000 (09:40 -0800)]
Minor adjustments of recently-changed frame functions.
* buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
known to be a frame (we're in the FRAMEP branch).
* lisp.h (Qframep): Remove decl. frame.h declares this.
* window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
since they're meant for Lisp fixnum values.
Eli Zaretskii [Tue, 6 Nov 2012 16:36:02 +0000 (18:36 +0200)]
Fix bug #12811 with scrolling under scroll-up/down-aggressively.
src/xdisp.c (try_scrolling): Fix correction of aggressive-scroll
amount when the scroll margins are too large. When scrolling
backwards in the buffer, give up if cannot reach point or the
scroll margin within a reasonable number of screen lines. Fixes
point position in window under scroll-up/down-aggressively when
point is positioned many lines beyond the window top/bottom.
Agustín Martín [Tue, 6 Nov 2012 16:33:56 +0000 (17:33 +0100)]
ispell.el (ispell-region): Do not prefix sent string by comment in autoconf mode
This commit changes some of the `in-comment' ocurrences to more specific
`add-comment', set only if comment prefix is to be added.
When in comment, old code prefixed string by comment string to let ispell
know this is part of a comment string.
This is only supported in some modes. In particular, this is not supported in
autoconf mode where adding the comment string messes everything up because
ispell tries to spellcheck the `dnl' string header causing misalignments in
some cases (debbugs.gnu.org: #12768).
Agustín Martín [Tue, 6 Nov 2012 16:22:09 +0000 (17:22 +0100)]
textmodes/ispell.el: Experimental support for support debugging.
* (ispell-create-debug-buffer): Create a `ispell-debug-buffer' debug
buffer for ispell.
* (ispell-print-if-debug): New function to print stuff to
`ispell-debug-buffer' if debugging is enabled.
* (ispell-region, ispell-process-line): Use `ispell-print-if-debug' to
show some debugging info.
* (ispell-buffer-with-debug): New function that creates a debugging
buffer and calls `ispell-buffer' with debugging enabled. This is also
en example of a possible way to use this system.
Dmitry Antipov [Tue, 6 Nov 2012 15:57:14 +0000 (19:57 +0400)]
* window.c (Fwindow_combination_limit): Revert to the only
required argument and adjust docstring as suggested in
http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
by Martin Rudalics <rudalics@gmx.at>.
Dmitry Antipov [Tue, 6 Nov 2012 06:27:20 +0000 (10:27 +0400)]
* window.c (quad): New function.
(Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
(Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
(Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
(Fwindow_line_height): Use it.
(Fwindow_fringes): Use list3.
(Fwindow_scroll_bars): Use list4.
(Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
(Fwindow_combination_limit): Allow zero number of arguments.