unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21195: 25.0.50; Let MARKER arg to `set-marker' be a number
@ 2015-08-05 17:40 Drew Adams
  2016-04-30 21:42 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2015-08-05 17:40 UTC (permalink / raw)
  To: 21195

Minor enhancement request.  Let `set-marker' (aka `move-marker') accept
a buffer position that is just a number as its first arg.  IOW, give
`set-marker' this behavior:

(defun new-set-marker (num-or-marker position &optional buffer)
  "..."
  (unless (markerp num-or-marker)
    (setq num-or-marker  (with-current-buffer buffer
                           (copy-marker num-or-marker))))
  (set-marker num-or-marker position buffer))


In GNU Emacs 25.0.50.1 (i686-pc-mingw32)
 of 2015-07-03 on LEG570
Bzr revision: 2b848fadd51e805b2f46da64c5958ea7f009048a
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --host=i686-pc-mingw32 --enable-checking=yes,glyphs'





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

* bug#21195: 25.0.50; Let MARKER arg to `set-marker' be a number
  2015-08-05 17:40 bug#21195: 25.0.50; Let MARKER arg to `set-marker' be a number Drew Adams
@ 2016-04-30 21:42 ` Lars Ingebrigtsen
  2016-05-01  1:05   ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-30 21:42 UTC (permalink / raw)
  To: Drew Adams; +Cc: 21195

Drew Adams <drew.adams@oracle.com> writes:

> Minor enhancement request.  Let `set-marker' (aka `move-marker') accept
> a buffer position that is just a number as its first arg.  IOW, give
> `set-marker' this behavior:
>
> (defun new-set-marker (num-or-marker position &optional buffer)
>   "..."
>   (unless (markerp num-or-marker)
>     (setq num-or-marker  (with-current-buffer buffer
>                            (copy-marker num-or-marker))))
>   (set-marker num-or-marker position buffer))

Hm...  Well, I don't really see the point.  `set-marker' is so
conceptually clean.  And saying `(set-marker (make-marker) ...)' is so
easy.  Closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#21195: 25.0.50; Let MARKER arg to `set-marker' be a number
  2016-04-30 21:42 ` Lars Ingebrigtsen
@ 2016-05-01  1:05   ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2016-05-01  1:05 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 21195

> > Minor enhancement request.  Let `set-marker' (aka `move-marker') accept
> > a buffer position that is just a number as its first arg.  IOW, give
> > `set-marker' this behavior:
> >
> > (defun new-set-marker (num-or-marker position &optional buffer)
> >   "..."
> >   (unless (markerp num-or-marker)
> >     (setq num-or-marker  (with-current-buffer buffer
> >                            (copy-marker num-or-marker))))
> >   (set-marker num-or-marker position buffer))
> 
> Hm...  Well, I don't really see the point.  `set-marker' is so
> conceptually clean.  And saying `(set-marker (make-marker) ...)' is so
> easy.  Closing.

Well, I said it was minor.  Consider funcalling, applying, or
mapping over positions, which can be markers.

Sure, you can use an anonymous function that does just what
you need (test with markerp, copy-marker if not a marker)...
But why shouldn't `set-marker' do this?  It's trivial and
costs only a call to `markerp' for doing what `set-marker'
does now.





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

end of thread, other threads:[~2016-05-01  1:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-05 17:40 bug#21195: 25.0.50; Let MARKER arg to `set-marker' be a number Drew Adams
2016-04-30 21:42 ` Lars Ingebrigtsen
2016-05-01  1:05   ` Drew Adams

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).