From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Trent Buck" Subject: Re: require-final-newline Date: Wed, 23 May 2007 19:18:24 +1000 Message-ID: <20070523091824.GA898@baal.lan> References: <20070521020326.GA14277@baal.lan> <7a73d44309f7c011f5a9eb724af92096@science.uva.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0085972550==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HqmzO-0006C7-I3 for emacs-orgmode@gnu.org; Wed, 23 May 2007 05:18:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HqmzL-00069I-MC for emacs-orgmode@gnu.org; Wed, 23 May 2007 05:18:37 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HqmzK-00068X-Ru for emacs-orgmode@gnu.org; Wed, 23 May 2007 05:18:35 -0400 Received: from omta01ps.mx.bigpond.com ([144.140.82.153]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HqmzJ-0004fH-NV for emacs-orgmode@gnu.org; Wed, 23 May 2007 05:18:34 -0400 In-Reply-To: <7a73d44309f7c011f5a9eb724af92096@science.uva.nl> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org --===============0085972550== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="r5Pyd7+fXNt84Ff3" Content-Disposition: inline --r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 22, 2007 at 09:34:53AM +0200, Carsten Dominik wrote: >=20 > On May 21, 2007, at 4:03, Trent Buck wrote: >=20 > >[Please CC replies; I'm not subscribed to this list.] > > > >I have the following in my .emacs: > > > > | ;;; If the last line is an item and you have a final newline, > > | ;;; collapsing item bodies will result in > > | ;;; > > | ;;; ** eat marshmallows... > > | ;;; > > | ;;; where the ellipsis is simply eliding the final newline. This > > | ;;; annoys me. >=20 > I do not yet see what the problem is. Why is this annoying you? It annoys me because the ... indicate that text is being hidden, but in fact the only hidden data is a single newline. > - Carsten >=20 >=20 > >Rather than fix org mode, I've opted to simply > > | ;;; disable implicit adding of a final newline for this mode. > > | (add-hook 'org-mode-hook > > | (lambda () > > | (set (make-local-variable 'require-final-newline) nil))) > > > >It would be better if org mode did this automatically. There is > >a facility specifically for this: > > > > | mode-require-final-newline is a variable defined in `files.el'. > > | > > | Documentation: > > | Whether to add a newline at end of file, in certain major modes. > > | Those modes set `require-final-newline' to this value when you=20 > >enable them. > > | They do so because they are often used for files that are supposed > > | to end in newlines, and the question is how to arrange that. > > | > > | A value of t means do this only when the file is about to be saved. > > | A value of `visit' means do this right after the file is visited. > > | A value of `visit-save' means do it at both of those times. > > | Any other non-nil value means ask user whether to add a newline,=20 > >when saving. > > | > > | nil means do not add newlines. That is a risky choice in this=20 > >variable > > | since this value is used for modes for files that ought to have=20 > >final newlines. > > | So if you set this to nil, you must explicitly check and add > > | a final newline, whenever you save a file that really needs one. > > > >I posit that org-mode should set this variable to nil. --=20 Trent Buck --r5Pyd7+fXNt84Ff3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGVAbfLpef9iTtxAYRAk50AKCUI+74A3ynlXc5xnppg650f0mltgCgrqm+ TNUuxpEj1djuQ6Reqky8iEE= =Pm9W -----END PGP SIGNATURE----- --r5Pyd7+fXNt84Ff3-- --===============0085972550== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0085972550==--