all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to make dabbrev expand to 2nd/3rd/... last occurence?
@ 2006-10-12 12:53 Florian Kaufmann
  2006-10-12 15:36 ` Florian Kaufmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Florian Kaufmann @ 2006-10-12 12:53 UTC (permalink / raw)


Hello

Is there an extension to the dabbrev mode so that I can also have
´printed´ the 2nd/3rd... last occurence of a word? For example
something like this. Say I have dabbrev-expand bound to C-; .Pressing
C-; would behave normaly, another ; would replace the just found
occurence with the 2nd last occurence, another ; would replace it with
the 3rd last occurence and so on. 

Greetings

Flo

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

* Re: how to make dabbrev expand to 2nd/3rd/... last occurence?
  2006-10-12 12:53 how to make dabbrev expand to 2nd/3rd/... last occurence? Florian Kaufmann
@ 2006-10-12 15:36 ` Florian Kaufmann
  2006-10-13  8:31 ` Holger Sparr
       [not found] ` <lnmz80ka8z.fsf@mfk.tu-dresden.de>
  2 siblings, 0 replies; 4+ messages in thread
From: Florian Kaufmann @ 2006-10-12 15:36 UTC (permalink / raw)



I have to add that I know that there is also dabbrev-completion.
However this is not as convininient as just press C-; and then some ;
until I have the right one.

Greetings

Flo

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

* Re: how to make dabbrev expand to 2nd/3rd/... last occurence?
  2006-10-12 12:53 how to make dabbrev expand to 2nd/3rd/... last occurence? Florian Kaufmann
  2006-10-12 15:36 ` Florian Kaufmann
@ 2006-10-13  8:31 ` Holger Sparr
       [not found] ` <lnmz80ka8z.fsf@mfk.tu-dresden.de>
  2 siblings, 0 replies; 4+ messages in thread
From: Holger Sparr @ 2006-10-13  8:31 UTC (permalink / raw)


On 12 Oct 2006, Florian Kaufmann wrote:

> Is there an extension to the dabbrev mode so that I can also have
> ´printed´ the 2nd/3rd... last occurence of a word? For example
> something like this. Say I have dabbrev-expand bound to C-; .Pressing
> C-; would behave normaly, another ; would replace the just found
> occurence with the 2nd last occurence, another ; would replace it with
> the 3rd last occurence and so on. 

I'd use C-; again, since you have C- already pressed.

Otherwise you have to modify the behavior of ";"


Something like 

(defun my-semi-or-complete (&optional arg)
  (interactive "p")        
  (let ((n (if arg         
               arg         
             1)))          
     (if (or (eq last-command 'my-semi-or-complete) (eq last-command 'dabbrev-expand))   
         (call-interactively 'dabbrev-expand)
      (insert-char ?\; n))))


which can be bound to ";"

(global-set-key (kbd ";") 'my-semi-or-complete)


(Probably not the best solution.)


Holger

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

* Re: how to make dabbrev expand to 2nd/3rd/... last occurence?
       [not found] ` <lnmz80ka8z.fsf@mfk.tu-dresden.de>
@ 2006-10-13  9:46   ` Florian Kaufmann
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Kaufmann @ 2006-10-13  9:46 UTC (permalink / raw)



> ,----[ C-h f dabbrev-expand RET ]
> | dabbrev-expand is an interactive autoloaded Lisp function in `dabbrev'.
...
> | If the cursor has not moved from the end of the previous expansion and
> | no argument is given, replace the previously-made expansion
> | with the next possible expansion not yet tried.

Thank you Holger

Tststs, I'm sorry to have asked a question that is so obviously in the
help. I actually read the help before I posted my question, but
obviously very carelessly.

Flo

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

end of thread, other threads:[~2006-10-13  9:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-12 12:53 how to make dabbrev expand to 2nd/3rd/... last occurence? Florian Kaufmann
2006-10-12 15:36 ` Florian Kaufmann
2006-10-13  8:31 ` Holger Sparr
     [not found] ` <lnmz80ka8z.fsf@mfk.tu-dresden.de>
2006-10-13  9:46   ` Florian Kaufmann

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.