From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Help setting nadvice for indent-region Date: Tue, 09 Feb 2016 04:07:52 +0100 Message-ID: <87fux2a8dz.fsf@debian.uxu> References: <87a8ne2k6v.fsf@web.de> <87si145aru.fsf@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1454987308 19121 80.91.229.3 (9 Feb 2016 03:08:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Feb 2016 03:08:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 09 04:08:19 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 1aSyf4-0007F6-PH for geh-help-gnu-emacs@m.gmane.org; Tue, 09 Feb 2016 04:08:18 +0100 Original-Received: from localhost ([::1]:51219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSyf4-0000mv-3C for geh-help-gnu-emacs@m.gmane.org; Mon, 08 Feb 2016 22:08:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSyet-0000mk-Lf for help-gnu-emacs@gnu.org; Mon, 08 Feb 2016 22:08:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aSyeq-00046K-FX for help-gnu-emacs@gnu.org; Mon, 08 Feb 2016 22:08:07 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:44334) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aSyeq-000468-88 for help-gnu-emacs@gnu.org; Mon, 08 Feb 2016 22:08:04 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aSyek-0006t8-E3 for help-gnu-emacs@gnu.org; Tue, 09 Feb 2016 04:07:58 +0100 Original-Received: from nl106-137-227.student.uu.se ([130.243.137.227]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Feb 2016 04:07:58 +0100 Original-Received: from embe8573 by nl106-137-227.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 09 Feb 2016 04:07:58 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 79 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-227.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:pqyi5vR9JvqbnEPrplKLgQCv14k= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:109068 Archived-At: Kaushal Modi writes: > I am sorry, I did not follow that. The link I pasted > was to a particular commit in my config, > highlighting only 46 lines pertaining to this > advice definition. One should never expect anyone to follow links. They are provided to say "this piece of code exists in a file, it is compiled or otherwise in effect on some system somewhere on the planet, if you against all odds would like to use it or study it on your terms I'm making this as easy for you as possible..." It is just like scientific papers that have hundreds of references no one ever bothers to read up on. So you should do it, but always yank the code into the message as well. > On a PC, clicking that link should show you that > highlighted section of 46 lines in a browser like > Chrome/Firefox. OK, drop them GUI browsers for Emacs-w3m, and stop clicking on stuff - instead hit RET! But it is OK to use a PC :) > I simply find it convenient to read code on github > with monospace fonts and syntax highlighting. Mails/posts should always be written/read in a monospace font. Try Emacs Gnus. As for syntax highlighting (we call int font-lock) it is possible to have snippets like that inline - not really necessary (for messages) IMHO. > I like the message telling me exactly what happened > i.e. I indented the whole buffer or I eval'ed the > whole buffer. But I can understand that that does > not give much value. My initial purpose to use macro > here was to learn how to use a macro. Probably better to wait for a sharp situation to arrive and do other stuff meanwhile. Because, if you make up a solution to a made-up problem chances are something won't work or won't work as intended and you will then not be able to tell if it is the solution, the method or the "made-up"-ness that failed (or a combination). > Just one important thing I'd like to point out in my > code is the necessity to modify the orig-fn args > ONLY when args is nil. This is to protect from > corrupting the args when the advised fn is called by > a wrapper fn. E.g. we do not want to override all 4 > args to eval-region (set by eval-defun) with just 2 > args when eval-region is being called by eval-defun. You shouldn't focus on the technology. If a problem that is very straightforward ends up in a complicated discussion where everything is about technology and nothing is about the problem, then the problem has not been solved in a good way. During the stone-age there were problems-solvers that could solve all problems in the caves and around the fireplace and even between the women in the cave-society. You can carry out a thought experiment to assess your solution. If you can explain it to such a problem-solving cave-dweller, then it is a good solution. If he doesn't understand because of all the advices, macros, arguments, and funcalls, it is a bad solution. -- underground experts united http://user.it.uu.se/~embe8573