From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: Is it possible to set a "goal column" for 'beginning-of-line'? Date: 22 Nov 2005 10:29:30 -0800 Organization: http://groups.google.com Message-ID: <1132684170.693714.45920@g49g2000cwa.googlegroups.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1132685108 31153 80.91.229.2 (22 Nov 2005 18:45:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 22 Nov 2005 18:45:08 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Nov 22 19:45:08 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eed45-0008EK-Tq for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Nov 2005 19:40:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eed45-000158-8c for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Nov 2005 13:40:25 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!g49g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: 198.74.20.73 Original-X-Trace: posting.google.com 1132684175 22843 127.0.0.1 (22 Nov 2005 18:29:35 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 22 Nov 2005 18:29:35 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g49g2000cwa.googlegroups.com; posting-host=198.74.20.73; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:135657 Original-To: help-gnu-emacs@gnu.org 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:31260 Archived-At: Herbert Euler wrote: > Hello everyone, > > The command 'beginning-of-line' moves point to column 0 > by default. Is it possible to set a "goal column," so that > this command moves point to that column, e.g. column 7, > rather than 0? The content before such column will become > irreachable in this situation (but it might still be displayed). > > In another word, is there a vertical version of narrowing > (but perhaps don't try to hide something)? This would do what you want globally. I tried it and it seems dangerous. (defun avoid-columns-1-7 () (when (< (current-column) 7) (move-to-column 7 t))) (add-hook 'post-command-hook 'avoid-columns-1-7) You probably want to limit it to a mode by using a more restrictive `when' condition like this: (and (string= mode-name "FOO") (< (current-column) 7)) Or maybe having it look at some variable that you can toggle.