help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Help setting nadvice for indent-region


From: Kaushal Modi
Subject: Re: Help setting nadvice for indent-region
Date: Thu, 11 Feb 2016 20:38:49 +0000

OK, so this is what I have now.

(defun modi/advice-region-or-whole (&rest args)
  "Advice function that sets the region boundaries to that of the whole
buffer
if no region is selected."
  (interactive (if (use-region-p)
                   (list (region-beginning) (region-end))
                 (list (point-min) (point-max))))
  ;; (message "Args: %S R: %S I: %S"
  ;;          args (use-region-p) (called-interactively-p 'interactive))
  (when (and (eq (first args) (point-min))
             (eq (second args) (point-max)))
    (message "Executing %s on the whole buffer."
             (propertize (symbol-name this-command)
                         'face 'font-lock-function-name-face)))
  nil)


reply via email to

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