diff options
| author | Glenn Morris | 2011-01-06 19:10:39 -0800 |
|---|---|---|
| committer | Glenn Morris | 2011-01-06 19:10:39 -0800 |
| commit | 66b7b0fe80885b6357517a78f67189ab6a5dbd68 (patch) | |
| tree | 4a854d4dca2a11e2b90a60eddd8f52036f8df1d9 /src | |
| parent | 83f3eadc06b0fe40c669568394b14174018382c8 (diff) | |
| download | emacs-66b7b0fe80885b6357517a78f67189ab6a5dbd68.tar.gz emacs-66b7b0fe80885b6357517a78f67189ab6a5dbd68.zip | |
Add --no-site-lisp option, make -Q use it. (Bug#5707)
* lisp/Makefile.in (EMACSOPT): Add --no-site-lisp.
* src/emacs.c (no_site_lisp): New int.
(USAGE1): Add --no-site-lisp, mention -Q uses it.
(main): Set no_site_lisp.
(standard_args): Add --no-site-lisp.
* src/lisp.h (no_site_lisp): New int.
* src/lread.c (init_lread): If no_site_lisp, don't re-add site-lisp
directories to Vload_path.
* etc/NEWS: Mention --no-site-lisp.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/emacs.c | 30 | ||||
| -rw-r--r-- | src/lisp.h | 7 | ||||
| -rw-r--r-- | src/lread.c | 4 |
4 files changed, 45 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a32e7a28dc3..12768f3578b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2011-01-07 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs.c (no_site_lisp): New int. | ||
| 4 | (USAGE1): Add --no-site-lisp, mention -Q uses it. | ||
| 5 | (main): Set no_site_lisp. | ||
| 6 | (standard_args): Add --no-site-lisp. | ||
| 7 | * lisp.h (no_site_lisp): New int. | ||
| 8 | * lread.c (init_lread): If no_site_lisp, don't re-add site-lisp | ||
| 9 | directories to Vload_path. | ||
| 10 | |||
| 1 | 2011-01-05 Andreas Schwab <schwab@linux-m68k.org> | 11 | 2011-01-05 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 12 | ||
| 3 | * alloc.c (mark_stack): Use __builtin_unwind_init if available. | 13 | * alloc.c (mark_stack): Use __builtin_unwind_init if available. |
diff --git a/src/emacs.c b/src/emacs.c index 59223336d45..2388146105b 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -231,6 +231,9 @@ int noninteractive1; | |||
| 231 | /* Nonzero means Emacs was run in --quick mode. */ | 231 | /* Nonzero means Emacs was run in --quick mode. */ |
| 232 | int inhibit_x_resources; | 232 | int inhibit_x_resources; |
| 233 | 233 | ||
| 234 | /* Nonzero means remove site-lisp directories from load-path. */ | ||
| 235 | int no_site_lisp; | ||
| 236 | |||
| 234 | /* Name for the server started by the daemon.*/ | 237 | /* Name for the server started by the daemon.*/ |
| 235 | static char *daemon_name; | 238 | static char *daemon_name; |
| 236 | 239 | ||
| @@ -268,9 +271,11 @@ Initialization options:\n\ | |||
| 268 | --no-init-file, -q load neither ~/.emacs nor default.el\n\ | 271 | --no-init-file, -q load neither ~/.emacs nor default.el\n\ |
| 269 | --no-shared-memory, -nl do not use shared memory\n\ | 272 | --no-shared-memory, -nl do not use shared memory\n\ |
| 270 | --no-site-file do not load site-start.el\n\ | 273 | --no-site-file do not load site-start.el\n\ |
| 274 | --no-site-lisp, -nsl do not add site-lisp directories to load-path\n\ | ||
| 271 | --no-splash do not display a splash screen on startup\n\ | 275 | --no-splash do not display a splash screen on startup\n\ |
| 272 | --no-window-system, -nw do not communicate with X, ignoring $DISPLAY\n\ | 276 | --no-window-system, -nw do not communicate with X, ignoring $DISPLAY\n\ |
| 273 | --quick, -Q equivalent to -q --no-site-file --no-splash\n\ | 277 | --quick, -Q equivalent to:\n\ |
| 278 | -q --no-site-file --no-site-lisp --no-splash\n\ | ||
| 274 | --script FILE run FILE as an Emacs Lisp script\n\ | 279 | --script FILE run FILE as an Emacs Lisp script\n\ |
| 275 | --terminal, -t DEVICE use DEVICE for terminal I/O\n\ | 280 | --terminal, -t DEVICE use DEVICE for terminal I/O\n\ |
| 276 | --user, -u USER load ~USER/.emacs instead of your own\n\ | 281 | --user, -u USER load ~USER/.emacs instead of your own\n\ |
| @@ -1341,6 +1346,9 @@ main (int argc, char **argv) | |||
| 1341 | no_loadup | 1346 | no_loadup |
| 1342 | = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args); | 1347 | = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args); |
| 1343 | 1348 | ||
| 1349 | no_site_lisp | ||
| 1350 | = argmatch (argv, argc, "-nsl", "--no-site-lisp", 11, NULL, &skip_args); | ||
| 1351 | |||
| 1344 | #ifdef HAVE_NS | 1352 | #ifdef HAVE_NS |
| 1345 | ns_alloc_autorelease_pool(); | 1353 | ns_alloc_autorelease_pool(); |
| 1346 | if (!noninteractive) | 1354 | if (!noninteractive) |
| @@ -1409,9 +1417,27 @@ main (int argc, char **argv) | |||
| 1409 | && argv[count_before + 1][1] == '-') | 1417 | && argv[count_before + 1][1] == '-') |
| 1410 | argv[count_before + 1] = "-d"; | 1418 | argv[count_before + 1] = "-d"; |
| 1411 | 1419 | ||
| 1420 | if (! no_site_lisp) | ||
| 1421 | { | ||
| 1422 | if (argmatch (argv, argc, "-Q", "--quick", 3, NULL, &skip_args) | ||
| 1423 | || argmatch (argv, argc, "-quick", 0, 2, NULL, &skip_args)) | ||
| 1424 | no_site_lisp = 1; | ||
| 1425 | } | ||
| 1426 | |||
| 1412 | /* Don't actually discard this arg. */ | 1427 | /* Don't actually discard this arg. */ |
| 1413 | skip_args = count_before; | 1428 | skip_args = count_before; |
| 1414 | } | 1429 | } |
| 1430 | #else /* !HAVE_X_WINDOWS */ | ||
| 1431 | if (! no_site_lisp) | ||
| 1432 | { | ||
| 1433 | int count_before = skip_args; | ||
| 1434 | |||
| 1435 | if (argmatch (argv, argc, "-Q", "--quick", 3, NULL, &skip_args) | ||
| 1436 | || argmatch (argv, argc, "-quick", 0, 2, NULL, &skip_args)) | ||
| 1437 | no_site_lisp = 1; | ||
| 1438 | |||
| 1439 | skip_args = count_before; | ||
| 1440 | } | ||
| 1415 | #endif | 1441 | #endif |
| 1416 | 1442 | ||
| 1417 | /* argmatch must not be used after here, | 1443 | /* argmatch must not be used after here, |
| @@ -1743,10 +1769,12 @@ const struct standard_args standard_args[] = | |||
| 1743 | { "-daemon", "--daemon", 99, 0 }, | 1769 | { "-daemon", "--daemon", 99, 0 }, |
| 1744 | { "-help", "--help", 90, 0 }, | 1770 | { "-help", "--help", 90, 0 }, |
| 1745 | { "-nl", "--no-loadup", 70, 0 }, | 1771 | { "-nl", "--no-loadup", 70, 0 }, |
| 1772 | { "-nsl", "--no-site-lisp", 65, 0 }, | ||
| 1746 | /* -d must come last before the options handled in startup.el. */ | 1773 | /* -d must come last before the options handled in startup.el. */ |
| 1747 | { "-d", "--display", 60, 1 }, | 1774 | { "-d", "--display", 60, 1 }, |
| 1748 | { "-display", 0, 60, 1 }, | 1775 | { "-display", 0, 60, 1 }, |
| 1749 | /* Now for the options handled in `command-line' (startup.el). */ | 1776 | /* Now for the options handled in `command-line' (startup.el). */ |
| 1777 | /* (Note that to imply -nsl, -Q is partially handled here.) */ | ||
| 1750 | { "-Q", "--quick", 55, 0 }, | 1778 | { "-Q", "--quick", 55, 0 }, |
| 1751 | { "-quick", 0, 55, 0 }, | 1779 | { "-quick", 0, 55, 0 }, |
| 1752 | { "-q", "--no-init-file", 50, 0 }, | 1780 | { "-q", "--no-init-file", 50, 0 }, |
diff --git a/src/lisp.h b/src/lisp.h index e02d559512c..eadbbacbff4 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Fundamental definitions for GNU Emacs Lisp interpreter. | 1 | /* Fundamental definitions for GNU Emacs Lisp interpreter. |
| 2 | Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2000, | 2 | Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2000, |
| 3 | 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 | 3 | 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 |
| 4 | Free Software Foundation, Inc. | 4 | Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | This file is part of GNU Emacs. | 6 | This file is part of GNU Emacs. |
| @@ -3225,6 +3225,9 @@ extern int noninteractive; | |||
| 3225 | /* Nonzero means don't load X resources or Windows Registry settings. */ | 3225 | /* Nonzero means don't load X resources or Windows Registry settings. */ |
| 3226 | extern int inhibit_x_resources; | 3226 | extern int inhibit_x_resources; |
| 3227 | 3227 | ||
| 3228 | /* Nonzero means remove site-lisp directories from load-path. */ | ||
| 3229 | extern int no_site_lisp; | ||
| 3230 | |||
| 3228 | /* Pipe used to send exit notification to the daemon parent at | 3231 | /* Pipe used to send exit notification to the daemon parent at |
| 3229 | startup. */ | 3232 | startup. */ |
| 3230 | extern int daemon_pipe[2]; | 3233 | extern int daemon_pipe[2]; |
| @@ -3668,5 +3671,3 @@ extern Lisp_Object safe_alloca_unwind (Lisp_Object); | |||
| 3668 | 3671 | ||
| 3669 | #endif /* EMACS_LISP_H */ | 3672 | #endif /* EMACS_LISP_H */ |
| 3670 | 3673 | ||
| 3671 | /* arch-tag: 9b2ed020-70eb-47ac-94ee-e1c2a5107d5e | ||
| 3672 | (do not change this comment) */ | ||
diff --git a/src/lread.c b/src/lread.c index ea8c0416518..bc371fc02b0 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995, 1997, | 3 | Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995, 1997, |
| 4 | 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, | 4 | 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, |
| 5 | 2009, 2010 Free Software Foundation, Inc. | 5 | 2009, 2010, 2011 Free Software Foundation, Inc. |
| 6 | 6 | ||
| 7 | This file is part of GNU Emacs. | 7 | This file is part of GNU Emacs. |
| 8 | 8 | ||
| @@ -4086,7 +4086,7 @@ init_lread (void) | |||
| 4086 | Vload_path = Fcons (tem, Vload_path); | 4086 | Vload_path = Fcons (tem, Vload_path); |
| 4087 | } | 4087 | } |
| 4088 | } | 4088 | } |
| 4089 | if (!NILP (sitelisp)) | 4089 | if (!NILP (sitelisp) && !no_site_lisp) |
| 4090 | Vload_path = nconc2 (Fnreverse (sitelisp), Vload_path); | 4090 | Vload_path = nconc2 (Fnreverse (sitelisp), Vload_path); |
| 4091 | } | 4091 | } |
| 4092 | } | 4092 | } |