From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jambunathan K Newsgroups: gmane.emacs.bugs Subject: bug#13892: 24.3.50; Provide for customizing default regexp in hi-lock commands Date: Thu, 07 Mar 2013 16:01:57 +0530 Message-ID: <87wqtjwleq.fsf@gmail.com> References: <87fw08za2u.fsf@gmail.com> <87ehfrmv92.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362652358 15530 80.91.229.3 (7 Mar 2013 10:32:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 Mar 2013 10:32:38 +0000 (UTC) Cc: 13892@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 07 11:33:00 2013 Return-path: Envelope-to: geb-bug-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 1UDY8B-0006lI-QT for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Mar 2013 11:33:00 +0100 Original-Received: from localhost ([::1]:38272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDY7q-0003l7-3f for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Mar 2013 05:32:38 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDY7m-0003kw-2c for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2013 05:32:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDY7k-0006z5-0l for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2013 05:32:34 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDY7j-0006z1-Ue for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2013 05:32:31 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UDY8E-00044J-CF for bug-gnu-emacs@gnu.org; Thu, 07 Mar 2013 05:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jambunathan K Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Mar 2013 10:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13892 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13892-submit@debbugs.gnu.org id=B13892.136265236315615 (code B ref 13892); Thu, 07 Mar 2013 10:33:02 +0000 Original-Received: (at 13892) by debbugs.gnu.org; 7 Mar 2013 10:32:43 +0000 Original-Received: from localhost ([127.0.0.1]:35567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDY7v-00043o-5h for submit@debbugs.gnu.org; Thu, 07 Mar 2013 05:32:43 -0500 Original-Received: from mail-pa0-f43.google.com ([209.85.220.43]:45072) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDY7q-00043Y-7Y for 13892@debbugs.gnu.org; Thu, 07 Mar 2013 05:32:41 -0500 Original-Received: by mail-pa0-f43.google.com with SMTP id bh2so375275pad.16 for <13892@debbugs.gnu.org>; Thu, 07 Mar 2013 02:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=4pTxryESy54KYt1tuQX9PJWNqctYM96IzZX4uUOs6pE=; b=TnTYOFelcpIqLTBlJR6Jz/YQg2Bz9tH1lhSbuT4kDz0+UbU89B6zc69FTJvGouNs30 7T8UIWIaatKrmUbzNQ1vLlKY/Ovec6rqkMATg3yFdL3T9gIPEwZ1otkUXzEXNnNd/q24 afZgSQV0DB0oy2f4LHKvAlZY10rx5ZSEMC0LCNlmluZZRYz3WXorGaHLvFCEBj7K5HVM OYgYNjTCtXYf8zOwWH+xwSZQNW+b6pXiZiBYOdc9vTZuLi802NV7sESaq5WqtA7w9PV0 YThhgaMm2H1H4U13wJLtmLYwxGD886KYeWXg3BM3D4xwT2APtwJkZEWVydx5G87K6bAQ UM8w== X-Received: by 10.68.116.169 with SMTP id jx9mr52126954pbb.94.1362652321289; Thu, 07 Mar 2013 02:32:01 -0800 (PST) Original-Received: from debian-6.05 ([101.63.208.188]) by mx.google.com with ESMTPS id wm3sm1275366pbc.4.2013.03.07.02.31.57 (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Thu, 07 Mar 2013 02:32:00 -0800 (PST) In-Reply-To: <87ehfrmv92.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 07 Mar 2013 11:09:29 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72197 Archived-At: Juri Linkov writes: >> +(defvar hi-lock-read-regexp-defaults-function >> + 'hi-lock-read-regexp-defaults >> + "Function that provides default regexp(s) for highlighting commands. >> +This function should take one argument OP and return one of nil, >> +a regexp or a list of regexps for use with highlighting command >> +OP. OP, a symbol, can be one of `phrase', `line' or `nil' >> +signifying commands `hi-lock-face-phrase-buffer', >> +`hi-lock-line-face-buffer' and `hi-lock-face-buffer' >> +respectively. > > Requiring an additional argument `op' means that we wouldn't > be able to customize `hi-lock-read-regexp-defaults-function' > to just `find-tag-default' or `find-tag-default-as-regexp'. > I think there is no need to distinguish between different > hi-lock commands since one user would very likely prefer > the one way to get the default for all hi-lock commands, > so you could call `hi-lock-read-regexp-defaults-function' > without arguments. I had the same thought but ended up with having an OP. If we want to remove OP but still want the ability to choose the regexp based on the highlighting command, then may be `this-command' can take the place of OP. ps: Does EmacsLisp have notion of function pointers (as in C). Here the function pointer is not declared and the function pointer could well be set in a .emacs file. So there is no way the byte-compiler can complain based on arity. Does runtime check for arity? (I don't think so). May be (i.e., technically) it is OK to call a function that takes no argument with a single argument? I don't know. Let's see what others think.