More robust check for `package-initialize' calls in init file.
This function accepts an optional argument, but calls passing
an argument would not have been detected.
(save-restriction
(widen)
(goto-char (point-min))
- (search-forward "(package-initialize)" nil 'noerror))))
+ (re-search-forward "(package-initialize\\_>" nil 'noerror))))
;; Don't visit the file if we don't have to.
(with-temp-buffer
(insert-file-contents user-init-file)
(goto-char (point-min))
- (search-forward "(package-initialize)" nil 'noerror)))))
+ (re-search-forward "(package-initialize\\_>" nil 'noerror)))))
(unless contains-init
(with-current-buffer (or buffer
(let ((delay-mode-hooks t))