Mercurial > hg > xemacs-beta
annotate lisp/gtk-select.el @ 5879:77d7b77909c2
Move extents.c to working in byte positions only; fix a bug, extent_detach()
src/ChangeLog addition:
2015-03-27 Aidan Kehoe <kehoea@parhasard.net>
Fix a small bug, extent_detach(); minimise needless char-byte
conversion, extents.c, sticking to byte positions in general in
this file.
* extents.c:
* extents.c (signal_single_extent_changed):
Pass byte endpoints to
gutter_extent_signal_changed_region_maybe(),
buffer_extent_signal_changed_region().
* extents.c (extent_detach):
Call signal_extent_changed() correctly, pass both extent endpoints
rather than just the byte and character variants of the start.
* extents.c (struct report_extent_modification_closure):
Do this in terms of byte positions.
* extents.c (report_extent_modification_mapper):
Use byte positions, only converting to characters when we are
definitely calling Lisp.
* extents.c (report_extent_modification):
Use byte positions in this API, move the byte-char conversion to
our callers, simplifying extents.c (it all now works in byte
positions).
* extents.h:
Update report_extent_modification's prototype.
* gutter.c (gutter_extent_signal_changed_region_maybe):
Use byte positions here, avoids needless byte-char conversion.
* gutter.h:
Update the prototype here.
* insdel.c:
* insdel.c (buffer_extent_signal_changed_region):
Implement this in terms of byte positions.
* insdel.c (signal_before_change):
* insdel.c (signal_after_change):
Call report_extent_modification() with byte positions, doing the
char->byte conversion here rather than leaving it to extents.c.
* insdel.h:
* insdel.h (struct each_buffer_change_data):
The extent unchanged info now describes bytecounts.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Fri, 27 Mar 2015 23:39:49 +0000 |
parents | 308d34e9f07d |
children |
rev | line source |
---|---|
462 | 1 ;;; gtk-select.el --- Lisp interface to GTK selections. |
2 | |
3 ;; Copyright (C) 1990, 1997 Free Software Foundation, Inc. | |
4 ;; Copyright (C) 1995 Sun Microsystems. | |
5 ;; Copyright (C) 2000 Free Software Foundation | |
6 | |
7 ;; Maintainer: William Perry <wmperry@gnu.org> | |
8 ;; Keywords: extensions, dumped | |
9 | |
10 ;; This file is part of XEmacs. | |
11 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
462
diff
changeset
|
12 ;; XEmacs is free software: you can redistribute it and/or modify it |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
462
diff
changeset
|
13 ;; under the terms of the GNU General Public License as published by the |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
462
diff
changeset
|
14 ;; Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
462
diff
changeset
|
15 ;; option) any later version. |
462 | 16 |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
462
diff
changeset
|
17 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
462
diff
changeset
|
18 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
462
diff
changeset
|
19 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
462
diff
changeset
|
20 ;; for more details. |
462 | 21 |
22 ;; You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
462
diff
changeset
|
23 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
462 | 24 |
25 ;;; Synched up with: Not in FSF | |
26 | |
27 ;;; Commentary: | |
28 | |
29 ;; This file is dumped with XEmacs (when GTK support is compiled in). | |
30 ;; #### Only copes with copying/pasting text | |
31 | |
32 ;;; Code: | |
33 | |
34 (defun gtk-get-secondary-selection () | |
35 "Return text selected from some GTK window." | |
36 (get-selection 'SECONDARY)) | |
37 | |
38 (defun gtk-own-secondary-selection (selection &optional type) | |
39 "Make a secondary GTK Selection of the given argument. The argument may be a | |
40 string or a cons of two markers (in which case the selection is considered to | |
41 be the text between those markers)." | |
42 (interactive (if (not current-prefix-arg) | |
43 (list (read-string "Store text for pasting: ")) | |
44 (list (cons ;; these need not be ordered. | |
45 (copy-marker (point-marker)) | |
46 (copy-marker (mark-marker)))))) | |
47 (own-selection selection 'SECONDARY)) | |
48 | |
49 (defun gtk-notice-selection-requests (selection type successful) | |
50 "for possible use as the value of `gtk-sent-selection-hooks'." | |
51 (if (not successful) | |
52 (message "Selection request failed to convert %s to %s" | |
53 selection type) | |
54 (message "Sent selection %s as %s" selection type))) | |
55 | |
56 (defun gtk-notice-selection-failures (selection type successful) | |
57 "for possible use as the value of `gtk-sent-selection-hooks'." | |
58 (or successful | |
59 (message "Selection request failed to convert %s to %s" | |
60 selection type))) | |
61 | |
62 ;(setq gtk-sent-selection-hooks 'gtk-notice-selection-requests) | |
63 ;(setq gtk-sent-selection-hooks 'gtk-notice-selection-failures) |