all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Help setting nadvice for indent-region
Date: Tue, 09 Feb 2016 04:07:52 +0100	[thread overview]
Message-ID: <87fux2a8dz.fsf@debian.uxu> (raw)
In-Reply-To: CAFyQvY34QNGvHFaOByrn9kJCGzJnF4J-tcu5=Hj5o1pXQmG=Yg@mail.gmail.com

Kaushal Modi <kaushal.modi@gmail.com> 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




  parent reply	other threads:[~2016-02-09  3:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 23:49 Help setting nadvice for indent-region Kaushal Modi
2016-02-05 23:58 ` Kaushal Modi
2016-02-06  0:00   ` Kaushal Modi
2016-02-06  0:30   ` Emanuel Berg
2016-02-06  3:31     ` Kaushal Modi
2016-02-06 10:43 ` Michael Heerdegen
2016-02-07  3:12   ` Kaushal Modi
2016-02-07 17:46     ` Kaushal Modi
2016-02-07 18:51       ` John Mastro
2016-02-08  0:03         ` Emanuel Berg
2016-02-08  4:22           ` Kaushal Modi
2016-02-08 17:05             ` Eli Zaretskii
2016-02-08 17:27               ` Kaushal Modi
2016-02-09  3:07             ` Emanuel Berg [this message]
2016-02-08 20:03           ` John Mastro
2016-02-08 23:13             ` Emanuel Berg
2016-02-11 14:02         ` Stefan Monnier
2016-02-11 17:36           ` Kaushal Modi
2016-02-11 18:10             ` Michael Heerdegen
2016-02-11 18:47               ` Kaushal Modi
2016-02-11 18:56                 ` Kaushal Modi
2016-02-11 19:14                   ` Michael Heerdegen
2016-02-11 20:15                     ` Kaushal Modi
2016-02-11 20:38                       ` Kaushal Modi
2016-02-12 14:09                         ` Michael Heerdegen
2016-02-12 14:21                           ` Michael Heerdegen
2016-02-12 16:02                             ` Kaushal Modi
2016-02-12 19:04                               ` Michael Heerdegen
2016-02-12 13:57                       ` Michael Heerdegen
2016-02-11 19:03                 ` Michael Heerdegen
2016-02-07 23:48       ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fux2a8dz.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.