help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bookmark the end of file?


From: Marcin Borkowski
Subject: Re: Bookmark the end of file?
Date: Tue, 07 Apr 2015 21:19:07 +0200

On 2015-04-07, at 18:49, Dale Snell <ddsnell@frontier.com> 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 (<go to eof>) 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 <end> 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 <End> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]