From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David PONCE Newsgroups: gmane.emacs.devel Subject: Re: [Stephen.Berman@gmx.net: Recentf and gzipped elisp source files] Date: Thu, 24 Nov 2005 11:01:51 +0100 (CET) Message-ID: <10324035.1132826511689.JavaMail.www@wwinf1615> Reply-To: david.ponce@wanadoo.fr NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1132835049 11457 80.91.229.2 (24 Nov 2005 12:24:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 24 Nov 2005 12:24:09 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 24 13:24:06 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EfG7m-0000fd-1w for ged-emacs-devel@m.gmane.org; Thu, 24 Nov 2005 13:22:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EfG7k-0003sB-Ly for ged-emacs-devel@m.gmane.org; Thu, 24 Nov 2005 07:22:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EfEFt-00089q-TD for emacs-devel@gnu.org; Thu, 24 Nov 2005 05:23:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EfE4d-00076e-Mi for emacs-devel@gnu.org; Thu, 24 Nov 2005 05:11:29 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EfDvO-0005gz-QX for emacs-devel@gnu.org; Thu, 24 Nov 2005 05:01:55 -0500 Original-Received: from [193.252.23.89] (helo=smtp16.wanadoo.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EfDvN-0001Ob-Ry for emacs-devel@gnu.org; Thu, 24 Nov 2005 05:01:54 -0500 Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1602.wanadoo.fr (SMTP Server) with ESMTP id AD624700008E for ; Thu, 24 Nov 2005 11:01:51 +0100 (CET) Original-Received: from wwinf1615 (wwinf1615 [172.22.147.59]) by mwinf1602.wanadoo.fr (SMTP Server) with ESMTP id A9AA27000081; Thu, 24 Nov 2005 11:01:51 +0100 (CET) X-ME-UUID: 20051124100151695.A9AA27000081@mwinf1602.wanadoo.fr Original-To: Stephen.Berman@gmx.net, rms@gnu.org X-Originating-IP: [205.167.7.18] X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-TO: |~||~| X-WUM-CC: |~| X-WUM-REPLYTO: |~| X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:46507 Archived-At: Hi, Richard M. Stallman wrote: > Please DTRT and ack. >=20 > ------- Start of forwarded message ------- [...] > Since the change by which Emacs lisp source files are automatically > gzipped if possible, these are not listed in the recentf menu under > the entry "emacs-lisp" when recentf-menu-filter is set to > recentf-arrange-by-mode, although such files are visited in > emacs-lisp-mode; rather, they are listed under the entry "others". [...] Please, could you try the patch below. It fixes the problem for me. David 2005-11-24 David Ponce =09* recentf.el (recentf-arrange-by-rule): Handle a special =09`auto-mode-alist'-like "strip suffix" rule. =09(recentf-build-mode-rules): Handle second level auto-mode entries. Index: recentf.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/emacs/emacs/lisp/recentf.el,v retrieving revision 1.48 diff -c -r1.48 recentf.el *** recentf.el=0914 Oct 2005 09:04:38 -0000=091.48 --- recentf.el=0924 Nov 2005 09:44:59 -0000 *************** *** 813,826 **** Arrange them in sub-menus following rules in `recentf-arrange-rules'." (if (not recentf-arrange-rules) l ! (let ((menus (mapcar #'(lambda (r) (list (car r))) ! recentf-arrange-rules)) ! menu others min file rules elts count) (dolist (elt l) (setq file (recentf-menu-element-value elt) rules recentf-arrange-rules elts menus menu nil) (while (and (not menu) rules) (when (recentf-match-rule-p (cdar rules) file) (setq menu (car elts)) --- 813,832 ---- Arrange them in sub-menus following rules in `recentf-arrange-rules'." (if (not recentf-arrange-rules) l ! (let* ((strip (assq t recentf-arrange-rules)) ! (menus (mapcar #'(lambda (r) (list (car r))) ! (remq strip recentf-arrange-rules))) ! menu others min file rules elts count) ! ;; Group menu items in the sub-menus defined in rules. (dolist (elt l) (setq file (recentf-menu-element-value elt) rules recentf-arrange-rules elts menus menu nil) + ;; Apply the strip suffix rule. + (while (recentf-match-rule-p (cdr strip) file) + (setq file (substring file 0 (match-beginning 0)))) + ;; Search in which group to put the menu item. (while (and (not menu) rules) (when (recentf-match-rule-p (cdar rules) file) (setq menu (car elts)) *************** *** 828,836 **** menu (cons elt (recentf-menu-element-value menu)))) (setq rules (cdr rules) elts (cdr elts))) (unless menu (push elt others))) !=20 (setq l nil min (if (natnump recentf-arrange-by-rules-min-items) recentf-arrange-by-rules-min-items 0)) --- 834,844 ---- menu (cons elt (recentf-menu-element-value menu)))) (setq rules (cdr rules) elts (cdr elts))) + ;; Put unmatched menu-items in an "other" bin. (unless menu (push elt others))) ! ;; Setup the sub-menus from the groups of menu-items. Count ! ;; sub-menu elements, and apply sub-filter to menu-items. (setq l nil min (if (natnump recentf-arrange-by-rules-min-items) recentf-arrange-by-rules-min-items 0)) *************** *** 845,851 **** menu (recentf-apply-menu-filter recentf-arrange-by-rule-subfilter (nreverse elts))) (push menu l)))) !=20 (if (and (stringp recentf-arrange-by-rule-others) others) (nreverse (cons --- 853,859 ---- menu (recentf-apply-menu-filter recentf-arrange-by-rule-subfilter (nreverse elts))) (push menu l)))) ! ;; Add items in the "other" bin. (if (and (stringp recentf-arrange-by-rule-others) others) (nreverse (cons *************** *** 857,864 **** (nconc (nreverse l) (recentf-apply-menu-filter ! recentf-arrange-by-rule-subfilter (nreverse others))))) ! )) =0C ;;; Predefined rule based menu filters ;; --- 865,871 ---- (nconc (nreverse l) (recentf-apply-menu-filter ! recentf-arrange-by-rule-subfilter (nreverse others))))))) =0C ;;; Predefined rule based menu filters ;; *************** *** 870,881 **** (dolist (mode auto-mode-alist) (setq regexp (car mode) mode (cdr mode)) ! (when (symbolp mode) ! (setq rule-name (symbol-name mode)) ! (if (string-match "\\(.*\\)-mode$" rule-name) ! (setq rule-name (match-string 1 rule-name))) ! (setq rule-name (concat rule-name " (%d)") ! rule (assoc rule-name rules)) (if rule (setcdr rule (cons regexp (cdr rule))) (push (list rule-name regexp) rules)))) --- 877,896 ---- (dolist (mode auto-mode-alist) (setq regexp (car mode) mode (cdr mode)) ! (when mode ! (cond ! ;; Build a special "strip suffix" rule from entries of the ! ;; form (REGEXP FUNCTION NON-NIL). Notice that FUNCTION is ! ;; ignored by the menu filter. So in some corner cases a ! ;; wrong mode could be guessed. ! ((and (consp mode) (cadr mode)) ! (setq rule-name t)) ! ((and mode (symbolp mode)) ! (setq rule-name (symbol-name mode)) ! (if (string-match "\\(.*\\)-mode$" rule-name) ! (setq rule-name (match-string 1 rule-name))) ! (setq rule-name (concat rule-name " (%d)")))) ! (setq rule (assoc rule-name rules)) (if rule (setcdr rule (cons regexp (cdr rule))) (push (list rule-name regexp) rules))))