From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anselm Helbig Newsgroups: gmane.emacs.help Subject: Re: How to set line wrap Date: Tue, 22 Dec 2009 13:48:12 +0100 Organization: Freie Universitaet Berlin Message-ID: <87aaxbp437.wl%anselm.helbig+news2009@googlemail.com> References: <76d3932e-13dd-40e7-b05a-d14eeac56574@q16g2000vbc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1261489283 31564 80.91.229.12 (22 Dec 2009 13:41:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Dec 2009 13:41:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 22 14:41:14 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NN4zB-00027s-8t for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Dec 2009 14:41:13 +0100 Original-Received: from localhost ([127.0.0.1]:33785 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NN4zB-000082-B2 for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Dec 2009 08:41:13 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 62 Original-X-Trace: news.uni-berlin.de MNWXmPn5iUMiV8hzrcPxig18ehF4UcJQYfH2MorLyAXpxXW/ZaFMY7pXdu Cancel-Lock: sha1:mQaN/H4QGhyLZAF5j9RQm+OcUNA= In-Reply-To: <76d3932e-13dd-40e7-b05a-d14eeac56574@q16g2000vbc.googlegroups.com> Mail-Followup-To: Anselm Helbig Original-Xref: news.stanford.edu gnu.emacs.help:175720 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70796 Archived-At: At Mon, 21 Dec 2009 15:56:06 -0800 (PST), RAYHAN MUKTADER wrote: > > Hello, > > Could some tell me how I can set the line wrap to 80 characters? > > The following is what my ~/.emacs file currently looks like: > > (set-fill-column 5) > ;; Turn on tabs > (setq indent-tabs-mode t) > (setq-default indent-tabs-mode t) > > ;; Bind the TAB key > (global-set-key (kbd "TAB") 'self-insert-command) > > ;; Set the tab width > (setq default-tab-width 4) > (setq tab-width 4) > (setq c-basic-indent 4) > (load-library "php-mode") > (global-font-lock-mode t) > > As you can see I have set fill column to 5 just to test it. > However, My my cursor does not move to the next line after I go pass > five characters and I don't see any change in highlighting either. > > I have also tried C-u 5 C-x f but I did not see any difference. Two things. See the docs for fill-column: fill-column is a variable defined in `C source code'. Its value is 70 Automatically becomes buffer-local when set in any fashion. This variable is safe as a file local variable if its value satisfies the predicate `integerp'. So, when you set the fill column from your .emacs, this setting will not apply to other buffers. To set a global default value use setq-default: (setq-default fill-column 5) Furthermore you have to make sure that auto-fill-mode is turned on, otherwise your setting will have no effect. You usually only turn it on for certain major modes, e.g. to turn it on for latex-mode you'd add this to your .emacs: (add-hook 'latex-mode-hook 'turn-on-auto-fill) You can of course also change the setting for fill-column in a buffer-specific hook, using setq would make sense there. HTH, Anselm -- Anselm Helbig - http://mnemonikk.org