Dmitry Gutov [Tue, 13 Nov 2012 09:30:16 +0000 (13:30 +0400)]
* lisp/progmodes/ruby-mode.el (ruby-add-log-current-method): Print the
period before class method names, not after. Remove handling of
one impossible case. Add comments.
* test/automated/ruby-mode-tests.el
(ruby-add-log-current-method-examples): New test.
(ruby-test-string): Extract from ruby-should-indent-buffer.
Stefan Monnier [Tue, 13 Nov 2012 04:05:35 +0000 (23:05 -0500)]
* lisp/emacs-lisp/advice.el: Remove support for freezing.
(ad-make-freeze-docstring, ad-make-freeze-definition): Remove functions.
(ad-make-single-advice-docstring, ad-defadvice-flags, defadvice):
Remove support for `freeze'.
Glenn Morris [Tue, 13 Nov 2012 03:19:34 +0000 (19:19 -0800)]
Move SES NEWS entry here from emacs-24 and expand it
Cf emacs-24 2012-11-09T15:56:51Z!monnier@iro.umontreal.ca.
Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00221.html
Stefan Monnier [Tue, 13 Nov 2012 03:00:09 +0000 (22:00 -0500)]
* lisp/emacs-lisp/cl.el (dolist, dotimes, declare): Use advice-add to
override the default.
* lisp/emacs-lisp/cl-macs.el (cl-dolist, cl-dotimes): Rewrite without using
cl--dotimes/dolist.
* lisp/subr.el (dolist, dotimes, declare): Redefine them normally, even when
`cl' is loaded.
* lisp/emacs-lisp/nadvice.el (advice--normalize): New function, extracted
from add-advice.
(advice--strip-macro): New function.
(advice--defalias-fset): Use them to handle macros.
(advice-add): Use them.
(advice-member-p): Correctly handle macros.
Paul Eggert [Tue, 13 Nov 2012 01:35:14 +0000 (17:35 -0800)]
Fix a race with verify-visited-file-modtime.
Since at least 1991 Emacs has ignored an mtime difference of no
more than one second, but my guess is that this was to work around
file system bugs that were fixed long ago. Since the race is
causing problems now, let's remove that code.
* fileio.c (Fverify_visited_file_modtime): Do not accept a file
whose time stamp is off by no more than a second. Insist that the
file time stamps match exactly.
Stefan Monnier [Mon, 12 Nov 2012 20:43:43 +0000 (15:43 -0500)]
* lisp/emacs-lisp/nadvice.el: New package.
* lisp/subr.el (special-form-p): New function.
* lisp/emacs-lisp/elp.el: Use lexical-binding and advice-add.
(elp-all-instrumented-list): Remove var.
(elp-not-profilable): Remove elp-wrapper.
(elp-profilable-p): Use autoloadp and special-form-p.
(elp--advice-name): New const.
(elp-instrument-function): Use advice-add.
(elp--instrumented-p): New predicate.
(elp-restore-function): Use advice-remove.
(elp-restore-all, elp-reset-all): Use mapatoms.
(elp-set-master): Use elp--instrumented-p.
(elp--make-wrapper): Rename from elp-wrapper, return a function
suitable for advice-add. Use cl-inf.
(elp-results): Use mapatoms+elp--instrumented-p.
* lisp/emacs-lisp/debug.el: Use lexical-binding and advice-add.
(debug-function-list): Remove var.
(debug): Rename arg, and then let-bind it explicitly inside.
(debugger-setup-buffer): Rename arg.
(debugger-setup-buffer): Adjust counts to new debug-on-entry setup.
(debugger-frame-number): Adjust to new debug-on-entry setup.
(debug--implement-debug-on-entry): Rename from
implement-debug-on-entry, add argument.
(debugger-special-form-p): Remove, use special-form-p instead.
(debug-on-entry): Use advice-add.
(debug--function-list): New function.
(cancel-debug-on-entry): Use it, along with advice-remove.
(debug-arglist, debug-convert-byte-code, debug-on-entry-1): Remove.
(debugger-list-functions): Use debug--function-list instead of
debug-function-list.
* lisp/emacs-lisp/advice.el (ad-save-real-definition): Remove, unused.
(ad-special-form-p): Remove, use special-form-p instead.
(ad-set-advice-info): Use add-function and remove-function.
(ad--defalias-fset): Adjust accordingly.
* test/automated/advice-tests.el: New tests.
Wolfgang Jenkner [Mon, 12 Nov 2012 17:12:33 +0000 (18:12 +0100)]
lisp/ansi-color.el (ansi-color-apply-sequence): Implement SGR codes 39 and 49.
This fixes bug#12792. Also, treat unimplemented parameters as 0,
thereby restoring the behavior of revisions prior to 2012-08-15T03:33:55Z!monnier@iro.umontreal.ca.
Dmitry Antipov [Mon, 12 Nov 2012 16:02:46 +0000 (20:02 +0400)]
* frame.h (struct frame): Convert external_tool_bar member to
1-bit unsigned bitfield.
* termhooks.h (struct terminal): Remove mouse_moved member since
all users are long dead. Adjust comment on mouse_position_hook.
Eli Zaretskii [Mon, 12 Nov 2012 15:25:34 +0000 (17:25 +0200)]
Fix bug #12867 with crashes due to large field width in mode-line format.
src/xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
passed to pint2str and pint2hrstr to be at most the size of the
frame's decode_mode_spec_buffer. This avoids crashes with very
large values of FIELD_WIDTH argument to decode_mode_spec.
Fix end-of-defun misbehavior.
* progmodes/python.el (python-nav-beginning-of-defun): Rename from
python-beginning-of-defun-function. Handle nested defuns
correctly.
(python-nav-end-of-defun): Rename from
python-end-of-defun-function. Ensure forward movement.
(python-info-current-defun): Reimplemented to work as intended
with new fixed python-nav-{end,beginning}-of-defun. Stop scanning
parent defuns as soon as possible.
Vincent Belaïche [Mon, 12 Nov 2012 05:53:53 +0000 (06:53 +0100)]
* ses.texi: Doc for ses-rename-cell, ses-repair-cell-reference-all & ses-range.
In all file place SES into @acronym{...}.
(Advanced Features): Add key index and function index for
ses-set-header-row. Add description for function
ses-rename-cell. Add description for function
ses-repair-cell-reference-all.
(Ranges in formulas): Add description for ses-range flags.
Dmitry Gutov [Mon, 12 Nov 2012 01:11:06 +0000 (05:11 +0400)]
* lisp/progmodes/ruby-mode.el (ruby-move-to-block): When moving
backward, always stop at indentation. Reverts the change from
2012-08-12T22:06:56Z!monnier@iro.umontreal.ca.
Paul Eggert [Mon, 12 Nov 2012 01:09:34 +0000 (17:09 -0800)]
Another tweak to vectorlike_header change.
* alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
Remove, and replace all uses with ...
(next_in_free_list, set_next_in_free_list):
New functions, which respect C's aliasing rules better.
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.