Loading ...
Sorry, an error occurred while loading the content.

Re: [jasspa] Restricting actions on text to a region

Expand Messages
  • Thomas Hundt
    I was going to say, you want unnarrow-buffer . But it turns out that s a macro in my init file. I don t remember now why I wrote it, but I must have been
    Message 1 of 6 , Jun 1, 2005
    • 0 Attachment
      I was going to say, you want "unnarrow-buffer". But it turns out that's
      a macro in my init file. I don't remember now why I wrote it, but I
      must have been annoyed at some behavior of "1 narrow-buffer" which
      unnarrows (widens) it:


      ;------------------------------------------------------------
      ; unnarrow-buffer: leave user at previously-narrowed area
      ;------------------------------------------------------------
      define-macro unnarrow-buffer
      set-variable #l3 $window-aline ; save in case of failure

      ; Save narrowed area's start/end
      beginning-of-buffer
      set-variable #l1 $window-aline
      end-of-buffer
      backward-line ; otherwise $window-aline = EOF
      set-variable #l2 $window-aline

      !force 1 narrow-buffer
      !if $status ; 1=succeed
      ; Set region to previously-narrowed area
      #l1 goto-line
      set-mark
      #l2 goto-line
      forward-line
      3 show-region
      show-region ;; doesn't work for some reason
      !else
      ; if narrow-buffer fails, now at EOF
      #l3 goto-line ; take us back to current line
      ml-write "[Buffer is not narrowed]"
      !bell
      !abort
      !endif
      !emacro
      !force global-bind-key unnarrow-buffer "C-x >"


      > Is there a non-menu way of activating the opposite of "narrow-region"
      > in me? I tried "widen" (as in Gnu-EMacs) but this was unknown. Other
      > keywords like "region", "narrow" etc. with apropos gave also nothing
      > appropiate...
      >
      > Meino


      --
      Thomas Hundt <tom@...> +1-415-867-6698
    Your message has been successfully submitted and would be delivered to recipients shortly.