简体   繁体   中英

How to apply changes to emacs .el files

How to apply changes to emacs .el files?

I've done the following:

  1. # locate buff-menu

/usr/share/emacs/22.1/lisp/buff-menu.el.gz
/usr/share/emacs/22.1/lisp/buff-menu.elc

  1. Modify /usr/share/emacs/22.1/lisp/buff-menu.el.gz - add some custom letters in Buffer-menu-select doc section.

  2. # rm /usr/share/emacs/22.1/lisp/buff-menu.elc

  3. Byte compile /usr/share/emacs/22.1/lisp/buff-menu.el.gz

Start emacs and see old description for Buffer-menu-select

We could more easily answer you if you tell us what exactly you want to do. The fact is the correct way to customize Emacs is never to change the .el in Emacs system libraries.

  • to change a defun you can:

    • use an advice (look at the documentation of defadvice )
    • use a new defun that you will eval in an eval-after-load

       (eval-after-load 'buff-menu '(defun Buffer-menu-mark () "do nothing" (interactive))) 
  • to add a key binding you can again use eval-after-load :

      (eval-after-load 'buff-menu '(define-key Buffer-menu-mode-map "M" 'Buffer-menu-mark)) 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM