all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#20063: 24.4: read-from-minibuffer improperly setting hist parameter
@ 2015-03-08 22:25 Boruch Baum
  2015-03-09  1:08 ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Boruch Baum @ 2015-03-08 22:25 UTC (permalink / raw)
  To: 20063

[-- Attachment #1: Type: text/plain, Size: 2007 bytes --]

This started out as a bug report for function `toggle-option' in file
toggle-option.el. That function takes a user-defined list of options
through which the user can scroll in the minibuffer. However, the
scrolling only operates in the forward direction (using the down-arrow
key); When scrolling in the reverse direction (using the up-arrow key),
one gets elements from some other history list, which are mostly items
invalid for the function called, and in fact are correctly rejected by
the function (toggle-option) if one selects them.

Function `toggle-option' calls `completing-read', without providing
parameters REQUIRE-MATCH or HIST. `completing-read' calls
`completing-read-default' in `minibuffer.el'. `completing-read-default'
calls `read-from-minibuffer' in `minibuf.c'. There, on line 974 of
`minibuf.c:'

     if (NILP (histvar))
       histvar = Qminibuffer_history;

If I understand this correctly, this says that even if the caller
explicitly says that there should be no history used (condition nil),
the Qminibuffer_history should be used anyway.

Correcting this looks like it would solve other bugs reported (eg. bug
#19877).

BTW, I fiddled with function `toggle-option', and even when all the
optional parameters are explicitly passed with nil values, the behavior
remains the same.

BTBTW, `read-from-minibuffer' calls `read-minibuf' which calls
`read_minibuf_noninteractive' (line 223 in minibuf.c), which asks for
parameters it does not use: map, initial, backup_n, histvar, histpos,
allow_props, and inherit_input_method (BTBTBTW, courtesy of the spelling
police, unless 'default' is a reserved word, parameter 'defalt' might
properly be refactored `default').

Finally, my two cents are that when functions ask for parameter
COLLECTION to scroll through, that scrolling should wrap-around, and not
report an error when reaching the first or final entry.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-02-13  9:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-08 22:25 bug#20063: 24.4: read-from-minibuffer improperly setting hist parameter Boruch Baum
2015-03-09  1:08 ` Glenn Morris
2015-03-09 12:05   ` Boruch Baum
2015-03-09 18:14     ` Stefan Monnier
2015-03-10 15:34       ` Boruch Baum
2015-03-11 14:09         ` Stefan Monnier
2015-03-11 15:43           ` Boruch Baum
2015-03-11 19:19             ` Stefan Monnier
2022-02-13  9:13   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.