all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Different semantics for yank-pop??
@ 2002-12-14 19:13 Larry Denenberg
  2002-12-15 22:49 ` Alex Rice
  0 siblings, 1 reply; 3+ messages in thread
From: Larry Denenberg @ 2002-12-14 19:13 UTC (permalink / raw)
  Cc: larry


I'm running Mac OS X and picked up a pre-built Emacs from Mindlube, not an
official released version.

When I run emacs with "emacs --nw" from a Terminal window, yank-pop works
just like I expect it to.  But when I invoke the Emacs application from the
finder (like other OS X applications) things are screwy.  The first yank-pop
of a sequence seems to yank the top of the kill ring (i.e., the same text
yanked by the immediately preceding C-y) rather than the previous entry.
So, for example, C-k C-y M-y is always a no-op, whereas I expect it to
replace the rest of the line with the previous kill.

I don't know quite where to ask about this since the provenance of my Emacs
is so informal.  Any help would be appreciated.

/Larry Denenberg
larry@denenberg.com
http://larry.denenberg.com/

In GNU Emacs 21.3.50.1 (powerpc-apple-darwin6.2)
 of 2002-11-27 on darkstar.local.
configured using `configure '--with-carbon' '--without-x''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: t

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

* Re: Different semantics for yank-pop??
       [not found] <mailman.219.1039893239.19936.help-gnu-emacs@gnu.org>
@ 2002-12-14 21:31 ` Andrew Choi
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Choi @ 2002-12-14 21:31 UTC (permalink / raw)


Larry Denenberg <larry@denenberg.com> writes:

> When I run emacs with "emacs --nw" from a Terminal window, yank-pop
> works just like I expect it to.  But when I invoke the Emacs
> application from the finder (like other OS X applications) things are
> screwy.  The first yank-pop of a sequence seems to yank the top of the
> kill ring (i.e., the same text yanked by the immediately preceding
> C-y) rather than the previous entry.  So, for example, C-k C-y M-y is
> always a no-op, whereas I expect it to replace the rest of the line
> with the previous kill.  [...]

I'll try to work out a more permanent fix when I can.  But for the time
being, putting the following in your startup file will make it behave
the way you want.

;; Temporary fix for problem with yank-pop (borrowed from pc-win.el).
(defcustom x-select-enable-clipboard t
  "Non-nil means cutting and pasting uses the clipboard.
This is the default on this system, since Mac OS X does not support
other types of selections."
  :type 'boolean
  :group 'killing)

(defun mac-set-clipboard-data (str push)
  (mac-cut-function
   (encode-coding-string str selection-coding-system t) push))

(defun mac-get-clipboard-data ()
  (decode-coding-string
   (mac-paste-function) selection-coding-system t))

(defun x-select-text (text &optional push)
  (if x-select-enable-clipboard 
      (mac-set-clipboard-data text push))
  (setq x-last-selected-text text))

;;; Return the value of the current selection.
;;; Consult the selection, then the cut buffer.  Treat empty strings
;;; as if they were unset.
(defun x-get-selection-value ()
  (if x-select-enable-clipboard 
      (let ((text (mac-get-clipboard-data)))
	(if (string= text "") (setq text nil))
	(cond
	 ((not text) nil)
	 ((eq text x-last-selected-text) nil)
	 ((string= text x-last-selected-text)
	  ;; Record the newer string, so subsequent calls can use the
	  ;; 'eq' test.
	  (setq x-last-selected-text text)
	  nil)
	 (t
	  (setq x-last-selected-text text))))))

;;; Arrange for the kill and yank functions to set and check the clipboard.
(setq interprogram-cut-function 'x-select-text)
(setq interprogram-paste-function 'x-get-selection-value)

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

* Re: Different semantics for yank-pop??
  2002-12-14 19:13 Larry Denenberg
@ 2002-12-15 22:49 ` Alex Rice
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Rice @ 2002-12-15 22:49 UTC (permalink / raw)
  Cc: help-gnu-emacs


On Saturday, December 14, 2002, at 12:13  PM, Larry Denenberg wrote:

>
> I'm running Mac OS X and picked up a pre-built Emacs from Mindlube, 
> not an
> official released version.
>
> When I run emacs with "emacs --nw" from a Terminal window, yank-pop 
> works
> just like I expect it to.  But when I invoke the Emacs application 
> from the
> finder (like other OS X applications) things are screwy.  The first 
> yank-pop
> of a sequence seems to yank the top of the kill ring (i.e., the same 
> text
> yanked by the immediately preceding C-y) rather than the previous 
> entry.
> So, for example, C-k C-y M-y is always a no-op, whereas I expect it to
> replace the rest of the line with the previous kill.
>
> I don't know quite where to ask about this since the provenance of my 
> Emacs
> is so informal.  Any help would be appreciated.

Hello, When doing C-k C-y M-y, hit M-y again and you should see the 
normal behavior. For some reason the first M-y has no effect, or 
contains the first entry in the kill ring, as you say. However, 
subsequent M-y work as expected. At least that's what I'm seeing. I'm 
filing bug report about the empty yank item. You can do this too if you 
find anything else (M-x report-emacs-bug).

Also make sure to notice the Menu item Edit | Select and Paste. It 
shows the current contents of your kill ring. So you can tell the kill 
ring is at least doing it's job.

Hope this helps,

//     Alex Rice <alex@mindlube.com>
//     Mindlube Software
//     http://mindlube.com

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

end of thread, other threads:[~2002-12-15 22:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.219.1039893239.19936.help-gnu-emacs@gnu.org>
2002-12-14 21:31 ` Different semantics for yank-pop?? Andrew Choi
2002-12-14 19:13 Larry Denenberg
2002-12-15 22:49 ` Alex Rice

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.