From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: Generating a listing of all symbols (16K+) and labeling subsets Date: Fri, 18 Apr 2014 12:09:59 +0200 Message-ID: <87lhv3uex4.fsf@gmail.com> References: <87sipb5ckz.fsf@zigzag.favinet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1397815757 7957 80.91.229.3 (18 Apr 2014 10:09:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Apr 2014 10:09:17 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 18 12:09:10 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 1Wb5jI-0001K8-DP for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Apr 2014 12:09:08 +0200 Original-Received: from localhost ([::1]:37136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wb5jH-00052L-Tm for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Apr 2014 06:09:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wb5ix-00052C-15 for help-gnu-emacs@gnu.org; Fri, 18 Apr 2014 06:08:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wb5ir-0004BZ-4G for help-gnu-emacs@gnu.org; Fri, 18 Apr 2014 06:08:46 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:47247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wb5iq-0004B9-Tq for help-gnu-emacs@gnu.org; Fri, 18 Apr 2014 06:08:41 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Wb5ip-0000RC-GC for help-gnu-emacs@gnu.org; Fri, 18 Apr 2014 12:08:39 +0200 Original-Received: from e178054054.adsl.alicedsl.de ([85.178.54.54]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Apr 2014 12:08:39 +0200 Original-Received: from tjolitz by e178054054.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Apr 2014 12:08:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 81 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178054054.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:HlUkSsb5xVZ8ayWxIRvRBPo7xBk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:97191 Archived-At: Thien-Thi Nguyen writes: > () hansbkk@gmail.com > () Thu, 17 Apr 2014 22:09:35 -0400 > > I'd specifically like to ask about the logic of the > categorizing breakdown and for better taxonomy terms. > > It is a category error to categorize Emacs Lisp symbols into > (single) buckets, unless you wish to defer understanding. :-D I wrote something similar (but much simpler) recently for getting a list of all mode commands with keybindings, and detecting keybinding conflicts between two modes: * Compare Keymaps #+begin_src emacs-lisp (defun omm-get-cmd-symbols-with-keys (rgxp mode &optional req) "Return alist of (key . sym) pairs where sym matches RGXP. Require REQ and load MODE in temp buffer before doing the real work. Push the intermediary results of `mapatoms' to `omm-tmp-storage'. Usage example: (pp (omm-get-cmd-symbols-with-keys \"\\(^org-\\|^orgtbl-\\)\" 'org-mode 'org))" (setq omm-tmp-storage nil) (mapatoms (lambda (--sym) (eval `(and (commandp --sym) (string-match ,rgxp (symbol-name --sym)) (with-temp-buffer (when ,req (require (quote ,req))) (funcall (quote ,mode)) (let ((cmd-key (substitute-command-keys (concat "\\[" (symbol-name --sym) "]")))) (push (cons (if (string-match "^M-x " cmd-key) nil cmd-key) --sym) omm-tmp-storage))))))) (delq nil (mapcar (lambda (--pair) (if (car --pair) --pair nil)) (delq nil omm-tmp-storage)))) #+end_src #+begin_src emacs-lisp (defun omm-get-keybinding-conflicts (cmd-syms1 cmd-syms2) "Return alist with common keys of CMD-SYMS1 and CMD-SYMS2. The return-list consists of sublists of this form (event definition-map1 definition-map2) Usage example: (pp (omm-get-keybinding-conflicts (omm-get-cmd-symbols-with-keys \"^magit-\" 'magit-mode) (omm-get-cmd-symbols-with-keys \"^dired-\" 'dired-mode)))" (let ((keys2 (map 'car cmd-syms2))) ; FIXME with org-mode-map (delq nil (mapcar (lambda (--pair) (when (member (car --pair) keys2) (list (car --pair) (cdr --pair) (cdr (assoc (car --pair) cmd-syms2))))) cmd-syms1)))) #+end_src -- cheers, Thorsten