Commit 1d3c7fd6 authored by Glenn Morris's avatar Glenn Morris
Browse files

(widget-specify-field, widget-field-value-get, character):

Revert 2009-03-24 change, since it causes a more serious problem than
the one it solves.  (Closes Bug#3136, reopens Bug#2689.)
parent 51520a1a
2009-05-02 Glenn Morris <rgm@gnu.org>
* wid-edit.el (widget-specify-field, widget-field-value-get, character):
Revert 2009-03-24 change, since it causes a more serious problem than
the one it solves. (Closes Bug#3136, reopens Bug#2689.)
2009-05-02 Martin Rudalics <rudalics@gmx.at> 2009-05-02 Martin Rudalics <rudalics@gmx.at>
   
* frame.el (pop-up-frame-function): Remove choice nil since it * frame.el (pop-up-frame-function): Remove choice nil since it
...@@ -253,7 +259,7 @@ ...@@ -253,7 +259,7 @@
   
2009-04-09 Richard M Stallman <rms@gnu.org> 2009-04-09 Richard M Stallman <rms@gnu.org>
   
* mail/rmailkwd.el (rmail-set-label): Warn if multipe labels spec'd. * mail/rmailkwd.el (rmail-set-label): Warn if multiple labels spec'd.
(rmail-kill-label, rmail-add-label): Doc fixes. (rmail-kill-label, rmail-add-label): Doc fixes.
   
* mail/rmailout.el (rmail-output): If file is visited, * mail/rmailout.el (rmail-output): If file is visited,
......
...@@ -342,16 +342,12 @@ new value.") ...@@ -342,16 +342,12 @@ new value.")
(or (not widget-field-add-space) (widget-get widget :size)))) (or (not widget-field-add-space) (widget-get widget :size))))
(if (functionp help-echo) (if (functionp help-echo)
(setq help-echo 'widget-mouse-help)) (setq help-echo 'widget-mouse-help))
(when (and (> to (1+ from)) (when (= (char-before to) ?\n)
(= (char-before to) ?\n))
;; When the last character in the field is a newline, we want to ;; When the last character in the field is a newline, we want to
;; give it a `field' char-property of `boundary', which helps the ;; give it a `field' char-property of `boundary', which helps the
;; C-n/C-p act more naturally when entering/leaving the field. We ;; C-n/C-p act more naturally when entering/leaving the field. We
;; do this by making a small secondary overlay to contain just that ;; do this by making a small secondary overlay to contain just that
;; one character. ;; one character.
;; We DON'T do this if the field just consists of a newline, eg
;; when specifying a character, since it breaks things (below
;; does 1- to, which results in to = from). Bug#2689.
(let ((overlay (make-overlay (1- to) to nil t nil))) (let ((overlay (make-overlay (1- to) to nil t nil)))
(overlay-put overlay 'field 'boundary) (overlay-put overlay 'field 'boundary)
;; We need the real field for tabbing. ;; We need the real field for tabbing.
...@@ -1949,9 +1945,7 @@ the earlier input." ...@@ -1949,9 +1945,7 @@ the earlier input."
(set-buffer buffer) (set-buffer buffer)
(while (and size (while (and size
(not (zerop size)) (not (zerop size))
;; Bug#2689. Don't allow this loop to reduce a (> to from)
;; character field to zero size if it contains a space.
(> to (1+ from))
(eq (char-after (1- to)) ?\s)) (eq (char-after (1- to)) ?\s))
(setq to (1- to))) (setq to (1- to)))
(let ((result (buffer-substring-no-properties from to))) (let ((result (buffer-substring-no-properties from to)))
...@@ -3456,8 +3450,7 @@ To use this type, you must define :match or :match-alternatives." ...@@ -3456,8 +3450,7 @@ To use this type, you must define :match or :match-alternatives."
:value 0 :value 0
:size 1 :size 1
:format "%{%t%}: %v\n" :format "%{%t%}: %v\n"
;; `.' does not match newline, but newline is a valid character. :valid-regexp "\\`.\\'"
:valid-regexp "\\`\\(.\\|\n\\)\\'"
:error "This field should contain a single character" :error "This field should contain a single character"
:value-to-internal (lambda (widget value) :value-to-internal (lambda (widget value)
(if (stringp value) (if (stringp value)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment