[Top][All Lists]
[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: |
Tue, 14 Oct 2003 19:52:39 -0400 |
Index: emacs/lisp/wid-edit.el
diff -c emacs/lisp/wid-edit.el:1.110.2.1 emacs/lisp/wid-edit.el:1.110.2.2
*** emacs/lisp/wid-edit.el:1.110.2.1 Fri Apr 4 01:20:12 2003
--- emacs/lisp/wid-edit.el Tue Oct 14 19:51:28 2003
***************
*** 1,6 ****
;;; wid-edit.el --- Functions for creating and using widgets
-*-byte-compile-dynamic: t;-*-
;;
! ;; Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation,
Inc.
;;
;; Author: Per Abrahamsen <address@hidden>
;; Maintainer: FSF
--- 1,6 ----
;;; wid-edit.el --- Functions for creating and using widgets
-*-byte-compile-dynamic: t;-*-
;;
! ;; Copyright (C) 1996,97,1999,2000,01,02,2003 Free Software Foundation, Inc.
;;
;; Author: Per Abrahamsen <address@hidden>
;; Maintainer: FSF
***************
*** 63,71 ****
"Character position of the end of event if that exists, or nil."
(posn-point (event-end event)))
- (autoload 'pp-to-string "pp")
- (autoload 'Info-goto-node "info")
-
(defun widget-button-release-event-p (event)
"Non-nil if EVENT is a mouse-button-release event object."
(and (eventp event)
--- 63,68 ----
***************
*** 236,243 ****
;; Define SPC as a prefix char to get to this menu.
(define-key overriding-terminal-local-map " "
(setq map (make-sparse-keymap title)))
! (save-excursion
! (set-buffer (get-buffer-create " widget-choose"))
(erase-buffer)
(insert "Available choices:\n\n")
(while items
--- 233,239 ----
;; Define SPC as a prefix char to get to this menu.
(define-key overriding-terminal-local-map " "
(setq map (make-sparse-keymap title)))
! (with-current-buffer (get-buffer-create " widget-choose")
(erase-buffer)
(insert "Available choices:\n\n")
(while items
***************
*** 304,310 ****
;;
;; These functions are for specifying text properties.
! (defvar widget-field-add-space t
"Non-nil means add extra space at the end of editable text fields.
If you don't add the space, it will become impossible to edit a zero
size field.")
--- 300,307 ----
;;
;; These functions are for specifying text properties.
! ;; We can set it to nil now that get_local_map uses get_pos_property.
! (defconst widget-field-add-space nil
"Non-nil means add extra space at the end of editable text fields.
If you don't add the space, it will become impossible to edit a zero
size field.")
***************
*** 417,432 ****
"Execute FORM without inheriting any text properties."
`(save-restriction
(let ((inhibit-read-only t)
! (inhibit-modification-hooks t)
! result)
! (insert "<>")
! (narrow-to-region (- (point) 2) (point))
! (goto-char (1+ (point-min)))
! (setq result (progn ,@form))
! (delete-region (point-min) (1+ (point-min)))
! (delete-region (1- (point-max)) (point-max))
! (goto-char (point-max))
! result)))
(defface widget-inactive-face '((((class grayscale color)
(background dark))
--- 414,423 ----
"Execute FORM without inheriting any text properties."
`(save-restriction
(let ((inhibit-read-only t)
! (inhibit-modification-hooks t))
! (narrow-to-region (point) (point))
! (prog1 (progn ,@form)
! (goto-char (point-max))))))
(defface widget-inactive-face '((((class grayscale color)
(background dark))
***************
*** 568,576 ****
respectively."
(let ((cur (point-min))
(widget nil)
- (parent nil)
(overlays (if buffer
! (save-excursion (set-buffer buffer) (overlay-lists))
(overlay-lists))))
(setq overlays (append (car overlays) (cdr overlays)))
(while (setq cur (pop overlays))
--- 559,566 ----
respectively."
(let ((cur (point-min))
(widget nil)
(overlays (if buffer
! (with-current-buffer buffer (overlay-lists))
(overlay-lists))))
(setq overlays (append (car overlays) (cdr overlays)))
(while (setq cur (pop overlays))
***************
*** 1004,1011 ****
(or (bobp) (> arg 0) (backward-char))
(let ((wrapped 0)
(number arg)
! (old (widget-tabable-at))
! new)
;; Forward.
(while (> arg 0)
(cond ((eobp)
--- 994,1000 ----
(or (bobp) (> arg 0) (backward-char))
(let ((wrapped 0)
(number arg)
! (old (widget-tabable-at)))
;; Forward.
(while (> arg 0)
(cond ((eobp)
***************
*** 1104,1115 ****
;;; Setting up the buffer.
! (defvar widget-field-new nil)
! ;; List of all newly created editable fields in the buffer.
(make-variable-buffer-local 'widget-field-new)
! (defvar widget-field-list nil)
! ;; List of all editable fields in the buffer.
(make-variable-buffer-local 'widget-field-list)
(defun widget-at (&optional pos)
--- 1093,1104 ----
;;; Setting up the buffer.
! (defvar widget-field-new nil
! "List of all newly created editable fields in the buffer.")
(make-variable-buffer-local 'widget-field-new)
! (defvar widget-field-list nil
! "List of all editable fields in the buffer.")
(make-variable-buffer-local 'widget-field-list)
(defun widget-at (&optional pos)
***************
*** 1675,1681 ****
(defun widget-info-link-action (widget &optional event)
"Open the info node specified by WIDGET."
! (Info-goto-node (widget-value widget)))
;;; The `url-link' Widget.
--- 1664,1670 ----
(defun widget-info-link-action (widget &optional event)
"Open the info node specified by WIDGET."
! (info (widget-value widget)))
;;; The `url-link' Widget.
***************
*** 2486,2492 ****
(defun widget-editable-list-format-handler (widget escape)
;; We recognize the insert button.
! ;;; (let ((widget-push-button-gui widget-editable-list-gui))
(cond ((eq escape ?i)
(and (widget-get widget :indent)
(insert-char ?\ (widget-get widget :indent)))
--- 2475,2481 ----
(defun widget-editable-list-format-handler (widget escape)
;; We recognize the insert button.
! ;; (let ((widget-push-button-gui widget-editable-list-gui))
(cond ((eq escape ?i)
(and (widget-get widget :indent)
(insert-char ?\ (widget-get widget :indent)))
***************
*** 2495,2501 ****
(widget-get widget :append-button-args)))
(t
(widget-default-format-handler widget escape)))
! ;;; )
)
(defun widget-editable-list-value-create (widget)
--- 2484,2490 ----
(widget-get widget :append-button-args)))
(t
(widget-default-format-handler widget escape)))
! ;; )
)
(defun widget-editable-list-value-create (widget)
***************
*** 2596,2602 ****
(defun widget-editable-list-entry-create (widget value conv)
;; Create a new entry to the list.
(let ((type (nth 0 (widget-get widget :args)))
! ;;; (widget-push-button-gui widget-editable-list-gui)
child delete insert)
(widget-specify-insert
(save-excursion
--- 2585,2591 ----
(defun widget-editable-list-entry-create (widget value conv)
;; Create a new entry to the list.
(let ((type (nth 0 (widget-get widget :args)))
! ;; (widget-push-button-gui widget-editable-list-gui)
child delete insert)
(widget-specify-insert
(save-excursion
***************
*** 2625,2642 ****
widget type (widget-default-get type)))))
(t
(error "Unknown escape `%c'" escape)))))
! (widget-put widget
! :buttons (cons delete
! (cons insert
! (widget-get widget :buttons))))
(let ((entry-from (point-min-marker))
(entry-to (point-max-marker)))
(set-marker-insertion-type entry-from t)
(set-marker-insertion-type entry-to nil)
(widget-put child :entry-from entry-from)
(widget-put child :entry-to entry-to)))
! (widget-put insert :widget child)
! (widget-put delete :widget child)
child))
;;; The `group' Widget.
--- 2614,2631 ----
widget type (widget-default-get type)))))
(t
(error "Unknown escape `%c'" escape)))))
! (let ((buttons (widget-get widget :buttons)))
! (if insert (push insert buttons))
! (if delete (push delete buttons))
! (widget-put widget :buttons buttons))
(let ((entry-from (point-min-marker))
(entry-to (point-max-marker)))
(set-marker-insertion-type entry-from t)
(set-marker-insertion-type entry-to nil)
(widget-put child :entry-from entry-from)
(widget-put child :entry-to entry-to)))
! (if insert (widget-put insert :widget child))
! (if delete (widget-put delete :widget child))
child))
;;; The `group' Widget.
***************
*** 3253,3259 ****
:value-to-internal (lambda (widget value)
(list (car value) (cdr value)))
:value-to-external (lambda (widget value)
! (cons (nth 0 value) (nth 1 value))))
(defun widget-cons-match (widget value)
(and (consp value)
--- 3242,3248 ----
:value-to-internal (lambda (widget value)
(list (car value) (cdr value)))
:value-to-external (lambda (widget value)
! (apply 'cons value)))
(defun widget-cons-match (widget value)
(and (consp value)
***************
*** 3476,3487 ****
(prompt (concat tag ": "))
(value (widget-value widget))
(start (widget-field-start widget))
- (pos (cond ((< (point) start)
- 0)
- ((> (point) (+ start (length value)))
- (length value))
- (t
- (- (point) start))))
(answer (facemenu-read-color prompt)))
(unless (zerop (length answer))
(widget-value-set widget answer)
--- 3465,3470 ----
***************
*** 3502,3512 ****
(help-echo (and widget (widget-get widget :help-echo))))
(if (functionp help-echo)
(setq help-echo (funcall help-echo widget)))
! (if (stringp help-echo)
! (message "%s" help-echo))))
;;; The End:
(provide 'wid-edit)
;;; wid-edit.el ends here
--- 3485,3495 ----
(help-echo (and widget (widget-get widget :help-echo))))
(if (functionp help-echo)
(setq help-echo (funcall help-echo widget)))
! (if help-echo (message "%s" (eval help-echo)))))
;;; The End:
(provide 'wid-edit)
+ ;;; arch-tag: a076e75e-18a1-4b46-8be5-3f317bcbc707
;;; wid-edit.el ends here
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/wid-edit.el [lexbind],
Miles Bader <=