1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-13 06:50:39 -08:00

Backport: Don't compare arguments that can be nil (Bug#28039)

copy-region-as-kill can be called passing nil as `beg' and
`end'. Magit does that, which caused an error when this advice was in
effect.

* lisp/ses.el (ses--advice-copy-region-as-kill): avoid comparison
  unless `beg' and `end' are non-nil.
This commit is contained in:
Oscar Fuentes 2017-12-16 01:34:35 +01:00
parent 89cfdbf729
commit 2e9eba2013

View file

@ -3051,7 +3051,7 @@ We'll assume copying front-sticky properties doesn't make sense, either.
This advice also includes some SES-specific code because otherwise it's too
hard to override how mouse-1 works."
(when (> beg end)
(when (and beg end (> beg end))
(let ((temp beg))
(setq beg end
end temp)))