I think you need to spend some time reading the help documentation on the 'AND' function to have a better understanding of its functionality.
In my code:
Code:
(if ; If the following test expression returns a non-nil value
(and
tmp ; 'tmp' variable has a non-nil value
(findfile tmp) ; The file with filename tmp can be found
)
(vl-file-delete tmp) ; Then delete the file
)
In your modification, you now have a redundant expression, and the extra check for the existence of the file is no longer present:
Code:
(if tmp ; If 'tmp' variable has a non-nil value
(progn
(findfile tmp) ; This is redundant since its result isn't used in any way
(vl-file-delete tmp) ; delete the file
)
)