From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: Bookmark the end of file? Date: Tue, 07 Apr 2015 21:19:07 +0200 Message-ID: <877ftnhhlg.fsf@wmi.amu.edu.pl> References: <87vbh8hlns.fsf@wmi.amu.edu.pl> <20150406170005.16781930@zothique.localdomain> <87sicchhen.fsf@wmi.amu.edu.pl> <20150407094947.3383cafe@zothique.localdomain> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1428434381 14324 80.91.229.3 (7 Apr 2015 19:19:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Apr 2015 19:19:41 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: ddsnell@frontier.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 07 21:19:34 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1YfZ25-0000Mk-Rr for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Apr 2015 21:19:34 +0200 Original-Received: from localhost ([::1]:48418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfZ25-00048n-3E for geh-help-gnu-emacs@m.gmane.org; Tue, 07 Apr 2015 15:19:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfZ1s-00048d-HL for help-gnu-emacs@gnu.org; Tue, 07 Apr 2015 15:19:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfZ1n-0000Gi-Jx for help-gnu-emacs@gnu.org; Tue, 07 Apr 2015 15:19:20 -0400 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:43193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfZ1n-0000BL-9D for help-gnu-emacs@gnu.org; Tue, 07 Apr 2015 15:19:15 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id CF7255BABF; Tue, 7 Apr 2015 21:19:12 +0200 (CEST) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OEGw8M0ONY-M; Tue, 7 Apr 2015 21:19:12 +0200 (CEST) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 3EAED5BAB8; Tue, 7 Apr 2015 21:19:12 +0200 (CEST) In-reply-to: <20150407094947.3383cafe@zothique.localdomain> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103562 Archived-At: On 2015-04-07, at 18:49, Dale Snell wrote: > On Tue, 07 Apr 2015 03:10:56 +0200, in message > 87sicchhen.fsf@wmi.amu.edu.pl, Marcin Borkowski wrote: > >> But putting stupid jokes aside, if I /always/ hit M-> after visiting >> some file, something is not optimal, right? And bookmarks are >> a convenient way to visit often-used files, regardless if the >> directory I'm in. (And I have a rather deep directory structure - I >> have virtually no files until two levels down, and usually there are >> three or four. OTOH, there are no more than maybe two-three dozen of >> files I'm working on at any particular moment. This is a perfect use >> case for bookmarks.) > > Are these files of a type that can take comments? If so, you > could try adding a file-local variable to each one, telling Emacs > to go to the end of the file. Another possibility is to Customize > the "find-file-hook" to do what you want. (Despite its name, > find-file-hook is a "List of functions to be called after a buffer > is loaded from a file." [From the documentation.]) Nice idea (I mean, file-local vars). Bookmarks, however, have one advantage: I can visit bookmarked files from any directory, without having to specify the path. And I like putting the "jump-to-the-end" functionality into the bookmark better than in file-local variables, since then visiting a file with C-x C-f has uniform semantics of, well, visiting the file, and jumping to a bookmark has a uniform semantics of, well, visiting the file /in the place I'm interested in/ (after all, this is what bookmarks are for). It just happens that for some files the "interesting" place is the EOF. Customizing find-file-hook seems a dirty hack, since I want this behavior only for few files. > Hmm... Now that I think about it, I seem to recall someone on this > list asking if one could create a command-line option to do what > you're asking. "emacs --exec () filename", or > something like that. Of course, it would only work with the > file(s) on the command line. (If you were the one who asked that > question, I'm going to feel very silly.) I vaguely remember that discussion (and no, it wasn't me). Not my use case - I want it from within Emacs. >> PS. BTW, the other bindings you mentioned are useless for me: I have >> my menu-bar disabled (ok, I /could/ use M-x menu-bar-open...), and >> don't have an key on my netbook. > > That's okay; while I do have the menu-bar active, I never use it > to go to the end or beginning of the file -- M-> is so much > simpler to type. As for the key, I've never used it. :-) I have a small netbook, so every pixel of screen real estate is precious for me. No menus, no toolbar, no window decorations (I use a tiling WM). I even changed the mode-line face to a smaller one. (Incidentally, more things than the mode-line use the mode-line face, btw.) > I don't know if any of this will help, but maybe it will point you > in the right direction. > > --Dale Thanks for your suggestions, even if I won't use them - they might be of use for someone else! Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University