all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* changing bookmark entry
@ 2006-04-17  6:33 Mike Ballard
  2006-04-17 15:35 ` B. T. Raven
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mike Ballard @ 2006-04-17  6:33 UTC (permalink / raw)



In ~/.emacs.bnk I have a bookmark which opens an existing file; the file
is continually being written to by another source.  So the line the
bookmark code set to open the file to originally, is now way up near the
top of this growing file whenever I open this bookmark.

How can I change the ~/.emacs.bmk entry to make it always open this
bookmarked file and position point at the end of the buffer instead?

Here's the code as it is now:

(("bookmark title"
  ((filename . "<path to some file>")
   (front-context-string . " 18:32:29 EDT 20")
   (rear-context-string . "t)  - Sat Apr 08")
   (position . 8154)))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: changing bookmark entry
  2006-04-17  6:33 changing bookmark entry Mike Ballard
@ 2006-04-17 15:35 ` B. T. Raven
  2006-04-17 16:34 ` Kevin Rodgers
       [not found] ` <mailman.506.1145291768.9609.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: B. T. Raven @ 2006-04-17 15:35 UTC (permalink / raw)



"Mike Ballard" <dont_w@nt_spam.org> wrote in message
news:m264l8k637.fsf@west_f1.net...
>
> In ~/.emacs.bnk I have a bookmark which opens an existing file; the file
> is continually being written to by another source.  So the line the
> bookmark code set to open the file to originally, is now way up near the
> top of this growing file whenever I open this bookmark.
>
> How can I change the ~/.emacs.bmk entry to make it always open this
> bookmarked file and position point at the end of the buffer instead?
>
> Here's the code as it is now:
>
> (("bookmark title"
>   ((filename . "<path to some file>")
>    (front-context-string . " 18:32:29 EDT 20")
>    (rear-context-string . "t)  - Sat Apr 08")
>    (position . 8154)))
>
>

Maybe you don't need a bookmark then but just a macro that visits that
file and moves point to the end. Here's an example:

C-x ( C-x C-f d:/mydocu~1/dribdrab <ret> M-> C-x ) <ret> ;; define kbd
macro

M-x name-last-kbd-macro <ret> dribdrab

C-x C-f ;; visit your .emacs

move to where you want the macro definition inserted...

M-x insert-kbd-macro <ret> dribdrab

this produces:

(fset 'dribdrab
   [?\C-x ?\C-f ?d ?: ?/ ?m ?y ?d ?o ?c ?u ?~ ?1 ?/ ?d ?r ?i ?b ?d ?r ?a
?b return ?\M->])

Then you can M-x dribdrab or set dribdrab to a key if you want. I set it
with defalias:

(defalias 'ddb 'dribdrab) for invocation with M-x ddb.

Just change the names to protect the innocent on your system.

Ed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: changing bookmark entry
  2006-04-17  6:33 changing bookmark entry Mike Ballard
  2006-04-17 15:35 ` B. T. Raven
@ 2006-04-17 16:34 ` Kevin Rodgers
       [not found] ` <mailman.506.1145291768.9609.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2006-04-17 16:34 UTC (permalink / raw)


Mike Ballard wrote:
> In ~/.emacs.bnk I have a bookmark which opens an existing file; the file
> is continually being written to by another source.  So the line the
> bookmark code set to open the file to originally, is now way up near the
> top of this growing file whenever I open this bookmark.
> 
> How can I change the ~/.emacs.bmk entry to make it always open this
> bookmarked file and position point at the end of the buffer instead?
> 
> Here's the code as it is now:
> 
> (("bookmark title"
>   ((filename . "<path to some file>")
>    (front-context-string . " 18:32:29 EDT 20")
>    (rear-context-string . "t)  - Sat Apr 08")
>    (position . 8154)))

(goto-char POSITION) will move point to the end of the buffer if
POSITION is greater than (point-max).  So choose the largest possible
buffer position on your platform:

(defconst most-positive-fixnum (eval '(lsh -1 -1)))

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: changing bookmark entry
       [not found] ` <mailman.506.1145291768.9609.help-gnu-emacs@gnu.org>
@ 2006-04-18 19:55   ` Mike Ballard
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Ballard @ 2006-04-18 19:55 UTC (permalink / raw)



On Tue Apr 18, I was peacefully napping until Kevin Rodgers said:

> Mike Ballard wrote:
> > In ~/.emacs.bnk I have a bookmark which opens an existing file; the file
> > is continually being written to by another source.  So the line the
> > bookmark code set to open the file to originally, is now way up near the
> > top of this growing file whenever I open this bookmark.
> > How can I change the ~/.emacs.bmk entry to make it always open this
> > bookmarked file and position point at the end of the buffer instead?
> > Here's the code as it is now:
> > (("bookmark title"
> >   ((filename . "<path to some file>")
> >    (front-context-string . " 18:32:29 EDT 20")
> >    (rear-context-string . "t)  - Sat Apr 08")
> >    (position . 8154)))
> 
> (goto-char POSITION) will move point to the end of the buffer if
> POSITION is greater than (point-max).  So choose the largest possible
> buffer position on your platform:
> 
> (defconst most-positive-fixnum (eval '(lsh -1 -1)))
> 

Thanks so much!!  

I couldn't figure out how to use the defconst/var stuff w/o 'integer-p'
kinds of errors so I just did '(position . NNN+)', removed the context
strings and it works perfectly (file size will never get this big anyway
so seems perfectly satisfactory to me; I'm assuming the 'lsh' thing is for
some reason returning an invalid value)...

Mike
-- 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-04-18 19:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-17  6:33 changing bookmark entry Mike Ballard
2006-04-17 15:35 ` B. T. Raven
2006-04-17 16:34 ` Kevin Rodgers
     [not found] ` <mailman.506.1145291768.9609.help-gnu-emacs@gnu.org>
2006-04-18 19:55   ` Mike Ballard

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.