* lisp/bindings.el (ctl-x-map): Bind C-x SPC to rectangle-mark-mode.

* src/keyboard.c (command_loop_1): Use region-extract-function.
* src/insdel.c (Qregion_extract_function): Not static any more (can we
stop pretending that these vars can benefit from being marked static?).
This commit is contained in:
Stefan Monnier 2013-11-11 00:18:53 -05:00
parent 608c2085c4
commit 7818df11b8
7 changed files with 21 additions and 15 deletions

View file

@ -189,7 +189,7 @@ Czech typography rules. To globally enable this feature, evaluate:
* Editing Changes in Emacs 24.4
** New command `rectangle-mark' makes a rectangular region.
** Command `rectangle-mark-mode' bound to C-x SPC makes a rectangular region.
Most commands are still unaware of it, but kill/yank do work on the rectangle.
** C-x TAB enters a transient interactive mode.

View file

@ -1,3 +1,7 @@
2013-11-11 Stefan Monnier <monnier@iro.umontreal.ca>
* bindings.el (ctl-x-map): Bind C-x SPC to rectangle-mark-mode.
2013-11-11 Nathan Trapuzzano <nbtrap@nbtrap.com> (tiny change)
* emacs-lisp/cconv.el (cconv-convert): Print warning instead of

View file

@ -891,6 +891,7 @@ if `inhibit-field-text-motion' is non-nil."
(define-key ctl-x-map "\C-x" 'exchange-point-and-mark)
(define-key ctl-x-map "\C-@" 'pop-global-mark)
(define-key ctl-x-map " " 'rectangle-mark-mode)
(define-key ctl-x-map [?\C- ] 'pop-global-mark)
(define-key global-map "\C-n" 'next-line)

View file

@ -414,9 +414,7 @@ with a prefix argument, prompt for START-AT and FORMAT."
;;; New rectangle integration with kill-ring.
;; FIXME: lots of known problems with the new rectangle support:
;; - no key binding for mark-rectangle.
;; - no access to the `string-rectangle' functionality.
;; FIXME: known problems with the new rectangle support:
;; - lots of commands handle the region without paying attention to its
;; rectangular shape.

View file

@ -1,3 +1,9 @@
2013-11-11 Stefan Monnier <monnier@iro.umontreal.ca>
* keyboard.c (command_loop_1): Use region-extract-function.
* insdel.c (Qregion_extract_function): Not static any more (can we
stop pretending that these vars can benefit from being marked static?).
2013-11-09 Eli Zaretskii <eliz@gnu.org>
* search.c (find_newline): If buffer text is relocated during the

View file

@ -1778,7 +1778,7 @@ modify_text (ptrdiff_t start, ptrdiff_t end)
bset_point_before_scroll (current_buffer, Qnil);
}
static Lisp_Object Qregion_extract_function;
Lisp_Object Qregion_extract_function;
/* Check that it is okay to modify the buffer between START and END,
which are char positions.

View file

@ -1321,6 +1321,8 @@ static void adjust_point_for_property (ptrdiff_t, bool);
/* The last boundary auto-added to buffer-undo-list. */
Lisp_Object last_undo_boundary;
extern Lisp_Object Qregion_extract_function;
/* FIXME: This is wrong rather than test window-system, we should call
a new set-selection, which will then dispatch to x-set-selection, or
tty-set-selection, or w32-set-selection, ... */
@ -1629,16 +1631,11 @@ command_loop_1 (void)
&& NILP (Fmemq (Vthis_command,
Vselection_inhibit_update_commands)))
{
ptrdiff_t beg
= XINT (Fmarker_position (BVAR (current_buffer, mark)));
ptrdiff_t end = PT;
if (beg < end)
call2 (Qx_set_selection, QPRIMARY,
make_buffer_string (beg, end, 0));
else if (beg > end)
call2 (Qx_set_selection, QPRIMARY,
make_buffer_string (end, beg, 0));
/* Don't set empty selections. */
Lisp_Object txt
= call1 (Fsymbol_value (Qregion_extract_function), Qnil);
if (XINT (Flength (txt)) > 0)
/* Don't set empty selections. */
call2 (Qx_set_selection, QPRIMARY, txt);
}
if (current_buffer != prev_buffer || MODIFF != prev_modiff)