Discussion:
Things I miss in GNU Emacs
Michael Sperber
2015-12-20 15:46:52 UTC
Permalink
I appreciate everybody's input on the discussion on how to continue with
the project. I personally would like to collect features that XEmacs
has but GNU Emacs hasn't and see what the chances are of getting them
included in GNU Emacs. So if you have such a list, or just random
items, please send them to me or the list.

FWIW, my list so far has this:

User-visible features:

- Ben's HTML mode
- C-Left Mouse for pasting
- minibuffer-confirm-incomplete
- Marcus's incremental collector (slim chance ...)

Internal features:

- opaque datastructures for various things - keymaps
- menus separate from keymaps
- specifiers
- extents
- separate representations for chars and numbers
--
Regards,
Mike
Uwe Brauer
2015-12-20 16:28:29 UTC
Permalink
Post by Michael Sperber
I appreciate everybody's input on the discussion on how to continue with
the project. I personally would like to collect features that XEmacs
has but GNU Emacs hasn't and see what the chances are of getting them
included in GNU Emacs. So if you have such a list, or just random
items, please send them to me or the list.
- Ben's HTML mode
- C-Left Mouse for pasting
- minibuffer-confirm-incomplete
- Marcus's incremental collector (slim chance ...)
I would add:

- apropos (GNU emacs's apropos seems ancient)

- list-matching-lines: when cursor is on word, this word is offered
as the search expression. GNU emacs still does not have this
feature. I think I will ask in devel about it, or Michael are you
planning anyhow to send a feature proposal list to emacs devel?

- change-log-exit: ours returns back to the original buffer and
precisely at the place where I used change-log-exit. I have a
workaround for this in GNUS using defadvice, but my solution
sucks. I proposed that on emacs devel was considered as being
interesting but then nothing happened, Xemacs implementation can
not be used, since it uses bury-buffer which is a built-in function.
Michael Sperber
2015-12-27 14:24:09 UTC
Permalink
Hi Uwe,

thanks for your list!
- I think I will ask in devel about it, or Michael are you
planning anyhow to send a feature proposal list to emacs devel?
Yes. But it can't hurt if you do, too.
--
Regards,
Mike
Uwe Brauer
2016-01-04 17:32:27 UTC
Permalink
Post by Michael Sperber
Hi Uwe,
thanks for your list!
- I think I will ask in devel about it, or Michael are you
planning anyhow to send a feature proposal list to emacs devel?
Yes. But it can't hurt if you do, too.
BTW: here is how to configure GNU emacs, such that occur works as in
Xemacs:

- One has to customize 'read-regexp-defaults-function'
to'find-tag-default-as-regexp'


- Or using M-n when the occur buffer pops up.

I prefer the first solution.

Uwe

Raymond Toy
2015-12-21 23:42:02 UTC
Permalink
Michael> I appreciate everybody's input on the discussion on how
Michael> to continue with the project. I personally would like to
Michael> collect features that XEmacs has but GNU Emacs hasn't and
Michael> see what the chances are of getting them included in GNU
Michael> Emacs. So if you have such a list, or just random items,
Michael> please send them to me or the list.

If GNU Emacs hasn't picked these things up yet, it seems unlikely that
will ever happen.

Am I being to pessimistic in my old age?

--
Ray
Stephen J. Turnbull
2015-12-22 08:25:11 UTC
Permalink
Post by Raymond Toy
If GNU Emacs hasn't picked these things up yet, it seems unlikely that
will ever happen.
Am I being to pessimistic in my old age?
Yes, although you're right, GNU doesn't much "pick things up". It
waits for someone else to do the work.

But if you're willing and able, pretty much any pure Elisp feature can
be added as long as (1) it's encapsulated in a separate command and
(2) you don't touch the keymap (even that can be done, but is a 200-
post thread with Drew Adams really worth it?) Nowadays they might ask
you to put it in GELPA, but that's almost as good.
Andrés Ramírez
2015-12-22 00:35:44 UTC
Permalink
Hi Raymond and guys.
Post by Raymond Toy
If GNU Emacs hasn't picked these things up yet, it seems unlikely that
will ever happen.
Am I being to pessimistic in my old age?
Uwe has got some addings to GNU/Emacs. I think everythink is
possible. Even now on emacs-devel a guy is discussing about touch screen
interfaces. So the sky is the limit.

