emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] Re: advising remember-region


From: J. David Boyd
Subject: [emacs-wiki-discuss] Re: advising remember-region
Date: Tue, 23 Aug 2005 12:54:36 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Sacha Chua <address@hidden> writes:

> address@hidden (J. David Boyd) writes:
>
>> Is it feasible/possible to add advice to the remember functions so
>> that I could turn off the planner-use-day-pages variable, remember a
>> buffer/region/whatever, then turn the planner-use-day-pages back on?
>
> C-c C-c in a remember buffer calls remember-buffer, so you can advise
> that function to always turn day pages off.
>
> (defadvice remember-buffer (around david activate)
>   "Remember the contents of the current buffer, but don't use day pages."
>   (let ((planner-use-day-pages nil))
>      ad-do-it))
>
> Another way to do it without advice would be to write a new function:
>
> (defun david/remember-buffer ()
>   "Remember the contents of the current buffer, but don't use day pages."
>   (interactive)
>   (let ((planner-use-day-pages nil))
>     (remember-region (point-min) (point-max))))
> (define-key remember-mode-map "\C-c\C-c" 'david/remember-buffer)
>

Ah, thank you so much. This will come in handy!

Dave





reply via email to

[Prev in Thread] Current Thread [Next in Thread]