Commit 2f0bebce authored by Johan Sundström's avatar Johan Sundström
Browse files

Usage change for the universal prefix arguments; zero now means text under...

Usage change for the universal prefix arguments; zero now means text under point, empty argument prompts.
parent 824ffa3a
2000-07-28 Johan Sundstrm <jhs@lysator.liu.se>
* utilities.el (lyskom-read-text-no-prefix-arg): Policy change;
prefix argument zero means text under point. Empty (C-u) prefix
argument now prompts for a text number. This influence compliments
of Ulrik Haugen. :-)
Fri Jul 28 14:15:12 2000 David Byers <davby@sen2.ida.liu.se>
* Release av 0.46-BETA-K
......
......@@ -515,16 +515,17 @@ The value is actually the element of LIST whose car equals KEY."
(defun lyskom-read-text-no-prefix-arg (prompt &optional always-read default)
"Call in interactive list to read text-no.
If optional argument ALWAYS-READ is non-nil the user is prompted if
an explicit prefix argument was not given. A positive prefix argument
is interpreted as a text-no, whereas a negative prefix argument will
try to find the text-no of the text `arg' messages above point from
the current kom buffer. DEFAULT specifies the default text to use. If
it is nil, the most recently read text is the default. The symbol
If optional argument ALWAYS-READ is non-nil the user is prompted if an
explicit prefix argument was not given. The prefix argument zero
refers to the text under point. A positive prefix argument is
interpreted as a text-no, whereas a negative prefix argument will try
to find the text-no of the text `arg' messages above point from the
current kom buffer. DEFAULT specifies the default text to use. If it
is nil, the most recently read text is the default. The symbol
last-written means use the text most recently written. The symbol
last-seen-written means use the text in lyskom-last-seen-written.
A number means use that text as the default."
(let ((default (cond ((or (null default)
last-seen-written means use the text in lyskom-last-seen-written. A
number means use that text as the default."
(let ((default (cond ((or (null default)
(eq 0 default))
(lyskom-default-value 'lyskom-current-text))
((numberp default) default)
......@@ -550,7 +551,7 @@ A number means use that text as the default."
(if (eq '- current-prefix-arg) -1 current-prefix-arg)))
(cond
((> current-prefix-arg 0) current-prefix-arg)
((zerop current-prefix-arg) (lyskom-read-number prompt default))
((zerop current-prefix-arg) (lyskom-text-at-point))
(t
(save-excursion
(backward-text (- 1 current-prefix-arg))
......@@ -559,7 +560,7 @@ A number means use that text as the default."
(lyskom-error (lyskom-get-string 'bad-text-no-prefix)
current-prefix-arg)))))))
((listp current-prefix-arg)
(lyskom-read-number prompt (lyskom-text-at-point)))
(lyskom-read-number prompt default))
(t (lyskom-error (lyskom-get-string 'bad-text-no-prefix)
current-prefix-arg)))))
......
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