Regards
ps: xemacs-is-dead-long-live-xemacs. Xemacs got GNU/Emacs to evolve :)
Mats Lidell
2015-12-26 13:50:15 UTC
Permalink
Hi,
Post by Michael Sperber
[...]
- C-Left Mouse for pasting
This is one really nice feature that I not only miss in GNU Emacs but in other
tools as well.

Yours
--
%% Mats
Raymond Toy
2015-12-26 17:17:12 UTC
Permalink
Mats> Hi,
Post by Michael Sperber
[...]
- C-Left Mouse for pasting
Mats> This is one really nice feature that I not only miss in GNU Emacs but in other
Mats> tools as well.

Can't that be done with a bit of elisp?

--
Ray
Thorsten Bonow
2015-12-28 10:11:05 UTC
Permalink
User-visible features: [...]
- C-Left Mouse for pasting
Mats> This is one really nice feature that I not only miss in GNU
Mats> Emacs but in other tools as well.

Ray> Can't that be done with a bit of elisp?

Hi,

I have a shortened version of what I posted yesterday (hasn't come
through yet, send from the wrong mail address to the list I
think. Sry.)

This is the non-invasive version. Since basically only the 'old-*'
variables are set, this could also be done by advising
'mouse-drag-region', 'mouse-set-region' and 'mouse-yank-at-click' or
be implemented directly in the GNU Emacs version of "mouse.el".

I checked and XEmacs' 'mouse-track-insert' doesn't work when selecting
something in a different frame---pasting is tried at point of the
frame the selection is done (and so does my version). I my opinion
this should be fixed, because I think selecting with the mouse implies
window system and that implies probably multiple frames. However, I
haven't found a simple solution (yet) and my lisp is limited.

Hope this helps.

Toto


(defvar old-point nil)
(defvar old-mark nil)
(defvar old-buffer nil)

