unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Simplify init_lread() branch and fix comments
@ 2016-12-28  3:01 Chris Gregory
  2016-12-28  8:52 ` Andreas Schwab
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Gregory @ 2016-12-28  3:01 UTC (permalink / raw)
  To: emacs-devel

This patch moves the comments before the branch in init_lread() to the
correct locations, and simplifies the branch because (true && a) == a.
-- 
Chris Gregory

Diff:

diff --git a/src/lread.c b/src/lread.c
index 35348f1..23ebc8f 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4430,17 +4430,13 @@ load_path_default (void)
 void
 init_lread (void)
 {
-  /* First, set Vload_path.  */
-
-  /* Ignore EMACSLOADPATH when dumping.  */
-#ifdef CANNOT_DUMP
-  bool use_loadpath = true;
-#else
-  bool use_loadpath = NILP (Vpurify_flag);
-#endif
-
-  if (use_loadpath && egetenv ("EMACSLOADPATH"))
+  if (
+#ifndef CANNOT_DUMP
+      NILP (Vpurify_flag) &&
+#endif
+      egetenv ("EMACSLOADPATH"))
     {
+      /* First, set Vload_path.  */
       Vload_path = decode_env_path ("EMACSLOADPATH", 0, 1);
 
       /* Check (non-nil) user-supplied elements.  */
@@ -4479,6 +4475,7 @@ init_lread (void)
     }
   else
     {
+      /* Ignore EMACSLOADPATH when dumping.  */
       Vload_path = load_path_default ();
 
       /* Check before adding site-lisp directories.



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Simplify init_lread() branch and fix comments
  2016-12-28  3:01 Simplify init_lread() branch and fix comments Chris Gregory
@ 2016-12-28  8:52 ` Andreas Schwab
  2016-12-28 15:46   ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Schwab @ 2016-12-28  8:52 UTC (permalink / raw)
  To: Chris Gregory; +Cc: emacs-devel

On Dez 27 2016, Chris Gregory <czipperz@gmail.com> wrote:

> diff --git a/src/lread.c b/src/lread.c
> index 35348f1..23ebc8f 100644
> --- a/src/lread.c
> +++ b/src/lread.c
> @@ -4430,17 +4430,13 @@ load_path_default (void)
>  void
>  init_lread (void)
>  {
> -  /* First, set Vload_path.  */
> -
> -  /* Ignore EMACSLOADPATH when dumping.  */
> -#ifdef CANNOT_DUMP
> -  bool use_loadpath = true;
> -#else
> -  bool use_loadpath = NILP (Vpurify_flag);
> -#endif
> -
> -  if (use_loadpath && egetenv ("EMACSLOADPATH"))
> +  if (
> +#ifndef CANNOT_DUMP
> +      NILP (Vpurify_flag) &&
> +#endif
> +      egetenv ("EMACSLOADPATH"))
>      {

That makes it worse, and violates the GNU coding style.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Simplify init_lread() branch and fix comments
  2016-12-28  8:52 ` Andreas Schwab
@ 2016-12-28 15:46   ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2016-12-28 15:46 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: czipperz, emacs-devel

> From: Andreas Schwab <schwab@linux-m68k.org>
> Date: Wed, 28 Dec 2016 09:52:56 +0100
> Cc: emacs-devel@gnu.org
> 
> > diff --git a/src/lread.c b/src/lread.c
> > index 35348f1..23ebc8f 100644
> > --- a/src/lread.c
> > +++ b/src/lread.c
> > @@ -4430,17 +4430,13 @@ load_path_default (void)
> >  void
> >  init_lread (void)
> >  {
> > -  /* First, set Vload_path.  */
> > -
> > -  /* Ignore EMACSLOADPATH when dumping.  */
> > -#ifdef CANNOT_DUMP
> > -  bool use_loadpath = true;
> > -#else
> > -  bool use_loadpath = NILP (Vpurify_flag);
> > -#endif
> > -
> > -  if (use_loadpath && egetenv ("EMACSLOADPATH"))
> > +  if (
> > +#ifndef CANNOT_DUMP
> > +      NILP (Vpurify_flag) &&
> > +#endif
> > +      egetenv ("EMACSLOADPATH"))
> >      {
> 
> That makes it worse, and violates the GNU coding style.

Agreed.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-28 15:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-28  3:01 Simplify init_lread() branch and fix comments Chris Gregory
2016-12-28  8:52 ` Andreas Schwab
2016-12-28 15:46   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).