From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Fwd: Update earlier posted hideif.el enhancements Date: Tue, 03 Dec 2013 08:45:09 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1386078348 6094 80.91.229.3 (3 Dec 2013 13:45:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Dec 2013 13:45:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: Luke Lee Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 03 14:45:53 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VnqI8-0005ti-RK for ged-emacs-devel@m.gmane.org; Tue, 03 Dec 2013 14:45:33 +0100 Original-Received: from localhost ([::1]:42492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnqI8-0007hj-GS for ged-emacs-devel@m.gmane.org; Tue, 03 Dec 2013 08:45:32 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnqHu-0007P1-Ik for emacs-devel@gnu.org; Tue, 03 Dec 2013 08:45:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VnqHn-0003Ar-52 for emacs-devel@gnu.org; Tue, 03 Dec 2013 08:45:18 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:25507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnqHn-0003Aj-1a for emacs-devel@gnu.org; Tue, 03 Dec 2013 08:45:11 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFxL6g/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kLodwBq1Tg0yQDpEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFFFxL6g/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kLodwBq1Tg0yQDpEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="40991461" Original-Received: from 69-196-190-160.dsl.teksavvy.com (HELO pastel.home) ([69.196.190.160]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 03 Dec 2013 08:45:10 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id C798D60DDA; Tue, 3 Dec 2013 08:45:09 -0500 (EST) In-Reply-To: (Luke Lee's message of "Tue, 3 Dec 2013 12:33:54 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166037 Archived-At: > Umm, here I only comment out the "make-local-variable" for hide-ifdef-env. > Otherwise the defined tokens works only for that buffer. I would like it to > work for all currently openned buffers in a "project" based manner. Hmm... I see. Affecting the value globally would also affect buffers that are unrelated. Sadly we don't really have an easy way currently to talk about project-wide settings. I guess we should use the CEDET infrastructure for that (which would also make it possible to scan files which aren't currently visited). But I guess for now we can try your "quick&dirty" solution of making the settings global. > The "set" form derived from the original code. Ah, right. Then just replace "(set 'hide-ifdef-env" with "(setq hide-ifdef-env". It's just a stylistic issue. >> Indeed, there's been no real development on it in recently. See my >> comments below. Overall, I think it looks good and could be included in >> hideif.el, but I'd appreciate if you could clean up a few things first >> and split the change into a few chunks (this is a bit large to review as >> one single chunk). IIUC one chunk would focus on extend the current >> parser & evaluator to handle the full CPP syntax. >> The remaining cleanups > The remaining cleanups are done. The original code that I derived from > contains a lot of ';;;' comments, I fixed most of them but left some since > they looks like to be placed on purpose to become a separator there. Thanks. Fixing the pre-existing issues is gravy. The main part is to not make it worse ;-) > Therefore it's extremely time consuming to cherry-pick among all those > changes and group them into several valid topic patches, sorry about that... I'm not asking you to cherry pick commits. Instead you should take your current code (call it "target") and remove "all but the parsing-related modifications", for example (I usually do that with "C-x v d" then C-u C-c C-a to undo the hunks that are not related, plus manual changes for those hunks which contain both changes I want to keep and changes I want to remove). That gives you a first patch to send. Then you diff the result with your "target code" and remove "all but something else". This does not use the commit history. Instead it kind of "creates a brand new and clean history". Stefan