abo-abo / oremacs

My Emacs config
https://oremacs.com/
296 stars 33 forks source link

magit related keys - calling `magit-status` #16

Closed srustamo closed 7 years ago

srustamo commented 7 years ago

I see a bunch of magit-mode-map related keybindings, but I don't see how you actually call magit-status, for instance?

abo-abo commented 7 years ago

μm, with μ bound to headlong-bookmark-jump.

srustamo commented 7 years ago

Thank you.

srustamo commented 7 years ago

I suppose to use function as a bookmark you need bookmark+. el package? I don't see any trace of this package in this repo except here

abo-abo commented 7 years ago

Here's the full bookmark entry:

("m:  magit"
 (filename . "   - no file -")
 (position . 0)
 (function . bmk/magit-status)
 (handler . bmk/function))

The referenced functions are defined in auto.el.

srustamo commented 7 years ago

So, function bookmarks can be set with stock bookmark.el? Or do you still require bookmark+.el?

abo-abo commented 7 years ago

You can use stock bookmark.el.

srustamo commented 7 years ago

I suppose one manually adds this entry to the bookmark file defined in bookmark-default-file? If so, the format of existing entries does not exactly follow your bookmark entry earlier.

Here's what the format of this file on my system (first entry):

;;;; Emacs Bookmark Format Version 1 ;;;;
;;; This format is meant to be slightly human-readable;
;;; nevertheless, you probably don't want to edit it.
;;; -*- End Of Bookmark File Format Version Stamp -*-
(#1=(#("ranger-m" 0 8
      (bmkp-full-record #1#))
    (buffer-name . "org")
    (front-context-string . "25_02_2015-routi")
    (rear-context-string . "1K Feb 25  2015 ")
    (front-context-region-string)
    (rear-context-region-string)
    (visits . 0)
    (time . #2=(22756 44184 631615 0))
    (created . #2#)
    (position . 4509)
    (filename .
              #("/Users/s3/Dropbox/org/" 0 26
                (face ivy-virtual)))
    (dired-directory . "~/Dropbox/org/")
    (dired-marked "/Users/s3/Dropbox/org/25_02_2015-routing-protocol.jpg")
    (dired-switches . "-alGh")
    (dired-subdirs)
    (dired-hidden-dirs)
    (handler . bmkp-jump-dired))
srustamo commented 7 years ago

It looks like this format was there from bookmark+.el. Starting fresh with adding your snippet above works.

So, you manually add functions like this, or use a helper function as in 'bookmark+.el'?

abo-abo commented 7 years ago

So, you manually add functions like this, or use a helper function as in 'bookmark+.el'?

I used bookmark+ in the past. Then I used a function that you found to stip unused stuff from it and use it with plain bookmark. I haven't added more functional bookmarks in a year, counsel-M-x and hydra serve better for it. But I could add function bookmarks manually in the future.

One more argument against bookmark+ is that it's sourced on emacswiki.

srustamo commented 7 years ago

One more argument against bookmark+ is that it's sourced on emacswiki.

It looks like it is on melpa, and sourced from there, unless you mean something else.

abo-abo commented 7 years ago

It looks like it is on melpa, and sourced from there, unless you mean something else.

The argument on reddit recently pointed out that although it's on melpa, the pull is automatic, and anyone can edit the file on emacswiki for possibly malicious purposes.

srustamo commented 7 years ago

Thank you.