emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/wid-edit.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/wid-edit.el [lexbind]
Date: Wed, 08 Dec 2004 19:16:52 -0500

Index: emacs/lisp/wid-edit.el
diff -c emacs/lisp/wid-edit.el:1.110.2.9 emacs/lisp/wid-edit.el:1.110.2.10
*** emacs/lisp/wid-edit.el:1.110.2.9    Sat Sep  4 09:21:45 2004
--- emacs/lisp/wid-edit.el      Wed Dec  8 23:36:18 2004
***************
*** 339,344 ****
--- 339,346 ----
        ;; one character.
        (let ((overlay (make-overlay (1- to) to nil t nil)))
        (overlay-put overlay 'field 'boundary)
+         ;; We need the real field for tabbing.
+       (overlay-put overlay 'real-field widget)
        ;; Use `local-map' here, not `keymap', so that normal editing
        ;; works in the field when, say, Custom uses `suppress-keymap'.
        (overlay-put overlay 'local-map keymap)
***************
*** 1085,1098 ****
    :type 'function
    :group 'widgets)
  
  (defun widget-complete ()
    "Complete content of editable field from point.
  When not inside a field, move to the previous button or field."
    (interactive)
    (let ((field (widget-field-find (point))))
      (if field
!       (widget-apply field :complete)
!       (error "Not in an editable field"))))
  
  ;;; Setting up the buffer.
  
--- 1087,1109 ----
    :type 'function
    :group 'widgets)
  
+ (defun widget-narrow-to-field ()
+   "Narrow to field"
+   (interactive)
+   (let ((field (widget-field-find (point))))
+     (if field
+       (narrow-to-region (line-beginning-position) (line-end-position)))))
+ 
  (defun widget-complete ()
    "Complete content of editable field from point.
  When not inside a field, move to the previous button or field."
    (interactive)
    (let ((field (widget-field-find (point))))
      (if field
!       (save-restriction
!         (widget-narrow-to-field)
!         (widget-apply field :complete))
!         (error "Not in an editable field"))))
  
  ;;; Setting up the buffer.
  
***************
*** 1140,1146 ****
    "Return the widget field at POS, or nil if none."
    (let ((field (get-char-property (or pos (point)) 'field)))
      (if (eq field 'boundary)
!       nil
        field)))
  
  (defun widget-field-buffer (widget)
--- 1151,1157 ----
    "Return the widget field at POS, or nil if none."
    (let ((field (get-char-property (or pos (point)) 'field)))
      (if (eq field 'boundary)
!       (get-char-property (or pos (point)) 'real-field)
        field)))
  
  (defun widget-field-buffer (widget)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]