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: Sun, 07 Feb 2016 03:12:53 +0000 Message-ID: References: <87a8ne2k6v.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 1454814798 9367 80.91.229.3 (7 Feb 2016 03:13:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Feb 2016 03:13:18 +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 Sun Feb 07 04:13:18 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 1aSFmn-0002Ca-TJ for geh-help-gnu-emacs@m.gmane.org; Sun, 07 Feb 2016 04:13:18 +0100 Original-Received: from localhost ([::1]:59024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSFmm-0005E0-TM for geh-help-gnu-emacs@m.gmane.org; Sat, 06 Feb 2016 22:13:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSFmb-0005DG-59 for help-gnu-emacs@gnu.org; Sat, 06 Feb 2016 22:13:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSFma-0000T7-8p for help-gnu-emacs@gnu.org; Sat, 06 Feb 2016 22:13:05 -0500 Original-Received: from mail-ob0-x233.google.com ([2607:f8b0:4003:c01::233]:34736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSFma-0000T3-3c for help-gnu-emacs@gnu.org; Sat, 06 Feb 2016 22:13:04 -0500 Original-Received: by mail-ob0-x233.google.com with SMTP id wb13so121340310obb.1 for ; Sat, 06 Feb 2016 19:13:03 -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=YNtxUc4HJf6bLUQ70GpWF0HYLoV+nrp1swR+Dv9ul9E=; b=HX6qfoafUldVy/pWAHbV0mSNNbL3tSaEpNhNE1LN7cBDH/MiXDrzVQlAqjmdYQ0SnF pJWQec8tVd8KYEL+XNMmqPUsH4vKct5vb9Zuz0Si1GXV/G6idYg8IB62CbcELHYiQyQS yNcFmoxnknw3x8qNq9NDAXb3Z1x3YZHycSA6h2ZX710XSDeJB8YgYIgDK10s50GvDnbM f8SwQXgdOlOHUgwN9uiUbM/ysE9U3d3VhSXNAattsBMjr4DONI0IDnILnLzLDuT44qsE lrXHbCvXiWMWGWkgFkKg2toBLIjfe40XgAn9gk9s1Mi+0T2MvwMR8NxdDzCriwCup0Ul solg== 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=YNtxUc4HJf6bLUQ70GpWF0HYLoV+nrp1swR+Dv9ul9E=; b=FDs9h0CiMXy0htOzTx1Sy7L3IWl1KCTDJOZgM0URjk8AG7YL+/OhBppji9csXEPjgE HkmwS/YZmCojS/+Zsl7vlhzGx/YvkX72oSD3BezUYUNKM6/uaO5SsOdu/OisnyQGwiHJ bmmBx6zhd3rstPR1YSiyh+A0l5BewekJ7pc5uXdkIFTWzSNNDom5pEHAefry1VxJyLVp js8ZHEkBFfIu1H18E9PpnMnAZSluONg05S1dXpcfGt1WQiqxHSdfom04rtpGxhD/hLex UsG37yISPB+OEnBJfcG4X3ngdgSJQVnnQcXBDE55S7rijmNAl0JKCm74dfmoxHvc+Ofc jdZA== X-Gm-Message-State: AG10YOTxlX38SbgLYMoSv5j6+WHSHXxQmMswbSAKKV1nrDr8+wS8fmRQJJlRVbBInUHHdiFIQr5a9UM7XxTnuA== X-Received: by 10.60.178.180 with SMTP id cz20mr18141089oec.15.1454814783517; Sat, 06 Feb 2016 19:13:03 -0800 (PST) In-Reply-To: <87a8ne2k6v.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c01::233 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:109034 Archived-At: On Sat, Feb 6, 2016 at 5:43 AM Michael Heerdegen wrote: > Just specify an alternative interactive form in adv/indent-region. I > would change it into the :around type then, though. > Thanks! That worked! (defun adv/indent-region (orig-fn &rest args) (interactive) (if mark-active (setq args (list (region-beginning) (region-end))) (setq args (list (point-min) (point-max)))) (message "Args: %S" args) (apply orig-fn args)) (advice-add 'indent-region :around #'adv/indent-region)