]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/bindings.el (ctl-x-map): Bind C-x SPC to rectangle-mark-mode.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 11 Nov 2013 05:18:53 +0000 (00:18 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 11 Nov 2013 05:18:53 +0000 (00:18 -0500)
* 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?).

etc/NEWS
lisp/ChangeLog
lisp/bindings.el
lisp/rect.el
src/ChangeLog
src/insdel.c
src/keyboard.c

index 5fa56401641e0cf3a44cf1113ab5facfc27d1eb6..3198c0d28ccb2545674dc41e66abd4dd4cbfff49 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -189,7 +189,7 @@ Czech typography rules.  To globally enable this feature, evaluate:
 \f
 * 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.
index a9eacb5638339c5973f95d303b70dbe2a679516d..1e1992fae2aad5da4ded61f20c7fd9b75ccf10e0 100644 (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
index 2ea6713216d443f7973295fea84ece97f4d26290..b3b4f76b5558a692440a1f747bb5d07fca407429 100644 (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)
index 4335bb25409e46d1f2c68151a43bbcf71e896995..ad94663fc9679b53eb9e0249ea38bdfddc25fdb7 100644 (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.
 
index 9a4855332661178aca295439d291b138028bcf3d..cc20b68c729c703804ccfe776ae6c594b74e66d2 100644 (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
index 4b8ab19fe24b693da48657703b76dddfb479a50b..5515b641d661c01e0b1bce3361ca45e94f67d706 100644 (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.
index a066900fc91c66b2580f7a394a87f167c8c9492c..0fcea387aea01d9de99198e5e6af85af5f898627 100644 (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)