From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Wierd Elispsisms (was: trunk r113793: lisp/*.el: More lexical-binding warnings' cleanups.) Date: Sun, 11 Aug 2013 13:16:40 +0200 Message-ID: <87iozcmq93.fsf@wanadoo.es> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376219831 7619 80.91.229.3 (11 Aug 2013 11:17:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 Aug 2013 11:17:11 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Aug 11 13:17:12 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 1V8Te4-00032R-7h for ged-emacs-devel@m.gmane.org; Sun, 11 Aug 2013 13:17:12 +0200 Original-Received: from localhost ([::1]:35331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8Te3-0006av-P2 for ged-emacs-devel@m.gmane.org; Sun, 11 Aug 2013 07:17:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8Tdu-0006Zt-CA for emacs-devel@gnu.org; Sun, 11 Aug 2013 07:17:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8Tdn-0002s4-1w for emacs-devel@gnu.org; Sun, 11 Aug 2013 07:17:02 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:48556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8Tdm-0002rr-Rg for emacs-devel@gnu.org; Sun, 11 Aug 2013 07:16:54 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V8Tdj-0002lh-36 for emacs-devel@gnu.org; Sun, 11 Aug 2013 13:16:51 +0200 Original-Received: from 137.red-83-61-144.dynamicip.rima-tde.net ([83.61.144.137]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Aug 2013 13:16:51 +0200 Original-Received: from ofv by 137.red-83-61-144.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 11 Aug 2013 13:16:51 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 137.red-83-61-144.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:NpqYEhZo9tKPORHhxNyBHZ88Mtg= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:162562 Archived-At: Juanma Barranquero writes: [elisp/woman.el] @@ -1614,7 +1614,7 @@ (let* ((bufname (file-name-nondirectory file-name)) (case-fold-search t) (compressed - (not (not (string-match woman-file-compression-regexp bufname))))) + (and (string-match-p woman-file-compression-regexp bufname) t))) (if compressed (setq bufname (file-name-sans-extension bufname))) The expressions (not (not (something))) and (and (something-p) t) look bizarre. As someone who is not strong on Elisp, I was puzzled at first. Finally realized that the point is to force a boolean value for `compressed'. Why is so important to use a nil/t value for `compressed'? And, if there exists a reason for using nil/t instead of the original value here and elsewhere, why doesn't exist a function for casting an arbitrary value to a boolean? Using (and ... t) or (not (not ...)) is probably not harder to type than a function, but the function has the advantage of clearly conveying the intention and is safer to edit.