From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: RAYHAN MUKTADER Newsgroups: gmane.emacs.help Subject: Re: How to set line wrap Date: Tue, 22 Dec 2009 06:21:20 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <76d3932e-13dd-40e7-b05a-d14eeac56574@q16g2000vbc.googlegroups.com> <87aaxbp437.wl%anselm.helbig+news2009@googlemail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1261502326 12000 80.91.229.12 (22 Dec 2009 17:18:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Dec 2009 17:18:46 +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 18:18:39 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 1NN8NZ-0000LD-J9 for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Dec 2009 18:18:37 +0100 Original-Received: from localhost ([127.0.0.1]:35026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NN8NZ-0007hU-HY for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Dec 2009 12:18:37 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!h2g2000vbd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 77 Original-NNTP-Posting-Host: 24.0.112.198 Original-X-Trace: posting.google.com 1261491680 22622 127.0.0.1 (22 Dec 2009 14:21:20 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 22 Dec 2009 14:21:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h2g2000vbd.googlegroups.com; posting-host=24.0.112.198; posting-account=OT4QewoAAAC2yYcxiQu3UX05RaZ6OV1r User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 (.NET CLR 3.5.30729), gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:175724 X-Mailman-Approved-At: Tue, 22 Dec 2009 12:18:13 -0500 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:70804 Archived-At: On Dec 22, 7:48=A0am, Anselm Helbig wrote: > 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, =A0My 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 =A0but I did not see any difference. > > Two things. See the docs for fill-column: > > =A0 fill-column is a variable defined in `C source code'. > =A0 Its value is 70 > > =A0 =A0 Automatically becomes buffer-local when set in any fashion. > =A0 =A0 This variable is safe as a file local variable if its value > =A0 =A0 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: > > =A0 (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 f= or > certain major modes, e.g. to turn it on for latex-mode you'd add this > to your .emacs: > > =A0 (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 Thank you for your reply. I have already tried C-u 5 C-x f. It did not do anything. Are you recommending that I put the following in my ~/.emacs? (setq-default fill-column 5) (add-hook 'php-mode-hook 'turn-on-auto-fill) I've never tried to personalize Emacs before. So, please correct me if I am making a mistake.