(defun mouse-drag-region-insert (start-event)
"This is a hack! Adapted from `mouse-drag-region' to implement
the functionality of the XEmacs function `mouse-track-insert':
\"Make a selection with the mouse and insert it at point.\"

Set the region to the text that the mouse is dragged over.
Highlight the drag area as you move the mouse. This must be
bound to a button-down mouse event. In Transient Mark mode, the
highlighting remains as long as the mark remains active.
Otherwise, it remains until the next input event.

If the click is in the echo area, display the `*Messages*' buffer.

Safes point and mark of current buffer so that they can be
restored in `mouse-set-region-insert'."
(interactive "e")
(setq old-point (point-marker))
(setq old-mark (mark-marker))
(setq old-buffer (current-buffer))
(mouse-drag-region start-event))

(defun mouse-set-region-insert (click)
"This is a hack! Adapted from `mouse-set-region' to implement
the functionality of the XEmacs function `mouse-track-insert':
\"Make a selection with the mouse and insert it at point.\"

Set the region to the text dragged over, copy to kill ring (the
`mouse-drag-copy-region' variable is lambda-bound for the
duration of this call) and yank it at point in the buffer active
before marking the region with the mouse. This should be bound
to a mouse drag event."
(interactive "e")
(let ((mouse-drag-copy-region t))
(mouse-set-region click))
;; adapted from `mouse-yank-at-click'
(let ((mouse-yank-at-point t))
;; Give temporary modes such as isearch a chance to turn off.
(run-hooks 'mouse-leave-buffer-hook)
(when select-active-regions
;; Without this, confusing things happen upon e.g. inserting into
;; the middle of an active region.
(deactivate-mark))
(set-buffer (marker-buffer old-point))
(goto-char old-point)
(push-mark old-mark t)
(setq this-command 'yank)
(yank)))

(define-key global-map [C-down-mouse-1] 'mouse-drag-region-insert)
(define-key global-map [C-drag-mouse-1] 'mouse-set-region-insert)
Mats Lidell
2015-12-31 14:32:23 UTC
Permalink
Hi Thorsten,
This is the non-invasive version. [...]
[...]
Hope this helps.
Yes. It does the job. Thanks.

There is a default binding in GNU Emacs on control left click that I think is
hidden by this version. Maybe it can't be avoided. For the general GNU Emacs
user that might be a problem. For an old XEmacs user in desperate need of
mouse-track-insert that is not an issue ;-)

A general observation since many years: With more standard bindings in GNU
Emacs using one modifier together with mouse click I have moved over my
personal bindings to use the combined control shift modifier together with
mouse actions. That binding seems to be less used. The mouse-track-insert hack
works with that binding as well of course. Thanks again!

Yours
--
%% Mats
Thorsten Bonow
2016-01-04 13:28:24 UTC
Permalink
[...]

Mats> Yes. It does the job. Thanks.

Hi Mats,

shorter and streamlined version included below. First attempt which I
posted from the wrong mail account and was delayed has hit the list
now, so my answers are out of sequence. Sry about that.

Mats> There is a default binding in GNU Emacs on control left click
Mats> that I think is hidden by this version. Maybe it can't be
Mats> avoided. [...]

By default, control left click is bound to '(mouse-buffer-menu EVENT)'
but there is no orthodoxy. If you do use 'msb.el' ("customizable
buffer-selection with multiple menus") which is included in GNU Emacs,
it is bound to '(msb EVENT)'. Therefor an
'xemacs[-{compat|features}].el' could become part of GNU Emacs and
key-binding left up to customisation.

Mats> A general observation since many years: With more standard
Mats> bindings in GNU Emacs using one modifier together with mouse
Mats> click I have moved over my personal bindings to use the combined
Mats> control shift modifier together with mouse actions. That binding
Mats> seems to be less used. The mouse-track-insert hack works with
Mats> that binding as well of course. Thanks again!

Because C-S-... is not used be GNU Emacs, I use it for
window-management (LarsWM, keyboard driven and tiling window manager).
Free key combinations are in short supply on my
system... A German keyboard comes to the rescue, I have our funny
'Umlaut' keys for additional bindings :-)

Here comes the shorter version. Still doesn't work with multiple
frames. Still looking into this. It appears that GNU Emacs doesn't
really keeps track of the order of selected frames. And even that may
not be enough. Cycling through all frames in search for the thing to
copy doesn't imply that I want to yank it in the last frame I looked
at before I found the correct one; yanking should be done in the last
frame I edited text in, I suppose. So maybe the command should only
work in a single frame, but fail gracefully when tried with multiple
frames.

Toto


(defvar old-point nil)

(defun mouse-drag-region-insert (start-event)
"This is a hack! Adapted from `mouse-drag-region' to implement
the functionality of the XEmacs function `mouse-track-insert':
\"Make a selection with the mouse and insert it at point.\"

Set the region to the text that the mouse is dragged over.
Highlight the drag area as you move the mouse. This must be
bound to a button-down mouse event. In Transient Mark mode, the
highlighting remains as long as the mark remains active.
Otherwise, it remains until the next input event.

If the click is in the echo area, display the `*Messages*' buffer.

Safes point and mark of current buffer so that they can be
restored in `mouse-set-region-insert'."
(interactive "e")
(setq old-point (point-marker))
(mouse-drag-region start-event))

(defun mouse-set-region-insert (click)
"This is a hack! Adapted from `mouse-set-region' to implement
the functionality of the XEmacs function `mouse-track-insert':
\"Make a selection with the mouse and insert it at point.\"

Set the region to the text dragged over, copy to kill ring (the
`mouse-drag-copy-region' variable is lambda-bound for the
duration of this call) and yank it at point in the buffer active
before marking the region with the mouse. This should be bound
to a mouse drag event."
(interactive "e")
(let ((mouse-drag-copy-region t))
(mouse-set-region click))
(let ((mouse-yank-at-point t))
(set-buffer (marker-buffer old-point))
(goto-char old-point)
(mouse-yank-at-click click nil)))

