From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sharon Kimble Newsgroups: gmane.emacs.help Subject: Re: how to use 'easy-menu'? Date: Sat, 29 Nov 2014 14:11:47 +0000 Message-ID: <87lhmum6zg.fsf@skimble.plus.com> References: <87k32fcqnr.fsf@skimble.plus.com> <61fc0ec8-c5ac-4178-8405-b3d839a37838@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1417270348 18645 80.91.229.3 (29 Nov 2014 14:12:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Nov 2014 14:12:28 +0000 (UTC) Cc: help-gnu-emacs To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 29 15:12:23 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xuiky-00081H-Md for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Nov 2014 15:12:16 +0100 Original-Received: from localhost ([::1]:47778 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xuiky-0005dw-3Q for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Nov 2014 09:12:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xuiki-0005de-MZ for help-gnu-emacs@gnu.org; Sat, 29 Nov 2014 09:12:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xuike-0002XH-47 for help-gnu-emacs@gnu.org; Sat, 29 Nov 2014 09:12:00 -0500 Original-Received: from avasout04.plus.net ([212.159.14.19]:36361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xuikd-0002X1-Qo for help-gnu-emacs@gnu.org; Sat, 29 Nov 2014 09:11:56 -0500 Original-Received: from london ([46.208.49.40]) by avasout04 with smtp id MSBt1p0040s20Ky01SBu41; Sat, 29 Nov 2014 14:11:54 +0000 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=ZuVjKrLG c=1 sm=1 tr=0 a=TFhflJmy72J+D2HLcJUc6g==:117 a=TFhflJmy72J+D2HLcJUc6g==:17 a=0Bzu9jTXAAAA:8 a=AesOsg4oJXAA:10 a=EBOSESyhAAAA:8 a=yPCof4ZbAAAA:8 a=LlzXLoV6AAAA:8 a=xtERp6CFAAAA:8 a=iI7HsYTVAAAA:8 a=mZSl69lzkfUB8uUW_EkA:9 a=7Y5Esu3ysJnXwwn-:21 a=22O5qVgae0nZNU02:21 a=QEXdDO2ut3YA:10 a=mBqnyly3mNpEDz1Os04A:9 X-AUTH: skimble:2500 User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 212.159.14.19 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:101293 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Drew Adams writes: >> I have an easy-menu menu that works under org-mode, but I would now >> like to use it emacs-wide, i.e. have it available when I=E2=80=99m using >> latex, or a shell-script, anywhere really. > > I don't have an answer for you. But after you get the answer, if > you think that is was understandable that you were not able to > find it easily by consulting the doc, then consider reporting a > doc-improvement request: `M-x report-emacs-bug', explaining what > was missing or confusing to you. Thanks Drew, I've partially solved it. This is now my working actual working code - =2D-8<---------------cut here---------------start------------->8--- #+BEGIN_SRC emacs-lisp (easy-menu-define sk-menu global-map "menu" '("Mono" ("Misc" ;; submenu ["Wrap Text" auto-fill-mode] ["List packages for update" paradox-list-packages] ["Get colours" list-colors-display] ["Delete this file" delete-this-file] ["? stack-overflow" howdoi-query] ["shell" shell] ["password-vault" password-vault] ["Start org-mode" org-mode] ["insert drawer" org-insert-property-drawer] ["new buffer" xah-new-empty-buffer] ["w3m open new site" w3m-open-site] ["w3m buffer to org-style" w3m-get-buffer-with-org-style] ["new latex" fc-insert-latex-skeleton] ["cleanup buffer" buffer-cleanup] ["toggle page lines" linum-mode] ) ("Clock" ;; submenu ["In" org-clock-in] ["Out" org-clock-out] ["Resolve" org-resolve-clocks] ["Goto" org-clock-goto] ) ("Agenda" ;; submenu ["Regular View" org-agenda-list] ["Show Agenda" org-agenda] ) ("Org2blog" ;; submenu ["New entry" org2blog/wp-new-entry] ["Push draft" org2blog/wp-post-buffer] ["Publish" org2blog/wp-post-buffer-and-publish] ) ("Words" ;; submenu ["dictionary" words-dictionary] ["thesaurus" words-thesaurus] ["google" words-google] ["wikipedia search" wikipedia-search] ) )) (easy-menu-add-item nil '("Tools") sk-menu "Mono") #+END_SRC =2D-8<---------------cut here---------------end--------------->8--- This now shows as below, and also added on to the "Tools" menu at the very bottom, plus it is now global! When it shows in the menu list of items, clumsily put, I mean in this continuance - "Mono,Imenu,Org,etc" , but *always* at the extreme left. I haven't yet found a way of positioning it better, although the second easymenu is always close to the "current mode||common menus" divide. =2D-8<---------------cut here---------------start------------->8--- Mono |- Misc |- Clock |- Agenda |- Org2blog |- Words =2D-8<---------------cut here---------------end--------------->8--- The other type of menu that 'easymenu' can create takes the form of a long list where you can choose one item, but this one *cannot* have nested menus. This is the one that handles my theme choice with this as the code - =2D-8<---------------cut here---------------start------------->8--- (add-to-list 'custom-theme-load-path (file-name-as-directory "/home/boudiccas/git/replace-colorthemes")) (add-to-list 'custom-theme-load-path "/home/boudiccas/.emacs.d/themes") (add-to-list 'custom-theme-load-path "/home/boudiccas/.emacs.d/elpa") ;; set up a variable and initialize it (defvar tj-current-theme 'flatui "Current Color Theme") ;; Install the default scheme (load-theme tj-current-theme t) ;; Function to first disable current theme, then create ;; and install a new one (defun tj-load-theme (new-theme) "Disable existing themes before loading new theme" (interactive) (disable-theme tj-current-theme) (setq tj-current-theme new-theme) (load-theme tj-current-theme)) ;; Example menu (easy-menu-add-item ;; console nil nil (easy-menu-create-menu "Theme" '(["1) Dark - Goldenrod" (tj-load-theme 'goldenrod) :active t] ["2) Dark - Darkest midnight" (tj-load-theme 'darkest-midnight) :active = t] ["3) Dark - soft-morning" (tj-load-theme 'soft-morning) :active t] ["4) Light - darkest-dawn" (tj-load-theme 'darkest-dawn) :active t] ["5) Light - Wheat" (tj-load-theme 'wheat) :active t] ["6) Dark - Smyx" (tj-load-theme 'smyx) :active t] ["7) Light - monokai" (tj-load-theme 'monokai) :active t] ["8) Dark - dark-emacs" (tj-load-theme 'dark-emacs) :active t] ["9) Dark - pok-wob" (tj-load-theme 'pok-wob) :active t] ["10) clues" (tj-load-theme 'clues) :active t] ["11) soft-stone" (tj-load-theme 'soft-stone) :active t] ))) #+end_src =2D-8<---------------cut here---------------end--------------->8--- But this one cannot have nested items/sections, it just has a straight list. I would love to be proved wrong in both of these cases, i.e., the straight list + nested items/sections, and the positioning of the nested list. Sharon. =2D-=20 A taste of linux =3D http://www.sharons.org.uk my git repo =3D https://bitbucket.org/boudiccas/dots TGmeds =3D http://www.tgmeds.org.uk Debian testing, fluxbox 1.3.5, emacs 24.4.1.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJUedQkAAoJEDaBgBkK+INb7dsP/2dCYj5YrOqzzz4N6o8o4hd6 GOGn702jjBEm07uQLw9/1J1QjGUBYXjskiA7lp1ito8rpp2JHBnQ7ZTZwbjmrlGu 0YXtR8Tk7Lv1vK0pi2Mj1AMzt1ng6H7dJr/G/tv5uGJxE+Rj/J62GdWTqUughrUa bKCU75rTPODsb7HHSXwbJGPcZ1b/Fyy7VFr+UNoBwV8GEKCw730KFFEeDkwmj53d 1enBeC/9OIdoHELHomwY20/bmE0kR2RBB+tKr3sqmYTSPetRVAeGZGxH44DfOAAz +UXgDBLcnm2VfpBc05vM9mVBkgIwmHsxYurT2tUZJ7Km4Guu7Nc7uer6BlIu9aSW jMymAnJIIje8/YveY2bxSRTu1bo1nUqcIxLxruB/GX6HcM2v0voqhMZNTdjy64WA krNbf5dYMQJJN76evv8kq5q+nIYjej+x5ukgJw+v7Y/eYfshJWiCW7a/GvMy9Tyl THCqAyMzPIwCT4I02TQ/BGS9F8ghvCkB99yvY9uHoNcoIA1UHmYw9tDe/y5MT1a6 n41JlBkfrS6mdfTdjoHUnacanavTsrpbg23lDUXLwcTCqMRpdXCMAVMyLyojmtzS /+P18/78Y/YSlfngpFuptuXIPkmrNdgKhx5DcFaCk8AcUlTnod+hSsivKS6c+/T8 8DsNx8vw8F2aK9+/vPfC =Yo0a -----END PGP SIGNATURE----- --=-=-=--