From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.devel Subject: poplife-mode Date: Sun, 5 Nov 2017 10:00:06 +0900 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_79348C26-CF61-4E10-8F80-555960630B91" X-Trace: blaine.gmane.org 1509843587 8316 195.159.176.226 (5 Nov 2017 00:59:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 5 Nov 2017 00:59:47 +0000 (UTC) Cc: Kunihiro Tak To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 05 01:59:39 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eB9Hl-0001MR-ED for ged-emacs-devel@m.gmane.org; Sun, 05 Nov 2017 01:59:38 +0100 Original-Received: from localhost ([::1]:42636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eB9Hq-0002k6-UL for ged-emacs-devel@m.gmane.org; Sat, 04 Nov 2017 20:59:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eB9Hh-0002jp-QN for emacs-devel@gnu.org; Sat, 04 Nov 2017 20:59:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eB9He-0003sH-Mk for emacs-devel@gnu.org; Sat, 04 Nov 2017 20:59:33 -0400 Original-Received: from mxl065v65.mxlogic.net ([208.81.65.65]:43410 helo=s14p02o142.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eB9Hd-0003qX-Fg for emacs-devel@gnu.org; Sat, 04 Nov 2017 20:59:30 -0400 Original-Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o142.mxlogic.net(mxl_mta-8.5.0-1883) over TLS secured channel with ESMTP id 9626ef95.0.53144.00-393.107526.s14p02o142.mxlogic.net (envelope-from ); Sat, 04 Nov 2017 18:59:21 -0600 (MDT) X-MXL-Hash: 59fe62695f4aae05-395c7fe821b3cf62435800c0363913c3dfa9d70c Original-Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 54e3_4f14_64f230d1_a270_44eb_bca3_4709f13a497a; Sun, 05 Nov 2017 09:59:15 +0900 Original-Received: from [192.168.1.51] (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id A0D7F4C0B32; Sun, 5 Nov 2017 09:59:15 +0900 (JST) X-Mailer: Apple Mail (2.1878.6) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 5 Rules triggered EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_RB_PASS=0, EDT_SA_TS_PASS=0, RV6151=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6151> : inlines <6156> : streams <1769366> : uri <2528302> X-AnalysisOut: [v=2.2 cv=PP1/wbiC c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=sC3jslCIGhcA:10 a=VAO] X-AnalysisOut: [ownwzmRMlZSjGc18A:9 a=CjuIK1q_8ugA:10 a=TtDHjFxgljz1kN7Gw2] X-AnalysisOut: [EA:9 a=qaz0FYm14BQA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017110410); S=0.489(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 208.81.65.65 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219928 Archived-At: --Apple-Mail=_79348C26-CF61-4E10-8F80-555960630B91 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii With following line, one can cut and paste text using a pop-up menu triggered by right click. (define-key global-map [mouse-3] menu-bar-edit-menu) I noticed that menu-bar items that lead visiting files, buffers, frames, bookmarks, and recentf can be gathered into a pop-up menu. I wrote a minor mode `poplife' that provides an integrated pop-up menu triggered by right click. Also this minor mode offers contextual pop-up menus. When a thing under mouse click is file/directory, word, and url, this provides pop-up menus of list of files, candidates of words, and url-opening-menu, respectively. (require 'poplife) (setq poplife-word-flag t) (setq poplife-url-flag t) (setq poplife-edit-cottager '(:imenu t :buffer t :frame t :bookmark t = :recentf t)) (poplife-mode 1) Contextual pop-up menu by right click is very common interface nowadays and I propose to include this (or something like this) to Emacs. --Apple-Mail=_79348C26-CF61-4E10-8F80-555960630B91 Content-Disposition: attachment; filename=poplife.el Content-Type: application/octet-stream; name="poplife.el" Content-Transfer-Encoding: quoted-printable ;;;=20poplife.el=20---=20Pop=20files=20up=20on=20mouse=20click=0A=0A;;=20= Author:=20Tak=20Kunihiro=20=0A;;=20Keywords:=20= mouse=0A;;=20Package:=20emacs=0A=0A;;=20This=20file=20is=20NOT=20part=20= of=20GNU=20Emacs.=0A=0A;;=20This=20program=20is=20free=20software:=20you=20= can=20redistribute=20it=20and/or=20modify=0A;;=20it=20under=20the=20= terms=20of=20the=20GNU=20General=20Public=20License=20as=20published=20= by=0A;;=20the=20Free=20Software=20Foundation,=20either=20version=203=20= of=20the=20License,=20or=0A;;=20(at=20your=20option)=20any=20later=20= version.=0A=0A;;=20This=20program=20is=20distributed=20in=20the=20hope=20= that=20it=20will=20be=20useful,=0A;;=20but=20WITHOUT=20ANY=20WARRANTY;=20= without=20even=20the=20implied=20warranty=20of=0A;;=20MERCHANTABILITY=20= or=20FITNESS=20FOR=20A=20PARTICULAR=20PURPOSE.=20=20See=20the=0A;;=20GNU=20= General=20Public=20License=20for=20more=20details.=0A=0A;;=20You=20= should=20have=20received=20a=20copy=20of=20the=20GNU=20General=20Public=20= License=0A;;=20along=20with=20this=20program.=20=20If=20not,=20see=20= .=0A=0A;;=20Usage:=0A;;=0A;;=20To=20= interactively=20toggle=20the=20mode:=0A;;=0A;;=20=20=20M-x=20= poplife-mode=20RET=0A;;=0A;;=20To=20make=20the=20mode=20permanent,=20put=20= these=20in=20your=20init=20file:=0A;;=0A;;=20=20=20(require=20'poplife)=0A= ;;=20=20=20(poplife-mode=201)=0A=0A;;;=20Commentary:=0A;;=0A;;=20This=20= package=20pops=20contextual=20menu=20triggered=20by=20right=20click.=20=20= On=20a=0A;;=20click,=20depending=20on=20a=20thing=20under=20the=20mouse=20= event,=20(1)=0A;;=20FILE/DIRECTORY=20menu,=20(2)=20WORD=20menu,=20(3)=20= URL=20menu,=20or=20(4)=20EDIT=20menu=0A;;=20will=20be=20popped.=20=20The=20= edit=20menu=20lets=20you=20revise=20buffer=20and=20visit=20a=0A;;=20file=20= in=20a=20directory.=20=20As=20an=20option,=20the=20edit=20menu=20also=20= lets=20you=0A;;=20jump=20by=20iMenu,=20switch=20to=20a=20buffer,=20= switch=20to=20a=20frame,=20visit=20a=0A;;=20bookmark,=20and=20visit=20a=20= recent=20file.=20=20The=20four=20menus=20are=20detailed=20as=0A;;=20= below.=0A;;=0A;;=20(1)=20FILE/DIRECTORY=20menu=0A;;=0A;;=20List=20= how-to-open-a-file=20menu=20or=20files=20in=0A;;=20default-directory=20= under=20a=20mouse=20event.=0A;;=0A;;=20(2)=20WORD=20menu=0A;;=0A;;=20Pop=20= word=20candidates=20when=20word=20under=20a=20mouse=20event=20is=20= incorrect,=0A;;=20when=20`poplife-word-flag'=20is=20non-nil.=0A;;=0A;;=20= (3)=20URL=20menu=0A;;=0A;;=20Pop=20how-to-open-an-url=20menu=20under=20a=20= mouse=20event,=20when=0A;;=20`poplife-url-flag'=20is=20non-nil.=0A;;=0A= ;;=20(4)=20EDIT=20menu=0A;;=0A;;=20List=20basic=20edition-commands,=20= optional=20edition-commands,=0A;;=20and=20visiting=20menus.=0A;;=0A;;=20= Basic=20edition-commands=20are=20defined=20by=20`poplife-edit-cmd-0'.=0A= ;;=0A;;=20Optional=20edition-commands=20are=20defined=20by=20= `poplife-edit-cmd-1'.=0A;;=20with=20format=20similar=20to=20= `recentf-menu-items-for-commands'.=0A;;=0A;;=20Visiting=20menu=20to=20= visit=20files=20in=20default-directory=20is=20included=20by=0A;;=20= default.=20=20To=20include=20a=20series=20of=20visiting=20menus,=20set=20= each=20item=20of=0A;;=20`poplife-edit-cottager'=20to=20non-nil,=20as=20= listed=20below.=0A;;=0A;;=20=20:buffer=20=20=20=20=20List=20buffers=20by=20= `global-buffers-menu-map'.=0A;;=20=20:imenu=20=20=20=20=20=20List=20= table=20of=20contents=20of=20current=20buffer=20by=20iMenu.=0A;;=20=20= :frame=20=20=20=20=20=20List=20frames=20by=20`global-buffers-menu-map'.=0A= ;;=20=20:bookmark=20=20=20List=20bookmarks=20by=20`bookmark-all-names'.=0A= ;;=20=20:recentf=20=20=20=20List=20recent=20files=20by=20= `recentf-menu-elements'.=0A=0A;;;=20References=0A=0A;;=20Following=20= discussions=20were=20referred=20to=20paste=20text=20with=20erasing=0A;;=20= active=20region.=0A;;=0A;;=20= http://lists.gnu.org/archive/html/bug-gnu-emacs/2017-07/msg00086.html=0A= ;;=20http://lists.gnu.org/archive/html/emacs-devel/2017-07/msg00796.html=0A= ;;=0A;;=20Following=20codes=20from=20Emacs=20core=20are=20useful=20for=20= development.=0A;;=0A;;=20(define-key=20global-map=20[mouse-3]=20= menu-bar-edit-menu)=0A;;=20(popup-menu=20menu-bar-edit-menu)=0A;;=20= (popup-menu=20(mouse-menu-bar-map))=0A;;=20(popup-menu=20= (mouse-menu-major-mode-map))=0A;;=20(popup-menu=20menu-bar-bookmark-map)=0A= ;;=20(popup-menu=20global-buffers-menu-map)=0A;;=20(define-key=20= global-map=20[mouse-3]=20'mouse-buffer-menu)=0A;;=20(buffer-menu-open)=0A= =0A;;;=20Templates=20of=20keymap=0A;;=0A;;=20Keymaps=20from=20imenu,=20= menu-bar,=20bookmark,=20and=20recentf=20are=20united.=0A;;=20They=20are=20= formatted=20to=20be=20easymenu=20from=20standard=20keymap.=20=20Typical=0A= ;;=20easymenu=20and=20standard=20keymap=20are=20shown=20below=20for=20= convenience.=0A;;=0A;;=20(label=0A;;=20=20[label=20callback]=0A;;=20=20= (label=0A;;=20=20=20[label=20callback]=0A;;=20=20=20["--"=20=20ignore]=0A= ;;=20=20=20[label=20callback])=0A;;=20=20[label=20callback])=0A;;=0A;;=20= (keymap=0A;;=20=20label=0A;;=20=20(symbol=20menu-item=20label=20= callback)=0A;;=20=20[(label=20lambda=20nil=20(interactive)=20commands)=0A= ;;=20=20=20(label=20keymap=0A;;=20=20=20=20=20=20=20=20=20=20(symbol=20= menu-item=20label=20callback)=0A;;=20=20=20=20=20=20=20=20=20=20(symbol=20= menu-item=20label=20callback))=0A;;=20=20=20(label=20lambda=20nil=20= (interactive)=20commands)]=0A;;=20=20(symbol=20"--")=0A;;=20=20(symbol=20= menu-item=20label=0A;;=20=20=20=20=20=20=20=20=20=20(keymap=20label=0A;;=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(symbol=20menu-item=20= label=20callback)=0A;;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(symbol=20menu-item=20label=20callback)))=0A;;=20=20(symbol=20= menu-item=20label=20callback))=0A=0A;;;=20Code:=0A(defcustom=20= poplife-word-flag=20nil=0A=20=20"Popup=20words=20under=20mouse=20event=20= using=20`flyspell-correct-word'."=0A=20=20:group=20'mouse=0A=20=20:type=20= 'boolean=0A=20=20:version=20"26.1")=0A=0A(defcustom=20poplife-url-flag=20= nil=0A=20=20"Popup=20URL=20menu=20under=20mouse=20event=20using=20= `eww'."=0A=20=20:group=20'mouse=0A=20=20:type=20'boolean=0A=20=20= :version=20"26.1")=0A=0A(defcustom=20poplife-edit-cmd-0=20'(cut=20copy=20= paste=20select-paste=20paste-from-menu=20clear=20mark-whole-buffer)=0A=20= =20"Basic=20edition-commands=20in=20edit=20menu.=0AItems=20must=20be=20= one=20listed=20in=20`menu-bar-edit-menu'."=0A=20=20:group=20'mouse=0A=20=20= :type=20'(repeat=20symbol)=0A=20=20:version=20"26.1")=0A=0A(defvar=20= poplife-edit-cmd-1=0A=20=20(list=0A=20=20=20["Close"=0A=20=20=20=20= (lambda=20()=20(interactive)=0A=20=20=20=20=20=20(if=20(one-window-p)=0A=20= =20=20=20=20=20=20=20=20=20(if=20(>=20(length=20(visible-frame-list))=20= 1)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20(call-interactively=20= 'delete-frame)=0A=20=20=20=20=20=20=20=20=20=20=20=20(quit-window))=20;=20= (kill-buffer=20(window-buffer))=0A=20=20=20=20=20=20=20=20= (delete-window)))=0A=20=20=20=20:help=20"Remove=20this=20window=20or=20= kill=20this=20buffer"=0A=20=20=20=20:visible=20(not=20(region-active-p))=0A= =20=20=20=20:active=20t]=0A=20=20=20["Spell-Check"=0A=20=20=20=20= flyspell-correct-word-before-point=0A=20=20=20=20:help=20"Spell=20check=20= word=20at=20point"=0A=20=20=20=20:visible=20(and=20poplife-word-flag=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(fboundp=20= 'flyspell-correct-word-before-point)=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(not=20(region-active-p)))=0A=20=20=20=20:active=20t]=0A= =20=20=20["Spell-Check"=0A=20=20=20=20ispell-region=0A=20=20=20=20:help=20= "Spell=20check=20selected=20text"=0A=20=20=20=20:visible=20(and=20= poplife-word-flag=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (region-active-p))=0A=20=20=20=20:active=20t]=0A=20=20=20["Search=20Web"=0A= =20=20=20=20(lambda=20()=20(interactive)=0A=20=20=20=20=20=20(let=20= ((keyword=20(buffer-substring-no-properties=20(region-beginning)=20= (region-end))))=0A=20=20=20=20=20=20=20=20(switch-to-buffer-other-window=20= (generate-new-buffer=20"*eww*"))=0A=20=20=20=20=20=20=20=20(eww-mode)=0A=20= =20=20=20=20=20=20=20(eww=20keyword)))=0A=20=20=20=20:help=20"Search=20= selected=20text=20by=20online=20service"=0A=20=20=20=20:visible=20(and=20= poplife-url-flag=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (region-active-p))=0A=20=20=20=20:active=20t]=0A=20=20=20["--"=0A=20=20=20= =20ignore=0A=20=20=20=20:visible=20(and=20(region-active-p)=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20poplife-word-flag=20= poplife-url-flag))=0A=20=20=20=20:active=20t])=0A=20=20"Optional=20= commands=20in=20edit=20menu.")=0A=0A(defvar=20poplife-edit-cottager=0A=20= =20'(:imenu=20nil=20:buffer=20nil=20:frame=20nil=20:bookmark=20nil=20= :recentf=20nil)=0A=20=20"Extra=20menus=20to=20be=20included=20in=20edit=20= menu=20besides=20file.")=0A=0C=0A(defvar=20poplife-file-max-menu-items=20= 25=0A=20=20"Maximum=20number=20of=20items=20in=20file=20menu.=0ASee=20= also=20`recentf-max-menu-items',=20`buffers-menu-max-size',=20and=0A= `imenu-max-items'.")=0A=0A(defvar=20poplife-file-recursive=201=0A=20=20= "Depth=20of=20directory=20scan=20on=20directory=20menu.")=0A=0A(defvar=20= poplife-dir-do-not-scan-regexp=20"inbox"=0A=20=20"Contents=20of=20= directory=20matching=20this=20regexp=20will=20not=20be=20shown.=0A= Instead=20contents=20of=20home=20directory=20are=20displayed.")=0A=0A= (defvar=20poplife-file-do-not-show-regexp=0A=20=20= "^\\.\\.?$\\|^#\\|\\.elc\\'\\|\\.exe\\'\\|^\\.[^e]\\|\\.lnk\\'\\|\\~\\'\\|= ^desktop\\.ini\\'\\|^\\.DS_store\\'\\|^\\.dropbox\\'\\|^auto\\'\\|^ntuser\= \|^_master_\\|^_region_\\|\\.aux\\'\\|\\.bbl\\'\\|\\.blg\\'\\|\\.fdb_latex= mk\\'\\|\\.fls\\'\\|\\.lof\\'\\|\\.lot\\'\\|\\.out\\'\\|\\.toc\\'\\|\\.syn= ctex\\.gz\\'\\|\\.synctex\\.ico\\'\\|^Thumbs\\.db\\'\\|^Icon"=0A=20=20= "Filenames=20matching=20this=20regexp=20will=20not=20be=20displayed=20in=20= file=20menu.")=20;=20dired-trivial-filenames,=20dired-omit-files=0A=0A= (defvar=20poplife-file-do-not-open-regexp=0A=20=20= "\\.pdf\\'\\|\\.doc\\'\\|\\.docx\\'\\|\\.xls\\'\\|\\.xlsx\\'\\|\\.ppt\\'\\= |\\.pptx\\'\\|\\.jpg\\'\\|\\.png\\'\\|\\.tif\\'\\|\\.tiff\\'\\|\\.bmp\\'\\= |\\.aif\\'\\|\\.wav\\'\\|\\.7z\\'\\|\\.tar\\'\\|\\.dll\\'\\|\\.zip\\'\\|\\= .info\\'\\|\\.igpi\\'\\|\\.ttf\\'\\|\\.otf\\'\\|\\.pkg\\'"=0A=20=20= "Filenames=20matching=20this=20regexp=20will=20not=20be=20suggested=20to=20= open=20by=20file=20menu.")=0A=0A(defvar=20poplife-func-find-file=20= 'find-file=0A=20=20"Function=20to=20visit=20a=20file,=20and=20a=20= Recentf=20element.=0ADepending=20on=20context,=20this=20is=20internally=20= overwritten=20to=20be=0A`find-file',=20`find-file-other-window',=20and=0A= `find-file-other-frame'.=20=20This=20is=20referred=20to=20visit=20a=20= buffer,=20an=0Aimenu=20element,=20and=20a=20bookmark=20element=20via=0A= `poplife-func-switch-to-buffer'.=20=20A=20buffer=20is=20visited=20by=0A= `menu-bar-select-buffer-function'=20on=20`global-buffers-menu-map'.=0AAn=20= imenu=20element=20is=20always=20visited=20on=20current=20buffer.=20=20A=20= bookmark=0Aelement=20is=20visited=20by=20`display-func'=20on=20= `bookmark-jump'.")=0A=0A(defvar=20poplife-func-find-file-by-default-app=20= 'poplife-find-file-by-default-app=0A=20=20"Function=20to=20visit=20file=20= by=20default=20application.")=0A=0C=0A(require=20'ffap)=0A(require=20= 'easymenu)=0A=0A;;;###autoload=0A(define-minor-mode=20poplife-mode=0A=20=20= "A=20global=20minor-mode=20to=20show=20contextual=20menu=20by=20right=20= click."=0A=20=20:init-value=20nil=0A=20=20:group=20'mouse=0A=20=20= :global=20t=0A=20=20:keymap=20(let=20((map=20(make-sparse-keymap)))=0A=20= =20=20=20=20=20=20=20=20=20=20=20(define-key=20map=20[mouse-3]=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20`(menu-item=20"Edit=20menu"=20= poplife-menu-keymap=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20:filter=20,(lambda=20(_)=20= (poplife-menu-keymap=20(aref=20(this-command-keys)=200)))))=0A=20=20=20=20= =20=20=20=20=20=20=20=20(define-key=20map=20[drag-mouse-3]=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20`(menu-item=20"Edit=20menu"=20= poplife-menu-keymap=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20:filter=20,(lambda=20(_)=20= (poplife-menu-keymap=20(aref=20(this-command-keys)=200)))))=0A=20=20=20=20= =20=20=20=20=20=20=20=20(define-key=20map=20[C-down-mouse-1]=20'ignore)=0A= =20=20=20=20=20=20=20=20=20=20=20=20(define-key=20map=20[C-mouse-1]=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20`(menu-item=20"Edit=20menu"=20= poplife-menu-keymap=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20:filter=20,(lambda=20(_)=20= (poplife-menu-keymap=20(aref=20(this-command-keys)=200)))))=0A=20=20=20=20= =20=20=20=20=20=20=20=20(define-key=20map=20[C-double-mouse-1]=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20`(menu-item=20"Edit=20menu"=20= poplife-menu-keymap=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20:filter=20,(lambda=20(_)=20= (poplife-menu-keymap=20(aref=20(this-command-keys)=200)))))=0A=20=20=20=20= =20=20=20=20=20=20=20=20(define-key=20map=20[C-triple-mouse-1]=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20`(menu-item=20"Edit=20menu"=20= poplife-menu-keymap=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20:filter=20,(lambda=20(_)=20= (poplife-menu-keymap=20(aref=20(this-command-keys)=200)))))=0A=20=20=20=20= =20=20=20=20=20=20=20=20(define-key=20map=20[C-drag-mouse-1]=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20`(menu-item=20"Edit=20menu"=20= poplife-menu-keymap=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20:filter=20,(lambda=20(_)=20= (poplife-menu-keymap=20(aref=20(this-command-keys)=200)))))=0A=20=20=20=20= =20=20=20=20=20=20=20=20(define-key=20map=20[remap=20buffer-menu-open]=20= 'poplife-menu-open)=0A=20=20=20=20=20=20=20=20=20=20=20=20(define-key=20= map=20[C-S-down-mouse-1]=20'mouse-buffer-menu)=0A=20=20=20=20=20=20=20=20= =20=20=20=20(define-key=20map=20[C-M-mouse-1]=20= 'poplife-what-mouse-position)=0A=20=20=20=20=20=20=20=20=20=20=20=20= map))=0A=0A(defun=20poplife-menu-open=20()=0A=20=20"Start=20key=20= navigation=20of=20the=20poplife=20menu.=0AThis=20is=20the=20keyboard=20= interface=20to=20\\[poplife-menu-keymap].=20=20This=20is=0Afork=20of=20= `buffer-menu-open'."=0A=20=20(interactive)=0A=20=20(popup-menu=20= (poplife-menu-keymap=20last-nonmenu-event)=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(posn-at-x-y=200=200=20nil=20t)))=0A=0A(defun=20= poplife-menu-keymap=20(event)=0A=20=20"Define=20keymap=20for=20= contextual=20edit=20menu=20on=20mouse=20click=20EVENT.=0AWhen=20point=20= in=20on=20word=20that=20is=20misspelled,=20return=20symbol=0A= flyspell-correct-word.=20=20When=20mouse=20click=20EVENT=20is=20on=20= file=20or=0Adirectory,=20return=20file-menu=20map.=20=20Otherwise=20= return=20edit-menu=0Amap."=0A=20=20(let=20(file-easymap=0A=20=20=20=20=20= =20=20=20dir-easymap=0A=20=20=20=20=20=20=20=20faces-at-point=0A=20=20=20= =20=20=20=20=20url-easymap=0A=20=20=20=20=20=20=20=20(no-region=20(not=20= (region-active-p))))=0A=20=20=20=20(cond=0A=20=20=20=20=20;;=20FILE=20= menu=0A=20=20=20=20=20((and=20no-region=0A=20=20=20=20=20=20=20=20=20=20=20= (setq=20file-easymap=20(if=20(equal=20major-mode=20'dired-mode)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(and=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (mouse-posn-property=20(event-start=20event)=20'dired-filename)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(poplife-file-easymap=20(save-excursion=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(mouse-set-point=20event)=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (dired-get-file-for-visit))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20t))=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(poplife-file-on-click-easymap=20event))))=0A=20=20=20=20=20=20= (easy-menu-create-menu=20(car=20file-easymap)=20(cdr=20file-easymap)))=0A= =20=20=20=20=20;;=20DIRECTORY=20menu=0A=20=20=20=20=20((and=20no-region=0A= =20=20=20=20=20=20=20=20=20=20=20(if=20(equal=20major-mode=20= 'dired-mode)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (mouse-posn-property=20(event-start=20event)=20'dired-filename)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20t)=0A=20=20=20=20=20=20=20=20=20=20=20= (setq=20dir-easymap=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (poplife-dir-on-click-easymap=20event)))=0A=20=20=20=20=20=20= (easy-menu-create-menu=20(car=20dir-easymap)=20(cdr=20dir-easymap)))=0A=20= =20=20=20=20;;=20WORD=20menu=0A=20=20=20=20=20((and=20no-region=0A=20=20=20= =20=20=20=20=20=20=20=20poplife-word-flag=0A=20=20=20=20=20=20=20=20=20=20= =20;;=20Check=20face=20by=20(what-cursor-position=20t)=20or=20C-u=20C-x=20= =3D.=0A=20=20=20=20=20=20=20=20=20=20=20(setq=20faces-at-point=20(mapcar=20= (lambda=20(xxx)=20(overlay-get=20xxx=20'face))=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(overlays-at=20(posn-point=20(event-start=20= event)))))=0A=20=20=20=20=20=20=20=20=20=20=20(or=20(member=20= 'flyspell-incorrect=20faces-at-point)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(member=20'flyspell-duplicate=20faces-at-point)))=0A=20=20=20= =20=20=20#'flyspell-correct-word)=20;=20= flyspell-correct-word-before-point=0A=20=20=20=20=20;;=20URL=20menu=0A=20= =20=20=20=20((and=20no-region=0A=20=20=20=20=20=20=20=20=20=20=20= poplife-url-flag=0A=20=20=20=20=20=20=20=20=20=20=20(setq=20url-easymap=20= (poplife-url-on-click-easymap=20event)))=0A=20=20=20=20=20=20= (easy-menu-create-menu=20(car=20url-easymap)=20(cdr=20url-easymap)))=0A=20= =20=20=20=20;;=20else=0A=20=20=20=20=20(t=0A=20=20=20=20=20=20;;=20= menu-bar-edit-menu=0A=20=20=20=20=20=20(poplife-edit-map=20event)))))=0A=0A= (defun=20poplife-what-mouse-position=20(event)=0A=20=20"Evaluate=20text=20= properties=20under=20mouse=20click."=0A=20=20(interactive=20"e")=0A=20=20= ;;=20Check=20also=20`C-u=20C-x=20=3D'.=0A=20=20= (with-output-to-temp-buffer=20"*Result*"=0A=20=20=20=20(princ=20(format=20= "Event=20was=20%S\n"=20event))=0A=20=20=20=20(princ=20(format=20"Click=20= was=20on=20face=20<%S>.\n"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(mouse-posn-property=20(event-start=20event)=20'face)))=0A=20= =20=20=20(princ=20(format=20"Click=20was=20on=20dired-filename=20= <%S>.\n"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (mouse-posn-property=20(event-start=20event)=20'dired-filename)))))=0A=0A= (defun=20poplife-file-on-click-easymap=20(event)=0A=20=20"Define=20= easymenu=20of=20a=20file=20that=20is=20under=20mouse=20click=20EVENT.=0A= The=20file=20is=20identified=20by=20`ffap-guesser'."=0A=20=20= (save-excursion=0A=20=20=20=20(mouse-set-point=20event)=20;=20= ~/.emacs.d/init.el=0A=20=20=20=20(let=20((file=20(ffap-guesser)))=20;=20= https://www.gnu.org/software/emacs/=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;=20= ffap-guesser=20cannot=20guess=20file=20with=20asterisk=20such=20as=20= "bookmark.html*"=0A=20=20=20=20=20=20(when=20(and=20file=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(not=20(ffap-file-remote-p=20file)))=0A= =20=20=20=20=20=20=20=20(poplife-file-easymap=20file=20t)))))=0A=0A= (defun=20poplife-dir-on-click-easymap=20(event)=0A=20=20"Define=20= easymenu=20of=20files=20and=20directories=20in=20directory=20that=20is=20= under=20mouse=20click=20EVENT.=0AThe=20directory=20is=20identified=20by=20= `ffap-guesser'."=0A=20=20(save-excursion=0A=20=20=20=20(mouse-set-point=20= event)=20;=20~/.emacs.d/=0A=20=20=20=20(let=20((dir=20(ffap-guesser)))=20= ;=20https://www.gnu.org/software/emacs/=0A=20=20=20=20=20=20(when=20(and=20= dir=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20= (ffap-file-remote-p=20dir)))=0A=20=20=20=20=20=20=20=20= (poplife-dir-easymap=20(file-name-as-directory=20dir)=20t)))))=0A=0A= (defun=20poplife-edit-map=20(event)=0A=20=20"Define=20edit=20menu=20on=20= mouse=20click=20EVENT."=0A=20=20;;=20initialize=0A=20=20(when=20= (plist-get=20poplife-edit-cottager=20:bookmark)=0A=20=20=20=20(require=20= 'bookmark))=0A=20=20(when=20(plist-get=20poplife-edit-cottager=20= :recentf)=0A=20=20=20=20(require=20'recentf)=0A=20=20=20=20(recentf-mode=20= 1))=0A=20=20(when=20(plist-get=20poplife-edit-cottager=20:imenu)=0A=20=20= =20=20(require=20'imenu))=0A=0A=20=20(save-excursion=0A=20=20=20=20= (mouse-set-point=20event)=0A=20=20=20=20(let=20((map=20= (make-sparse-keymap=20"Edit")))=0A=20=20=20=20=20=20(unless=20= (region-active-p)=0A=20=20=20=20=20=20=20=20;;=20Buffers=20with=20iMenu=0A= =20=20=20=20=20=20=20=20(when=20(plist-get=20poplife-edit-cottager=20= :buffer)=0A=20=20=20=20=20=20=20=20=20=20(easy-menu-add-item=20map=20nil=20= (poplife-buffer-easymap)))=0A=0A=20=20=20=20=20=20=20=20;;=20Frames=0A=20= =20=20=20=20=20=20=20(when=20(plist-get=20poplife-edit-cottager=20= :frame)=0A=20=20=20=20=20=20=20=20=20=20(easy-menu-add-item=20map=20nil=20= (poplife-frame-easymap)))=0A=0A=20=20=20=20=20=20=20=20;;=20Bookmark=0A=20= =20=20=20=20=20=20=20(when=20(plist-get=20poplife-edit-cottager=20= :bookmark)=0A=20=20=20=20=20=20=20=20=20=20(easy-menu-add-item=20map=20= nil=20(poplife-bookmark-easymap)))=0A=0A=20=20=20=20=20=20=20=20;;=20= Recentf=0A=20=20=20=20=20=20=20=20(when=20(plist-get=20= poplife-edit-cottager=20:recentf)=0A=20=20=20=20=20=20=20=20=20=20= (easy-menu-add-item=20map=20nil=20(poplife-recentf-easymap)))=0A=0A=20=20= =20=20=20=20=20=20;;=20File=0A=20=20=20=20=20=20=20=20(let=20((dir-map=20= (poplife-dir-easymap=20default-directory)))=0A=20=20=20=20=20=20=20=20=20= =20(setcar=20dir-map=20"File")=20;=20"File"=20instead=20of=20".emacs.d/"=0A= =20=20=20=20=20=20=20=20=20=20(easy-menu-add-item=20map=20nil=20= dir-map))=0A=0A=20=20=20=20=20=20=20=20;;=20Separator=0A=20=20=20=20=20=20= =20=20(define-key=20map=20[separator-edit]=20menu-bar-separator))=0A=0A=20= =20=20=20=20=20;;=20Option=0A=20=20=20=20=20=20(when=20= poplife-edit-cmd-1=0A=20=20=20=20=20=20=20=20(dolist=20(item=20= poplife-edit-cmd-1)=0A=20=20=20=20=20=20=20=20=20=20(setq=20item=20= (append=20item=20nil))=20;=20Convert=20vector=20to=20list.=0A=20=20=20=20= =20=20=20=20=20=20(let=20((name=20(car=20item)))=0A=20=20=20=20=20=20=20=20= =20=20=20=20(bindings--define-key=20map=20(vector=20= (easy-menu-make-symbol=20name))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(append=20`(menu-item=20,name)=20(cdr=20item))))))=0A=0A=20=20=20=20=20= =20;;=20Main=0A=20=20=20=20=20=20(dolist=20(item=20(reverse=20(cdr=20= menu-bar-edit-menu)))=0A=20=20=20=20=20=20=20=20(when=20(and=20(listp=20= item)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(member=20= (car=20item)=20poplife-edit-cmd-0))=20;=20pick=20some=0A=20=20=20=20=20=20= =20=20=20=20(bindings--define-key=20map=20(vector=20(car=20item))=20(cdr=20= item))))=0A=0A=20=20=20=20=20=20map)))=0A;;=20(let=20((foo=20= (poplife-edit-map=20last-nonmenu-event)))=20(describe-variable=20'foo))=0A= =0C=0A;;;=20iMenu=0A(defun=20poplife-imenu-easymap=20(&optional=20= submenu)=0A=20=20"Define=20easymenu=20to=20list=20index=20by=20iMenu.=0A= When=20SUBMENU=20is=20non-nil,=20this=20returns=20an=20easymenu=20with=20= multiple=20actions."=0A=20=20(let*=20((imenu-max-items=20= poplife-file-max-menu-items)=20;=2025=0A=20=20=20=20=20=20=20=20=20= (map-0=20(ignore-errors=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(imenu--split-menu=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(delq=20nil=20(cdr=20(imenu--make-index-alist=20t)))=20;=20= remove=20"*Rescan*"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(buffer-name))))=0A=20=20=20=20=20=20=20=20=20(map=20= (poplife-imenu-alist-to-easymap=20(car=20map-0)=20(cdr=20map-0)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= 'imenu--menubar-select)))=0A=20=20=20=20(when=20(>=3D=20(length=20map)=20= 2)=20;=20Return=20map=20only=20when=20map=20is=20with=20useful=20items.=0A= =20=20=20=20=20=20(if=20submenu=0A=20=20=20=20=20=20=20=20=20=20= (poplife-imenu-submenufy-easymap=20map)=0A=20=20=20=20=20=20=20=20(let=20= ((map-rev=20(reverse=20map)))=0A=20=20=20=20=20=20=20=20=20=20(push=20= (vector=20"More..."=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20'(popup-menu=20(poplife-imenu-easymap=20t)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(popup-menu-normalize-position=20= last-nonmenu-event)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= map-rev)=0A=20=20=20=20=20=20=20=20=20=20(reverse=20map-rev))))))=0A;;=20= (let=20((foo=20(poplife-imenu-easymap)))=20(describe-variable=20'foo))=0A= ;;=20(let*=20((poplife-func-find-file=20'find-file-other-frame)=20(foo=20= (poplife-imenu-easymap)))=20(describe-variable=20'foo))=0A;;=20(let=20= ((foo=20(poplife-imenu-easymap=20t)))=20(describe-variable=20'foo))=0A;;=20= (popup-menu=20(poplife-imenu-easymap))=0A=0A(defun=20= poplife-imenu-alist-to-easymap=20(title=20alist=20&optional=20cmd)=0A=20=20= "Create=20easymenu=20from=20alist=20by=20iMenu=20to=20display=20index=20= by=20CMD.=0AThis=20is=20fork=20of=20`imenu--create-keymap'."=0A=20=20= (let=20(map)=0A=20=20=20=20(dolist=20(item=20alist)=0A=20=20=20=20=20=20= (push=20(cond=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= ((imenu--subalist-p=20item)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (poplife-imenu-alist-to-easymap=20(car=20item)=20(cdr=20item)=20cmd))=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20(t=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(if=20cmd=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20["poplife-word-flag"=20(imenu--menubar-select=20= '("poplife-edit-cottager"=20.=20#))]=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ;;=20(vector=20(car=20item)=20(list=20cmd=20`(quote=20,item)))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(vector=20(car=20item)=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (list=20'let=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20= '((display-buffer--other-frame-action=20;=20hack=20for=20= switch-to-buffer-other-frame=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= '((display-buffer-pop-up-frame)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (inhibit-same-window=20.=20t))))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20`(funcall=20= (quote=20,(poplife-func-switch-to-buffer))=20,(current-buffer))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20`(,cmd=20(quote=20,item))))=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(list=20'quote=20item))))=0A=20=20=20=20=20=20=20=20=20=20= =20=20map))=0A=20=20=20=20(setq=20map=20(reverse=20map))=0A=20=20=20=20= (push=20title=20map)=0A=20=20=20=20map))=0A=0A(defun=20= poplife-imenu-submenufy-easymap=20(map)=0A=20=20"Return=20easymenu=20of=20= iMenu=20MAP=20with=20recursive=20structure."=0A=20=20(let=20(map-1)=0A=20= =20=20=20(dolist=20(item=20map)=0A=20=20=20=20=20=20(push=20(cond=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20((listp=20item)=20;=20when=20an=20item=20= is=20a=20list=20such=20for=20("Variables"...),=20resolve=20it=20until=20= atom=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (poplife-imenu-submenufy-easymap=20item))=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20((vectorp=20item)=20;=20when=20an=20item=20is=20vector=20such=20= for=20["poplife-word-flag"=20(imenu--menubar-select...)]=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(poplife-imenu-elt-easymap=20item))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20(t=20item))=20;=20else=20such=20for=20= "poplife.el"=0A=20=20=20=20=20=20=20=20=20=20=20=20map-1))=0A=20=20=20=20= (reverse=20map-1)))=0A=0A(defun=20poplife-imenu-elt-easymap=20(elt)=0A=20= =20"Return=20easymenu=20of=20iMenu=20ELT=20with=20submenu=20added."=0A=20= =20(let=20((label=20(aref=20elt=200))=20;=20"poplife-edit-cottager"=0A=20= =20=20=20=20=20=20=20(cmd=20(nth=203=20(aref=20elt=201)))=20;=20= (imenu--menubar-select=20'("poplife-edit-cottager"=20.=20#))=0A=20=20=20=20=20=20=20=20(buf=20= (current-buffer)))=20;=20#=0A=20=20=20=20(list=20= label=0A=20=20=20=20=20=20=20=20=20=20(vector=20"Open"=20`(progn=20= (switch-to-buffer=20,buf)=20,cmd))=0A=20=20=20=20=20=20=20=20=20=20["--"=20= ignore]=0A=20=20=20=20=20=20=20=20=20=20(vector=20"Open=20in=20Other=20= Window"=20`(progn=20(switch-to-buffer-other-window=20,buf)=20,cmd))=0A=20= =20=20=20=20=20=20=20=20=20;;=20(vector=20"Open=20in=20Frame"=20`(progn=20= (switch-to-buffer-other-frame=20,buf)=20,cmd))=0A=20=20=20=20=20=20=20=20= =20=20(vector=20"Open=20in=20Frame"=20`(progn=20(pop-to-buffer=20,buf=20= '((display-buffer-pop-up-frame)=20(inhibit-same-window=20.=20t)))=20= ,cmd)))))=0A=0C=0A;;;=20Frame=0A(defun=20poplife-frame-easymap=20()=0A=20= =20"Define=20easymenu=20to=20list=20frames."=0A=20=20(let=20((frame-vec=20= (nth=202=20(cadddr=20(assoc=20'frames=20global-buffers-menu-map))))=0A=20= =20=20=20=20=20=20=20(poplife-func-find-file=20'find-file-other-frame)=0A= =20=20=20=20=20=20=20=20map)=0A=20=20=20=20(dolist=20(elt=20(append=20= frame-vec=20nil))=20;=20Convert=20vector=20to=20list.=0A=20=20=20=20=20=20= (let*=20((nickname=20(car=20elt))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= (cmd=20(nth=204=20elt))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20(frame=20= (cadr=20cmd)))=0A=20=20=20=20=20=20=20=20(push=20(vector=20nickname=20= cmd=20:active=20(not=20(equal=20frame=20(selected-frame))))=20map)))=0A=20= =20=20=20(push=20["New"=20(make-frame-command)]=20map)=0A=20=20=20=20= (let*=20((dir-map=20(poplife-dir-easymap=20default-directory)))=0A=20=20=20= =20=20=20(push=20["--"=20ignore]=20map)=0A=20=20=20=20=20=20(when=20= (plist-get=20poplife-edit-cottager=20:buffer)=0A=20=20=20=20=20=20=20=20= (push=20(poplife-buffer-easymap)=20map))=0A=20=20=20=20=20=20(when=20= (plist-get=20poplife-edit-cottager=20:bookmark)=0A=20=20=20=20=20=20=20=20= (push=20(poplife-bookmark-easymap)=20map))=0A=20=20=20=20=20=20(when=20= (plist-get=20poplife-edit-cottager=20:recentf)=0A=20=20=20=20=20=20=20=20= (push=20(poplife-recentf-easymap)=20map))=0A=20=20=20=20=20=20(setcar=20= dir-map=20"File")=20;=20"Directory"=0A=20=20=20=20=20=20(push=20dir-map=20= map))=0A=20=20=20=20(setq=20map=20(reverse=20map))=0A=20=20=20=20(push=20= "Frames"=20map)=0A=20=20=20=20map))=0A;;=20(let=20((foo=20= (poplife-frame-easymap)))=20(describe-variable=20'foo))=0A=0C=0A;;;=20= Buffer=0A(defun=20poplife-buffer-easymap=20(&optional=20submenu)=0A=20=20= "Define=20easymenu=20to=20list=20buffers.=0AThis=20extracts=20list=20of=20= buffers=20from=20`global-buffers-menu-map'.=0AWhen=20SUBMENU=20is=20= non-nil,=20this=20returns=20an=20easymenu=20with=20multiple=20actions."=0A= =20=20(let=20((buffer-vec=20(nth=202=20global-buffers-menu-map))=0A=20=20= =20=20=20=20=20=20(menu-bar-select-buffer-function=20= (poplife-func-switch-to-buffer))=0A=20=20=20=20=20=20=20=20map)=0A=0A=20=20= =20=20;;=20Add=20submenu=20on=20request.=0A=20=20=20=20(dolist=20(elt=20= (append=20buffer-vec=20nil))=20;=20Convert=20vector=20to=20list.=0A=20=20= =20=20=20=20(push=20(poplife-buffer-elt-easymap=20elt=20submenu)=20map))=0A= =0A=20=20=20=20;;=20Add=20option.=0A=20=20=20=20(push=20(vector=20= "More..."=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'(let=20= (buffer-full-map)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(let=20(buffers-menu-max-size)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(menu-bar-update-buffers=20t)=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20= buffer-full-map=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(poplife-buffer-easymap=20t)))=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (menu-bar-update-buffers=20t)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(popup-menu=20buffer-full-map=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(popup-menu-normalize-position=20last-nonmenu-event)))=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20:active=20(not=20submenu))=0A=20=20=20=20= =20=20=20=20=20=20map)=0A=0A=20=20=20=20(let*=20((dir-map=20= (poplife-dir-easymap=20default-directory)))=0A=20=20=20=20=20=20(push=20= ["--"=20ignore]=20map)=0A=20=20=20=20=20=20(when=20(plist-get=20= poplife-edit-cottager=20:bookmark)=0A=20=20=20=20=20=20=20=20(push=20= (poplife-bookmark-easymap)=20map))=0A=20=20=20=20=20=20(when=20= (plist-get=20poplife-edit-cottager=20:recentf)=0A=20=20=20=20=20=20=20=20= (push=20(poplife-recentf-easymap)=20map))=0A=20=20=20=20=20=20(setcar=20= dir-map=20"File")=20;=20"Open",=20"Directory",=20"File"=0A=20=20=20=20=20= =20(push=20dir-map=20map))=0A=0A=20=20=20=20;;=20Reverse=20map=20and=20= add=20a=20key.=0A=20=20=20=20(setq=20map=20(reverse=20map))=0A=20=20=20=20= (push=20"Buffers"=20map)=0A=0A=20=20=20=20map))=0A;;=20(let=20((foo=20= (poplife-buffer-easymap)))=20(describe-variable=20'foo))=0A;;=20(let=20= ((foo=20(poplife-buffer-easymap=20t)))=20(describe-variable=20'foo))=0A=0A= (defun=20poplife-buffer-elt-easymap=20(elt=20&optional=20submenu)=0A=20=20= "Define=20easymenu=20a=20buffer=20ELT.=0AWhen=20SUBMENU=20is=20non-nil,=20= this=20returns=20an=20easymenu=20with=20multiple=20actions."=0A=20=20;;=20= on=2025.2,=20pick=204th=20out=20of=205=20items=0A=20=20;;=20= ("menu-bar.el.gz=20=20"=20lambda=20nil=20(interactive)=20(funcall=20= menu-bar-select-buffer-function=20#))=0A=20=20= ;;=20on=2024.5,=20pick=205th=20out=20of=206=20items=0A=20=20;;=20= ("menu-bar.el.gz=20=20"=20(nil)=20lambda=20nil=20(interactive)=20= (funcall=20menu-bar-select-buffer-function=20#))=0A=20=20(let*=20((len245=206)=0A=20=20=20=20=20=20=20=20= =20(nth252=204)=0A=20=20=20=20=20=20=20=20=20(nth245=205)=0A=20=20=20=20=20= =20=20=20=20(nickname=20(car=20elt))=0A=20=20=20=20=20=20=20=20=20(buf=20= (nth=202=20(nth=20(if=20(equal=20(length=20elt)=20len245)=20nth245=20= nth252)=20elt))))=0A=20=20=20=20(if=20(not=20submenu)=0A=20=20=20=20=20=20= =20=20(let*=20(imenu-map)=0A=20=20=20=20=20=20=20=20=20=20(if=20(and=20= (plist-get=20poplife-edit-cottager=20:imenu)=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(equal=20(current-buffer)=20buf)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20imenu-map=20= (poplife-imenu-easymap)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= imenu-map=0A=20=20=20=20=20=20=20=20=20=20=20=20(vector=20nickname=20= `(funcall=20(quote=20,menu-bar-select-buffer-function)=20,buf)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:active=20`(not=20= (equal=20,(current-buffer)=20,buf)))))=0A=20=20=20=20=20=20(list=20= nickname=0A=20=20=20=20=20=20=20=20=20=20=20=20(vector=20"Open"=20= `(switch-to-buffer=20,buf)=20:active=20`(not=20(equal=20= ,(current-buffer)=20,buf)))=0A=20=20=20=20=20=20=20=20=20=20=20=20["--"=20= ignore]=0A=20=20=20=20=20=20=20=20=20=20=20=20(vector=20"Open=20in=20= Other=20Window"=20`(switch-to-buffer-other-window=20,buf))=0A=20=20=20=20= =20=20=20=20=20=20=20=20(vector=20"Open=20in=20Frame"=20= `(switch-to-buffer-other-frame=20,buf))))))=0A=0C=0A;;;=20Recentf=0A= (defun=20poplife-recentf-easymap=20(&optional=20submenu)=0A=20=20"Define=20= easymenu=20to=20list=20recentf.=0AWhen=20SUBMENU=20is=20non-nil,=20this=20= returns=20an=20easymenu=20with=20multiple=20actions."=0A=20=20(let=20= (map=0A=20=20=20=20=20=20=20=20(recentf-menu-shortcuts=200)=0A=20=20=20=20= =20=20=20=20(elements=20(recentf-menu-elements=20= recentf-max-menu-items)))=0A=20=20=20=20;;=20See=20= `recentf-make-menu-items'.=0A=20=20=20=20(setq=20map=20(mapcar=20(lambda=20= (elt)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(funcall=20'poplife-recentf-elt-easymap=20elt=20submenu))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (recentf-apply-menu-filter=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20recentf-menu-filter=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20elements)))=0A=20=20=20=20(let=20= ((map-rev=20(reverse=20map)))=0A=20=20=20=20=20=20(push=20(vector=20= "More..."=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= '(let=20((recentf-max-menu-items=20recentf-max-saved-items))=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(popup-menu=20= (poplife-recentf-easymap=20t)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (popup-menu-normalize-position=20last-nonmenu-event)))=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20:help=20"Show=20more=20= Recentf"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= :visible=20t=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= :active=20(not=20submenu))=0A=20=20=20=20=20=20=20=20=20=20=20=20= map-rev)=0A=20=20=20=20=20=20(push=20["--"=20ignore]=20map-rev)=0A=20=20=20= =20=20=20(push=20["Edit=20List..."=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20recentf-edit-list=0A=20=20=20=20=20=20=20=20=20=20=20=20=20:help=20= "Manually=20remove=20files=20from=20the=20recent=20list"=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20:active=20t]=0A=20=20=20=20=20=20=20=20=20=20=20=20= map-rev)=0A=20=20=20=20=20=20(push=20["Save=20List=20Now"=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20recentf-save-list=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20:help=20"Save=20the=20list=20of=20recently=20opened=20files=20= now"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20:active=20t]=0A=20=20=20=20= =20=20=20=20=20=20=20=20map-rev)=0A=20=20=20=20=20=20(setq=20map=20= (reverse=20map-rev)))=0A=20=20=20=20(cons=20"Recent"=20map)))=0A;;=20= (let=20((foo=20(poplife-recentf-easymap)))=20(describe-variable=20'foo))=0A= =0A(defun=20poplife-recentf-elt-easymap=20(elt=20&optional=20submenu)=0A=20= =20"Define=20easymenu=20to=20popup=20recentf=20item=20ELT.=0AWhen=20= SUBMENU=20is=20non-nil,=20this=20returns=20an=20easymenu=20with=20= multiple=20actions."=0A=20=20;;=20This=20is=20fork=20of=20= `recentf-make-menu-item'.=0A=20=20(let=20((name=20= (recentf-menu-element-item=20elt))=0A=20=20=20=20=20=20=20=20(file=20= (recentf-menu-element-value=20elt)))=0A=20=20=20=20(if=20= (recentf-sub-menu-element-p=20elt)=0A=20=20=20=20=20=20=20=20(cons=20= name=20(mapcar=20(lambda=20(elt)=20(funcall=20= 'poplife-recentf-elt-easymap=20elt))=20file))=20;=20for=20= `recentf-arrange-by-dir'=0A=20=20=20=20=20=20;;=20(vector=20name=0A=20=20= =20=20=20=20;;=20=20=20=20=20=20=20=20=20`(,recentf-menu-action=20,file)=20= ;=20poplife-func-find-file=0A=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20= =20:help=20(concat=20"Open=20"=20file)=0A=20=20=20=20=20=20;;=20=20=20=20= =20=20=20=20=20:active=20t)=0A=20=20=20=20=20=20(let=20((map=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20(if=20(file-directory-p=20file)=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(poplife-dir-easymap=20file=20= submenu)=20;=20directory=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (poplife-file-easymap=20file=20submenu))))=20;=20file=0A=20=20=20=20=20=20= =20=20(when=20(listp=20map)=0A=20=20=20=20=20=20=20=20=20=20(setcar=20= map=20name))=0A=20=20=20=20=20=20=20=20map))))=0A=0C=0A;;;=20Bookmark=0A= (defun=20poplife-bookmark-easymap=20(&optional=20submenu)=0A=20=20= "Define=20easymenu=20to=20list=20bookmarks.=0AWhen=20SUBMENU=20is=20= non-nil,=20this=20returns=20an=20easymenu=20with=20multiple=20actions."=0A= =20=20(let=20((map=0A=20=20=20=20=20=20=20=20=20(list=0A=20=20=20=20=20=20= =20=20=20=20(vector=20"More..."=20'(popup-menu=20= (poplife-bookmark-easymap=20t)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(popup-menu-normalize-position=20last-nonmenu-event))=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20:active=20(not=20submenu)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:help=20"Set=20a=20bookmark=20= named=20inside=20a=20file.")=0A=20=20=20=20=20=20=20=20=20=20["--"=20= ignore]=0A=20=20=20=20=20=20=20=20=20=20["Add..."=20bookmark-set=20= :visible=20t=20:active=20(or=20(buffer-file-name)=20(eq=20major-mode=20= 'dired-mode))=0A=20=20=20=20=20=20=20=20=20=20=20:help=20"Set=20a=20= bookmark=20named=20inside=20a=20file."]=0A=20=20=20=20=20=20=20=20=20=20= ["Edit=20List..."=20bookmark-bmenu-list=20:visible=20t=20:active=20t=0A=20= =20=20=20=20=20=20=20=20=20=20:help=20"Display=20a=20list=20of=20= existing=20bookmarks"]=0A=20=20=20=20=20=20=20=20=20=20["Save=20List=20= Now"=20bookmark-save=20:visible=20t=20:active=20t=0A=20=20=20=20=20=20=20= =20=20=20=20:help=20"Save=20currently=20defined=20bookmarks"])))=0A=20=20= =20=20(dolist=20(bookmark=20(bookmark-all-names))=0A=20=20=20=20=20=20= (push=20(poplife-bookmark-elt-easymap=20bookmark=20submenu)=20map))=0A=20= =20=20=20(cons=20"Bookmark"=20map)))=0A;;=20(let=20((foo=20= (poplife-bookmark-easymap)))=20(describe-variable=20'foo))=0A;;=20(let=20= ((foo=20(poplife-bookmark-easymap=20t)))=20(describe-variable=20'foo))=0A= =0A(defun=20poplife-bookmark-elt-easymap=20(bookmark=20&optional=20= submenu)=0A=20=20"Define=20easymenu=20to=20list=20a=20BOOKMARK.=0AWhen=20= SUBMENU=20it=20non-nil,=20this=20returns=20an=20easymenu=20with=20= multiple=20actions."=0A=20=20(let=20(map)=0A=20=20=20=20(if=20(not=20= submenu)=0A=20=20=20=20=20=20=20=20(let=20((file=20= (bookmark-get-filename=20bookmark)))=0A=20=20=20=20=20=20=20=20=20=20(if=20= (and=20(not=20(file-remote-p=20file))=20;=20when=20bookmark=20is=20= directory=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (file-exists-p=20file)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(file-directory-p=20file))=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(poplife-dir-easymap=20file=20submenu)=20;=20offer=20directory=20= menu=0A=20=20=20=20=20=20=20=20=20=20=20=20(vector=20bookmark=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20`(bookmark-jump=20= ,bookmark=20DISPLAY-FUNC)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20`(bookmark-jump=20,bookmark=20(quote=20= ,(poplife-func-switch-to-buffer)))=20;=20switch-to-buffer=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:active=20(not=20(string=3D=20= ;=20gray=20the=20vising=20file=20out=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(and=20= (buffer-file-name)=20(expand-file-name=20(buffer-file-name)))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(expand-file-name=20(bookmark-get-filename=20= bookmark))))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= :help=20(format=20"Jump=20to=20%s"=20bookmark))))=0A=0A=20=20=20=20=20=20= ;;=20(push=20(vector=20"Show=20Annotation..."=20= `(bookmark-show-annotation=20,bookmark)=20:visible=20t=20:active=20= `(bookmark-get-annotation=20,bookmark)=20:help=20bookmark)=20map)=0A=20=20= =20=20=20=20;;=20(push=20(vector=20"Edit=20Annotation..."=20= `(bookmark-edit-annotation=20,bookmark)=20:visible=20t=20:help=20= bookmark)=20map)=0A=20=20=20=20=20=20(let=20((annot-map=20= (poplife-bookmark-annotation-easymap=20bookmark)))=0A=20=20=20=20=20=20=20= =20(if=20(vectorp=20annot-map)=20;=20with=20no=20annotation=20and=20with=20= "Add=20Annotation..."=0A=20=20=20=20=20=20=20=20=20=20=20=20(push=20= annot-map=20map)=0A=20=20=20=20=20=20=20=20=20=20(dolist=20(annot-item=20= (reverse=20(cdr=20annot-map)))=0A=20=20=20=20=20=20=20=20=20=20=20=20= (push=20annot-item=20map))=0A=20=20=20=20=20=20=20=20=20=20(push=20["--"=20= ignore]=20map)=0A=20=20=20=20=20=20=20=20=20=20(push=20(vector=20"Edit=20= Annotation..."=20`(bookmark-edit-annotation=20,bookmark)=20:visible=20t=20= :help=20bookmark)=20map)))=0A=20=20=20=20=20=20(push=20(vector=20= "Delete..."=20`(and=20(y-or-n-p=20(format=20"Are=20you=20sure=20you=20= want=20to=20delete=20a=20bookmark=20%s?=20"=20,bookmark))=20= (bookmark-delete=20,bookmark))=20:visible=20t=20:help=20bookmark)=20map)=0A= =20=20=20=20=20=20(push=20(vector=20"Edit=20Location..."=20= `(bookmark-relocate=20,bookmark)=20:visible=20t=20:help=20bookmark)=20= map)=0A=20=20=20=20=20=20(push=20(vector=20"Rename..."=20= `(bookmark-rename=20,bookmark)=20:visible=20t=20:help=20bookmark)=20map)=0A= =20=20=20=20=20=20(push=20(vector=20"Insert=20Location"=20= `(bookmark-locate=20,bookmark)=20:visible=20t=20:help=20bookmark)=20map)=0A= =20=20=20=20=20=20(push=20(vector=20"Insert=20Contents"=20= `(bookmark-insert=20,bookmark)=20:visible=20t=20:help=20bookmark)=20map)=0A= =20=20=20=20=20=20(push=20(vector=20"Open=20in=20File=20Browser"=20= `(poplife-find-location=20(expand-file-name=20(bookmark-get-filename=20= ,bookmark)))=20:visible=20t=20:active=20t=20:help=20bookmark)=20map)=0A=20= =20=20=20=20=20(push=20(vector=20"Open=20in=20Frame"=20`(bookmark-jump=20= ,bookmark=20'switch-to-buffer-other-frame)=20:visible=20t=20:help=20= bookmark)=20map)=0A=20=20=20=20=20=20(push=20(vector=20"Open=20in=20= Other=20Window"=20`(bookmark-jump-other-window=20,bookmark)=20:visible=20= t=20:help=20bookmark)=20map)=0A=20=20=20=20=20=20(push=20["--"=20ignore]=20= map)=0A=20=20=20=20=20=20(push=20(vector=20"Open"=20`(bookmark-jump=20= ,bookmark)=20:visible=20t=20:help=20bookmark)=20map)=20;=20= switch-to-buffer=0A=20=20=20=20=20=20(push=20(vector=20".."=20`(let=20= ((poplife-file-recursive=20,poplife-file-recursive)=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (poplife-func-find-file=20(quote=20,poplife-func-find-file)))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (poplife-find-dir=20(expand-file-name=20"../"=20(bookmark-get-filename=20= ,bookmark))=20,submenu))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20:visible=20t=20:active=20t)=20map)=0A=20=20=20=20=20=20(let=20= ((annotation=20(bookmark-get-annotation=20bookmark)))=0A=20=20=20=20=20=20= =20=20(cons=20(format=20"%s%s"=20bookmark=20(if=20(and=20annotation=20= (not=20(string-equal=20annotation=20"")))=20"*"=20""))=20map)))))=0A;;=20= (let=20((foo=20(poplife-bookmark-elt-easymap=20= "poplife.el\\site-lisp")))=20(describe-variable=20'foo))=0A;;=20(let=20= ((foo=20(poplife-bookmark-elt-easymap=20"poplife.el\\site-lisp"=20t)))=20= (describe-variable=20'foo))=0A=0A(defvar=20= poplife-bookmark-annotation-detail-flag=20t=0A=20=20"Show=20full=20= contents=20of=20annotation=20in=20popup-menu.")=0A=0A(defun=20= poplife-bookmark-annotation-easymap=20(bookmark)=0A=20=20"Define=20= easymenu=20to=20list=20annotation."=0A=20=20(let=20((annot=20= (bookmark-get-annotation=20bookmark))=0A=20=20=20=20=20=20=20=20= (annot-column=2036))=20;=2036=20is=20arbitrary=20number=20or=20(length=20= "Open=20in=20Other=20Window")=0A=20=20=20=20(if=20(and=20annot=20(not=20= (string-equal=20annot=20"")))=0A=20=20=20=20=20=20=20=20(if=20= poplife-bookmark-annotation-detail-flag=0A=20=20=20=20=20=20=20=20=20=20=20= =20(let=20((lines=20(poplife-split-string=20annot=20annot-column))=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20map)=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(dolist=20(line=20(reverse=20lines))=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(push=20(vector=20line=20= `(bookmark-edit-annotation=20,bookmark)=20:visible=20t=20:active=20t=20= :help=20bookmark)=20map))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cons=20"Edit=20Annotation..."=20map))=0A=20=20=20=20=20=20=20=20=20=20= (let=20(annot-name)=0A=20=20=20=20=20=20=20=20=20=20=20=20(setq=20= annot-name=20(format=20"Edit=20Annotation=20`%s'..."=20(if=20(>=20= (length=20annot)=20annot-column)=20(substring=20annot=200=20= annot-column)=20annot)))=0A=20=20=20=20=20=20=20=20=20=20=20=20(vector=20= annot-name=20`(bookmark-edit-annotation=20,bookmark)=20:visible=20t=20= :active=20t=20:help=20bookmark)))=0A=20=20=20=20=20=20(vector=20"Add=20= Annotation..."=20`(bookmark-edit-annotation=20,bookmark)=20:visible=20t=20= :active=20t=20:help=20bookmark))))=0A=0A(defun=20poplife-split-string=20= (string=20fill-length)=0A=20=20"Split=20STRING=20into=20list=20of=20= string.=0AArgument=20FILL-LENGTH=20determines=20length=20of=20each=20= line."=0A=20=20(setq=20string=20(replace-regexp-in-string=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(rx=20(*=20(any=20"=20\t\n"))=20eos)=20= ""=20string))=20;=20Chomp=20text.=0A=20=20(with-temp-buffer=0A=20=20=20=20= (insert=20string)=0A=20=20=20=20(let=20((fill-column=20fill-length)=20;=20= Replace=20text.=0A=20=20=20=20=20=20=20=20=20=20(find-repl-list=20= '(("^$"=20.=20"=20")=20("=20+"=20.=20"=20"))))=20;=20Avoid=20having=20= "--"=20on=20menu.=0A=20=20=20=20=20=20(fill-region=20(point-min)=20= (point-max))=0A=20=20=20=20=20=20(dolist=20(find-repl=20find-repl-list)=0A= =20=20=20=20=20=20=20=20(goto-char=20(point-min))=0A=20=20=20=20=20=20=20= =20(while=20(re-search-forward=20(car=20find-repl)=20nil=20t)=0A=20=20=20= =20=20=20=20=20=20=20(replace-match=20(cdr=20find-repl)))))=0A=20=20=20=20= (split-string=20(buffer-string)=20"\n")))=20;=20List=20of=20text=20= lines.=0A=0C=0A;;;=20File=0A(defun=20poplife-file-easymap=20(file=20= &optional=20submenu)=0A=20=20"Define=20easymenu=20to=20list=20a=20FILE.=0A= When=20SUBMENU=20it=20non-nil,=20this=20returns=20an=20easymenu=20with=20= multiple=20actions."=0A=20=20(setq=20file=20(expand-file-name=20file))=0A= =20=20(and=20(not=20(file-directory-p=20file))=0A=20=20=20=20=20=20=20= (let*=20(map=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20(file-nickname=20= (file-name-nondirectory=20file))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(file-readable-flag=20(and=20(file-regular-p=20file)=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(file-readable-p=20file)))=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(open-file-flag=20(and=20(not=20(string-match-p=20= poplife-file-do-not-open-regexp=20file))=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= file-readable-flag))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20(dir=20= (file-name-directory=20file))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (open-dir-flag=20(and=20(file-directory-p=20dir)=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(file-accessible-directory-p=20dir))))=0A=20=20=20=20=20=20=20=20=20= (if=20(not=20submenu)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20(vector=20= file-nickname=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20`(funcall=20(if=20,open-file-flag=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (quote=20,poplife-func-find-file)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(quote=20= ,poplife-func-find-file-by-default-app))=20,file)=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20:active=20(and=20= file-readable-flag=20;=20gray=20the=20vising=20file=20out=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(not=20(string=3D=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(and=20(buffer-file-name)=20(expand-file-name=20(buffer-file-name)))=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20file)))=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:help=20file)=0A=20=20=20=20= =20=20=20=20=20=20=20(push=20(vector=20"Open=20in=20File=20Browser"=20= `(poplife-find-location=20,file)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:active=20= open-dir-flag=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20:help=20dir)=20map)=0A=20=20=20=20=20=20=20=20=20=20=20= (push=20(vector=20"Open=20by=20Default=20App"=20= `(,poplife-func-find-file-by-default-app=20,file)=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= :active=20t=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20:help=20file)=20map)=0A=20=20=20=20=20=20=20=20=20=20=20= (push=20(vector=20"Open=20with=20Bookmarked..."=20`(progn=20(find-file=20= ,file)=20(bookmark-set))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20:visible=20(fboundp=20'bookmark-set)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= :active=20open-file-flag=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20:help=20"Open=20and=20Add=20to=20Bookmarks")=20= map)=0A=20=20=20=20=20=20=20=20=20=20=20(push=20(vector=20"Open=20in=20= Frame"=20`(find-file-other-frame=20,file)=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:active=20= open-file-flag=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20:help=20file)=20map)=0A=20=20=20=20=20=20=20=20=20=20=20= (push=20(vector=20"Open=20in=20Other=20Window"=20= `(find-file-other-window=20,file)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:active=20= open-file-flag=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20:help=20file)=20map)=0A=20=20=20=20=20=20=20=20=20=20=20= (push=20["--"=20ignore]=20map)=0A=20=20=20=20=20=20=20=20=20=20=20(push=20= (vector=20"Open"=20`(find-file=20,file)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:active=20(and=20= open-file-flag=20;=20gray=20the=20vising=20file=20out=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(not=20(string=3D=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(and=20(buffer-file-name)=20(expand-file-name=20= (buffer-file-name)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20file)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20:help=20file)=20map)=0A=20=20=20=20=20=20=20=20=20=20=20= (push=20(vector=20".."=20`(let=20((poplife-file-recursive=20= ,poplife-file-recursive)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (poplife-func-find-file=20(quote=20,poplife-func-find-file)))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(poplife-find-dir=20,dir,=20submenu))=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=20= :active=20open-dir-flag=20:help=20dir)=20map)=0A=20=20=20=20=20=20=20=20=20= =20=20(cons=20file-nickname=20map)))))=0A;;=20(let=20((foo=20= (poplife-file-easymap=20"~/.emacs.d/init.el")))=20(describe-variable=20= 'foo))=0A;;=20(let=20((foo=20(poplife-file-easymap=20= "~/.emacs.d/init.el"=20t)))=20(describe-variable=20'foo))=0A=0A(defun=20= poplife-dir-easymap=20(dir=20&optional=20submenu=20depth)=0A=20=20= "Define=20easymenu=20to=20list=20files=20and=20directories=20in=20DIR.=0A= When=20SUBMENU=20is=20non-nil,=20this=20returns=20an=20easymenu=20with=20= multiple=20actions.=0AWhen=20DEPTH=20is=20more=20than=201,=20DIR=20is=20= recursively=20scanned."=0A=20=20(when=20(string-match-p=20= poplife-dir-do-not-scan-regexp=20dir)=0A=20=20=20=20(setq=20dir=20"~"))=0A= =20=20(setq=20dir=20(directory-file-name=20(expand-file-name=20dir)))=20= ;=20Remove=20slash=20at=20the=20end.=0A=20=20(or=20depth=20(setq=20depth=20= 1))=0A=20=20(let=20(map=20base-dir=20parent-dir=20rawfiles=20menufiles)=0A= =20=20=20=20(setq=20base-dir=20(file-name-as-directory=20= (file-name-nondirectory=20dir)))=20;=20Add=20slash=20at=20the=20end.=0A=20= =20=20=20(setq=20parent-dir=20(directory-file-name=20= (file-name-directory=20dir)))=0A=20=20=20=20;;=20Obtain=20a=20file=20= list.=0A=20=20=20=20(setq=20rawfiles=20(ignore-errors=20(directory-files=20= dir=20t)))=0A=20=20=20=20;;=20Filter=20out=20trivial=20files.=0A=20=20=20= =20(dolist=20(fullfile=20rawfiles)=0A=20=20=20=20=20=20(let=20= ((file-nickname=20(file-name-nondirectory=20fullfile)))=0A=20=20=20=20=20= =20=20=20(unless=20(string-match-p=20poplife-file-do-not-show-regexp=20= file-nickname)=0A=20=20=20=20=20=20=20=20=20=20(push=20fullfile=20= menufiles))))=0A=20=20=20=20;;=20Limit=20number=20of=20menufiles=0A=20=20= =20=20(when=20(and=20poplife-file-max-menu-items=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(not=20submenu))=0A=20=20=20=20=20=20(let=20((nfile=20= (length=20menufiles)))=0A=20=20=20=20=20=20=20=20(setq=20menufiles=20= (nthcdr=20(-=20nfile=20poplife-file-max-menu-items)=20menufiles))))=0A=20= =20=20=20;;=20Add=20More=20menu.=0A=20=20=20=20(push=20(vector=20= "More..."=20;=20Item=20to=20open=20a=20current=20directory.=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20`(let=20= (poplife-file-max-menu-items=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20;;=20(poplife-file-recursive=20,(1+=20= poplife-file-recursive))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(poplife-file-recursive=20= ,poplife-file-recursive)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(poplife-func-find-file=20(quote=20= ,poplife-func-find-file)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(poplife-find-dir=20,dir=20t))=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20:active=20`(not=20,submenu)=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20:help=20dir)=0A=20=20=20=20=20=20=20=20=20= =20map)=0A=20=20=20=20;;=20Create=20map=20with=20files=20and=20= directories.=0A=20=20=20=20(dolist=20(fullfile=20menufiles)=0A=20=20=20=20= =20=20(let=20((file-nickname=20(file-name-nondirectory=20fullfile)))=0A=20= =20=20=20=20=20=20=20(if=20(file-directory-p=20fullfile)=20;=20when=20= item=20is=20directory=0A=20=20=20=20=20=20=20=20=20=20=20=20(push=20(if=20= (or=20(>=3D=20depth=20poplife-file-recursive)=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(not=20= (file-accessible-directory-p=20fullfile)))=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(vector=20(file-name-as-directory=20= file-nickname)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20`(let=20((poplife-file-recursive=20= ,poplife-file-recursive)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (poplife-func-find-file=20(quote=20,poplife-func-find-file)))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(poplife-find-dir=20,fullfile=20,submenu))=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= :active=20(file-accessible-directory-p=20fullfile)=20:help=20fullfile)=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (poplife-dir-easymap=20fullfile=20submenu=20(1+=20depth)))=20;=20= recursive=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20map)=0A= =20=20=20=20=20=20=20=20=20=20(push=20;=20when=20item=20is=20file=20= (that=20is=20defined=20as=20`not=20a=20directory')=0A=20=20=20=20=20=20=20= =20=20=20=20(poplife-file-easymap=20fullfile=20submenu)=0A=20=20=20=20=20= =20=20=20=20=20=20map))))=0A=20=20=20=20(push=20["--"=20ignore]=20map)=0A= =20=20=20=20(push=20(if=20(not=20submenu)=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20;;=20Single=20item=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (vector=20"."=20;=20item=20to=20open=20current=20directory=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= `(,poplife-func-find-file=20,dir=20,submenu)=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=20:active=20t=20= :help=20dir)=0A=20=20=20=20=20=20=20=20=20=20=20=20;;=20Multiple=20items=20= in=20submenu.=0A=20=20=20=20=20=20=20=20=20=20=20=20(delq=20nil=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(list=20"."=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(vector=20= "Open"=20;=20item=20to=20open=20current=20directory=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= `(find-file=20,dir)=20;=20,poplife-func-find-file=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= :visible=20t=20:active=20t=20:help=20dir)=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20["--"=20ignore]=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(vector=20"Open=20= in=20Other=20Window"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20`(find-file-other-window=20= ,dir)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20:visible=20t=20:active=20t=20:help=20dir)=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (vector=20"Open=20in=20Frame"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= `(find-file-other-frame=20,dir)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=20= :active=20t=20:help=20dir)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(vector=20"Open=20with=20Bookmarked..."=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20`(progn=20(find-file=20,dir)=20(bookmark-set))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20:visible=20(fboundp=20'bookmark-set)=20:active=20t=20:help=20= "Open=20and=20Add=20to=20Bookmarks")=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(vector=20"Open=20in=20File=20= Browser"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20= `(,poplife-func-find-file-by-default-app=20,dir)=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= :visible=20t=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20:active=20t=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= :help=20dir))))=0A=20=20=20=20=20=20=20=20=20=20map)=0A=20=20=20=20(push=20= (vector=20".."=20;=20Item=20to=20open=20parent=20directory.=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20`(let=20= ((poplife-file-recursive=20,poplife-file-recursive)=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (poplife-func-find-file=20(quote=20,poplife-func-find-file)))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(poplife-find-dir=20= ,parent-dir=20,submenu))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20:active=20t=20:help=20parent-dir)=0A=20=20=20=20=20=20=20=20=20=20= map)=0A=20=20=20=20(setq=20base-dir=20(replace-regexp-in-string=20"^@"=20= "at"=20base-dir=20t=20t))=0A=20=20=20=20(cons=20base-dir=20map)))=0A;;=20= (let=20((foo=20(poplife-dir-easymap=20"~/.emacs.d")))=20= (describe-variable=20'foo))=0A;;=20(let=20((foo=20(poplife-dir-easymap=20= "~/.emacs.d"=20t)))=20(describe-variable=20'foo))=0A;;=20(popup-menu=20= (poplife-dir-easymap=20"~/"))=0A=0C=0A;;;=20Util=0A(defun=20= poplife-func-switch-to-buffer=20()=0A=20=20"Return=20switch-to-buffer=20= function=20that=20corresponds=20to=20`poplife-func-find-file'."=0A=20=20= (cdr=20(assoc=20poplife-func-find-file=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20'((find-file=20.=20switch-to-buffer)=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(find-file-other-window=20.=20= switch-to-buffer-other-window)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(find-file-other-frame=20.=20switch-to-buffer-other-frame)))))=0A= ;;=20(let=20((foo=20(poplife-func-switch-to-buffer)))=20= (describe-variable=20'foo))=0A=0A(defun=20poplife-find-dir=20(dir=20= &optional=20submenu)=0A=20=20"Visit=20directory=20DIR=20using=20= `popup-menu'.=0AWhen=20SUBMENU=20is=20non-nil,=20this=20offers=20= multiple=20actions."=0A=20=20;;=20(interactive=20(list=20= (read-directory-name=20"Find=20directory:=20")))=0A=20=20(popup-menu=20= (poplife-dir-easymap=20dir=20submenu)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(popup-menu-normalize-position=20last-nonmenu-event)))=0A=0A= (defun=20poplife-find-location=20(file)=0A=20=20"Visit=20directory=20= that=20contains=20FILE."=0A=20=20(cond=0A=20=20=20((eq=20system-type=20= 'darwin)=0A=20=20=20=20;;=20Select=20file=20in=20Finder.=0A=20=20=20=20= (ns-do-applescript=0A=20=20=20=20=20(format=20"tell=20application=20= \"Finder\"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20set=20= thePath=20to=20POSIX=20file=20\"%s\"=20as=20string=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20activate=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20reveal=20thePath=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20end=20tell"=20file)))=0A=20=20=20((eq=20system-type=20= 'windows-nt)=0A=20=20=20=20;;=20Select=20file=20in=20File=20Explore.=0A=20= =20=20=20(w32-shell-execute=20"open"=20"explorer"=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(concat=20"/e,/select,"=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(poplife-convert-w32-filename=20file))))=0A=20=20=20= ((eq=20system-type=20'gnu/linux)=0A=20=20=20=20;;=20Visit=20dir=20that=20= contains=20file=20by=20default-app.=0A=20=20=20=20;;=20(start-process=20= "select-file-by-nautilus"=20nil=20"nautilus"=20file)=0A=20=20=20=20= (start-process=20"open-dir-by-xdg-open"=20nil=20"xdg-open"=20= (file-name-directory=20file)))=0A=20=20=20(t=0A=20=20=20=20;;=20Select=20= file=20in=20Dired=0A=20=20=20=20(dired-other-frame=20= (file-name-directory=20file))=20;=20Visit=20dir=20that=20contains=20file=0A= =20=20=20=20(dired-goto-file=20file))))=20;=20Move=20point=20to=20file=0A= =0A(defun=20poplife-convert-w32-filename=20(file-name)=0A=20=20"Mirror=20= slash=20characters=20in=20file=20names=20into=20backslashes."=0A=20=20;;=20= https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D24387=0A=20=20;;=20= https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D28883=0A=20=20(let=20= ((start=200))=0A=20=20=20=20(while=20(string-match=20"/"=20file-name=20= start)=0A=20=20=20=20=20=20(aset=20file-name=20(match-beginning=200)=20= ?\\)=0A=20=20=20=20=20=20(setq=20start=20(match-end=200)))=0A=20=20=20=20= file-name))=0A=0A(defun=20poplife-find-file-by-default-app=20(file)=0A=20= =20"Visit=20FILE=20by=20default=20application=20or=20default=20file=20= browser."=0A=20=20(when=20(plist-get=20poplife-edit-cottager=20:recentf)=0A= =20=20=20=20(recentf-push=20file))=0A=20=20(cond=0A=20=20=20((eq=20= system-type=20'gnu/linux)=0A=20=20=20=20(start-process=20= "find-file-by-default-app"=20nil=20"xdg-open"=20file))=20;=20Visit=20= file=20by=20default-app=0A=20=20=20((eq=20system-type=20'darwin)=0A=20=20= =20=20(start-process=20"find-file-by-default-app"=20nil=20"open"=20= file))=20;=20Visit=20file=20by=20default-app=0A=20=20=20((eq=20= system-type=20'cygwin)=0A=20=20=20=20(start-process=20= "find-file-by-default-app"=20nil=20"cygstart"=20file))=20;=20Visit=20= file=20by=20default-app=0A=20=20=20((eq=20system-type=20'windows-nt)=0A=20= =20=20=20(w32-shell-execute=20"open"=20"explorer"=20= (poplife-convert-w32-filename=20file)))=20;=20visit=20file=20by=20= default-app=0A=20=20=20(t=0A=20=20=20=20(find-file-other-frame=20= file))))=0A=0A(defun=20poplife-url-on-click-easymap=20(event)=0A=20=20= "Define=20easymenu=20of=20an=20URL=20that=20is=20under=20mouse=20click=20= EVENT.=0AThe=20URL=20is=20identified=20by=20= `thing-at-point-url-at-point'."=0A=20=20(save-excursion=0A=20=20=20=20= (mouse-set-point=20event)=0A=20=20=20=20;;=20= https://www.gnu.org/software/emacs/=0A=20=20=20=20(let=20((url=20(or=20= (thing-at-point-url-at-point=20t)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(get-text-property=20(point)=20'shr-url)=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(get-text-property=20= (point)=20'image-url))))=0A=20=20=20=20=20=20(when=20url=0A=20=20=20=20=20= =20=20=20=20=20(list=20url=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(vector=20"Open"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20`(eww=20,url)=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20:visible=20t=20:active=20t=20:help=20= url)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20["--"=20ignore]=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(vector=20"Copy=20Link=20= Location"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20`(kill-new=20,url)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20:visible=20t=20:active=20t=20:help=20url)=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(vector=20"Open=20in=20= Other=20Window"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20eww-browse-url,=20eww-open-in-new-buffer=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20`(progn=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (switch-to-buffer-other-window=20(generate-new-buffer=20"*eww*"))=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (eww-mode)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(eww=20,url))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20:visible=20t=20:active=20t=20:help=20= url)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(vector=20"Open=20= in=20Frame"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20`(progn=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(switch-to-buffer-other-frame=20= (generate-new-buffer=20"*eww*"))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(eww-mode)=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(eww=20,url))=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= :visible=20t=20:active=20t=20:help=20url)=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(vector=20"Open=20by=20Default=20App"=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20`(let=20= ((browse-url-browser-function=20'browse-url-default-browser))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (browse-url=20,url))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20:visible=20t=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20:active=20t=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:help=20url))))))=0A=0A= (provide=20'poplife)=0A;;;=20poplife.el=20ends=20here=0A= --Apple-Mail=_79348C26-CF61-4E10-8F80-555960630B91--