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