unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18093: 24.4.50; `delsel.el' fixes for use with `completion.el'
@ 2014-07-23 20:58 Drew Adams
  2021-01-23 21:55 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2014-07-23 20:58 UTC (permalink / raw)
  To: 18093

`delsel.el' should be updated to play well with library `completion.el'.
The following should be done (or equivalent):

1.
(put 'completion-separator-self-insert-command 'delete-selection t)
(put 'completion-separator-self-insert-autofilling 'delete-selection t)

2. If `last-command' is `complete' and `this-command' has
`delete-selection' property `supersede' or `kill', replace the last
inserted completion with the string that was completed.

(defun delete-active-region (&optional killp)
  (cond ((and (eq last-command 'complete) ; See `completion.el'.
              (boundp 'cmpl-last-insert-location))
         ;; Do not delete region if a `self-insert-command'.  Delete it only if a
         ;; supersede or a kill.
         (when (and (symbolp this-command)
                    (memq (get this-command 'delete-selection) '(supersede kill)))
           (delete-region (point) cmpl-last-insert-location) ; Free var here.
           (insert cmpl-original-string) ; Free var here.
           (setq completion-to-accept  nil))) ; Free var here.
        (killp                    ; Do not let `kill-region' change `this-command'
         (let (this-command)
           (if (or (> emacs-major-version 24)
                   (and (= emacs-major-version 24)  (< emacs-minor-version 4)))
               (kill-region (point) (mark) 'REGION)
             (kill-region (point) (mark)))))
        ((boundp 'region-extract-function) ; Emacs 24.4+
         (funcall region-extract-function 'delete-only))
        (t (delete-region (point) (mark))))
  (deactivate-mark)
  t)


In GNU Emacs 24.4.50.1 (i686-pc-mingw32)
 of 2014-06-28 on ODIEONE
Bzr revision: 117431 rgm@gnu.org-20140628015517-eku6hj8mpgcvfnso
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/snapshot/trunk
 --enable-checking=yes,glyphs 'CFLAGS=-O0 -g3'
 LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''





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

* bug#18093: 24.4.50; `delsel.el' fixes for use with `completion.el'
  2014-07-23 20:58 bug#18093: 24.4.50; `delsel.el' fixes for use with `completion.el' Drew Adams
@ 2021-01-23 21:55 ` Lars Ingebrigtsen
  2021-01-24  0:52   ` bug#18093: [External] : " Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-23 21:55 UTC (permalink / raw)
  To: Drew Adams; +Cc: 18093

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

> `delsel.el' should be updated to play well with library `completion.el'.
> The following should be done (or equivalent):
>
> 1.
> (put 'completion-separator-self-insert-command 'delete-selection t)
> (put 'completion-separator-self-insert-autofilling 'delete-selection t)
>
> 2. If `last-command' is `complete' and `this-command' has
> `delete-selection' property `supersede' or `kill', replace the last
> inserted completion with the string that was completed.
>
> (defun delete-active-region (&optional killp)
>   (cond ((and (eq last-command 'complete) ; See `completion.el'.
>               (boundp 'cmpl-last-insert-location))

(I'm going through old bug reports that unfortunately got no response at
the time.)

As far as I can tell, 1) doesn't exist any more, and I'm not quite sure
I understand 2) (I've never used delsel mode).

Is this something that still needs work, or has what this bug report is
about been fixed in the years since it was filed?

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





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

* bug#18093: [External] : Re: bug#18093: 24.4.50; `delsel.el' fixes for use with `completion.el'
  2021-01-23 21:55 ` Lars Ingebrigtsen
@ 2021-01-24  0:52   ` Drew Adams
  2021-01-25 23:57     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2021-01-24  0:52 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 18093@debbugs.gnu.org

> > `delsel.el' should be updated to play well with library `completion.el'.
> > The following should be done (or equivalent):
> >
> > 1.
> > (put 'completion-separator-self-insert-command 'delete-selection t)
> > (put 'completion-separator-self-insert-autofilling 'delete-selection t)
> >
> > 2. If `last-command' is `complete' and `this-command' has
> > `delete-selection' property `supersede' or `kill', replace the last
> > inserted completion with the string that was completed.
> >
> > (defun delete-active-region (&optional killp)
> >   (cond ((and (eq last-command 'complete) ; See `completion.el'.
> >               (boundp 'cmpl-last-insert-location))
> 
> As far as I can tell, 1) doesn't exist any more, and I'm not quite sure
> I understand 2) (I've never used delsel mode).
> 
> Is this something that still needs work, or has what this bug report is
> about been fixed in the years since it was filed?

Yes, Emacs 25 changed `completion.el' in this regard
when it ___ed `delsel.el' in order to accommodate
electric whatever (`electric--after-char-pos' seems
to be the place that `completion.el' was affected.

I have no idea anymore what needs to be done now,
to fix the problems reported by this bug.  Sorry.

Someone familiar with the changes made to `delsel.el'
and `completion.el' back in Emacs 25 for accommodating
whatever electric toy was involved will need to take
a look.

This is what happens when someone adds a feature
(or even fixes a bug) without paying attention to
outstanding bugs reported for the code they modify.
(One can presume that's what happened, else this bug
would have been closed one way or another.)





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

* bug#18093: [External] : Re: bug#18093: 24.4.50; `delsel.el' fixes for use with `completion.el'
  2021-01-24  0:52   ` bug#18093: [External] : " Drew Adams
@ 2021-01-25 23:57     ` Lars Ingebrigtsen
  2021-01-26  2:00       ` Drew Adams
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-25 23:57 UTC (permalink / raw)
  To: Drew Adams; +Cc: 18093@debbugs.gnu.org

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

> I have no idea anymore what needs to be done now,
> to fix the problems reported by this bug.  Sorry.

But are any of the problems reported by this bug still present?  If so,
which ones?

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





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

* bug#18093: [External] : Re: bug#18093: 24.4.50; `delsel.el' fixes for use with `completion.el'
  2021-01-25 23:57     ` Lars Ingebrigtsen
@ 2021-01-26  2:00       ` Drew Adams
  2021-01-26  2:07         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2021-01-26  2:00 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 18093@debbugs.gnu.org

> > I have no idea anymore what needs to be done now,
> > to fix the problems reported by this bug.  Sorry.
> 
> But are any of the problems reported by this bug still present?  If so,
> which ones?

No idea.  Emacs is in charge of both completion.el
and delsel.el.

I fixed my version of delsel.el to play well with
completion.el back when this bug was reported.
I even provided a fix that makes delsel.el play
well with completion for both Emacs < 24.4 and
Emacs >= 24.4.  Sorry, but I'm not going to try
to provide yet another fix, for Emacs 28 or
whatever.

Emacs's version of delsel.el was changed since
the bug report, as you pointed out, so the fixes
I provided clearly aren't fixes for the current
delsel.el.

It's up to you whether you want delsel.el to play
well with completion.el or not, and propose a fix
if you do.





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

* bug#18093: [External] : Re: bug#18093: 24.4.50; `delsel.el' fixes for use with `completion.el'
  2021-01-26  2:00       ` Drew Adams
@ 2021-01-26  2:07         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-26  2:07 UTC (permalink / raw)
  To: Drew Adams; +Cc: 18093@debbugs.gnu.org

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

>> > I have no idea anymore what needs to be done now,
>> > to fix the problems reported by this bug.  Sorry.
>> 
>> But are any of the problems reported by this bug still present?  If so,
>> which ones?
>
> No idea.  Emacs is in charge of both completion.el
> and delsel.el.

OK, then it seems like there's not going to be any progress here, and
I'm closing this bug report.

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





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

end of thread, other threads:[~2021-01-26  2:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23 20:58 bug#18093: 24.4.50; `delsel.el' fixes for use with `completion.el' Drew Adams
2021-01-23 21:55 ` Lars Ingebrigtsen
2021-01-24  0:52   ` bug#18093: [External] : " Drew Adams
2021-01-25 23:57     ` Lars Ingebrigtsen
2021-01-26  2:00       ` Drew Adams
2021-01-26  2:07         ` Lars Ingebrigtsen

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).