From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.devel Subject: Re: Modern Conventions for Emacs Lisp files? Date: Mon, 15 Apr 2013 13:16:44 +0200 Message-ID: <87d2tw59ib.fsf@gmail.com> References: <87hajhswdh.fsf@gmail.com> <87y5csu7ml.fsf@gmail.com> <87hajgu5bp.fsf@gmail.com> <87li8m3sny.fsf@gmail.com> <87y5cknq9q.fsf@gmail.com> <834nf86u79.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1366025221 11015 80.91.229.3 (15 Apr 2013 11:27:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Apr 2013 11:27:01 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 15 13:27:03 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 1URhYn-00046u-RP for ged-emacs-devel@m.gmane.org; Mon, 15 Apr 2013 13:26:58 +0200 Original-Received: from localhost ([::1]:40594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URhYn-00038y-CD for ged-emacs-devel@m.gmane.org; Mon, 15 Apr 2013 07:26:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URhYj-00038p-Aa for emacs-devel@gnu.org; Mon, 15 Apr 2013 07:26:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URhYh-0007AV-JE for emacs-devel@gnu.org; Mon, 15 Apr 2013 07:26:53 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URhP5-0001ny-Eq for emacs-devel@gnu.org; Mon, 15 Apr 2013 07:16:55 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1URhP2-0001Yq-KK for emacs-devel@gnu.org; Mon, 15 Apr 2013 13:16:52 +0200 Original-Received: from e178191116.adsl.alicedsl.de ([85.178.191.116]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Apr 2013 13:16:52 +0200 Original-Received: from tjolitz by e178191116.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Apr 2013 13:16:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 93 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178191116.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:cct8DJFErsEfdnfRcALL3hh7Os8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:158922 Archived-At: Eli Zaretskii writes: >> From: Thorsten Jolitz >> Date: Mon, 15 Apr 2013 10:37:21 +0200 >> Cc: Bastien >> >> | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >> | ;; >> | ;;; Commentary: >> | ;; >> | >> | [...] >> `------------------------------------------------------------------------------ >> >> I would prefer in this case not to investigate why this line causes such >> problems but rather to consider writing such a line a bug. >> >> So maybe Bastien could consider this a bug-report and remove this line? >> Because otherwise org.el with its more than 23000 lines is just a >> perfect example were the use of outline/outshine and navi-mode for file >> structuring, high-level (over)views on the file and easy navigation >> makes sense. > > There are about 60 non-Org *.el files in Emacs which have similar > lines, and about 40 in lisp/org/. So IMO asking people not to use > that runs a risk of being a quixotic battle. This line actually shows another disadvantage of using only comment-chars for signalling headlines (^;;;+ ): people feel free to do whatever they want with comment-chars, even drawing ascii art or invent their own section separators or so, which then interferes with the matching of headlines. I don't want to take the risk of fighting a quixotic battle. The problem lies in the following function from outshine.el which is actually copied from Fabrice Niessen who probably copied/adapted it from Org-mode: ,--------------------------------------------------------------------------------- | (defun outshine-fontify-headlines (outline-regexp) | ;; highlight the headings | ;; see http://www.gnu.org/software/emacs/manual/html_node/emacs/Font-Lock.html | ;; use `M-x customize-apropos-faces' to customize faces | ;; to find the corresponding face for each outline level, see | ;; `org-faces.el' | | ;; Added `\n?', after having read the following chunk of code (from org.el): | ;; `(,(if org-fontify-whole-heading-line | ;; "^\\(\\**\\)\\(\\* \\)\\(.*\n?\\)" | ;; "^\\(\\**\\)\\(\\* \\)\\(.*\\)") | | (let ((outshine-fontify-whole-heading-line "") ; "\n?") | (heading-1-regexp | (concat (substring outline-regexp 0 -1) | "\\{1\\} \\(.*" outshine-fontify-whole-heading-line "\\)")) | [... snip ...] | (heading-8-regexp | (concat (substring outline-regexp 0 -1) | "\\{8,\\} \\(.*" outshine-fontify-whole-heading-line "\\)"))) | (font-lock-add-keywords | nil | `((,heading-1-regexp 1 'outshine-level-1 t) | [... snip ...] | (,heading-8-regexp 1 'outshine-level-8 t))))) `--------------------------------------------------------------------------------- Its the '-1' that causes the problem: ,---------------------------------------- | (concat (substring outline-regexp 0 -1) `---------------------------------------- => Result: "^;;[;]+\\{1\\} \\(.*\\)" When I delete it ,---------------------------------------- | (concat (substring outline-regexp 0) `---------------------------------------- => Result: "^;;[;]+ \\{1\\} \\(.*\\)" the problem is gone - but fontification doesn't work anymore. This is probably more suited for emacs-help, because I would need some help on this, but since this thread is already on emacs-devel I ask it here: How can I get the best of both worlds in this case (no infinite loops but working fontification)? -- cheers, Thorsten