From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xue Fuqiao Newsgroups: gmane.emacs.devel Subject: Re: About elements in `format-alist' Date: Tue, 18 Jun 2013 06:59:49 +0800 Message-ID: References: <878v28tlyh.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1371509996 2926 80.91.229.3 (17 Jun 2013 22:59:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Jun 2013 22:59:56 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 18 00:59:57 2013 Return-path: Envelope-to: ged-emacs-devel@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 1UoiOx-0005dh-3a for ged-emacs-devel@m.gmane.org; Tue, 18 Jun 2013 00:59:55 +0200 Original-Received: from localhost ([::1]:43481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoiOw-0003jm-KF for ged-emacs-devel@m.gmane.org; Mon, 17 Jun 2013 18:59:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoiOt-0003hn-64 for emacs-devel@gnu.org; Mon, 17 Jun 2013 18:59:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoiOs-0005uA-9O for emacs-devel@gnu.org; Mon, 17 Jun 2013 18:59:51 -0400 Original-Received: from mail-ie0-x236.google.com ([2607:f8b0:4001:c03::236]:47443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoiOs-0005tz-4Z for emacs-devel@gnu.org; Mon, 17 Jun 2013 18:59:50 -0400 Original-Received: by mail-ie0-f182.google.com with SMTP id s9so8423290iec.27 for ; Mon, 17 Jun 2013 15:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=XKS8YESBUdE6a6U1rGXpeG+l5kAgZWnRSWsh+DPBN3U=; b=hkQcrPjwWt+7ftegHqMwMEvjeiMDWJ41GZzP+w7R3jP1NObqxn7peGDIWMXgBqn66l prulytD/JZ96qcpZJp2WDKdGCwbsBQoAzsAW2CAuDl5lNpjs31aZF3NVIl8tcYsq00vr aEx2YGxGYOxgew6aPogZBBhxfMNhLd9jQsaRVrvstfPH9cssm1Brs+PpkO1+Io24pS85 rA2ETWlyhlHqrftFM3Vf79DIjkfjSuuTC1OXdkphvtnITaqDE8OLEEReoCR1lJkw6QVm PuX7cGhgTMXN+jB24U0+A5AP4YZ3FrhJPFL14MrjlMCBbHmfyiRDP2UHK+nDJu/Der8C 0wBA== X-Received: by 10.50.29.107 with SMTP id j11mr6021232igh.105.1371509989482; Mon, 17 Jun 2013 15:59:49 -0700 (PDT) Original-Received: by 10.42.159.68 with HTTP; Mon, 17 Jun 2013 15:59:49 -0700 (PDT) In-Reply-To: <878v28tlyh.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160537 Archived-At: On Tue, Jun 18, 2013 at 6:24 AM, Michael Heerdegen wrote: > Xue Fuqiao writes: > >> Hi list, >> >> In the doc string of `format-alist': >> >> Elements are of the form >> (NAME DOC-STR REGEXP FROM-FN TO-FN MODIFY MODE-FN PRESERVE). >> >> There should be 8 elements in each list. But there are only 7 elements >> in each list of the default value. Which one is absent? If there's an >> optional element, I think we should mention it in the doc string. > > Looks like missing elements are just treated as if they were nil (the > code uses `nth'). Thanks. May I install the following patch to trunk? === modified file 'lisp/format.el' --- lisp/format.el 2013-01-01 09:11:05 +0000 +++ lisp/format.el 2013-06-17 22:57:24 +0000 @@ -101,6 +101,7 @@ "List of information about understood file formats. Elements are of the form \(NAME DOC-STR REGEXP FROM-FN TO-FN MODIFY MODE-FN PRESERVE). +If an element list is not that long, the excessive part is taken as nil. NAME is a symbol, which is stored in `buffer-file-format'. -- Best regards, Xue Fuqiao. http://www.gnu.org/software/emacs/