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: J. David Boyd
Subject: Re: Bookmark the end of file?
Date: Tue, 07 Apr 2015 09:36:32 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (cygwin)

Marcin Borkowski <address@hidden> writes:

> On 2015-04-07, at 02:00, Dale Snell <address@hidden> wrote:
>
>> On Tue, 07 Apr 2015 01:39:03 +0200, in message
>> address@hidden, Marcin Borkowski wrote:
>>
>>> Hi all,
>>>
>>> how to set a bookmark to the end of some file (IOW, (point-max))?  (Of
>>> course it is possible with Bookmark+, but is there any UI for that
>>> there?  Is it at all possible with vanilla bookmarks?)
>>>
>>> My use case is a file which I visit (almost) every day to /add/
>>> something to its end (e.g., a ledger file).  I can imagine other,
>>> similar uses for that, too.
>>
>>
>> Marcin,
>>
>> Why not use "M->" ((end-of-buffer &optional ARG), which is also
>> bound to "C-end", and <menu-bar> <edit> <goto> <end-of-buffer>)?
>> There's no need to set up a bookmark, or other bit of programming.
>>
>> The reverse operation is bound to "M-<" ("C-home", etc).
>
> Well, thinking in that direction, I don't need Emacs at all: a magnetic
> needle and a steady hand is all that is really necessary. ;-)
>
> 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.)
>
>> --Dale
>
> But thanks anyway!
>
> 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.


Why not define a function to do what you want, then bind it to a keystroke?

I have stuff like

  (defun open-personal()
    (interactive) (progn(find-file 
"~/org/personal/personal.org")(end-of-buffer)))

and then with

  (bind-key (kbd "H-M-p") 'open-personal)


I can open my file and go where I want to with a keypress.

Dave




reply via email to

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