(define-key global-map [C-down-mouse-1] 'mouse-drag-region-insert)
(define-key global-map [C-drag-mouse-1] 'mouse-set-region-insert)
--
Sent from my GNU Emacs running on GNU/Linux
Thorsten Bonow
2015-12-27 19:44:03 UTC
Permalink
Mats> Hi,
User-visible features: [...]
- C-Left Mouse for pasting
Mats> This is one really nice feature that I not only miss in GNU
Mats> Emacs but in other tools as well.

Ray> Can't that be done with a bit of elisp?

Ray> -- Ray

Hi,

this works for me. Hacked it together today after reading this
thread. Nifty feature. Strangely enough, I never knew about
`mouse-track-insert' when I was using XEmacs.

Hope this is useful

Toto


(defvar old-point nil)
(defvar old-mark nil)
(defvar old-buffer nil)

(defun mouse-drag-region-insert (start-event)
"This is a hack! Adapted from `mouse-drag-region' to implement
the functionality of the XEmacs function `mouse-track-insert':
\"Make a selection with the mouse and insert it at point.\"

Set the region to the text that the mouse is dragged over.
Highlight the drag area as you move the mouse. This must be
bound to a button-down mouse event. In Transient Mark mode, the
highlighting remains as long as the mark remains active.
Otherwise, it remains until the next input event.

Safes point and mark of current buffer so that they can be
restored in `mouse-set-region-insert'."
(interactive "e")
(setq old-point (point-marker))
(setq old-mark (mark-marker))
(setq old-buffer (current-buffer))
(mouse-drag-region start-event))

(defun mouse-set-region-insert (click)
"This is a hack! Adapted from `mouse-set-region' to implement
the functionality of the XEmacs function `mouse-track-insert':
\"Make a selection with the mouse and insert it at point.\"

Set the region to the text dragged over, copy to kill ring (the
`mouse-drag-copy-region' variable is lambda-bound for the
duration of this call) and yank it at point in the buffer active
before marking the region with the mouse. This should be bound
to a mouse drag event."
(interactive "e")
(let ((mouse-drag-copy-region t))
;; copied from `mouse-set-region'
(mouse-minibuffer-check click)
(select-window (posn-window (event-start click)))
(let ((beg (posn-point (event-start click)))
(end (posn-point (event-end click))))
(and mouse-drag-copy-region (integerp beg) (integerp end)
;; Don't set this-command to `kill-region', so a following
;; C-w won't double the text in the kill ring. Ignore
;; `last-command' so we don't append to a preceding kill.
(let (this-command last-command deactivate-mark)
(copy-region-as-kill beg end)))
(if (numberp beg) (goto-char beg))
;; On a text terminal, bounce the cursor.
(or transient-mark-mode
(window-system)
(sit-for 1))
(push-mark)
(set-mark (point))
(if (numberp end) (goto-char end))
(mouse-set-region-1)))
;; copied code from `mouse-set-region' ends here
;; adapted from `mouse-yank-at-click'
(let ((mouse-yank-at-point t))
;; Give temporary modes such as isearch a chance to turn off.
(run-hooks 'mouse-leave-buffer-hook)
(when select-active-regions
;; Without this, confusing things happen upon e.g. inserting into
;; the middle of an active region.
(deactivate-mark))
(set-buffer (marker-buffer old-point))
(goto-char old-point)
(push-mark old-mark t)
(setq this-command 'yank)
(yank)))

(define-key global-map [C-down-mouse-1] 'mouse-drag-region-insert)
(define-key global-map [C-drag-mouse-1] 'mouse-set-region-insert)
--
Sent from my GNU Emacs running on GNU/Linux

I abandoned XEmacs at 21:49 on the 25th of December 2008---and deemed
the event to be so noteworthy that I entered it in my diary.
Continue reading on narkive:
Loading...