all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* About setf extensions
@ 2013-02-15 13:07 Xue Fuqiao
  0 siblings, 0 replies; 3+ messages in thread
From: Xue Fuqiao @ 2013-02-15 13:07 UTC (permalink / raw)
  To: help-gnu-emacs

In (info "(cl) Setf Extensions"):

     Most of these have directly corresponding "set" functions, like
     `use-local-map' for `current-local-map', or `goto-char' for
     `point'.  A few, like `point-min', expand to longer sequences of
     code when they are used with `setf' (`(narrow-to-region x
     (point-max))' in this case).

I don't understand the `point-min' example.  What does the "x" mean
here?  I know it is the START argument of `narrow-to-region', but where
is it from?  And where will it be used?  Thanks.

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About setf extensions
       [not found] <mailman.20013.1360933676.855.help-gnu-emacs@gnu.org>
@ 2013-02-15 14:11 ` Michael Heerdegen
  2013-02-15 14:48 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Heerdegen @ 2013-02-15 14:11 UTC (permalink / raw)
  To: help-gnu-emacs

Xue Fuqiao <xfq.free@gmail.com> writes:

> In (info "(cl) Setf Extensions"):
>
>      Most of these have directly corresponding "set" functions, like
>      `use-local-map' for `current-local-map', or `goto-char' for
>      `point'.  A few, like `point-min', expand to longer sequences of
>      code when they are used with `setf' (`(narrow-to-region x
>      (point-max))' in this case).
>
> I don't understand the `point-min' example.  What does the "x" mean
> here?  I know it is the START argument of `narrow-to-region', but where
> is it from?  And where will it be used?  Thanks.

I guess it's the value the generalized variable `(point-min)' should be
set to.  I.e.,

  (setf (point-min) x)

is translated to

  (narrow-to-region x (point-max))

This seems reasonable, because afterwards, (point-min) will give x.


Regards,

Michael.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: About setf extensions
       [not found] <mailman.20013.1360933676.855.help-gnu-emacs@gnu.org>
  2013-02-15 14:11 ` About setf extensions Michael Heerdegen
@ 2013-02-15 14:48 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2013-02-15 14:48 UTC (permalink / raw)
  To: help-gnu-emacs

>      Most of these have directly corresponding "set" functions, like
>      `use-local-map' for `current-local-map', or `goto-char' for
>      `point'.  A few, like `point-min', expand to longer sequences of
>      code when they are used with `setf' (`(narrow-to-region x
>      (point-max))' in this case).

> I don't understand the `point-min' example.  What does the "x" mean
> here?

(setf (point-min) x) gets turned into (narrow-to-region x (point-max)).


        Stefan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-15 14:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.20013.1360933676.855.help-gnu-emacs@gnu.org>
2013-02-15 14:11 ` About setf extensions Michael Heerdegen
2013-02-15 14:48 ` Stefan Monnier
2013-02-15 13:07 Xue Fuqiao

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.