all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: 21429@debbugs.gnu.org
Subject: bug#21429: 24.5; More robust test for calls to `package-initialize' in init file
Date: Tue, 08 Sep 2015 02:26:26 +1200	[thread overview]
Message-ID: <55ED9E92.9060702@orcon.net.nz> (raw)

[-- Attachment #1: Type: text/plain, Size: 144 bytes --]

The code which checks the user's init file for calls to
`package-initialize' doesn't take the optional argument to
that function into account.


[-- Attachment #2: 0001-More-robust-check-for-package-initialize-calls-in-in.patch --]
[-- Type: text/x-patch, Size: 1438 bytes --]

From e4031d15e635493b69e5402acec33861817303ad Mon Sep 17 00:00:00 2001
From: Phil Sainty <psainty@orcon.net.nz>
Date: Tue, 8 Sep 2015 02:15:53 +1200
Subject: [PATCH] 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.
---
 lisp/emacs-lisp/package.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 23247d7..45d66f6 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1838,12 +1838,12 @@ add a call to it along with some explanatory comments."
                     (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))
-- 
2.1.0


             reply	other threads:[~2015-09-07 14:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-07 14:26 Phil Sainty [this message]
2015-09-07 20:34 ` bug#21429: 24.5; More robust test for calls to `package-initialize' in init file Artur Malabarba
2015-09-08  1:08   ` Phil Sainty
2015-09-09 11:14     ` Artur Malabarba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55ED9E92.9060702@orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=21429@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.