From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.help Subject: Re: Help setting nadvice for indent-region Date: Thu, 11 Feb 2016 20:38:49 +0000 Message-ID: References: <87a8ne2k6v.fsf@web.de> <87bn7n15ki.fsf@web.de> <87vb5vys7n.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 1455223153 26220 80.91.229.3 (11 Feb 2016 20:39:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Feb 2016 20:39:13 +0000 (UTC) To: Michael Heerdegen , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Feb 11 21:39:12 2016 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 1aTy1A-0004At-Hu for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Feb 2016 21:39:12 +0100 Original-Received: from localhost ([::1]:53379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTy1A-0001AG-0M for geh-help-gnu-emacs@m.gmane.org; Thu, 11 Feb 2016 15:39:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTy0z-00018k-1P for help-gnu-emacs@gnu.org; Thu, 11 Feb 2016 15:39:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTy0y-0007NK-2E for help-gnu-emacs@gnu.org; Thu, 11 Feb 2016 15:39:00 -0500 Original-Received: from mail-ob0-x236.google.com ([2607:f8b0:4003:c01::236]:34402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTy0x-0007NG-SW for help-gnu-emacs@gnu.org; Thu, 11 Feb 2016 15:38:59 -0500 Original-Received: by mail-ob0-x236.google.com with SMTP id wb13so92914330obb.1 for ; Thu, 11 Feb 2016 12:38:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=b2tBDmbPvx4VwR+l0D1S7TdS5hwNQ8dfvResRhNME+0=; b=X13ye8TMayabNW91Sg3t0fqab52xrARi+51abCTm2lxpJp/k4YpPLNNYlF6NS5kPMx /SN1KVL3PUnGBVkZp/dwDHJ76evfdwFtvWcHegw5RpAn41dPkGr+lYRR+SzEYUS2DDOQ BULjbdc319Tk2+r27KgrBDfzwAdX5XXXJIADr1ALh+KGsAytP8fT9ZMEE2ReFiMHmcC2 Gt+SOsBRkcd1DA9H726OfSk1dtYLXVZRWaVDiVyUuC/R4OySriFJIissTOka1bfcAaKx 6jSxQwDZZZ4aW6Rdlb9Ygf3fQJiOHZa8OBhYvb5xCbWBU6XyL9xII+Ex4Hqr7xR/PFFC 3mJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; bh=b2tBDmbPvx4VwR+l0D1S7TdS5hwNQ8dfvResRhNME+0=; b=hbv5OjUTSIc5lUPpJJRgWMyhgTUNlONPQNCetQbipOjfWgEW8MojMRL6mfc7xuCSoR CTD1DzxU9fDiVhdvXjgbRRoNwn8sPnsMztQ05KZ0PXLwinFSsufsHhSGIsR+nH4naTqb s9VLcPxVRuHXuelritXF+Tqj+2lPSAmcpoLO2hPQoANixrBtv5aeJ162umVaVBDRm1Rw nyPbnnvDZUeIwF+680+C9B5MAgt7bGCXj97G3d3gcPT5oSaQWKO6I0G1k4Sq0mUUo2pN 9gwFhi9yXhsgDE3j2mz6cmReFdmWgTSMfRQ2AMVbhHET6PTk5+elKEgEZBYN59I30JSZ uZXw== X-Gm-Message-State: AG10YOR94Jd1pppxdBGBvPqltlBug3mVB50rdYZGBFQ7B/oSwpLfrHi4actljccm9QZPbjBQxg3t1eNPxvNt4A== X-Received: by 10.60.54.1 with SMTP id f1mr14686872oep.29.1455223139111; Thu, 11 Feb 2016 12:38:59 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c01::236 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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:109116 Archived-At: OK, so this is what I have now. (defun modi/advice-region-or-whole (&rest args) "Advice function that sets the region boundaries to that of the whole buffer if no region is selected." (interactive (if (use-region-p) (list (region-beginning) (region-end)) (list (point-min) (point-max)))) ;; (message "Args: %S R: %S I: %S" ;; args (use-region-p) (called-interactively-p 'interactive)) (when (and (eq (first args) (point-min)) (eq (second args) (point-max))) (message "Executing %s on the whole buffer." (propertize (symbol-name this-command) 'face 'font-lock-function-name-face))) nil)