* bug#44021: delete-non-matching-lines optional arg REND not really optional
@ 2020-10-15 18:57 Boruch Baum
2020-10-16 5:36 ` Lars Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Boruch Baum @ 2020-10-15 18:57 UTC (permalink / raw
To: 44021
Unlike other functions with optional BEG and END args, where END is
presumed to be (point-max) if not supplied, function
delete-non-matching-lines returns an error when only RBEG is supplied.
Error: (wrong-type-argument number-or-marker-p nil)
--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#44021: delete-non-matching-lines optional arg REND not really optional
2020-10-15 18:57 bug#44021: delete-non-matching-lines optional arg REND not really optional Boruch Baum
@ 2020-10-16 5:36 ` Lars Ingebrigtsen
2020-10-16 6:42 ` Boruch Baum
0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2020-10-16 5:36 UTC (permalink / raw
To: Boruch Baum; +Cc: 44021
Boruch Baum <boruch_baum@gmx.com> writes:
> Unlike other functions with optional BEG and END args, where END is
> presumed to be (point-max) if not supplied, function
> delete-non-matching-lines returns an error when only RBEG is supplied.
>
> Error: (wrong-type-argument number-or-marker-p nil)
I've now mentioned this in the doc string.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#44021: delete-non-matching-lines optional arg REND not really optional
2020-10-16 5:36 ` Lars Ingebrigtsen
@ 2020-10-16 6:42 ` Boruch Baum
0 siblings, 0 replies; 3+ messages in thread
From: Boruch Baum @ 2020-10-16 6:42 UTC (permalink / raw
To: Lars Ingebrigtsen; +Cc: 44021
On 2020-10-16 07:36, Lars Ingebrigtsen wrote:
> I've now mentioned this in the doc string.
Not the solution I was expecting. I was expecting the ARG to really
become optional, to be consistent with similar END arguments in other
emacs functions. Something like:
(setq rend (or rend (point-max)))
Also, as a quibble, for consistency the args should be renamed START and
END, instead of RSTART and REND. See, for instance,
(delete-trailing-whitespace &optional START END)
(narrow-to-region START END)
This is true even in the same elisp file replace.el:
(replace-regexp regexp to-string &optional delimited start end backward)
(replace-string from-string to-string &optional delimited start end backward)
and many other functions in the same file, so it seems to have been an
oversight in integrating the function. The standard seems to be that the
args are named START and END and really are optional.
--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-10-16 6:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-15 18:57 bug#44021: delete-non-matching-lines optional arg REND not really optional Boruch Baum
2020-10-16 5:36 ` Lars Ingebrigtsen
2020-10-16 6:42 ` Boruch Baum
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.