{"thread":{"id":"19505","subject":"[PATCH 1/3] Documentation/Makefile: add a commented-out ' to unconfuse Emacs","startedAt":"2009-05-25T22:07:09Z","lastAt":"2013-12-19T23:52:21Z","messageCount":9,"participants":["Samuel Bronson","Markus Heidelberg","Junio C Hamano","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"114702","messageId":"1243289231-32500-1-git-send-email-naesten@gmail.com","threadId":"19505","inReplyTo":null,"subject":"[PATCH 1/3] Documentation/Makefile: add a commented-out ' to unconfuse Emacs","fromName":"Samuel Bronson","fromEmail":"naesten@gmail.com","sentAt":"2009-05-25T22:07:09Z","receivedAt":"2009-05-25T22:07:09Z","isPatch":true,"sender":{"key":"naesten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13903?v=4"},"body":"Signed-off-by: Samuel Bronson <naesten@gmail.com>\n---\n Documentation/Makefile |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 7a8037f..f5d670e 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -106,6 +106,7 @@ endif\n SHELL_PATH ?= $(SHELL)\n # Shell quote;\n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n+# unconfuse Emacs: '\n \n #\n # Please note that there is a minor bug in asciidoc.\n-- \n1.6.3.1\n"},{"id":"114704","messageId":"1243289231-32500-2-git-send-email-naesten@gmail.com","threadId":"19505","inReplyTo":"1243289231-32500-1-git-send-email-naesten@gmail.com","subject":"[PATCH 2/3] Makefile: Add \"make help\" telling users to read INSTALL and Makefile","fromName":"Samuel Bronson","fromEmail":"naesten@gmail.com","sentAt":"2009-05-25T22:07:10Z","receivedAt":"2009-05-25T22:07:10Z","isPatch":true,"sender":{"key":"naesten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13903?v=4"},"body":"Without this, \"make help\" first builds \"help.o\", then tries to link it to\nmake a \"help\" executable, which might take a while to fail in a clean tree.\n\nSigned-off-by: Samuel Bronson <naesten@gmail.com>\n---\n Makefile |    6 ++++++\n 1 files changed, 6 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex eaae45d..07a141d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1,6 +1,12 @@\n # The default target of this Makefile is...\n all::\n \n+.PHONY: help\n+help:\n+\t@echo 'Building:'\n+\t@echo '  For help on building, see the INSTALL file and the comments at'\n+\t@echo '  the top of Makefile'\n+\n # Define V=1 to have a more verbose compile.\n #\n # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()\n-- \n1.6.3.1\n"},{"id":"114703","messageId":"1243289231-32500-3-git-send-email-naesten@gmail.com","threadId":"19505","inReplyTo":"1243289231-32500-2-git-send-email-naesten@gmail.com","subject":"[PATCH 3/3] Makefile: add commented out 's for Emacs here, too","fromName":"Samuel Bronson","fromEmail":"naesten@gmail.com","sentAt":"2009-05-25T22:07:11Z","receivedAt":"2009-05-25T22:07:11Z","isPatch":true,"sender":{"key":"naesten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13903?v=4"},"body":"Signed-off-by: Samuel Bronson <naesten@gmail.com>\n---\n Makefile |   13 +++++++++++++\n 1 files changed, 13 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 07a141d..b485c21 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1190,6 +1190,13 @@ prefix_SQ = $(subst ','\\'',$(prefix))\n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n TCLTK_PATH_SQ = $(subst ','\\'',$(TCLTK_PATH))\n+# unconfuse Emacs: '\n+\n+# The above comment is in case there is an odd number of _SQ\n+# definitions above, since they seem to confuse Emacs. If there is an\n+# even number of such definitions, it does no harm, since emacs\n+# doesn't recognize string delimiters inside recognized comments.\n+\n \n LIBS = $(GITLIBS) $(EXTLIBS)\n \n@@ -1437,6 +1444,8 @@ cscope:\n ### Detect prefix changes\n TRACK_CFLAGS = $(subst ','\\'',$(ALL_CFLAGS)):\\\n              $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)\n+# unconfuse Emacs: '\n+# (see above comment about \"unconfuse Emacs\")\n \n GIT-CFLAGS: .FORCE-GIT-CFLAGS\n \t@FLAGS='$(TRACK_CFLAGS)'; \\\n@@ -1457,6 +1466,8 @@ GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS\n ### Detect Tck/Tk interpreter path changes\n ifndef NO_TCLTK\n TRACK_VARS = $(subst ','\\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)')\n+# unconfuse Emacs: '\n+# (see above comment about \"unconfuse Emacs\")\n \n GIT-GUI-VARS: .FORCE-GIT-GUI-VARS\n \t@VARS='$(TRACK_VARS)'; \\\n@@ -1540,6 +1551,8 @@ gitexec_instdir = $(prefix)/$(gitexecdir)\n endif\n gitexec_instdir_SQ = $(subst ','\\'',$(gitexec_instdir))\n export gitexec_instdir\n+# unconfuse Emacs: '\n+# (see above comment about \"unconfuse Emacs\")\n \n install: all\n \t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'\n-- \n1.6.3.1\n"},{"id":"115083","messageId":"200905301505.38016.markus.heidelberg@web.de","threadId":"19505","inReplyTo":"1243289231-32500-3-git-send-email-naesten@gmail.com","subject":"Re: [PATCH 3/3] Makefile: add commented out 's for Emacs here, too","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2009-05-30T13:05:37Z","receivedAt":"2009-05-30T13:05:37Z","isPatch":true,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"Samuel Bronson, 26.05.2009:\n> Signed-off-by: Samuel Bronson <naesten@gmail.com>\n> ---\n>  Makefile |   13 +++++++++++++\n>  1 files changed, 13 insertions(+), 0 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index 07a141d..b485c21 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1190,6 +1190,13 @@ prefix_SQ = $(subst ','\\'',$(prefix))\n>  SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n>  PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n>  TCLTK_PATH_SQ = $(subst ','\\'',$(TCLTK_PATH))\n> +# unconfuse Emacs: '\n> +\n> +# The above comment is in case there is an odd number of _SQ\n> +# definitions above, since they seem to confuse Emacs. If there is an\n> +# even number of such definitions, it does no harm, since emacs\n> +# doesn't recognize string delimiters inside recognized comments.\n\nThis doesn't only confuse Emacs, so the subject should be changed to\nsomething like \"... to unconfuse editors' syntax highlighting\" and be\nsquashed with Patch 1/3, since this is exactly the same issue.\n\nI think this is way too much comment and would prefer none at all. I\nalso would remove the global 4-line comment.\n\nBut Vim for example is not satisfied with your fix above. It needs this\nworkaround for every line and additionally needs a closing parenthesis,\nbecause the real one is hidden in the string. So this would work for\nVim:\n\n PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n+#')\n TCLTK_PATH_SQ = $(subst ','\\'',$(TCLTK_PATH))\n+#')\n\nMaybe even behind the concerned line to avoid clutter, if this doesn't\ncause other problems:\n\n-PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n+PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))#')\n-TCLTK_PATH_SQ = $(subst ','\\'',$(TCLTK_PATH))\n+TCLTK_PATH_SQ = $(subst ','\\'',$(TCLTK_PATH))#')\n\nBut I'm not completely confident of this fix anyway and don't know\nwhether it should be included at all.\n\nMarkus\n"},{"id":"115095","messageId":"db65a1cd0905301137o482d9b14se0c438678fb4e4dd@mail.gmail.com","threadId":"19505","inReplyTo":"200905301505.38016.markus.heidelberg@web.de","subject":"Re: [PATCH 3/3] Makefile: add commented out 's for Emacs here, too","fromName":"Samuel Bronson","fromEmail":"naesten@gmail.com","sentAt":"2009-05-30T18:37:14Z","receivedAt":"2009-05-30T18:37:14Z","isPatch":true,"sender":{"key":"naesten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13903?v=4"},"body":"On Sat, May 30, 2009 at 9:05 AM, Markus Heidelberg\n<markus.heidelberg@web.de> wrote:\n\n>> +# The above comment is in case there is an odd number of _SQ\n>> +# definitions above, since they seem to confuse Emacs. If there is an\n>> +# even number of such definitions, it does no harm, since emacs\n>> +# doesn't recognize string delimiters inside recognized comments.\n>\n> This doesn't only confuse Emacs, so the subject should be changed to\n> something like \"... to unconfuse editors' syntax highlighting\" and be\n> squashed with Patch 1/3, since this is exactly the same issue.\n>\n> I think this is way too much comment and would prefer none at all. I\n> also would remove the global 4-line comment.\n\nOkay. I guess I'll save it for the commit message (rewritten to match\nthe changes suggested below), maybe keep two words for the first one\nin each Makefile ...\n\n> But Vim for example is not satisfied with your fix above. It needs this\n> workaround for every line and additionally needs a closing parenthesis,\n> because the real one is hidden in the string. So this would work for\n> Vim:\n>\n>  PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n> +#')\n>  TCLTK_PATH_SQ = $(subst ','\\'',$(TCLTK_PATH))\n> +#')\n\nYeah, emacs would work better that way too -- I was going for a\nlow-disruption patch, and was mostly interested in making sure\nunrelated portions of the Makefile didn't get swallowed by\nstring-coloring. I didn't particularly care about the parentheses --\ndoes Vim care about that for indentation, or just paren-matching?\n\nI wonder why emacs and vim both have the same problem with that\nconstruct ... and how hard it would be to fix. (Thankfully, this\napproach to dealing with the breakage will not confuse corrected\nversions, since they will basically ignore the contents of the\ncomments for syntax highlighting purposes :-).\n\n> Maybe even behind the concerned line to avoid clutter, if this doesn't\n> cause other problems:\n>\n> -PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))\n> +PERL_PATH_SQ = $(subst ','\\'',$(PERL_PATH))#')\n> -TCLTK_PATH_SQ = $(subst ','\\'',$(TCLTK_PATH))\n> +TCLTK_PATH_SQ = $(subst ','\\'',$(TCLTK_PATH))#')\n\nThat should at least work a lot better than my initial attempt at 1/3,\nwhere I had a space before the # -- the space broke the build, which\nis actually how I ended up noticing the need for 2/3 .\n"},{"id":"115096","messageId":"7vr5y6z9xp.fsf@alter.siamese.dyndns.org","threadId":"19505","inReplyTo":"200905301505.38016.markus.heidelberg@web.de","subject":"Re: [PATCH 3/3] Makefile: add commented out 's for Emacs here, too","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-05-30T19:07:30Z","receivedAt":"2009-05-30T19:07:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Markus Heidelberg <markus.heidelberg@web.de> writes:\n\n>> +# unconfuse Emacs: '\n>> +\n>> +# The above comment is in case there is an odd number of _SQ\n>> +# definitions above, since they seem to confuse Emacs. If there is an\n>> +# even number of such definitions, it does no harm, since emacs\n>> +# doesn't recognize string delimiters inside recognized comments.\n> ...\n> I think this is way too much comment and would prefer none at all. I\n> also would remove the global 4-line comment.\n\nI personally do not like contaminating our source files with this kind of\nmagic crufts just to please broken tools, be they emacs or vim.  I would\nhate them even more if they are not clearly commented why they exist for\ntwo reasons.\n\n (1) without clear instructions (\"odd number of ...\" is not quite enough),\n     people who do *not* use broken tools cannot keep them up-to-date when\n     they make modifications;\n\n (2) when broken tools are finally fixed, nobody would remember why the\n     magic crufts exist, and they will end up staying in the source for a\n     long time.\n"},{"id":"115099","messageId":"200905310001.44532.markus.heidelberg@web.de","threadId":"19505","inReplyTo":"7vr5y6z9xp.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/3] Makefile: add commented out 's for Emacs here, too","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2009-05-30T22:01:43Z","receivedAt":"2009-05-30T22:01:43Z","isPatch":true,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"Junio C Hamano, 30.05.2009:\n> Markus Heidelberg <markus.heidelberg@web.de> writes:\n> \n> >> +# unconfuse Emacs: '\n> >> +\n> >> +# The above comment is in case there is an odd number of _SQ\n> >> +# definitions above, since they seem to confuse Emacs. If there is an\n> >> +# even number of such definitions, it does no harm, since emacs\n> >> +# doesn't recognize string delimiters inside recognized comments.\n> > ...\n> > I think this is way too much comment and would prefer none at all. I\n> > also would remove the global 4-line comment.\n> \n> I personally do not like contaminating our source files with this kind of\n> magic crufts just to please broken tools [...]\n\nNeither do I like it. That's why I wrote, I wasn't sure whether this\nshould be applied.\n\nIn the buildroot project (it consists of Makefiles) there a lots of\nthose workarounds. There was a patch on the list to replace all\n$(strip $(subst \",,$(FOO))) with $(call strip_dquotes, $(FOO)), but\n$(call) is not allowed in git for compatibility reasons.\n\nMarkus\n"},{"id":"232270","messageId":"CAJYzjmcbQVgRk9pjyWSqaDPz6=kFQ9spE14Bq5aG4dnuo-t=oA@mail.gmail.com","threadId":"19505","inReplyTo":"200905310001.44532.markus.heidelberg@web.de","subject":"Re: [PATCH 3/3] Makefile: add commented out 's for Emacs here, too","fromName":"Samuel Bronson","fromEmail":"naesten@gmail.com","sentAt":"2013-12-19T23:37:01Z","receivedAt":"2013-12-19T23:37:01Z","isPatch":true,"sender":{"key":"naesten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13903?v=4"},"body":"On Sat, May 30, 2009 at 6:01 PM, Markus Heidelberg\n<markus.heidelberg@web.de> wrote:\n\n> In the buildroot project (it consists of Makefiles) there a lots of\n> those workarounds. There was a patch on the list to replace all\n> $(strip $(subst \",,$(FOO))) with $(call strip_dquotes, $(FOO)), but\n> $(call) is not allowed in git for compatibility reasons.\n\nHmm.  What compatibility reasons, and are they still applicable?\n\n[If you're wondering why I'm revisiting this, I was looking through my\nbranches for anything outstanding and found this patch series there.]\n"},{"id":"232273","messageId":"20131219235221.GG20443@google.com","threadId":"19505","inReplyTo":"CAJYzjmcbQVgRk9pjyWSqaDPz6=kFQ9spE14Bq5aG4dnuo-t=oA@mail.gmail.com","subject":"Re: [PATCH 3/3] Makefile: add commented out 's for Emacs here, too","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-12-19T23:52:21Z","receivedAt":"2013-12-19T23:52:21Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nSamuel Bronson wrote:\n> Markus Heidelberg wrote:\n\n>> In the buildroot project (it consists of Makefiles) there a lots of\n>> those workarounds. There was a patch on the list to replace all\n>> $(strip $(subst \",,$(FOO))) with $(call strip_dquotes, $(FOO)), but\n>> $(call) is not allowed in git for compatibility reasons.\n>\n> Hmm.  What compatibility reasons, and are they still applicable?\n\nGood question.\n\n  $ git log -1 -S'$(call ' -- Makefile \n  commit 39c015c556f285106931e0500f301de462b0e46e\n  Author: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n  Date:   Sat Feb 18 12:40:22 2006 +0100\n\n      Fixes for ancient versions of GNU make\n\n      Some versions of GNU make do not understand $(call), and have problems to\n      interpret rules like this:\n\n      some_target: CFLAGS += -Dsome=defs\n\n      [jc: simplified substitution a bit. ]\n\n      Signed-off-by: Johannes E. Schindelin <Johannes.Schindelin@gmx.de>\n      Signed-off-by: Junio C Hamano <junkio@cox.net>\n\nA quick gmane search finds [1], which suggests the \"make\" where this\nproblem came up was on IRIX.  I don't have a strong opinion either way\nabout whether such ancient 'make' is worth supporting (as a practical\nmatter, it's hard to keep testing and make sure such support still\nworks).\n\nWould $(call) simplify the makefile much?\n\nThanks,\nJonathan\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/16344\nhttp://thread.gmane.org/gmane.comp.version-control.git/16345/focus=16375\nhttp://thread.gmane.org/gmane.comp.version-control.git/48968/focus=49117\n"}]}