minad / consult

:mag: consult.el - Consulting completing-read
GNU General Public License v3.0
1.12k stars 98 forks source link

Pre-select nearest heading arguments #938

Closed csxtan closed 3 months ago

csxtan commented 3 months ago

Not a bug in the main build, but in the helpful wiki, there is a hack for pre-selecting outline entries when using consult-outline by using advice. The function consult--set-previous-point is advised before consult-outline and consult-org-heading which have 1 and 2 optional arguments respectively. If these functions are called with arguments, they get passed to the advice function which does not accept arguments and throws "Wrong number of arguments".

This is easily resolved by changing the signature to:

(defun consult--set-previous-point (&optional arg1 arg2)